попытки все исправить силы на исходе

This commit is contained in:
ekallin 2024-03-25 00:08:21 +04:00
parent f45e4cfaee
commit 7cb45bfe43
6 changed files with 12 additions and 13 deletions

View File

@ -16,8 +16,7 @@ namespace SushiBarBusinessLogic.OfficePackage
CreateParagraph(new PdfParagraph
{
Text = info.Title,
Style =
"NormalTitle",
Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
CreateParagraph(new PdfParagraph
@ -36,10 +35,7 @@ namespace SushiBarBusinessLogic.OfficePackage
{
CreateRow(new PdfRowParameters
{
Texts = new List<string> { order.Id.ToString(),
order.DateCreate.ToShortDateString(),
order.SushiName,
order.Sum.ToString() },
Texts = new List<string> { order.Id.ToString(), order.DateCreate.ToShortDateString(), order.SushiName, order.Sum.ToString() },
Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Left
});

View File

@ -6,7 +6,7 @@ namespace SushiBarBusinessLogic.OfficePackage.HelperModels
{
public string FileName { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public List<ReportSushisComponentViewModel> SushiComponents
public List<ReportSushiComponentViewModel> SushiComponents
{
get;
set;

View File

@ -11,7 +11,8 @@ namespace SushiBarBusinessLogic.OfficePackage.Implements
private Document? _document;
private Section? _section;
private Table? _table;
private static ParagraphAlignment GetParagraphAlignment(PdfParagraphAlignmentType type)
private static ParagraphAlignment
GetParagraphAlignment(PdfParagraphAlignmentType type)
{
return type switch
{
@ -85,6 +86,7 @@ namespace SushiBarBusinessLogic.OfficePackage.Implements
row.Cells[i].VerticalAlignment = VerticalAlignment.Center;
}
}
protected override void SavePdf(PdfInfo info)
{
if (_document != null)

View File

@ -23,6 +23,7 @@ namespace SushiBarBusinessLogic
_sushiStorage = sushiStorage;
_componentStorage = componentStorage;
_orderStorage = orderStorage;
_saveToExcel = saveToExcel;
_saveToWord = saveToWord;
_saveToPdf = saveToPdf;
@ -31,14 +32,14 @@ namespace SushiBarBusinessLogic
/// Получение списка компонент с указанием, в каких изделиях используются
/// </summary>
/// <returns></returns>
public List<ReportSushisComponentViewModel> GetSushiComponent()
public List<ReportSushiComponentViewModel> GetSushiComponent()
{
var components = _componentStorage.GetFullList();
var sushis = _sushiStorage.GetFullList();
var list = new List<ReportSushisComponentViewModel>();
var list = new List<ReportSushiComponentViewModel>();
foreach (var component in components)
{
var record = new ReportSushisComponentViewModel
var record = new ReportSushiComponentViewModel
{
ComponentName = component.ComponentName,
Sushis = new List<Tuple<string, int>>(),

View File

@ -9,7 +9,7 @@ namespace SushiBarContracts.BusinessLogicsContracts
/// Получение списка компонент с указанием, в каких изделиях используются
/// </summary>
/// <returns></returns>
List<ReportSushisComponentViewModel> GetSushiComponent();
List<ReportSushiComponentViewModel> GetSushiComponent();
/// <summary>
/// Получение списка заказов за определенный период
/// </summary>

View File

@ -1,6 +1,6 @@
namespace SushiBarContracts.ViewModels
{
public class ReportSushisComponentViewModel
public class ReportSushiComponentViewModel
{
public string ComponentName { get; set; } = string.Empty;
public int TotalCount { get; set; }