From cfbf6479e555498819ab1e08adccdead4b2cdb7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=9C=D0=B0=D0=BB?= =?UTF-8?q?=D0=B0=D1=84=D0=B5=D0=B5=D0=B2?= Date: Tue, 30 Apr 2024 23:20:57 +0400 Subject: [PATCH] =?UTF-8?q?=D1=85=D0=B7=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/ReportBindingModel.cs | 16 ++++++++++++++++ .../ViewModels/ReportBundlingViewModel.cs | 15 +++++++++++++++ .../ViewModels/ReportCarViewModel.cs | 14 ++++++++++++++ .../ViewModels/ReportOrderViewModel.cs | 15 +++++++++++++++ .../ViewModels/ReportPresaleViewModel.cs | 14 ++++++++++++++ .../Implements/CarStorage.cs | 2 +- 6 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 CarCenter/CarCenterContracts/BindingModels/ReportBindingModel.cs create mode 100644 CarCenter/CarCenterContracts/ViewModels/ReportBundlingViewModel.cs create mode 100644 CarCenter/CarCenterContracts/ViewModels/ReportCarViewModel.cs create mode 100644 CarCenter/CarCenterContracts/ViewModels/ReportOrderViewModel.cs create mode 100644 CarCenter/CarCenterContracts/ViewModels/ReportPresaleViewModel.cs diff --git a/CarCenter/CarCenterContracts/BindingModels/ReportBindingModel.cs b/CarCenter/CarCenterContracts/BindingModels/ReportBindingModel.cs new file mode 100644 index 0000000..4d29120 --- /dev/null +++ b/CarCenter/CarCenterContracts/BindingModels/ReportBindingModel.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CarCenterContracts.BindingModels +{ + public class ReportBindingModel + { + public string FileName { get; set; } = string.Empty; + public DateTime? DateFrom { get; set; } + public DateTime? DateTo { get; set; } + } + +} diff --git a/CarCenter/CarCenterContracts/ViewModels/ReportBundlingViewModel.cs b/CarCenter/CarCenterContracts/ViewModels/ReportBundlingViewModel.cs new file mode 100644 index 0000000..7c9d8f7 --- /dev/null +++ b/CarCenter/CarCenterContracts/ViewModels/ReportBundlingViewModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CarCenterContracts.ViewModels +{ + public class ReportBundlingViewModel + { + public int Id { get; set; } + public List<(string, int)> Orders { get; set; } = new(); + public List<(string, int)> Features { get; set; } = new(); + } +} diff --git a/CarCenter/CarCenterContracts/ViewModels/ReportCarViewModel.cs b/CarCenter/CarCenterContracts/ViewModels/ReportCarViewModel.cs new file mode 100644 index 0000000..995f519 --- /dev/null +++ b/CarCenter/CarCenterContracts/ViewModels/ReportCarViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CarCenterContracts.ViewModels +{ + public class ReportCarViewModel + { + public int Id { get; set; } + public List<(string, int)> Presales { get; set; } = new(); + } +} diff --git a/CarCenter/CarCenterContracts/ViewModels/ReportOrderViewModel.cs b/CarCenter/CarCenterContracts/ViewModels/ReportOrderViewModel.cs new file mode 100644 index 0000000..63a833c --- /dev/null +++ b/CarCenter/CarCenterContracts/ViewModels/ReportOrderViewModel.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CarCenterContracts.ViewModels +{ + public class ReportOrderViewModel + { + public int Id { get; set; } + public List<(string, int)> Bundlings { get; set; } = new(); + public List<(string, int)> Requests { get; set; } = new(); + } +} diff --git a/CarCenter/CarCenterContracts/ViewModels/ReportPresaleViewModel.cs b/CarCenter/CarCenterContracts/ViewModels/ReportPresaleViewModel.cs new file mode 100644 index 0000000..3304ce9 --- /dev/null +++ b/CarCenter/CarCenterContracts/ViewModels/ReportPresaleViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CarCenterContracts.ViewModels +{ + public class ReportPresaleViewModel + { + public int Id { get; set; } + public List<(string, int)> Cars { get; set; } = new(); + } +} diff --git a/CarCenter/CarCenterDatabaseImplement/Implements/CarStorage.cs b/CarCenter/CarCenterDatabaseImplement/Implements/CarStorage.cs index d62831f..f17d612 100644 --- a/CarCenter/CarCenterDatabaseImplement/Implements/CarStorage.cs +++ b/CarCenter/CarCenterDatabaseImplement/Implements/CarStorage.cs @@ -29,7 +29,7 @@ namespace CarCenterDatabaseImplement.Implements public List GetFilteredList(CarSearchModel model) { using var context = new CarCenterDatabase(); - if (model.DateFrom.HasValue && model.DateTo.HasValue) + if (model.DateFrom.HasValue && model.DateTo.HasValue) // Для отчета списка { return context.Cars .Include(x => x.Bundlings)