Tournament form is ready but matchup information

This commit is contained in:
2020-04-08 00:00:49 +02:00
parent 137d012ab3
commit 12be5e3890
6 changed files with 153 additions and 16 deletions

View File

@ -100,9 +100,22 @@ namespace TrackerLibrary.DataAccess
{
return TeamFile.FullFilePath().LoadFile().ConvertToTeamModels(PeopleFile);
}
public TournamentModel CreateTournament(TournamentModel model)
public void CreateTournament(TournamentModel model)
{
List<TournamentModel> tournaments = TournamentFile.FullFilePath().LoadFile().ConvertToTournamentModels();
List<TournamentModel> tournaments = TournamentFile
.FullFilePath()
.LoadFile()
.ConvertToTournamentModels(TeamFile, PeopleFile, PrizesFile);
int currentId = 1;
if (tournaments.Count > 0)
{
currentId = tournaments.OrderByDescending(x => x.Id).First().Id + 1;
}
model.Id = currentId;
tournaments.Add(model);
tournaments.SaveToTournamentFile(TournamentFile);
}
}