Пример #1
0
        // Add developer to team
        public void AddDevtoTeam(DeveloperContent developer, string teamName)
        {
            // Get dev team we want to add dev to
            DevTeamContent team = GetDevTeamByTeamName(teamName);

            // Dig into dev team object using dot annotation to get to Developers property (which is a list)
            team.Developers.Add(developer);
            // Add developer to Developers property
        }
Пример #2
0
        //Update
        public bool UpdateDevTeam(string originalTeam, DevTeamContent newDevTeam)
        {
            //Find the developer
            DevTeamContent oldTeam = GetDevTeamByTeamName(originalTeam);

            //Update developer
            if (oldTeam != null)
            {
                oldTeam.TeamName   = newDevTeam.TeamName;
                oldTeam.TeamId     = newDevTeam.TeamId;
                oldTeam.Developers = newDevTeam.Developers;
                return(true);
            }
            else
            {
                return(false);
            }


            //Delete
        }
Пример #3
0
        public bool RemoveDevTeamFromList(string teamName)
        {
            DevTeamContent devTeam = GetDevTeamByTeamName(teamName);

            if (devTeam == null)
            {
                return(false);
            }
            int initialCount = _listOfDevTeams.Count;

            _listOfDevTeams.Remove(devTeam);

            if (initialCount > _listOfDevTeams.Count)
            {
                return(true);
            }
            else
            {
                return(false);
            }
            // Return devTeam from field list by team Id
        }
Пример #4
0
        private void RemoveDevFromTeam(DeveloperContent developer, string teamName)
        {
            DevTeamContent team = GetDevTeamByTeamName(teamName);

            team.Developers.Remove(developer);
        }
Пример #5
0
 //Create
 // Add devTeam to field list
 public void AddDevTeamToList(DevTeamContent team)
 {
     _listOfDevTeams.Add(team);
 }