private void DisplayTeam(KomodoInsuranceTeam team) { Console.WriteLine($"Team Name: {team.TeamName}\n" + $"Team ID: {team.IDNumber}\n"); Console.WriteLine("Members of the team:\n"); int count = 0; foreach (KomodoInsuranceDeveloper developer in team.Developers) { count++; Console.WriteLine($"{count}: {developer.LastName}\n"); } }
private void RemoveTeam() { Console.Clear(); Console.WriteLine("Which team would you like to remove?"); List <KomodoInsuranceTeam> teams = _komodoRepository.GetTeams(); int count = 0; foreach (KomodoInsuranceTeam team in teams) { count++; Console.WriteLine($"{count}: {team.TeamName}"); } int targetID = int.Parse(Console.ReadLine()); int targetIndex = targetID - 1; if (targetIndex >= 0 && targetIndex < teams.Count) { KomodoInsuranceTeam targetedTeam = teams[targetIndex]; if (_komodoRepository.DeleteTeam(targetedTeam)) { Console.WriteLine($"{targetedTeam.TeamName} was successfully removed"); } else { Console.WriteLine("I can't do that"); } } else { Console.WriteLine("Not a valid team"); } Console.WriteLine("Press any key to continue....."); Console.ReadKey(); }