From 3bba334dbbb1352bc059b8f101990c2761492172 Mon Sep 17 00:00:00 2001 From: prodigygirl Date: Fri, 10 Mar 2023 23:22:23 +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=20=D1=81=D1=82=D0=B0=D1=82=D1=83=D1=81=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BA=D0=B0=D0=B7=D0=B0=20=D0=B2=20=D0=BE=D1=82=D1=87=D0=B5?= =?UTF-8?q?=D1=82=D0=B5=20(=D1=84=D0=BE=D1=80=D0=BC=D0=B0=20=D0=B8=20pdf)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OfficePackage/AbstractSaveToPdf.cs | 6 +++--- .../FurnitureAssemblyBusinessLogic/ReportLogic.cs | 12 +++++------- .../ViewModels/ReportOrdersViewModel.cs | 6 ++++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToPdf.cs index e030375..e1ae738 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToPdf.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToPdf.cs @@ -24,10 +24,10 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage 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 FurnitureAssemblyBusinessLogic.OfficePackage { CreateRow(new PdfRowParameters { - Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.FurnitureName, order.Sum.ToString() }, + Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.FurnitureName, order.OrderStatus, order.Sum.ToString() }, Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Left }); diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs index c3b0950..d222422 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs @@ -21,10 +21,8 @@ namespace FurnitureAssemblyBusinessLogic private readonly AbstractSaveToExcel _saveToExcel; private readonly AbstractSaveToWord _saveToWord; private readonly AbstractSaveToPdf _saveToPdf; - public ReportLogic(IFurnitureStorage productStorage, IComponentStorage - componentStorage, IOrderStorage orderStorage, - AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, - AbstractSaveToPdf saveToPdf) + public ReportLogic(IFurnitureStorage productStorage, IComponentStorage componentStorage, IOrderStorage orderStorage, + AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf) { _productStorage = productStorage; _componentStorage = componentStorage; @@ -71,8 +69,7 @@ namespace FurnitureAssemblyBusinessLogic { return _orderStorage.GetFilteredList(new OrderSearchModel { - DateFrom - = model.DateFrom, + DateFrom = model.DateFrom, DateTo = model.DateTo }) .Select(x => new ReportOrdersViewModel @@ -80,7 +77,8 @@ namespace FurnitureAssemblyBusinessLogic Id = x.Id, DateCreate = x.DateCreate, FurnitureName = x.FurnitureName, - Sum = x.Sum + Sum = x.Sum, + OrderStatus = x.Status.ToString() }) .ToList(); } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/ReportOrdersViewModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/ReportOrdersViewModel.cs index dca1835..f8cbf7f 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/ReportOrdersViewModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/ReportOrdersViewModel.cs @@ -1,4 +1,6 @@ -namespace FurnitureAssemblyContracts.ViewModels +using FurnitureAssemblyDataModels.Enums; + +namespace FurnitureAssemblyContracts.ViewModels { public class ReportOrdersViewModel { @@ -6,6 +8,6 @@ public DateTime DateCreate { get; set; } public string FurnitureName { get; set; } = string.Empty; public double Sum { get; set; } - + public string OrderStatus { get; set; } = string.Empty; } }