This commit is contained in:
Игорь Гордеев 2024-06-01 01:48:01 +04:00
parent 6aa9a9e742
commit b36a8d0937
3 changed files with 26 additions and 56 deletions

View File

@ -31,32 +31,19 @@ namespace ElectronicsShopBusinessLogic.OfficePackage
{ {
ColumnName = "A", ColumnName = "A",
RowIndex = rowIndex, RowIndex = rowIndex,
Text = pc.PaymeantName.ToString(), //Text = pc.PaymeantName.ToString(),
StyleInfo = ExcelStyleInfoType.Text StyleInfo = ExcelStyleInfoType.Text
}); });
rowIndex++; rowIndex++;
foreach (var payment in pc.PaymeantsList)
{
InsertCellInWorksheet(new ExcelCellParameters
{
ColumnName = "B",
RowIndex = rowIndex,
Text = payment.PayOption.ToString(),
StyleInfo = ExcelStyleInfoType.Text
});
InsertCellInWorksheet(new ExcelCellParameters InsertCellInWorksheet(new ExcelCellParameters
{ {
ColumnName = "C", ColumnName = "C",
RowIndex = rowIndex, RowIndex = rowIndex,
Text = payment.SumPayment.ToString(), //Text = payment.SumPayment.ToString(),
StyleInfo = ExcelStyleInfoType.TextWithBroder StyleInfo = ExcelStyleInfoType.TextWithBroder
}); });
//Не хорошо, что доступны ID а не название продукта, в идеале пофиксить надо //туут потом исправить
//Это AbstractSaveToExcelClient
rowIndex++;
}
rowIndex++; rowIndex++;
} }

View File

@ -36,30 +36,18 @@ namespace ElectronicsShopBusinessLogic.OfficePackage
}); });
rowIndex++; rowIndex++;
foreach (var product in pc.Products)
{
InsertCellInWorksheet(new ExcelCellParameters
{
ColumnName = "B",
RowIndex = rowIndex,
Text = product.ProductName.ToString(),
StyleInfo = ExcelStyleInfoType.TextWithBroder
});
InsertCellInWorksheet(new ExcelCellParameters InsertCellInWorksheet(new ExcelCellParameters
{ {
ColumnName = "C", ColumnName = "C",
RowIndex = rowIndex, RowIndex = rowIndex,
Text = product.Price.ToString(), Text = pc.Price.ToString(),
StyleInfo = ExcelStyleInfoType.TextWithBroder StyleInfo = ExcelStyleInfoType.TextWithBroder
}); });
rowIndex++; rowIndex++;
} }
rowIndex++;
}
SaveExcel(info); SaveExcel(info);
} }

View File

@ -37,21 +37,16 @@ namespace ElectronicsShopBusinessLogic.OfficePackage
} }
}); });
foreach (var pre in product.Products)
{
CreateParagraph(new WordParagraph CreateParagraph(new WordParagraph
{ {
Texts = new List<(string, WordTextProperties)> Texts = new List<(string, WordTextProperties)>
{ (pre.ProductName, new WordTextProperties { Size = "20", Bold=false})}, { (product.ProductName, new WordTextProperties { Size = "20", Bold=false})},
TextProperties = new WordTextProperties TextProperties = new WordTextProperties
{ {
Size = "24", Size = "24",
JustificationType = WordJustificationType.Both JustificationType = WordJustificationType.Both
} }
}); });
//Добавить ещё поля кроме названия продукта
//Это AbstractSaveToWordEmployee
}
} }
SaveWord(info); SaveWord(info);