From 4a2b2a009b67a985c14669888074f87fde7ea568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Thu, 2 Mar 2023 04:28:14 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=B2=20pdf-file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OfficePackage/AbstractSaveToPdf.cs | 6 +- ConfectionaryBusinessLogic/ReportLogic.cs | 19 +- Confectionery/ConfectioneryView.csproj | 2 +- Confectionery/ReportOrders.rdlc | 179 ++---------------- .../ViewModels/ReportOrdersViewModel.cs | 5 +- 5 files changed, 36 insertions(+), 175 deletions(-) diff --git a/ConfectionaryBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/ConfectionaryBusinessLogic/OfficePackage/AbstractSaveToPdf.cs index 68e8d7d..3086250 100644 --- a/ConfectionaryBusinessLogic/OfficePackage/AbstractSaveToPdf.cs +++ b/ConfectionaryBusinessLogic/OfficePackage/AbstractSaveToPdf.cs @@ -18,11 +18,11 @@ namespace ConfectioneryBusinessLogic.OfficePackage Text = $"с {info.DateFrom.ToShortDateString()} по {info.DateTo.ToShortDateString()}", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Center }); - CreateTable(new List { "2cm", "3cm", "6cm", "4cm", "3cm" }); + CreateTable(new List { "3cm", "4cm", "5cm" }); CreateRow(new PdfRowParameters { - Texts = new List { "Номер", "Дата заказа", "Изделие", "Статус заказа", "Сумма" }, + Texts = new List { "Дата", "Количество", "Сумма" }, Style = "NormalTitle", ParagraphAlignment = PdfParagraphAlignmentType.Center }); @@ -31,7 +31,7 @@ namespace ConfectioneryBusinessLogic.OfficePackage { CreateRow(new PdfRowParameters { - Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.PastryName, Convert.ToString(order.OrderStatus), order.Sum.ToString() }, + Texts = new List { order.Date.ToShortDateString(), order.Count.ToString(), order.Sum.ToString() }, Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Left }); diff --git a/ConfectionaryBusinessLogic/ReportLogic.cs b/ConfectionaryBusinessLogic/ReportLogic.cs index 453b0fa..e21732c 100644 --- a/ConfectionaryBusinessLogic/ReportLogic.cs +++ b/ConfectionaryBusinessLogic/ReportLogic.cs @@ -76,16 +76,15 @@ namespace ConfectioneryBusinessLogic /// public List GetOrders(ReportBindingModel model) { - return _orderStorage.GetFilteredList(new OrderSearchModel { DateFrom = model.DateFrom, DateTo = model.DateTo }) - .Select(x => new ReportOrdersViewModel - { - Id = x.Id, - DateCreate = x.DateCreate, - PastryName = x.PastryName, - OrderStatus = Convert.ToString(x.Status) ?? string.Empty, - Sum = x.Sum - }) - .ToList(); + return _orderStorage.GetFullList() + .GroupBy(x => x.DateCreate.Date) + .Select(x => new ReportOrdersViewModel + { + Date = x.Key, + Count = x.Count(), + Sum = x.Sum(y => y.Sum) + }).ToList(); + } /// diff --git a/Confectionery/ConfectioneryView.csproj b/Confectionery/ConfectioneryView.csproj index 13143a7..463a255 100644 --- a/Confectionery/ConfectioneryView.csproj +++ b/Confectionery/ConfectioneryView.csproj @@ -28,7 +28,7 @@ - Always + PreserveNewest diff --git a/Confectionery/ReportOrders.rdlc b/Confectionery/ReportOrders.rdlc index 4a5e76b..5977266 100644 --- a/Confectionery/ReportOrders.rdlc +++ b/Confectionery/ReportOrders.rdlc @@ -21,21 +21,17 @@ Id System.Int32 - - DateCreate + + Date System.DateTime - - PastryName - System.String + + Count + System.Int32 Sum - System.Decimal - - - OrderStatus - ConfectioneryDataModels.OrderStatus + System.Double @@ -71,7 +67,7 @@ ReportParameterPeriod 1cm 1cm - 21cm + 12.40104cm @@ -103,7 +99,7 @@ 1cm - 21cm + 12.40104cm 1 - - - - - 2pt - 2pt - 2pt - 2pt - - - - @@ -212,7 +170,7 @@ - Изделие + Количество заказов @@ -235,38 +193,6 @@ - - - - true - true - - - - - Статус заказа - - - - - - 2pt - 2pt - 2pt - 2pt - - - - @@ -306,44 +232,14 @@ - + true true - =Fields!Id.Value - - - 2pt - 2pt - 2pt - 2pt - - - - - - - - true - true - - - - - =Fields!DateCreate.Value + =Fields!Date.Value @@ -352,7 +248,7 @@ - - 2pt - 2pt - 2pt - 2pt - - - true - - @@ -466,8 +331,6 @@ - - @@ -484,7 +347,7 @@ 2.48391cm 0.55245cm 1.2cm - 19.84713cm + 11.09835cm 2