From b8c2d2aa96391c89ac02a3b533392158c0eff9d5 Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Wed, 27 Mar 2024 11:52:48 +0400 Subject: [PATCH] lab-4 change contracts --- .../BindingModels/ReportBindingModel.cs | 15 +++++++ .../BusinessLogicsContracts/IReportLogic.cs | 40 +++++++++++++++++++ .../SearchModels/OrderSearchModel.cs | 2 + .../ReportManufactureComponentViewModel.cs | 15 +++++++ .../ViewModels/ReportOrdersViewModel.cs | 17 ++++++++ 5 files changed, 89 insertions(+) create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/ReportBindingModel.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IReportLogic.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportManufactureComponentViewModel.cs create mode 100644 BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportOrdersViewModel.cs diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/ReportBindingModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/ReportBindingModel.cs new file mode 100644 index 0000000..aa09ace --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BindingModels/ReportBindingModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.BindingModels +{ + public class ReportBindingModel + { + public string FileName { get; set; } = string.Empty; + public DateTime? DateFrom { get; set; } + public DateTime? DateTo { get; set; } + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IReportLogic.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IReportLogic.cs new file mode 100644 index 0000000..08a2b1a --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/BusinessLogicsContracts/IReportLogic.cs @@ -0,0 +1,40 @@ +using BlacksmithWorkshopContracts.BindingModels; +using BlacksmithWorkshopContracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.BusinessLogicsContracts +{ + public interface IReportLogic + { + /// + /// Получение списка компонент с указанием, в каких изделиях используются + /// + /// + List GetComputerComponent(); + /// + /// Получение списка заказов за определенный период + /// + /// + /// + List GetOrders(ReportBindingModel model); + /// + /// Сохранение компонент в файл-Word + /// + /// + void SaveComponentsToWordFile(ReportBindingModel model); + /// + /// Сохранение компонент с указаеним продуктов в файл-Excel + /// + /// + void SaveManufactureComponentToExcelFile(ReportBindingModel model); + /// + /// Сохранение заказов в файл-Pdf + /// + /// + void SaveOrdersToPdfFile(ReportBindingModel model); + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/SearchModels/OrderSearchModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/SearchModels/OrderSearchModel.cs index 254be46..6c57a01 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/SearchModels/OrderSearchModel.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/SearchModels/OrderSearchModel.cs @@ -9,5 +9,7 @@ namespace BlacksmithWorkshopContracts.SearchModels public class OrderSearchModel { public int? Id { get; set; } + public DateTime? DateFrom { get; set; } + public DateTime? DateTo { get; set; } } } diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportManufactureComponentViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportManufactureComponentViewModel.cs new file mode 100644 index 0000000..1df0884 --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportManufactureComponentViewModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.ViewModels +{ + public class ReportManufactureComponentViewModel + { + public string ComputerName { get; set; } = string.Empty; + public int TotalCount { get; set; } + public List> Components { get; set; } = new(); + } +} diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportOrdersViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportOrdersViewModel.cs new file mode 100644 index 0000000..404d2fd --- /dev/null +++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportOrdersViewModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BlacksmithWorkshopContracts.ViewModels +{ + public class ReportOrdersViewModel + { + public int Id { get; set; } + public DateTime DateCreate { get; set; } + public string ComputerName { get; set; } = string.Empty; + public double Sum { get; set; } + public string OrderStatus { get; set; } = string.Empty; + } +}