From 00fd7a1f5021e51adde7dae4d83faf348a74c7ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BE=D0=BB=D0=BE=D0=B4=D1=8F?= Date: Wed, 19 Apr 2023 18:06:28 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/ReportBindingModel.cs | 17 +++++++ .../BusinessLogicsContracts/IReportLogic.cs | 44 +++++++++++++++++++ .../SearchModel/OrderSearchModel.cs | 3 ++ .../ViewModel/ReportCarComponentViewModel.cs | 17 +++++++ .../ViewModel/ReportOrdersViewModel.cs | 20 +++++++++ 5 files changed, 101 insertions(+) create mode 100644 AutomobilePlant/AbstractAutoContracts/BindingModels/ReportBindingModel.cs create mode 100644 AutomobilePlant/AbstractAutoContracts/BusinessLogicsContracts/IReportLogic.cs create mode 100644 AutomobilePlant/AbstractAutoContracts/ViewModel/ReportCarComponentViewModel.cs create mode 100644 AutomobilePlant/AbstractAutoContracts/ViewModel/ReportOrdersViewModel.cs diff --git a/AutomobilePlant/AbstractAutoContracts/BindingModels/ReportBindingModel.cs b/AutomobilePlant/AbstractAutoContracts/BindingModels/ReportBindingModel.cs new file mode 100644 index 0000000..b7a2f10 --- /dev/null +++ b/AutomobilePlant/AbstractAutoContracts/BindingModels/ReportBindingModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AutomobilePlantContracts.BindingModels +{ + public class ReportBindingModel + { + public string FileName { get; set; } = string.Empty; + + public DateTime? DateFrom { get; set; } + + public DateTime? DateTo { get; set; } + } +} diff --git a/AutomobilePlant/AbstractAutoContracts/BusinessLogicsContracts/IReportLogic.cs b/AutomobilePlant/AbstractAutoContracts/BusinessLogicsContracts/IReportLogic.cs new file mode 100644 index 0000000..1c9a425 --- /dev/null +++ b/AutomobilePlant/AbstractAutoContracts/BusinessLogicsContracts/IReportLogic.cs @@ -0,0 +1,44 @@ +using AutomobilePlantContracts.BindingModels; +using AutomobilePlantContracts.ViewModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AutomobilePlantContracts.BusinessLogicsContracts +{ + public interface IReportLogic + { + /// + /// Получение списка компонент с указанием, в каких машинах используются + /// + /// + List GetCarComponent(); + + /// + /// Получение списка заказов за определенный период + /// + /// + /// + List GetOrders(ReportBindingModel model); + + /// + /// Сохранение компонент в файл-Word + /// + /// + void SaveComponentsToWordFile(ReportBindingModel model); + + /// + /// Сохранение компонент с указаеним машин в файл-Excel + /// + /// + void SaveCarComponentToExcelFile(ReportBindingModel model); + + /// + /// Сохранение заказов в файл-Pdf + /// + /// + void SaveOrdersToPdfFile(ReportBindingModel model); + } +} diff --git a/AutomobilePlant/AbstractAutoContracts/SearchModel/OrderSearchModel.cs b/AutomobilePlant/AbstractAutoContracts/SearchModel/OrderSearchModel.cs index de416ba..9406f9f 100644 --- a/AutomobilePlant/AbstractAutoContracts/SearchModel/OrderSearchModel.cs +++ b/AutomobilePlant/AbstractAutoContracts/SearchModel/OrderSearchModel.cs @@ -9,6 +9,9 @@ namespace AutomobilePlantContracts.SearchModel public class OrderSearchModel { public int? Id { get; set; } + public DateTime? DateFrom { get; set; } + + public DateTime? DateTo { get; set; } } } diff --git a/AutomobilePlant/AbstractAutoContracts/ViewModel/ReportCarComponentViewModel.cs b/AutomobilePlant/AbstractAutoContracts/ViewModel/ReportCarComponentViewModel.cs new file mode 100644 index 0000000..61983d1 --- /dev/null +++ b/AutomobilePlant/AbstractAutoContracts/ViewModel/ReportCarComponentViewModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AutomobilePlantContracts.ViewModel +{ + public class ReportCarComponentViewModel + { + public string CarName { get; set; } = string.Empty; + + public int TotalCount { get; set; } + + public List<(string Component, int Count)> Components { get; set; } = new(); + } +} diff --git a/AutomobilePlant/AbstractAutoContracts/ViewModel/ReportOrdersViewModel.cs b/AutomobilePlant/AbstractAutoContracts/ViewModel/ReportOrdersViewModel.cs new file mode 100644 index 0000000..b74e3b2 --- /dev/null +++ b/AutomobilePlant/AbstractAutoContracts/ViewModel/ReportOrdersViewModel.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AutomobilePlantContracts.ViewModel +{ + public class ReportOrdersViewModel + { + public int Id { get; set; } + + public DateTime DateCreate { get; set; } + + public string CarName { get; set; } = string.Empty; + public string Status { get; set; } = string.Empty; + + public double Sum { get; set; } + } +}