From aec779bd9955dbdab06772e18f9697b5b4963dc4 Mon Sep 17 00:00:00 2001 From: malimova Date: Thu, 25 Apr 2024 21:56:17 +0400 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=82=D1=87=D0=B5=D1=82=D1=8B=20=D0=B7=D0=B0=D0=BA=D0=B0?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractSaveToPdf.cs | 6 +- .../ConfectioneryBusinessLogic.csproj | 3 +- .../ConfectioneryBusinessLogic/ReportLogic.cs | 3 +- .../ConfectioneryBusinessLogic/SaveToPdf.cs | 4 +- .../ConfectioneryContracts.csproj | 2 +- .../ConfectioneryDataModels.csproj | 4 +- .../ConfectioneryDatabaseImplement.csproj | 4 +- .../OrderStorage.cs | 7 +-- .../ConfectioneryFileImplement.csproj | 3 +- .../ConfectioneryListImplement.csproj | 2 +- .../ConfectioneryView.csproj | 3 +- .../FormReportOrders.Designer.cs | 3 +- .../ConfectioneryView/FormReportOrders.cs | 2 +- .../ConfectioneryView/FormReportOrders.resx | 62 ++++++++++++++++++- 14 files changed, 84 insertions(+), 24 deletions(-) diff --git a/Confectionery/ConfectioneryBusinessLogic/AbstractSaveToPdf.cs b/Confectionery/ConfectioneryBusinessLogic/AbstractSaveToPdf.cs index 050c2eb..62d6c94 100644 --- a/Confectionery/ConfectioneryBusinessLogic/AbstractSaveToPdf.cs +++ b/Confectionery/ConfectioneryBusinessLogic/AbstractSaveToPdf.cs @@ -24,10 +24,10 @@ namespace ConfectioneryBusinessLogic Text = $"с { info.DateFrom.ToShortDateString() } по { info.DateTo.ToShortDateString() }", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Center }); - CreateTable(new List { "2cm", "3cm", "6cm", "3cm" }); + CreateTable(new List { "2cm", "3cm", "6cm", "3cm", "3cm" }); CreateRow(new PdfRowParameters { - Texts = new List { "Номер", "Дата заказа", "Изделие", "Сумма" }, + Texts = new List { "Номер", "Дата заказа", "Изделие", "Статус", "Сумма" }, Style = "NormalTitle", ParagraphAlignment = PdfParagraphAlignmentType.Center }); @@ -35,7 +35,7 @@ namespace ConfectioneryBusinessLogic { CreateRow(new PdfRowParameters { - Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.PastryName, order.Sum.ToString() }, + Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.PastryName, order.Status.ToString(), order.Sum.ToString() }, Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Left }); diff --git a/Confectionery/ConfectioneryBusinessLogic/ConfectioneryBusinessLogic.csproj b/Confectionery/ConfectioneryBusinessLogic/ConfectioneryBusinessLogic.csproj index eec37d3..7cfc245 100644 --- a/Confectionery/ConfectioneryBusinessLogic/ConfectioneryBusinessLogic.csproj +++ b/Confectionery/ConfectioneryBusinessLogic/ConfectioneryBusinessLogic.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable enable @@ -13,6 +13,7 @@ + diff --git a/Confectionery/ConfectioneryBusinessLogic/ReportLogic.cs b/Confectionery/ConfectioneryBusinessLogic/ReportLogic.cs index 85c5ea4..9a55dbf 100644 --- a/Confectionery/ConfectioneryBusinessLogic/ReportLogic.cs +++ b/Confectionery/ConfectioneryBusinessLogic/ReportLogic.cs @@ -77,7 +77,8 @@ namespace ConfectioneryBusinessLogic Id = x.Id, DateCreate = x.DateCreate, PastryName = x.PastryName, - Sum = x.Sum + Sum = x.Sum, + Status = x.Status.ToString() }) .ToList(); } diff --git a/Confectionery/ConfectioneryBusinessLogic/SaveToPdf.cs b/Confectionery/ConfectioneryBusinessLogic/SaveToPdf.cs index c9a3b3c..bad48d4 100644 --- a/Confectionery/ConfectioneryBusinessLogic/SaveToPdf.cs +++ b/Confectionery/ConfectioneryBusinessLogic/SaveToPdf.cs @@ -12,8 +12,8 @@ namespace ConfectioneryBusinessLogic private Document? _document; private Section? _section; private Table? _table; - private static ParagraphAlignment - GetParagraphAlignment(PdfParagraphAlignmentType type) + + private static ParagraphAlignment GetParagraphAlignment(PdfParagraphAlignmentType type) { return type switch { diff --git a/Confectionery/ConfectioneryContracts/ConfectioneryContracts.csproj b/Confectionery/ConfectioneryContracts/ConfectioneryContracts.csproj index aca6a26..75c03cc 100644 --- a/Confectionery/ConfectioneryContracts/ConfectioneryContracts.csproj +++ b/Confectionery/ConfectioneryContracts/ConfectioneryContracts.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 enable enable diff --git a/Confectionery/ConfectioneryDataModels/ConfectioneryDataModels.csproj b/Confectionery/ConfectioneryDataModels/ConfectioneryDataModels.csproj index c2d19e9..7b8c1c6 100644 --- a/Confectionery/ConfectioneryDataModels/ConfectioneryDataModels.csproj +++ b/Confectionery/ConfectioneryDataModels/ConfectioneryDataModels.csproj @@ -1,7 +1,7 @@ - + - net6.0 + net8.0 enable enable diff --git a/Confectionery/ConfectioneryDatabaseImplement/ConfectioneryDatabaseImplement.csproj b/Confectionery/ConfectioneryDatabaseImplement/ConfectioneryDatabaseImplement.csproj index 546b9c5..428d10d 100644 --- a/Confectionery/ConfectioneryDatabaseImplement/ConfectioneryDatabaseImplement.csproj +++ b/Confectionery/ConfectioneryDatabaseImplement/ConfectioneryDatabaseImplement.csproj @@ -1,7 +1,7 @@ - + - net6.0 + net8.0 enable enable diff --git a/Confectionery/ConfectioneryDatabaseImplement/OrderStorage.cs b/Confectionery/ConfectioneryDatabaseImplement/OrderStorage.cs index afbb0f2..f47bf75 100644 --- a/Confectionery/ConfectioneryDatabaseImplement/OrderStorage.cs +++ b/Confectionery/ConfectioneryDatabaseImplement/OrderStorage.cs @@ -22,12 +22,9 @@ namespace ConfectioneryDatabaseImplement.Implements public List GetFilteredList(OrderSearchModel model) { - if (!model.Id.HasValue) - { - return new(); - } using var context = new ConfectioneryDatabase(); - return context.Orders.Include(x => x.Pastry).Where(x => x.Id == model.Id).Select(x => x.GetViewModel).ToList(); + var result = context.Orders.Include(x => x.Pastry).Select(x => x.GetViewModel).ToList(); + return result; } public OrderViewModel? GetElement(OrderSearchModel model) diff --git a/Confectionery/ConfectioneryFileImplement/ConfectioneryFileImplement.csproj b/Confectionery/ConfectioneryFileImplement/ConfectioneryFileImplement.csproj index 778307f..965df58 100644 --- a/Confectionery/ConfectioneryFileImplement/ConfectioneryFileImplement.csproj +++ b/Confectionery/ConfectioneryFileImplement/ConfectioneryFileImplement.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable enable @@ -12,6 +12,7 @@ + diff --git a/Confectionery/ConfectioneryListImplement/ConfectioneryListImplement.csproj b/Confectionery/ConfectioneryListImplement/ConfectioneryListImplement.csproj index f7206a4..4473d7c 100644 --- a/Confectionery/ConfectioneryListImplement/ConfectioneryListImplement.csproj +++ b/Confectionery/ConfectioneryListImplement/ConfectioneryListImplement.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable enable diff --git a/Confectionery/ConfectioneryView/ConfectioneryView.csproj b/Confectionery/ConfectioneryView/ConfectioneryView.csproj index 88f69ae..f971e2f 100644 --- a/Confectionery/ConfectioneryView/ConfectioneryView.csproj +++ b/Confectionery/ConfectioneryView/ConfectioneryView.csproj @@ -2,7 +2,7 @@ WinExe - net6.0-windows + net8.0-windows7.0 enable true enable @@ -13,7 +13,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/Confectionery/ConfectioneryView/FormReportOrders.Designer.cs b/Confectionery/ConfectioneryView/FormReportOrders.Designer.cs index 7262b61..b994103 100644 --- a/Confectionery/ConfectioneryView/FormReportOrders.Designer.cs +++ b/Confectionery/ConfectioneryView/FormReportOrders.Designer.cs @@ -46,9 +46,10 @@ panel.Controls.Add(labelTo); panel.Controls.Add(dateTimePickerFrom); panel.Controls.Add(labelFrom); + panel.Dock = DockStyle.Top; panel.Location = new Point(0, 0); panel.Name = "panel"; - panel.Size = new Size(1332, 69); + panel.Size = new Size(1331, 69); panel.TabIndex = 0; // // buttonToPdf diff --git a/Confectionery/ConfectioneryView/FormReportOrders.cs b/Confectionery/ConfectioneryView/FormReportOrders.cs index d03cd6f..ec274b3 100644 --- a/Confectionery/ConfectioneryView/FormReportOrders.cs +++ b/Confectionery/ConfectioneryView/FormReportOrders.cs @@ -53,7 +53,7 @@ namespace ConfectioneryView var source = new ReportDataSource("DataSetOrders", dataSource); reportViewer.LocalReport.DataSources.Clear(); reportViewer.LocalReport.DataSources.Add(source); - var parameters = new[] { new ReportParameter("ReportParameterPeriod", $"c{dateTimePickerFrom.Value.ToShortDateString()} по{dateTimePickerTo.Value.ToShortDateString()}") }; + var parameters = new[] { new ReportParameter("ReportParameterPeriod", $"c{dateTimePickerFrom.Value.ToShortDateString()} по {dateTimePickerTo.Value.ToShortDateString()}") }; reportViewer.LocalReport.SetParameters(parameters); reportViewer.RefreshReport(); _logger.LogInformation("Загрузка списка заказов на период {From}-{ To}", dateTimePickerFrom.Value.ToShortDateString(), diff --git a/Confectionery/ConfectioneryView/FormReportOrders.resx b/Confectionery/ConfectioneryView/FormReportOrders.resx index f298a7b..af32865 100644 --- a/Confectionery/ConfectioneryView/FormReportOrders.resx +++ b/Confectionery/ConfectioneryView/FormReportOrders.resx @@ -1,4 +1,64 @@ - + + +