неужели. готовая лаба 4 для показа

This commit is contained in:
ekallin 2024-03-30 20:23:52 +03:00
parent 408a86401a
commit 65704d7e48
7 changed files with 616 additions and 533 deletions

View File

@ -30,8 +30,8 @@ namespace SushiBarView.Reports
{
if (dateTimePickerDateFrom.Value.Date >= dateTimePickerDateTo.Value.Date)
{
MessageBox.Show("Дата начала должна быть меньше даты окончания",
"Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("Дата начала должна быть меньше даты окончания",
"Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
try

File diff suppressed because it is too large Load Diff

View File

@ -24,10 +24,10 @@ namespace SushiBarBusinessLogic.OfficePackage
Text = $"с { info.DateFrom.ToShortDateString() } по { info.DateTo.ToShortDateString() }", Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
CreateTable(new List<string> { "2cm", "3cm", "6cm", "3cm" });
CreateTable(new List<string> { "1cm", "3cm", "4cm", "6cm", "3cm" });
CreateRow(new PdfRowParameters
{
Texts = new List<string> { "Номер", "Дата заказа", "Изделие", "Сумма" },
Texts = new List<string> { "Номер", "Дата заказа", "Статус", "Изделие", "Сумма" },
Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
@ -35,7 +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.Status.ToString(), order.SushiName, order.Sum.ToString() },
Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Left
});

View File

@ -1,4 +1,5 @@
using SushiBarContracts.ViewModels;
using SushiBarDataModels.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
@ -13,6 +14,7 @@ namespace SushiBarBusinessLogic.OfficePackage.HelperModels
public string Title { get; set; } = string.Empty;
public DateTime DateFrom { get; set; }
public DateTime DateTo { get; set; }
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
public List<ReportOrdersViewModel> Orders { get; set; } = new();
}

View File

@ -73,6 +73,7 @@ namespace SushiBarBusinessLogic
Id = x.Id,
DateCreate = x.DateCreate,
SushiName = x.SushiName,
Status = x.Status.ToString(),
Sum = x.Sum
}).ToList();
}
@ -114,6 +115,7 @@ namespace SushiBarBusinessLogic
Title = "Список заказов",
DateFrom = model.DateFrom!.Value,
DateTo = model.DateTo!.Value,
Status = model.Status,
Orders = GetOrders(model)
});
}

View File

@ -1,10 +1,13 @@
namespace SushiBarContracts.BindingModel
using SushiBarDataModels.Enums;
namespace SushiBarContracts.BindingModel
{
public class ReportBindingModel
{
public string FileName { get; set; } = string.Empty;
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
}
}

View File

@ -1,10 +1,13 @@
namespace SushiBarContracts.ViewModels
using SushiBarDataModels.Enums;
namespace SushiBarContracts.ViewModels
{
public class ReportOrdersViewModel
{
public int Id { get; set; }
public DateTime DateCreate { get; set; }
public string SushiName { get; set; } = string.Empty;
public string Status { get; set; } = string.Empty;
public double Sum { get; set; }
}