diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/BlacksmithWorkshop.csproj b/BlacksmithWorkshop/BlacksmithWorkshop/BlacksmithWorkshop.csproj index 59dd525..edd6fe3 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/BlacksmithWorkshop.csproj +++ b/BlacksmithWorkshop/BlacksmithWorkshop/BlacksmithWorkshop.csproj @@ -14,9 +14,9 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportGroupedOrders.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportGroupedOrders.cs index 49979ec..ed9f46b 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportGroupedOrders.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportGroupedOrders.cs @@ -34,7 +34,7 @@ namespace BlacksmithWorkshop Dock = DockStyle.Fill }; - reportViewer.LocalReport.LoadReportDefinition(new FileStream("..\\..\\..\\ReportGroupedOrders.rdlc", FileMode.Open)); + reportViewer.LocalReport.LoadReportDefinition(new FileStream("C:\\Users\\Programmist73\\Desktop\\Практика\\2-й курс\\4-й семестр\\PIbd-21_Eliseev_E.E._BlacksmithWorkshop\\BlacksmithWorkshop\\BlacksmithWorkshop\\ReportGroupedOrders.rdlc", FileMode.Open)); Controls.Clear(); Controls.Add(reportViewer); Controls.Add(panel); diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportOrders.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportOrders.cs index 29a74b8..3760334 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportOrders.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportOrders.cs @@ -34,7 +34,7 @@ namespace BlacksmithWorkshop Dock = DockStyle.Fill }; - reportViewer.LocalReport.LoadReportDefinition(new FileStream("..\\..\\..\\ReportOrders.rdlc", FileMode.Open)); + reportViewer.LocalReport.LoadReportDefinition(new FileStream("C:\\Users\\Programmist73\\Desktop\\Практика\\2-й курс\\4-й семестр\\PIbd-21_Eliseev_E.E._BlacksmithWorkshop\\BlacksmithWorkshop\\BlacksmithWorkshop\\ReportOrders.rdlc", FileMode.Open)); Controls.Clear(); Controls.Add(reportViewer); diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/OrderStorage.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/OrderStorage.cs index 290843b..a748729 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/OrderStorage.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/OrderStorage.cs @@ -49,14 +49,23 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements public List GetFilteredList(OrderSearchModel model) { - if (!model.Id.HasValue) + if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue) { - return new(); - } + return new(); + } - using var context = new BlacksmithWorkshopDatabase(); + using var context = new BlacksmithWorkshopDatabase(); - return context.Orders + if (!model.Id.HasValue && model.DateFrom.HasValue && model.DateTo.HasValue) + { + return context.Orders + .Include(x => x.Manufacture) + .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo) + .Select(x => x.GetViewModel) + .ToList(); + } + + return context.Orders .Include(x => x.Manufacture) .Where(x => x.Id == model.Id) .Select(x => x.GetViewModel)