From 48e03c42e6932cd11b7ff9298835e5ff2bc6b14a Mon Sep 17 00:00:00 2001 From: Kenny Young Date: Wed, 29 May 2019 20:24:09 -0700 Subject: [PATCH 1/2] Show Empty Swag Make sure that players who have not selected any swag show up, so we know who to check up on. --- ServerCore/Pages/Swag/Report.cshtml.cs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/ServerCore/Pages/Swag/Report.cshtml.cs b/ServerCore/Pages/Swag/Report.cshtml.cs index 2bd13899..585de43b 100644 --- a/ServerCore/Pages/Swag/Report.cshtml.cs +++ b/ServerCore/Pages/Swag/Report.cshtml.cs @@ -36,18 +36,19 @@ public class SwagView public async Task OnGetAsync(int? puzzleId) { - SwagViews = await (from s in _context.Swag - join t in _context.TeamMembers on s.PlayerId equals t.Member.ID - where s.Event == Event && t.Team.Event == Event - orderby t.Team.Name, s.ShirtSize - select new SwagView() - { - PlayerName = t.Member.Name, - TeamName = t.Team.Name, - Lunch = s.Lunch, - LunchModifications = s.LunchModifications, - ShirtSize = s.ShirtSize - }).ToListAsync(); + SwagViews = await (from t in _context.TeamMembers + join s in _context.Swag on t.Member.ID equals s.PlayerId into tmp + from swagState in tmp.DefaultIfEmpty() + where (swagState == null || swagState.Event == Event) && t.Team.Event == Event + orderby t.Team.Name, swagState.ShirtSize + select new SwagView() + { + PlayerName = t.Member.Name, + TeamName = t.Team.Name, + Lunch = swagState == null ? null : swagState.Lunch, + LunchModifications = swagState == null ? null : swagState.LunchModifications, + ShirtSize = swagState == null ? null : swagState.ShirtSize + }).ToListAsync(); return Page(); } } From 692a16638222c4757c099ac199783ad8192e5ae2 Mon Sep 17 00:00:00 2001 From: Kenny Young Date: Wed, 29 May 2019 20:38:04 -0700 Subject: [PATCH 2/2] Add email for easier reporting --- ServerCore/Pages/Swag/Report.cshtml | 6 ++++++ ServerCore/Pages/Swag/Report.cshtml.cs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/ServerCore/Pages/Swag/Report.cshtml b/ServerCore/Pages/Swag/Report.cshtml index 709067b3..435ce0bf 100644 --- a/ServerCore/Pages/Swag/Report.cshtml +++ b/ServerCore/Pages/Swag/Report.cshtml @@ -19,6 +19,9 @@ @Html.DisplayNameFor(model => model.SwagViews[0].PlayerName) + + @Html.DisplayNameFor(model => model.SwagViews[0].PlayerEmail) + @Html.DisplayNameFor(model => model.SwagViews[0].Lunch) @@ -40,6 +43,9 @@ @Html.DisplayFor(model => item.PlayerName) + + @Html.DisplayFor(model => item.PlayerEmail) + @Html.DisplayFor(model => item.Lunch) diff --git a/ServerCore/Pages/Swag/Report.cshtml.cs b/ServerCore/Pages/Swag/Report.cshtml.cs index 585de43b..d673a196 100644 --- a/ServerCore/Pages/Swag/Report.cshtml.cs +++ b/ServerCore/Pages/Swag/Report.cshtml.cs @@ -26,6 +26,7 @@ public SwagReportModel(PuzzleServerContext serverContext, UserManager