diff --git a/ElectronicsShop/ElectronicsShopBusinessLogic/OfficePackage/AbstractSaveToExcelClient.cs b/ElectronicsShop/ElectronicsShopBusinessLogic/OfficePackage/AbstractSaveToExcelClient.cs index 9ffdf9d..572eb10 100644 --- a/ElectronicsShop/ElectronicsShopBusinessLogic/OfficePackage/AbstractSaveToExcelClient.cs +++ b/ElectronicsShop/ElectronicsShopBusinessLogic/OfficePackage/AbstractSaveToExcelClient.cs @@ -31,32 +31,19 @@ namespace ElectronicsShopBusinessLogic.OfficePackage { ColumnName = "A", RowIndex = rowIndex, - Text = pc.PaymeantName.ToString(), + //Text = pc.PaymeantName.ToString(), StyleInfo = ExcelStyleInfoType.Text }); rowIndex++; - foreach (var payment in pc.PaymeantsList) + InsertCellInWorksheet(new ExcelCellParameters { - InsertCellInWorksheet(new ExcelCellParameters - { - ColumnName = "B", - RowIndex = rowIndex, - Text = payment.PayOption.ToString(), - StyleInfo = ExcelStyleInfoType.Text - }); - InsertCellInWorksheet(new ExcelCellParameters - { - ColumnName = "C", - RowIndex = rowIndex, - Text = payment.SumPayment.ToString(), - StyleInfo = ExcelStyleInfoType.TextWithBroder - }); - //Не хорошо, что доступны ID а не название продукта, в идеале пофиксить надо - //Это AbstractSaveToExcelClient - rowIndex++; - } - + ColumnName = "C", + RowIndex = rowIndex, + //Text = payment.SumPayment.ToString(), + StyleInfo = ExcelStyleInfoType.TextWithBroder + }); + //туут потом исправить rowIndex++; } diff --git a/ElectronicsShop/ElectronicsShopBusinessLogic/OfficePackage/AbstractSaveToExcelEmployee.cs b/ElectronicsShop/ElectronicsShopBusinessLogic/OfficePackage/AbstractSaveToExcelEmployee.cs index b0c3432..fbc03e1 100644 --- a/ElectronicsShop/ElectronicsShopBusinessLogic/OfficePackage/AbstractSaveToExcelEmployee.cs +++ b/ElectronicsShop/ElectronicsShopBusinessLogic/OfficePackage/AbstractSaveToExcelEmployee.cs @@ -36,26 +36,14 @@ namespace ElectronicsShopBusinessLogic.OfficePackage }); rowIndex++; - foreach (var product in pc.Products) + + InsertCellInWorksheet(new ExcelCellParameters { - InsertCellInWorksheet(new ExcelCellParameters - { - ColumnName = "B", - RowIndex = rowIndex, - Text = product.ProductName.ToString(), - StyleInfo = ExcelStyleInfoType.TextWithBroder - }); - - InsertCellInWorksheet(new ExcelCellParameters - { - ColumnName = "C", - RowIndex = rowIndex, - Text = product.Price.ToString(), - StyleInfo = ExcelStyleInfoType.TextWithBroder - }); - - rowIndex++; - } + ColumnName = "C", + RowIndex = rowIndex, + Text = pc.Price.ToString(), + StyleInfo = ExcelStyleInfoType.TextWithBroder + }); rowIndex++; } diff --git a/ElectronicsShop/ElectronicsShopBusinessLogic/OfficePackage/AbstractSaveToWordEmployee.cs b/ElectronicsShop/ElectronicsShopBusinessLogic/OfficePackage/AbstractSaveToWordEmployee.cs index 93914e1..02f281e 100644 --- a/ElectronicsShop/ElectronicsShopBusinessLogic/OfficePackage/AbstractSaveToWordEmployee.cs +++ b/ElectronicsShop/ElectronicsShopBusinessLogic/OfficePackage/AbstractSaveToWordEmployee.cs @@ -37,22 +37,17 @@ namespace ElectronicsShopBusinessLogic.OfficePackage } }); - foreach (var pre in product.Products) - { - CreateParagraph(new WordParagraph - { - Texts = new List<(string, WordTextProperties)> - { (pre.ProductName, new WordTextProperties { Size = "20", Bold=false})}, - TextProperties = new WordTextProperties - { - Size = "24", - JustificationType = WordJustificationType.Both - } - }); - //Добавить ещё поля кроме названия продукта - //Это AbstractSaveToWordEmployee - } - } + CreateParagraph(new WordParagraph + { + Texts = new List<(string, WordTextProperties)> + { (product.ProductName, new WordTextProperties { Size = "20", Bold=false})}, + TextProperties = new WordTextProperties + { + Size = "24", + JustificationType = WordJustificationType.Both + } + }); + } SaveWord(info); }