Esempio n. 1
0
        private void AddTeams()
        {
            Console.Clear();
            DevTeam devTeam = new DevTeam();

            Console.WriteLine("Enter ID Number for the Developer");
            string idInputString = Console.ReadLine();

            devTeam.IddNumber = int.Parse(idInputString);
            Console.WriteLine("Enter Team Name");
            devTeam.GroupName = Console.ReadLine();

            Console.WriteLine("Enter Projects Name");
            devTeam.Projects = Console.ReadLine();

            Console.WriteLine("Enter Programming languages used");
            devTeam.Languages = Console.ReadLine();
        }
        //DevTeam Update
        public bool UpdateExistingTeam(int idNumber, DevTeam newDevTeam)
        {
            DevTeam oldTeam = GetTeam(idNumber);

            if (oldTeam != null)
            {
                oldTeam.IddNumber = newDevTeam.IddNumber;
                oldTeam.GroupName = newDevTeam.GroupName;
                oldTeam.Projects  = newDevTeam.Projects;
                oldTeam.Languages = newDevTeam.Languages;

                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 3
0
        private void ViewTeamsById()
        {
            Console.Clear();
            Console.WriteLine("Enter DevTeams Id");
            string  idUser  = Console.ReadLine();
            int     teamId  = int.Parse(idUser);
            DevTeam devTeam = _devTeamRepo.GetTeam(teamId);

            if (devTeam != null)
            {
                Console.WriteLine($"Id Number {devTeam.IddNumber}\n" +
                                  $"Team Name {devTeam.GroupName}\n" +
                                  $"Projects {devTeam.Projects}\n" +
                                  $"Programming Languages used {devTeam.Languages}");
                DisplayTeamMembers(devTeam);
            }
            else
            {
                Console.WriteLine("DevTeam Does Not Exist");
            }
        }
        //DevTeam Delete
        public bool RemoveTeam(int iddNumber)
        {
            DevTeam devTeam = GetTeam(iddNumber);
            {
                if (devTeam == null)
                {
                    return(false);
                }

                int initialCount = _devTeams.Count;
                _devTeams.Remove(devTeam);

                if (initialCount > _devTeams.Count)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Esempio n. 5
0
        private void UpdateTeams()
        {
            ViewDevTeams();
            Console.WriteLine("Enter the Id of the team you would like to update");
            string oldTeamID = Console.ReadLine();
            int    devTeamID = int.Parse(oldTeamID);

            Console.Clear();

            DevTeam newDevTeam = new DevTeam();

            Console.WriteLine("Enter Team ID");
            string inputUser = Console.ReadLine();

            newDevTeam.IddNumber = int.Parse(inputUser);

            Console.WriteLine("Team Name");
            newDevTeam.GroupName = Console.ReadLine();

            Console.WriteLine("Projects");
            newDevTeam.Projects = Console.ReadLine();

            Console.WriteLine("Programming Languages used");
            newDevTeam.Languages = Console.ReadLine();

            bool teamUpdated = _devTeamRepo.UpdateExistingTeam(devTeamID, newDevTeam);

            if (teamUpdated)
            {
                Console.WriteLine("DevTeam Successfully Updated");
            }
            else
            {
                Console.WriteLine("DevTeam Failed To Update");
            }
        }
 //DevTeam Create
 public void AddTeam(DevTeam devTeam)
 {
     _devTeams.Add(devTeam);
 }