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",
RowIndex = rowIndex,
Text = pc.PaymeantName.ToString(),
//Text = pc.PaymeantName.ToString(),
StyleInfo = ExcelStyleInfoType.Text
});
rowIndex++;
foreach (var payment in pc.PaymeantsList)
{
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(),
//Text = payment.SumPayment.ToString(),
StyleInfo = ExcelStyleInfoType.TextWithBroder
});
//Не хорошо, что доступны ID а не название продукта, в идеале пофиксить надо
//Это AbstractSaveToExcelClient
rowIndex++;
}
//туут потом исправить
rowIndex++;
}

View File

@ -36,30 +36,18 @@ namespace ElectronicsShopBusinessLogic.OfficePackage
});
rowIndex++;
foreach (var product in pc.Products)
{
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(),
Text = pc.Price.ToString(),
StyleInfo = ExcelStyleInfoType.TextWithBroder
});
rowIndex++;
}
rowIndex++;
}
SaveExcel(info);
}

View File

@ -37,21 +37,16 @@ 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})},
{ (product.ProductName, new WordTextProperties { Size = "20", Bold=false})},
TextProperties = new WordTextProperties
{
Size = "24",
JustificationType = WordJustificationType.Both
}
});
//Добавить ещё поля кроме названия продукта
//Это AbstractSaveToWordEmployee
}
}
SaveWord(info);