public FlowDocument PrintEuro() { var rg = new PentamindStandingsGenerator(); var results = rg.GetEuroStandings(null); return(Print(results, "Eurogames WC Standings")); }
public void FreezeEurogames() { var context = DataEntitiesProvider.Provide(); var currentOlympiad = context.Olympiad_Infoes.First(x => x.Current); // Next a Eurogames one var pentamindStandingsGenerator = new PentamindStandingsGenerator(); var eurostandings = pentamindStandingsGenerator.GetEuroStandings(null); int rank = 1; foreach (var standing in eurostandings.Standings) { if (!standing.IsValid) { continue; } var contestant = context.Contestants.FirstOrDefault(x => x.Mind_Sport_ID == standing.ContestantId); var evt = context.Events.FirstOrDefault(x => x.OlympiadId == currentOlympiad.Id && x.Code == "EGWC"); var entry = context.Entrants.FirstOrDefault(x => x.OlympiadId == currentOlympiad.Id && x.Game_Code == "EGWC" && x.Mind_Sport_ID == standing.ContestantId); if (entry == null) { entry = Entrant.NewEntrant(evt.EIN, "EGWC", currentOlympiad.Id, contestant, 0m); context.Entrants.Add(entry); } entry.Score = standing.TotalScoreStr; entry.Rank = rank; entry.Medal = MedalForRank(rank); rank++; context.SaveChanges(); } }