Exemplo n.º 1
0
        private void removeDevsTeamsMembers()
        {
            Console.Clear();

            displayAllDevsTeams();

            Console.WriteLine("\nEnter the ID of the DevTeam you'd like to remove a member from:");

            //Get that Name
            int oldID = Convert.ToInt32(Console.ReadLine());

            //Call Object
            DevelopersTeams newDevTeam = _DevTeamRepo.getDeveloperTeamsByID(oldID);

            //Current Team Members
            displayAllDevs();
            Console.WriteLine("Please enter the ID number of the Developer you'd like to remove.");

            string     responseID = Console.ReadLine();
            Developers developer  = _DeveloperRepo.GetDeveloperByID(responseID);

            newDevTeam.DevTeamMembers.Remove(developer);

            //Verify update worked
            bool updateWorked = _DevTeamRepo.updateExistingDevsTeams(oldID, newDevTeam);

            if (updateWorked)
            {
                Console.WriteLine("Developer Team succesfully updated!");
            }
            else
            {
                Console.WriteLine("Could not update Develope Team.");
            }
        }
Exemplo n.º 2
0
        private void updateExistingDevsTeams()
        {
            Console.Clear();

            displayAllDevsTeams();

            Console.WriteLine("\nEnter the  ID of the Developer Team you'd like to update:");

            //Get that Name
            int oldID = Convert.ToInt32(Console.ReadLine());

            //Build a new object
            DevelopersTeams newDevTeam = new DevelopersTeams();

            //Name
            Console.WriteLine("Enter the name of the Developer Team:");
            newDevTeam.TeamName = Console.ReadLine();

            //ID Number
            Console.WriteLine("Enter the ID number for the Developer Team:");
            newDevTeam.TeamID = Convert.ToInt32(Console.ReadLine());

            //Current Team Members
            displayAllDevs();
            Console.WriteLine("Please enter the ID number of the Developer you'd like to assign as the new Team Lead.");

            string     responseID = Console.ReadLine();
            Developers developer  = _DeveloperRepo.GetDeveloperByID(responseID);

            newDevTeam.DevTeamMembers.Add(developer);

            //Verify update worked
            bool updateWorked = _DevTeamRepo.updateExistingDevsTeams(oldID, newDevTeam);

            if (updateWorked)
            {
                Console.WriteLine("Develop Team succesfully updated!");
            }
            else
            {
                Console.WriteLine("Could not update Developer Team.");
            }
        }
Exemplo n.º 3
0
        private void displayDevsTeamsByID()
        {
            Console.Clear();

            Console.WriteLine("Enter the ID of the Developer Team you'd like to see:");

            int iD = Convert.ToInt32(Console.ReadLine());

            DevelopersTeams devTeam = _DevTeamRepo.getDeveloperTeamsByID(iD);

            if (devTeam != null)
            {
                Console.WriteLine($"Name: {devTeam.TeamName},\n" +
                                  $" ID Number: {devTeam.TeamID}\n");
                foreach (Developers dev in devTeam.DevTeamMembers)
                {
                    Console.WriteLine($"{dev.Name}, {dev.IDNumber}\n");
                }
            }
            else
            {
                Console.WriteLine("No Developer Team by that ID.");
            }
        }
Exemplo n.º 4
0
        private void addNewDevsTeam()
        {
            Console.Clear();
            DevelopersTeams newDevTeam = new DevelopersTeams();

            //Name
            Console.WriteLine("Enter the name of the Developer Team:");
            newDevTeam.TeamName = Console.ReadLine();

            //ID Number
            Console.WriteLine("Enter the ID number for the Developer Team:");
            newDevTeam.TeamID = Convert.ToInt32(Console.ReadLine());

            //Add to Team List
            displayAllDevs();
            Console.WriteLine("Please enter the ID number of the Developer you'd like to add to this team.");

            string     responseID = Console.ReadLine();
            Developers developer  = _DeveloperRepo.GetDeveloperByID(responseID);

            newDevTeam.DevTeamMembers.Add(developer);

            _DevTeamRepo.AddDevsTeamToList(newDevTeam);
        }