A lot of refactoring and both saving types work
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user