Ejemplo n.º 1
0
        private void AddMultipleDevelopersToTeam()
        {
            Console.Clear();

            Console.WriteLine("Enter the Dev Team Id Number you want to add to.");
            int teamId = int.Parse(Console.ReadLine());

            List <Developer> developersToAdd    = new List <Developer>();
            bool             hasFilledPositions = false;

            while (hasFilledPositions == false)
            {
                Console.WriteLine("Do you have anymore Developers to add to the team y/n");
                string input = Console.ReadLine();

                if (input == "Y" || input == "y")
                {
                    Console.Clear();
                    Developer newDeveloper = new Developer();

                    Console.WriteLine("Enter the Name of the Developer.");
                    newDeveloper.Name = Console.ReadLine();

                    Console.WriteLine("Enter the ID Number of the Developer");
                    newDeveloper.IdNumber = int.Parse(Console.ReadLine());

                    Console.WriteLine("Does the Developer has Pluralsight? (y/n)");
                    string hasPluralSight = Console.ReadLine();

                    if (hasPluralSight == "y")
                    {
                        newDeveloper.HasPluralsight = true;
                    }
                    else
                    {
                        newDeveloper.HasPluralsight = false;
                    }
                    _developerRepository.AddDeveloperToRepo(newDeveloper);
                    developersToAdd.Add(newDeveloper);
                }
                if (input == "N" || input == "n")
                {
                    _devTeamRepository.AddMultipleDevToTeam(teamId, developersToAdd);
                    hasFilledPositions = true;
                }
            }
        }