public void UpdateTeam(Team team) { teams[team.GetTeamID()] = team; }
public void UpdateTeam(Team team) { var teamID = team.GetTeamID(); teams[teamID] = team; var queries = new List<string>(); queries.Add(SqlQueries.DeleteTeamPlayers(teamID)); foreach (var playerID in team.GetPlayerIDs()) { queries.Add(SqlQueries.InsertPlayerTeam(teamID, playerID)); } queries.Add(SqlQueries.UpdateTeam(teamID, team.GetTeamName(), team.GetTeamContact())); foreach (var query in queries) { var command = new SQLiteCommand(query, dbConnection); command.ExecuteNonQuery(); } }