A lot of refactoring and both saving types work

This commit is contained in:
2020-04-16 00:12:42 +02:00
parent 1361fa048e
commit 7f4bf45850
6 changed files with 128 additions and 37 deletions

View File

@ -199,44 +199,10 @@ namespace TrackerUI
}
}
if (teamOneScore > teamTwoScore)
{
// Team one winns
m.Winner = m.Entries[0].TeamCompeting;
}
else
if (teamTwoScore > teamOneScore)
{
// Team one winns
m.Winner = m.Entries[1].TeamCompeting;
}
else
{
MessageBox.Show("I dont handle tie games.");
}
foreach (List<MatchupModel> round in tournament.Rounds)
{
foreach (MatchupModel rm in round)
{
foreach (MatchupEntryModel me in rm.Entries)
{
if (me.ParentMatchup != null)
{
if (me.ParentMatchup.Id == m.Id)
{
me.TeamCompeting = m.Winner;
GlobalConfig.Connection.UpdateMatchup(rm);
}
}
}
}
}
TournamentLogic.UpdateTournamentResults(tournament);
LoadMatchups((int)roundDropDown.SelectedItem);
GlobalConfig.Connection.UpdateMatchup(m);
}
}
}