From ef9ae7a52b5c189a4a97997308e7ce94e270ca8c Mon Sep 17 00:00:00 2001 From: prodigygirl Date: Sat, 11 Mar 2023 08:47:04 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D1=87=D0=B5=D1=82=20=D1=81=20?= =?UTF-8?q?=D0=B8=D0=B7=D0=B4=D0=B5=D0=BB=D0=B8=D1=8F=D0=BC=D0=B8=20=D0=B8?= =?UTF-8?q?=20=D0=B8=D1=85=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormReportFurnitureComponents.cs | 4 ++-- .../OfficePackage/AbstractSaveToExcel.cs | 4 ++-- .../ReportLogic.cs | 18 +++++++++--------- .../ReportFurnitureComponentViewModel.cs | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/FurnitureAssembly/FurnitureAssembly/FormReportFurnitureComponents.cs b/FurnitureAssembly/FurnitureAssembly/FormReportFurnitureComponents.cs index 8083445..d785921 100644 --- a/FurnitureAssembly/FurnitureAssembly/FormReportFurnitureComponents.cs +++ b/FurnitureAssembly/FurnitureAssembly/FormReportFurnitureComponents.cs @@ -29,8 +29,8 @@ namespace FurnitureAssembly dataGridView.Rows.Clear(); foreach (var elem in dict) { - dataGridView.Rows.Add(new object[] { elem.ComponentName, "", "" }); - foreach (var listElem in elem.Furnitures) + dataGridView.Rows.Add(new object[] { elem.FurnitureName, "", "" }); + foreach (var listElem in elem.Components) { dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 }); } diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToExcel.cs index ced37ed..4e1cdf3 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToExcel.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/OfficePackage/AbstractSaveToExcel.cs @@ -36,11 +36,11 @@ namespace FurnitureAssemblyBusinessLogic.OfficePackage { ColumnName = "A", RowIndex = rowIndex, - Text = pc.ComponentName, + Text = pc.FurnitureName, StyleInfo = ExcelStyleInfoType.Text }); rowIndex++; - foreach (var product in pc.Furnitures) + foreach (var product in pc.Components) { InsertCellInWorksheet(new ExcelCellParameters { diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs index 609c1e0..4282150 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/ReportLogic.cs @@ -37,23 +37,23 @@ namespace FurnitureAssemblyBusinessLogic /// public List GetFurnitureComponent() { + var furnitures = _furnitureStorage.GetFullList(); var components = _componentStorage.GetFullList(); - var products = _furnitureStorage.GetFullList(); var list = new List(); - foreach (var component in components) + foreach (var furniture in furnitures) { var record = new ReportFurnitureComponentViewModel { - ComponentName = component.ComponentName, - Furnitures = new List>(), + FurnitureName = furniture.FurnitureName, + Components = new List>(), TotalCount = 0 }; - foreach (var product in products) + foreach (var component in components) { - if (product.FurnitureComponents.ContainsKey(component.Id)) + if (furniture.FurnitureComponents.ContainsKey(component.Id)) { - record.Furnitures.Add(new Tuple(product.FurnitureName, product.FurnitureComponents[component.Id].Item2)); - record.TotalCount += product.FurnitureComponents[component.Id].Item2; + record.Components.Add(new Tuple(component.ComponentName, furniture.FurnitureComponents[component.Id].Item2)); + record.TotalCount += furniture.FurnitureComponents[component.Id].Item2; } } list.Add(record); @@ -104,7 +104,7 @@ namespace FurnitureAssemblyBusinessLogic _saveToExcel.CreateReport(new ExcelInfo { FileName = model.FileName, - Title = "Список компонент", + Title = "Список изделий", FurnitureComponents = GetFurnitureComponent() }); } diff --git a/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/ReportFurnitureComponentViewModel.cs b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/ReportFurnitureComponentViewModel.cs index 80310d8..fd30b20 100644 --- a/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/ReportFurnitureComponentViewModel.cs +++ b/FurnitureAssembly/FurnitureAssemblyContracts/ViewModels/ReportFurnitureComponentViewModel.cs @@ -2,9 +2,9 @@ { public class ReportFurnitureComponentViewModel { - public string ComponentName { get; set; } = string.Empty; + public string FurnitureName { get; set; } = string.Empty; public int TotalCount { get; set; } - public List> Furnitures { get; set; } = new(); + public List> Components { get; set; } = new(); } }