Commit e13f8e9c authored by Tomáš Strachoň's avatar Tomáš Strachoň
Browse files

fix: resolve issues with counting group points during export

parent 8bc92b73
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ namespace TournamentManager.DbContexts
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = fin.Id, IdTeamGuest = gbr.Id, GoalsHost = 8, GoalsGuest = 0, Date = new DateTime(2024, 05, 12) },
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = svk.Id, IdTeamGuest = kaz.Id, GoalsHost = 6, GoalsGuest = 2, Date = new DateTime(2024, 05, 12) },
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = den.Id, IdTeamGuest = can.Id, GoalsHost = 1, GoalsGuest = 5, Date = new DateTime(2024, 05, 12) },
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = lat.Id, IdTeamGuest = fra.Id, GoalsHost = 3, GoalsGuest = 2, Date = new DateTime(2024, 05, 12) },
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = lat.Id, IdTeamGuest = fra.Id, GoalsHost = 3, GoalsGuest = 2, Date = new DateTime(2024, 05, 12), End = MatchEnd.Overtime },
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = aut.Id, IdTeamGuest = sui.Id, GoalsHost = 5, GoalsGuest = 6, Date = new DateTime(2024, 05, 12) },
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = swe.Id, IdTeamGuest = pol.Id, GoalsHost = 5, GoalsGuest = 1, Date = new DateTime(2024, 05, 12) },

@@ -240,7 +240,7 @@ namespace TournamentManager.DbContexts
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = fin.Id, IdTeamGuest = gbr.Id, GoalsHost = 8, GoalsGuest = 0, Date = new DateTime(2024, 05, 12) },
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = svk.Id, IdTeamGuest = kaz.Id, GoalsHost = 6, GoalsGuest = 2, Date = new DateTime(2024, 05, 12) },
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = den.Id, IdTeamGuest = can.Id, GoalsHost = 1, GoalsGuest = 5, Date = new DateTime(2024, 05, 12) },
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = lat.Id, IdTeamGuest = fra.Id, GoalsHost = 3, GoalsGuest = 2, Date = new DateTime(2024, 05, 12) },
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = lat.Id, IdTeamGuest = fra.Id, GoalsHost = 3, GoalsGuest = 2, Date = new DateTime(2024, 05, 12), End = MatchEnd.Overtime },
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = aut.Id, IdTeamGuest = sui.Id, GoalsHost = 5, GoalsGuest = 6, Date = new DateTime(2024, 05, 12) },
                new Match { Id = ++idMatch, IdTournament = idTournament, IdTeamHost = swe.Id, IdTeamGuest = pol.Id, GoalsHost = 5, GoalsGuest = 1, Date = new DateTime(2024, 05, 12) },

+3 −1
Original line number Diff line number Diff line
@@ -142,10 +142,12 @@ namespace TournamentManager.ViewModels

            foreach (var team in teams)
            {
                team.Points = 0;
                team.EliminationMatches = 0;
                dict.Add(team.IdTeam, team);
            }

            matches = [.. matches.Where(m => m.Round == 0 && dict.ContainsKey(m.IdTeamGuest))];
            matches = [.. matches.Where(m => m.Round == 1 && dict.ContainsKey(m.IdTeamGuest))];

            foreach (var match in matches)
            {