Now it is possible to finnish a tournament with scores and mails
This commit is contained in:
@ -12,6 +12,7 @@ namespace TrackerLibrary.DataAccess
|
||||
void CreateTeam(TeamModel model);
|
||||
void CreateTournament(TournamentModel model);
|
||||
void UpdateMatchup(MatchupModel model);
|
||||
void CompleteTournament(TournamentModel model);
|
||||
List<TeamModel> GetTeam_All();
|
||||
List<PersonModel> GetPerson_All();
|
||||
List<TournamentModel> GetTournament_All();
|
||||
|
||||
@ -321,5 +321,16 @@ namespace TrackerLibrary.DataAccess
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CompleteTournament(TournamentModel model)
|
||||
{
|
||||
// spTournaments_Complete
|
||||
using(IDbConnection connection = new System.Data.SqlClient.SqlConnection(GlobalConfig.CnnString(db)))
|
||||
{
|
||||
var p = new DynamicParameters();
|
||||
p.Add("@Id", model.Id);
|
||||
connection.Execute("dbo.spTournaments_Complete", p, commandType: CommandType.StoredProcedure);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,5 +126,19 @@ namespace TrackerLibrary.DataAccess
|
||||
{
|
||||
model.UpdateMatchupToFile();
|
||||
}
|
||||
|
||||
public void CompleteTournament(TournamentModel model)
|
||||
{
|
||||
List<TournamentModel> tournaments = GlobalConfig.TournamentFile
|
||||
.FullFilePath()
|
||||
.LoadFile()
|
||||
.ConvertToTournamentModels();
|
||||
|
||||
tournaments.Remove(model);
|
||||
|
||||
tournaments.SaveToTournamentFile();
|
||||
|
||||
TournamentLogic.UpdateTournamentResults(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user