//DevTeam Update public bool UpdateDevleoper(int devTeamId, string teamName) { DevTeam existingDevTeam = GetTeamById(devTeamId); if (existingDevTeam != null) { existingDevTeam.TeamName = teamName; return(true); } return(false); }
public void RemoveDevFromTeam(Developer developer, DevTeam devTeam) { if (devTeam == null) { return; } else { devTeam.ListOfDevelopers.Remove(developer); } }
public int AreDevlopers(int teamid) { DevTeam devTeam = GetDevTeamById(teamid); { if (devTeam.Employees == null) { return(0); } else { return(1); } } }
//Another method called AddDevToTeam()*will need to use helper method. public bool AddDevToTeam(DevTeam devteam) { int beforecount = _devTeams.Count; _devTeams.Add(devteam); int aftercount = _devTeams.Count; return(aftercount == beforecount + 1); }
public void AddDevelopersToTeam(long teamid, List <Developer> devs) { DevTeam team = FindTeamById(teamid); if (team != null) { foreach (Developer d in devs) { team.AddToTeam(d); } } }
public bool RemoveDeveloperFromTeam(long teamid, Developer dev) { DevTeam team = FindTeamById(teamid); bool devRemoved = false; if (team != null) { devRemoved = team.RemoveFromTeam(dev); } return(devRemoved); }
// seed content private void SetContent() { Developer dev1 = new Developer("Jack", "NeedsLicense", 1, false); Developer dev2 = new Developer("John", "NeedsLicense", 2, false); Developer dev3 = new Developer("Paul", "Jones", 3, true); Developer dev4 = new Developer("Jason", "Williams", 4, false); Developer dev5 = new Developer("Jack", "Daniels", 5, true); Developer dev6 = new Developer("Jamie", "Smith", 6, true); Developer dev7 = new Developer("James", "Bond", 7, true); _developerRepoUI.AddDeveloperToList(dev1); _developerRepoUI.AddDeveloperToList(dev2); _developerRepoUI.AddDeveloperToList(dev3); _developerRepoUI.AddDeveloperToList(dev4); _developerRepoUI.AddDeveloperToList(dev5); _developerRepoUI.AddDeveloperToList(dev6); _developerRepoUI.AddDeveloperToList(dev7); List <Developer> devTeamMem1 = new List <Developer>(); devTeamMem1.Add(dev1); devTeamMem1.Add(dev2); devTeamMem1.Add(dev3); List <Developer> devTeamMem2 = new List <Developer>(); devTeamMem2.Add(dev4); devTeamMem2.Add(dev5); devTeamMem2.Add(dev6); List <Developer> devTeamMem3 = new List <Developer>(); devTeamMem3.Add(dev1); devTeamMem3.Add(dev4); devTeamMem3.Add(dev7); List <Developer> devTeamMem4 = new List <Developer>(); devTeamMem4.Add(dev2); devTeamMem4.Add(dev3); devTeamMem4.Add(dev5); devTeamMem4.Add(dev7); DevTeam devT1 = new DevTeam("DevTeamOne", 1, devTeamMem1); DevTeam devT2 = new DevTeam("DevTeamTwo", 2, devTeamMem2); DevTeam devT3 = new DevTeam("DevTeamThree", 3, devTeamMem3); DevTeam devT4 = new DevTeam("DevTeamFour", 4, devTeamMem4); _devTeamRepoUI.AddDevTeamToList(devT1); _devTeamRepoUI.AddDevTeamToList(devT2); _devTeamRepoUI.AddDevTeamToList(devT3); _devTeamRepoUI.AddDevTeamToList(devT4); }
//DevTeam Create public void AddDevsToTeam(Developer developer, DevTeam devTeam) { //3. Check to make sure they are found (Are they null?) if (devTeam == null) { return; } //4. If not null, add developer to the list of developers of that desired team. else { devTeam.ListOfDevelopers.Add(developer); } }
//DevTeam Update public void updateExistingContent(string originalTeam, DevTeam newContent) { //Find the team DevTeam oldContent = GetContentByTeamName(originalTeam); //Update the content if (oldContent != null) { oldContent.TeamName = newContent.TeamName; oldContent.NumMembers = newContent.NumMembers; oldContent.Description = newContent.Description; oldContent.SecurityGroup = newContent.SecurityGroup; } }
//DevTeam Delete public bool DeleteTeam(long id) { DevTeam team = FindTeamById(id); if (team != null) { _devTeams.Remove(team); return(true); } else { return(false); } }
public bool AddDeveloperToTeam(long teamid, Developer dev) { DevTeam team = FindTeamById(teamid); if (team != null) { team.AddToTeam(dev); return(true); } else { return(false); } }
//DevTeam Create public string CreateNewDevTeam(string teamName) { DevTeam anothernewdevteam = new DevTeam(teamName); _devTeams.Add(anothernewdevteam); string returnString = ""; foreach (DevTeam thisTeam in _devTeams) { returnString += thisTeam.teamName; returnString += "\n"; } return(returnString); }
//DevTeam Update public bool UpdateDevTeam(string name) { DevTeam old = GetDevTeamByName(name); if (name != null) { old.Name = name; return(true); } else { return(false); } }
//DevTeam Delete Developer from Existing Team public bool RemoveDevFromTeam(string devTeamToUpdate, DevTeam developer) { DevTeam devTeam = GetDevTeamByID(devTeamToUpdate); devTeam.ListOfDevs = developer.ListOfDevs; foreach (var dev in developer.ListOfDevs) { //Console.WriteLine(dev.DevID); devTeam.ListOfDevs.Remove(dev); } return(true); }
//DevTeam Update public bool UpdateDevTeams(DevTeam oldTeam, DevTeam newTeam) { if (oldTeam != null && newTeam != null) { oldTeam.DevTeamName = newTeam.DevTeamName; oldTeam.DevTeamId = newTeam.DevTeamId; oldTeam.DevTeamMembers = newTeam.DevTeamMembers; return(true); } else { return(false); } }
//DevTeam Delete public bool DeleteTeam(string id) { DevTeam team = GetTeamByID(id); if (team != null) { _devTeams.Remove(team); return(true); } else { return(false); } }
//DevTeam Update public bool updateTeam(long id, DevTeam team) { DevTeam oldTeam = FindTeamById(id); if (oldTeam != null) { oldTeam.TeamName = team.TeamName; oldTeam.Id = team.Id; return(true); } else { return(false); } }
//DevTeam Update public bool UpdateExistingDevTeam(int oldDevTeamID, DevTeam newDevTeam) { DevTeam oldDevTeam = GetDevTeamByID(oldDevTeamID); if (oldDevTeam != null) { newDevTeam.DevTeamID = oldDevTeam.DevTeamID; oldDevTeam.DevTeamName = newDevTeam.DevTeamName; return(true); } else { return(false); } }
//DevTeam Update public bool UpdateExisitingDevTeam(int originalTeamNumber, DevTeam newDevTeam) { DevTeam oldDevTeam = GetDevTeamsById(originalTeamNumber); if (oldDevTeam != null) { oldDevTeam.TeamId = newDevTeam.TeamId; oldDevTeam.Developers = newDevTeam.Developers; return(true); } else { return(false); } }
//DevTeam Create public bool AddDevTeamToList(DevTeam devTeam) { int initialTeamCount = _devTeams.Count(); _devTeams.Add(devTeam); if (_devTeams.Count() > initialTeamCount) { return(true); } else { return(false); } }
//DevTeam Update public bool UpdateExistingTeam(string originalTeamName, string newTeamName) { DevTeam oldTeam = GetTeamByName(originalTeamName); if (oldTeam != null) { oldTeam.TeamName = newTeamName; return(true); } else { return(false); } }
// Create new DevTeam private void CreateDevTeam() { Console.WriteLine("Enter a team name: "); string name = Console.ReadLine(); Console.WriteLine("Enter an ID: "); string id = Console.ReadLine(); List <Developer> devsInTeam = new List <Developer>(); bool keepGoing = true; while (keepGoing == true) { Console.WriteLine(); DisplayDevins(); Console.WriteLine("\nEnter a Developer's ID to add to the list, or enter 'quit' to move on: "); string input = Console.ReadLine(); if (input != "quit") { Developer addTo = _devinRepo.GetDevinByID(input); if (addTo != null) { devsInTeam.Add(addTo); } else { Console.WriteLine("Developer with that ID could not be found"); } } else { keepGoing = false; } Console.WriteLine("Press Any Key To Continue..."); Console.ReadKey(); Console.Clear(); } DevTeam newTeam = new DevTeam(devsInTeam, name, id); _devTeamRepo.AddTeam(newTeam); }
//DevTeam Update public bool UpdateExistingDevTeam(int oldTeamId, DevTeam newTeam) { DevTeam oldTeam = GetTeamById(oldTeamId); if (oldTeam != null) { oldTeam.DevTeamId = newTeam.DevTeamId; oldTeam.DevTeamName = newTeam.DevTeamName; return(true); } else { return(false); } }
public bool UpdateExistingDevTeam(int originalId, DevTeam newDevTeam) { DevTeam oldDevTeam = GetDevTeamById(originalId); if (oldDevTeam != null) { oldDevTeam.Id = newDevTeam.Id; oldDevTeam.listOfDevelopers = oldDevTeam.listOfDevelopers; oldDevTeam.TeamName = oldDevTeam.TeamName; return(true); } else { return(false); } }
public void RemoveMultipleDevToTeam(int teamId, List <Developer> developers) { DevTeam devTeam = GetDevTeamsById(teamId); if (devTeam != null) { foreach (var developer in developers) { devTeam.Developers.Remove(developer); } } else { Console.WriteLine($"Sorry there's no available team with the Id. {devTeam.TeamId}"); } }
//DevTeam Update public bool UpdateExistingDevTeam(int teamID, DevTeam newDevTeam) { //find the dev team DevTeam oldDevTeam = GetDevTeamByID(teamID); //Update the dev team if (oldDevTeam != null) { oldDevTeam.TeamIDNum = newDevTeam.TeamIDNum; return(true); } else { return(false); } }
public bool UpdateDevTeamByID(int devTeamID, DevTeam newDevTeam) { DevTeam oldDevTeam = GetDevTeamByID(devTeamID); if (oldDevTeam != null) { oldDevTeam.DevTeamColor = newDevTeam.DevTeamColor; oldDevTeam.DevTeamID = newDevTeam.DevTeamID; return(true); } else { return(false); } }
public bool UpdateDevTeams(int originalTeamId, DevTeam newTeam) { //Find the team DevTeam originalTeamInfo = GetDevTeamById(originalTeamId); //update the team if (originalTeamInfo != null) { originalTeamInfo.TeamID = newTeam.TeamID; originalTeamInfo.TeamName = newTeam.TeamName; return(true); } else { return(false); } }
public bool AddDevTeamMember(int developerAddToTeam) { DevTeam newDevId = GetDevTeamId(developerAddToTeam); int initialTeamCount = _devTeams.Count(); _devTeams.Add(newDevId); if (_devTeams.Count > initialTeamCount) { return(true); } else { return(false); } }
//DevTeam Delete public bool RemoveDevTeamFromList(int devTeamId) { DevTeam removeDevTeamId = GetDevTeamId(devTeamId); int initialDevTeamCount = _devTeams.Count; _devTeams.Remove(removeDevTeamId); if (initialDevTeamCount > _devTeams.Count) { return(true); } else { return(false); } }