diff --git a/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml b/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml index e42b799..5d3f86e 100644 --- a/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml +++ b/ReportingServices.UI/Views/ProductionReport/DailyReport.cshtml @@ -38,7 +38,7 @@
-

Date Pulled: @DateTime.Now

+

Date Pulled: @DateTime.Now

@@ -77,10 +77,65 @@ bottleChanges = @rpt.BottleChanges.Split(',').Length; } - List dailyCompletedPartChanges = Model.CompletedDailyPartChanges.Select(x => x.REACTOR).ToList(); - List dailyProjectedPartChanges = Model.ProjectedDailyPartChanges.Select(x => x.REACTOR).ToList(); - List weeklyCompletedPartChanges = Model.CompletedWeeklyPartChanges.Select(x => x.REACTOR).ToList(); - List weeklyProjectedPartChanges = Model.ProjectedWeeklyPartChanges.Select(x => x.REACTOR).ToList(); + List dailyCompletedPartChanges = new(); + List dailyProjectedPartChanges = new(); + List weeklyCompletedPartChanges = new(); + List weeklyProjectedPartChanges = new(); + var grouped = Model.CompletedDailyPartChanges.GroupBy(x => new { x.REACTOR, x.PSN }); + + string reactNo = ""; + + foreach (var group in grouped) + { + if (string.IsNullOrEmpty(reactNo)) + reactNo = group.Key.REACTOR; + else if (reactNo == group.Key.REACTOR) + dailyCompletedPartChanges.Add(reactNo); + else + reactNo = group.Key.REACTOR; + } + + grouped = Model.ProjectedDailyPartChanges.GroupBy(x => new { x.REACTOR, x.PSN }); + + reactNo = ""; + + foreach (var group in grouped) + { + if (string.IsNullOrEmpty(reactNo)) + reactNo = group.Key.REACTOR; + else if (reactNo == group.Key.REACTOR) + dailyProjectedPartChanges.Add(reactNo); + else + reactNo = group.Key.REACTOR; + } + + grouped = Model.CompletedWeeklyPartChanges.GroupBy(x => new { x.REACTOR, x.PSN }); + + reactNo = ""; + + foreach (var group in grouped) + { + if (string.IsNullOrEmpty(reactNo)) + reactNo = group.Key.REACTOR; + else if (reactNo == group.Key.REACTOR) + weeklyCompletedPartChanges.Add(reactNo); + else + reactNo = group.Key.REACTOR; + } + + grouped = Model.ProjectedWeeklyPartChanges.GroupBy(x => new { x.REACTOR, x.PSN }); + + reactNo = ""; + + foreach (var group in grouped) + { + if (string.IsNullOrEmpty(reactNo)) + reactNo = group.Key.REACTOR; + else if (reactNo == group.Key.REACTOR) + weeklyProjectedPartChanges.Add(reactNo); + else + reactNo = group.Key.REACTOR; + } }
  • Bottle Change (@bottleChanges): @bottle
  • Daily Part Changes