This commit is contained in:
Андрей Байгулов 2024-04-25 22:19:15 +04:00
parent 7b725a5d74
commit c4a17d6300
4 changed files with 9 additions and 6 deletions

View File

@ -38,7 +38,7 @@ namespace SushiBarBusinessLogic.OfficePackage
{ {
Text = $"Итого: {info.Orders.Sum(x => x.Sum)}\t", Text = $"Итого: {info.Orders.Sum(x => x.Sum)}\t",
Style = "Normal", Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Rigth ParagraphAlignment = PdfParagraphAlignmentType.Right
}); });
SavePdf(info); SavePdf(info);
} }

View File

@ -4,6 +4,6 @@
{ {
Center, Center,
Left, Left,
Rigth Right
} }
} }

View File

@ -16,7 +16,7 @@ namespace SushiBarBusinessLogic.OfficePackage.Implements
{ {
PdfParagraphAlignmentType.Center => ParagraphAlignment.Center, PdfParagraphAlignmentType.Center => ParagraphAlignment.Center,
PdfParagraphAlignmentType.Left => ParagraphAlignment.Left, PdfParagraphAlignmentType.Left => ParagraphAlignment.Left,
PdfParagraphAlignmentType.Rigth => ParagraphAlignment.Right, PdfParagraphAlignmentType.Right => ParagraphAlignment.Right,
_ => ParagraphAlignment.Justify, _ => ParagraphAlignment.Justify,
}; };
} }
@ -27,7 +27,7 @@ namespace SushiBarBusinessLogic.OfficePackage.Implements
private static void DefineStyles(Document document) private static void DefineStyles(Document document)
{ {
var style = document.Styles["Normal"]; var style = document.Styles["Normal"];
style.Font.Name = "Times New Roman"; style.Font.Name = "Arial";
style.Font.Size = 14; style.Font.Size = 14;
style = document.Styles.AddStyle("NormalTitle", "Normal"); style = document.Styles.AddStyle("NormalTitle", "Normal");
style.Font.Bold = true; style.Font.Bold = true;

View File

@ -18,8 +18,11 @@ namespace SushiBarDatabaseImplement.Implements
public List<OrderViewModel> GetFilteredList(OrderSearchModel model) public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
{ {
using var context = new SushiBarDatabase(); using var context = new SushiBarDatabase();
var result = context.Orders.Include(x => x.Sushi).Select(x => x.GetViewModel).ToList(); if (model.DateFrom.HasValue)
return result; {
return context.Orders.Include(x => x.Sushi).Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo).Select(x => x.GetViewModel).ToList();
}
return context.Orders.Include(x => x.Sushi).Where(x => x.Id == model.Id).Select(x => x.GetViewModel).ToList();
} }
public OrderViewModel? GetElement(OrderSearchModel model) public OrderViewModel? GetElement(OrderSearchModel model)