Example #1
0
        }     // end Menu()

        private void AddMultipleDevelopersToTeam()
        {
            Console.Clear();
            bool hasFilledAllPositions = false;

            Console.WriteLine("Please Input an Team id.");
            int inputTeamId = int.Parse(Console.ReadLine());

            List <Developer> developersToAdd = new List <Developer>();

            while (hasFilledAllPositions == false)
            {
                Console.WriteLine("Do you have any developers to add to the team y/n");
                string inputNeededDeveloper = Console.ReadLine();
                if (inputNeededDeveloper == "Y" || inputNeededDeveloper == "y")
                {
                    Console.Clear();
                    Developer newdeveloper = new Developer();


                    Console.WriteLine("Please Input Developer Title: ");
                    string developerTitleInput = Console.ReadLine();
                    newdeveloper.Title = developerTitleInput;

                    Console.WriteLine("Please Input Developer First Name: ");
                    string developerFirstNameInput = Console.ReadLine();
                    newdeveloper.FirstName = developerFirstNameInput;

                    Console.WriteLine("Please Input Developer Last Name: ");
                    string developerLastNameInput = Console.ReadLine();
                    newdeveloper.LastName = developerLastNameInput;


                    Console.WriteLine("Enter the Developer ID :");
                    // obtain user info / input about specific developer ( key : employeeID )
                    int inputEmployeeId = int.Parse(Console.ReadLine());
                    newdeveloper.EmployeeId = inputEmployeeId;
                    Console.WriteLine("Does this delvelopoer have a PluralsightLicense(Y or N)");
                    string inputpluralSight = Console.ReadLine();
                    if (inputpluralSight == "Y")
                    {
                        newdeveloper.PluralsightAccess = true;
                    }
                    else if (inputpluralSight == "N")
                    {
                        newdeveloper.PluralsightAccess = false;
                    }

                    developersToAdd.Add(newdeveloper);
                    _developerRepo.AddDeveloperToList(newdeveloper);
                    Console.Clear();
                }

                if (inputNeededDeveloper == "N" || inputNeededDeveloper == "n")
                {
                    _devTeamRepo.AddMultipleDevelopersToTeam(inputTeamId, developersToAdd);
                    hasFilledAllPositions = true;
                }
            }
        }