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();
}
}