From f0589c577f9e06914f963da6cd873c7d96e25313 Mon Sep 17 00:00:00 2001 From: Yourdax Date: Wed, 17 Apr 2024 10:45:13 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BC=D1=8B=20=D0=B2=D1=81=D1=91=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B4=D0=BD=D1=8F=D0=BB=D0=B8,=20=D0=BD=D0=B0=D1=82?= =?UTF-8?q?=D0=B0=D1=88!!!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FishFactory/Forms/FormMain.Designer.cs | 53 ++++++++----------- FishFactory/Forms/FormMain.resx | 4 +- .../Forms/FormReportCannedComponents.cs | 2 +- FishFactory/Forms/FormReportOrders.cs | 1 + FishFactory/ReportOrders.rdlc | 49 ++++++++--------- .../BusinessLogic/ReportLogic.cs | 32 +++++++---- .../OfficePackage/AbstractSaveToExcel.cs | 42 ++++++++++----- .../OfficePackage/AbstractSaveToPdf.cs | 6 +-- .../OfficePackage/AbstractSaveToWord.cs | 13 +++-- .../OfficePackage/HelperModels/WordInfo.cs | 2 +- .../OfficePackage/Implements/SaveToWord.cs | 4 +- .../BusinessLogicsContracts/IReportLogic.cs | 2 +- .../ViewModels/ReportOrdersViewModel.cs | 3 +- .../FishFactoryDatabase.cs | 2 +- .../Implements/OrderStorage.cs | 12 +---- .../Implements/OrderStorage.cs | 2 +- .../Implements/OrderStorage.cs | 4 +- 17 files changed, 123 insertions(+), 110 deletions(-) diff --git a/FishFactory/Forms/FormMain.Designer.cs b/FishFactory/Forms/FormMain.Designer.cs index 85453da..a3599ad 100644 --- a/FishFactory/Forms/FormMain.Designer.cs +++ b/FishFactory/Forms/FormMain.Designer.cs @@ -53,7 +53,7 @@ toolStrip1.Items.AddRange(new ToolStripItem[] { toolStripDropDownButton1, toolStripDropDownButton2 }); toolStrip1.Location = new Point(0, 0); toolStrip1.Name = "toolStrip1"; - toolStrip1.Size = new Size(1107, 27); + toolStrip1.Size = new Size(969, 25); toolStrip1.TabIndex = 0; toolStrip1.Text = "toolStrip1"; // @@ -64,20 +64,20 @@ toolStripDropDownButton1.Image = (Image)resources.GetObject("toolStripDropDownButton1.Image"); toolStripDropDownButton1.ImageTransparentColor = Color.Magenta; toolStripDropDownButton1.Name = "toolStripDropDownButton1"; - toolStripDropDownButton1.Size = new Size(108, 24); + toolStripDropDownButton1.Size = new Size(88, 22); toolStripDropDownButton1.Text = "Справочник"; // // компонентыToolStripMenuItem // компонентыToolStripMenuItem.Name = "компонентыToolStripMenuItem"; - компонентыToolStripMenuItem.Size = new Size(182, 26); + компонентыToolStripMenuItem.Size = new Size(145, 22); компонентыToolStripMenuItem.Text = "Компоненты"; компонентыToolStripMenuItem.Click += компонентыToolStripMenuItem_Click; // // консервыToolStripMenuItem // консервыToolStripMenuItem.Name = "консервыToolStripMenuItem"; - консервыToolStripMenuItem.Size = new Size(182, 26); + консервыToolStripMenuItem.Size = new Size(145, 22); консервыToolStripMenuItem.Text = "Консервы"; консервыToolStripMenuItem.Click += консервыToolStripMenuItem_Click; // @@ -88,37 +88,36 @@ toolStripDropDownButton2.Image = (Image)resources.GetObject("toolStripDropDownButton2.Image"); toolStripDropDownButton2.ImageTransparentColor = Color.Magenta; toolStripDropDownButton2.Name = "toolStripDropDownButton2"; - toolStripDropDownButton2.Size = new Size(73, 24); + toolStripDropDownButton2.Size = new Size(61, 22); toolStripDropDownButton2.Text = "Отчёты"; // // списокКомпонентовToolStripMenuItem // списокКомпонентовToolStripMenuItem.Name = "списокКомпонентовToolStripMenuItem"; - списокКомпонентовToolStripMenuItem.Size = new Size(284, 26); - списокКомпонентовToolStripMenuItem.Text = "Список компонентов"; + списокКомпонентовToolStripMenuItem.Size = new Size(225, 22); + списокКомпонентовToolStripMenuItem.Text = "Список консерв"; списокКомпонентовToolStripMenuItem.Click += списокКомпонентовToolStripMenuItem_Click; // // компонентыПоКонсервамToolStripMenuItem // компонентыПоКонсервамToolStripMenuItem.Name = "компонентыПоКонсервамToolStripMenuItem"; - компонентыПоКонсервамToolStripMenuItem.Size = new Size(284, 26); + компонентыПоКонсервамToolStripMenuItem.Size = new Size(225, 22); компонентыПоКонсервамToolStripMenuItem.Text = "Компоненты по консервам"; компонентыПоКонсервамToolStripMenuItem.Click += компонентыПоИзделиямToolStripMenuItem_Click; // // списокЗаказовToolStripMenuItem // списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem"; - списокЗаказовToolStripMenuItem.Size = new Size(284, 26); + списокЗаказовToolStripMenuItem.Size = new Size(225, 22); списокЗаказовToolStripMenuItem.Text = "Список заказов"; списокЗаказовToolStripMenuItem.Click += списокЗаказовToolStripMenuItem_Click; // // buttonCreateOrder // buttonCreateOrder.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonCreateOrder.Location = new Point(914, 75); - buttonCreateOrder.Margin = new Padding(3, 4, 3, 4); + buttonCreateOrder.Location = new Point(800, 56); buttonCreateOrder.Name = "buttonCreateOrder"; - buttonCreateOrder.Size = new Size(161, 32); + buttonCreateOrder.Size = new Size(141, 24); buttonCreateOrder.TabIndex = 1; buttonCreateOrder.Text = "Создать заказ"; buttonCreateOrder.UseVisualStyleBackColor = true; @@ -127,10 +126,9 @@ // buttonTakeOrderInWork // buttonTakeOrderInWork.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonTakeOrderInWork.Location = new Point(914, 133); - buttonTakeOrderInWork.Margin = new Padding(3, 4, 3, 4); + buttonTakeOrderInWork.Location = new Point(800, 100); buttonTakeOrderInWork.Name = "buttonTakeOrderInWork"; - buttonTakeOrderInWork.Size = new Size(161, 32); + buttonTakeOrderInWork.Size = new Size(141, 24); buttonTakeOrderInWork.TabIndex = 2; buttonTakeOrderInWork.Text = "Отдать на выполнение"; buttonTakeOrderInWork.UseVisualStyleBackColor = true; @@ -139,10 +137,9 @@ // buttonOrderReady // buttonOrderReady.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonOrderReady.Location = new Point(914, 189); - buttonOrderReady.Margin = new Padding(3, 4, 3, 4); + buttonOrderReady.Location = new Point(800, 142); buttonOrderReady.Name = "buttonOrderReady"; - buttonOrderReady.Size = new Size(161, 32); + buttonOrderReady.Size = new Size(141, 24); buttonOrderReady.TabIndex = 3; buttonOrderReady.Text = "Заказ готов"; buttonOrderReady.UseVisualStyleBackColor = true; @@ -151,10 +148,9 @@ // buttonIssuedOrder // buttonIssuedOrder.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonIssuedOrder.Location = new Point(914, 241); - buttonIssuedOrder.Margin = new Padding(3, 4, 3, 4); + buttonIssuedOrder.Location = new Point(800, 181); buttonIssuedOrder.Name = "buttonIssuedOrder"; - buttonIssuedOrder.Size = new Size(161, 32); + buttonIssuedOrder.Size = new Size(141, 24); buttonIssuedOrder.TabIndex = 4; buttonIssuedOrder.Text = "Заказ выдан"; buttonIssuedOrder.UseVisualStyleBackColor = true; @@ -163,10 +159,9 @@ // buttonRef // buttonRef.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonRef.Location = new Point(914, 296); - buttonRef.Margin = new Padding(3, 4, 3, 4); + buttonRef.Location = new Point(800, 222); buttonRef.Name = "buttonRef"; - buttonRef.Size = new Size(161, 32); + buttonRef.Size = new Size(141, 24); buttonRef.TabIndex = 5; buttonRef.Text = "Обновить список"; buttonRef.UseVisualStyleBackColor = true; @@ -175,21 +170,20 @@ // dataGridView // dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridView.Location = new Point(0, 27); - dataGridView.Margin = new Padding(3, 4, 3, 4); + dataGridView.Location = new Point(0, 20); dataGridView.Name = "dataGridView"; dataGridView.ReadOnly = true; dataGridView.RowHeadersWidth = 51; dataGridView.RowTemplate.Height = 24; dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; - dataGridView.Size = new Size(872, 588); + dataGridView.Size = new Size(763, 441); dataGridView.TabIndex = 6; // // FormMain // - AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1107, 615); + ClientSize = new Size(969, 461); Controls.Add(dataGridView); Controls.Add(buttonRef); Controls.Add(buttonIssuedOrder); @@ -197,7 +191,6 @@ Controls.Add(buttonTakeOrderInWork); Controls.Add(buttonCreateOrder); Controls.Add(toolStrip1); - Margin = new Padding(3, 4, 3, 4); Name = "FormMain"; Text = "Рыбный завод"; Load += FormMain_Load; diff --git a/FishFactory/Forms/FormMain.resx b/FishFactory/Forms/FormMain.resx index cb299dc..7fd682f 100644 --- a/FishFactory/Forms/FormMain.resx +++ b/FishFactory/Forms/FormMain.resx @@ -124,7 +124,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc @@ -139,7 +139,7 @@ iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAEKSURBVEhL3ZG9DsFQHMXvczDZvIOtXsHObuhqkViI3Quw + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEKSURBVEhL3ZG9DsFQHMXvczDZvIOtXsHObuhqkViI3Quw 6CYmNoMYJJ0NBiFFIoIytOuf0+TeXP3yde+iyS+3OcP53Z4y3/dJJ4HAsiwyTVMp6BQCBIZhKAWdEcHV vSlBmeB82NFy1KLluEWOPRC5MoHdMWhazwi4RJlALgf4EuT6BI+5kCsTrGddUY658E+QvyXYHq9UnRyC U87f4aUApcXhnrI9Jzg/laQKFntXlHM+lSQK5psL5fvbp/JvJLGCQqmSWM5JkiCT84igXGtSrruKLQ0T diff --git a/FishFactory/Forms/FormReportCannedComponents.cs b/FishFactory/Forms/FormReportCannedComponents.cs index 27c01be..a734c97 100644 --- a/FishFactory/Forms/FormReportCannedComponents.cs +++ b/FishFactory/Forms/FormReportCannedComponents.cs @@ -18,7 +18,7 @@ namespace FishFactory.Forms { try { - var dict = _logic.GetCannedComponents(); + var dict = _logic.GetCannedComponent(); if (dict != null) { dataGridView.Rows.Clear(); diff --git a/FishFactory/Forms/FormReportOrders.cs b/FishFactory/Forms/FormReportOrders.cs index 3d50e99..2e12759 100644 --- a/FishFactory/Forms/FormReportOrders.cs +++ b/FishFactory/Forms/FormReportOrders.cs @@ -70,6 +70,7 @@ namespace FishFactory.Forms { try { + System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); _logic.SaveOrdersToPdfFile(new ReportBindingModel { FileName = dialog.FileName, diff --git a/FishFactory/ReportOrders.rdlc b/FishFactory/ReportOrders.rdlc index 5317f35..47f80cc 100644 --- a/FishFactory/ReportOrders.rdlc +++ b/FishFactory/ReportOrders.rdlc @@ -7,7 +7,7 @@ System.Data.DataSet /* Local Connection */ - 47cb53f0-7dde-4717-ba03-866a0bc4f4dd + 10791c83-cee8-4a38-bbd0-245fc17cefb3 @@ -29,19 +29,19 @@ CannedName System.String + + Status + FishFactoryDataModels.Status + Sum System.Decimal - - OrderStatus - FishFactoryDataModels.OrderStatus - FishFactoryContracts.ViewModels - ReportOrderViewModel - FishFactoryContracts.ViewModels.ReportOrderViewModel, FishFactoryContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + ReportOrdersViewModel + FishFactoryContracts.ViewModels.ReportOrdersViewModel, FishFactoryContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null @@ -59,7 +59,7 @@ =Parameters!ReportParameterPeriod.Value @@ -120,19 +120,19 @@ - 2.59525cm + 2.5cm - 3.30963cm + 3.21438cm - 8.32842cm + 8.23317cm - 2.59525cm + 2.5cm - 2.59525cm + 2.5cm @@ -244,7 +244,7 @@ - Статус Заказа + Статус @@ -398,21 +398,21 @@ - + true true - =Fields!OrderStatus.Value + =Fields!Status.Value - 4.21167cm - 14.97625cm + 4cm + 12cm 0.6cm 2.5cm 3 @@ -534,6 +534,7 @@ =Sum(Fields!Sum.Value, "DataSetOrders") @@ -542,8 +543,8 @@ - 4.21167cm - 17.47625cm + 4cm + 14.5cm 0.6cm 2.5cm 4 @@ -583,7 +584,7 @@ - 5 + 4 2 @@ -595,5 +596,5 @@ Cm - 1c0c12af-b9e8-41db-8d1f-26d1acbf91cc + 2de0031a-4d17-449d-922d-d9fc54572312 \ No newline at end of file diff --git a/FishFactoryBusinessLogic/BusinessLogic/ReportLogic.cs b/FishFactoryBusinessLogic/BusinessLogic/ReportLogic.cs index c3e7e0d..ab7b3f6 100644 --- a/FishFactoryBusinessLogic/BusinessLogic/ReportLogic.cs +++ b/FishFactoryBusinessLogic/BusinessLogic/ReportLogic.cs @@ -16,8 +16,7 @@ namespace FishFactoryBusinessLogic.BusinessLogic private readonly AbstractSaveToExcel _saveToExcel; private readonly AbstractSaveToWord _saveToWord; private readonly AbstractSaveToPdf _saveToPdf; - public ReportLogic(ICannedStorage CannedStorage, IComponentStorage componentStorage, IOrderStorage orderStorage, - AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf) + public ReportLogic(ICannedStorage CannedStorage, IComponentStorage componentStorage, IOrderStorage orderStorage, AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf) { _cannedStorage = CannedStorage; _componentStorage = componentStorage; @@ -26,16 +25,24 @@ namespace FishFactoryBusinessLogic.BusinessLogic _saveToWord = saveToWord; _saveToPdf = saveToPdf; } - public List GetCannedComponents() + /// + /// Получение списка компонент с указанием, в каких изделиях используются + /// + /// + public List GetCannedComponent() { - return _cannedStorage.GetFullList().Select( x => new ReportCannedComponentViewModel + return _cannedStorage.GetFullList().Select(x => new ReportCannedComponentViewModel { CannedName = x.CannedName, Components = x.CannedComponents.Select(x => (x.Value.Item1.ComponentName, x.Value.Item2)).ToList(), TotalCount = x.CannedComponents.Select(x => x.Value.Item2).Sum() }).ToList(); } - + /// + /// Получение списка заказов за определенный период + /// + /// + /// public List GetOrders(ReportBindingModel model) { return _orderStorage.GetFilteredList(new OrderSearchModel @@ -48,8 +55,8 @@ namespace FishFactoryBusinessLogic.BusinessLogic Id = x.Id, DateCreate = x.DateCreate, CannedName = x.CannedName, - Sum = x.Sum, - Status = x.Status.ToString() + Status = x.Status.ToString(), + Sum = x.Sum }) .ToList(); } @@ -60,7 +67,7 @@ namespace FishFactoryBusinessLogic.BusinessLogic { FileName = model.FileName, Title = "Список консерв", - Components = _componentStorage.GetFullList() + Canneds = _cannedStorage.GetFullList() }); } @@ -69,11 +76,14 @@ namespace FishFactoryBusinessLogic.BusinessLogic _saveToExcel.CreateReport(new ExcelInfo { FileName = model.FileName, - Title = "Список консерв", - CannedComponents = GetCannedComponents() + Title = "Список компонент", + CannedComponents = GetCannedComponent() }); } - + /// + /// Сохранение заказов в файл-Pdf + /// + /// public void SaveOrdersToPdfFile(ReportBindingModel model) { _saveToPdf.CreateDoc(new PdfInfo diff --git a/FishFactoryBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/FishFactoryBusinessLogic/OfficePackage/AbstractSaveToExcel.cs index 1157def..452ece7 100644 --- a/FishFactoryBusinessLogic/OfficePackage/AbstractSaveToExcel.cs +++ b/FishFactoryBusinessLogic/OfficePackage/AbstractSaveToExcel.cs @@ -5,10 +5,13 @@ namespace FishFactoryBusinessLogic.OfficePackage { public abstract class AbstractSaveToExcel { + /// + /// Создание отчета + /// + /// public void CreateReport(ExcelInfo info) { CreateExcel(info); - InsertCellInWorksheet(new ExcelCellParameters { ColumnName = "A", @@ -32,23 +35,24 @@ namespace FishFactoryBusinessLogic.OfficePackage StyleInfo = ExcelStyleInfoType.Text }); rowIndex++; - foreach (var Component in pc.Components) + foreach (var Canned in pc.Components) { InsertCellInWorksheet(new ExcelCellParameters { ColumnName = "B", RowIndex = rowIndex, - Text = Component.Item1, - StyleInfo = ExcelStyleInfoType.TextWithBroder + Text = Canned.Item1, + StyleInfo = + ExcelStyleInfoType.TextWithBroder }); InsertCellInWorksheet(new ExcelCellParameters { ColumnName = "C", RowIndex = rowIndex, - Text = Component.Item2.ToString(), - StyleInfo = ExcelStyleInfoType.TextWithBroder + Text = Canned.Item2.ToString(), + StyleInfo = + ExcelStyleInfoType.TextWithBroder }); - rowIndex++; } InsertCellInWorksheet(new ExcelCellParameters @@ -69,13 +73,27 @@ namespace FishFactoryBusinessLogic.OfficePackage } SaveExcel(info); } - + /// + /// Создание excel-файла + /// + /// protected abstract void CreateExcel(ExcelInfo info); - - protected abstract void InsertCellInWorksheet(ExcelCellParameters excelParams); - + /// + /// Добавляем новую ячейку в лист + /// + /// + protected abstract void InsertCellInWorksheet(ExcelCellParameters + excelParams); + /// + /// Объединение ячеек + /// + /// protected abstract void MergeCells(ExcelMergeParameters excelParams); - + /// + /// Сохранение файла + /// + /// protected abstract void SaveExcel(ExcelInfo info); + } } diff --git a/FishFactoryBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/FishFactoryBusinessLogic/OfficePackage/AbstractSaveToPdf.cs index 874cd52..7ebb9b9 100644 --- a/FishFactoryBusinessLogic/OfficePackage/AbstractSaveToPdf.cs +++ b/FishFactoryBusinessLogic/OfficePackage/AbstractSaveToPdf.cs @@ -19,10 +19,10 @@ namespace FishFactoryBusinessLogic.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 }); @@ -30,7 +30,7 @@ namespace FishFactoryBusinessLogic.OfficePackage { CreateRow(new PdfRowParameters { - Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.CannedName, order.Sum.ToString() }, + Texts = new List { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.CannedName, order.Status, order.Sum.ToString() }, Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Left }); diff --git a/FishFactoryBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/FishFactoryBusinessLogic/OfficePackage/AbstractSaveToWord.cs index 88b079a..4a86fd4 100644 --- a/FishFactoryBusinessLogic/OfficePackage/AbstractSaveToWord.cs +++ b/FishFactoryBusinessLogic/OfficePackage/AbstractSaveToWord.cs @@ -8,25 +8,24 @@ namespace FishFactoryBusinessLogic.OfficePackage public void CreateDoc(WordInfo info) { CreateWord(info); + CreateParagraph(new WordParagraph { - Texts = new List<(string, WordTextProperties)> { - (info.Title, - new WordTextProperties { Bold = true, Size = "24", }) - }, + Texts = new List<(string, WordTextProperties)> { (info.Title, new WordTextProperties { Bold = true, Size = "24", }) }, TextProperties = new WordTextProperties { Size = "24", JustificationType = WordJustificationType.Center } }); - foreach (var component in info.Components) + + foreach (var canned in info.Canneds) { CreateParagraph(new WordParagraph { Texts = new List<(string, WordTextProperties)> { - (component.ComponentName, - new WordTextProperties { Size = "24", }) + (canned.CannedName + ' ', new WordTextProperties { Size = "24", Bold = true }), + (canned.Price.ToString(), new WordTextProperties { Size = "24" }) }, TextProperties = new WordTextProperties { diff --git a/FishFactoryBusinessLogic/OfficePackage/HelperModels/WordInfo.cs b/FishFactoryBusinessLogic/OfficePackage/HelperModels/WordInfo.cs index bb4c13c..137e2e4 100644 --- a/FishFactoryBusinessLogic/OfficePackage/HelperModels/WordInfo.cs +++ b/FishFactoryBusinessLogic/OfficePackage/HelperModels/WordInfo.cs @@ -6,6 +6,6 @@ namespace FishFactoryBusinessLogic.OfficePackage.HelperModels { public string FileName { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; - public List Components { get; set; } = new(); + public List Canneds { get; set; } = new(); } } diff --git a/FishFactoryBusinessLogic/OfficePackage/Implements/SaveToWord.cs b/FishFactoryBusinessLogic/OfficePackage/Implements/SaveToWord.cs index 8b5e8fd..0e2ba25 100644 --- a/FishFactoryBusinessLogic/OfficePackage/Implements/SaveToWord.cs +++ b/FishFactoryBusinessLogic/OfficePackage/Implements/SaveToWord.cs @@ -16,7 +16,8 @@ namespace FishFactoryBusinessLogic.OfficePackage.Implements /// /// /// - private static JustificationValues GetJustificationValues(WordJustificationType type) + private static JustificationValues + GetJustificationValues(WordJustificationType type) { return type switch { @@ -60,7 +61,6 @@ namespace FishFactoryBusinessLogic.OfficePackage.Implements LineRule = LineSpacingRuleValues.Auto }); properties.AppendChild(new Indentation()); - var paragraphMarkRunProperties = new ParagraphMarkRunProperties(); if (!string.IsNullOrEmpty(paragraphProperties.Size)) { diff --git a/FishFactoryContracts/BusinessLogicsContracts/IReportLogic.cs b/FishFactoryContracts/BusinessLogicsContracts/IReportLogic.cs index 0dc2806..6960ffa 100644 --- a/FishFactoryContracts/BusinessLogicsContracts/IReportLogic.cs +++ b/FishFactoryContracts/BusinessLogicsContracts/IReportLogic.cs @@ -9,7 +9,7 @@ namespace FishFactoryContracts.BusinessLogicsContracts /// Получение списка компонент с указанием, в каких изделиях используются /// /// - List GetCannedComponents(); + List GetCannedComponent(); /// /// Получение списка заказов за определенный период /// diff --git a/FishFactoryContracts/ViewModels/ReportOrdersViewModel.cs b/FishFactoryContracts/ViewModels/ReportOrdersViewModel.cs index 63cd422..ce76f07 100644 --- a/FishFactoryContracts/ViewModels/ReportOrdersViewModel.cs +++ b/FishFactoryContracts/ViewModels/ReportOrdersViewModel.cs @@ -6,7 +6,8 @@ namespace FishFactoryContracts.ViewModels public int Id { get; set; } public DateTime DateCreate { get; set; } public string CannedName { get; set; } = string.Empty; - public double Sum { get; set; } public string Status { get; set; } = string.Empty; + public double Sum { get; set; } + } } diff --git a/FishFactoryDatabaseImplement/FishFactoryDatabase.cs b/FishFactoryDatabaseImplement/FishFactoryDatabase.cs index d93d11d..16b5a6e 100644 --- a/FishFactoryDatabaseImplement/FishFactoryDatabase.cs +++ b/FishFactoryDatabaseImplement/FishFactoryDatabase.cs @@ -9,7 +9,7 @@ namespace FishFactoryDatabaseImplement { if (optionsBuilder.IsConfigured == false) { - optionsBuilder.UseNpgsql(@"Host=localhost;Database=FishFactory;Username=postgres;Password=postgres"); + optionsBuilder.UseNpgsql(@"Host=localhost;Database=FishFactory2;Username=postgres;Password=postgres"); } base.OnConfiguring(optionsBuilder); AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); diff --git a/FishFactoryDatabaseImplement/Implements/OrderStorage.cs b/FishFactoryDatabaseImplement/Implements/OrderStorage.cs index d2e9090..3c38dca 100644 --- a/FishFactoryDatabaseImplement/Implements/OrderStorage.cs +++ b/FishFactoryDatabaseImplement/Implements/OrderStorage.cs @@ -19,21 +19,11 @@ namespace FishFactoryDatabaseImplement.Implements } public List GetFilteredList(OrderSearchModel model) { - if (!model.Id.HasValue || !model.DateFrom.HasValue || !model.DateTo.HasValue) + if (!model.Id.HasValue) { return new(); } using var context = new FishFactoryDatabase(); - - if (model.DateFrom.HasValue) - { - return context.Orders - .Include(x => x.Canned) - .Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo) - .Select(x => x.GetViewModel) - .ToList(); - } - return context.Orders .Include(x => x.Canned) .Where(x => x.Id == model.Id) diff --git a/FishFactoryFileImplement/Implements/OrderStorage.cs b/FishFactoryFileImplement/Implements/OrderStorage.cs index af38185..9a90729 100644 --- a/FishFactoryFileImplement/Implements/OrderStorage.cs +++ b/FishFactoryFileImplement/Implements/OrderStorage.cs @@ -23,7 +23,7 @@ namespace FishFactoryFileImplement.Implements } public List GetFilteredList(OrderSearchModel model) { - if (!model.Id.HasValue || !model.DateFrom.HasValue || !model.DateTo.HasValue) + if (!model.DateFrom.HasValue || !model.DateTo.HasValue) { return new(); } diff --git a/FishFactoryListImplement/Implements/OrderStorage.cs b/FishFactoryListImplement/Implements/OrderStorage.cs index 3562783..75896f3 100644 --- a/FishFactoryListImplement/Implements/OrderStorage.cs +++ b/FishFactoryListImplement/Implements/OrderStorage.cs @@ -33,13 +33,13 @@ namespace FishFactoryListImplement.Implements public List GetFilteredList(OrderSearchModel model) { var result = new List(); - if (model == null || !model.Id.HasValue || !model.DateFrom.HasValue || !model.DateFrom.HasValue) + if (model == null || !model.Id.HasValue) { return result; } foreach (var order in _source.Orders) { - if (order.DateCreate >= model.DateFrom && order.DateCreate <= model.DateTo) + if (order.Id == model.Id) { result.Add(AttachCannedName(order.GetViewModel)); }