예제 #1
0
        //Update
        public bool UpdateExistingTeam(int originalId, DevTeam newTeam)
        {
            {
                //Find Team
                DevTeam oldTeam = GetTeamById(originalId);

                //Update Team
                if (oldTeam != null)
                {
                    oldTeam.TeamId   = newTeam.TeamId;
                    oldTeam.TeamName = newTeam.TeamName;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
예제 #2
0
        //Delete
        public bool RemoveTeamFromList(int id)
        {
            DevTeam developer = GetTeamById(id);

            if (developer == null)
            {
                return(false);
            }

            int initialCount = _devTeam.Count;

            _devTeam.Remove(developer);

            if (initialCount > _devTeam.Count)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #3
0
 //Create
 public void AddTeamToList(DevTeam team)
 {
     _devTeam.Add(team);
     team.TeamId = _id;
     _id++;
 }