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

View File

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

View File

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