From 7b63e421fc806005f19917ddf36ee34e9958d0af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=BA=20=D0=98=D0=B3=D0=BE=D1=80=D1=8C?= Date: Sat, 8 Apr 2023 14:02:29 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B8=20=D0=BE?= =?UTF-8?q?=D1=82=D1=87=D0=B5=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CarServiceBusinessLogic/BusinessLogics/ReportLogic.cs | 8 +++++--- .../CarServiceDatabase/Implements/WorkPaymentStorage.cs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CarService/CarServiceBusinessLogic/BusinessLogics/ReportLogic.cs b/CarService/CarServiceBusinessLogic/BusinessLogics/ReportLogic.cs index e407dd8..58fe03f 100644 --- a/CarService/CarServiceBusinessLogic/BusinessLogics/ReportLogic.cs +++ b/CarService/CarServiceBusinessLogic/BusinessLogics/ReportLogic.cs @@ -8,21 +8,23 @@ namespace CarServiceBusinessLogic.BusinessLogics { public class ReportLogic : IReportLogic { - //private readonly ILogger _logger; + private readonly ILogger _logger; private readonly IWorkStorage _workStorage; private readonly IWorkPaymentStorage _workPaymentStorage; - public ReportLogic(/*ILogger logger,*/ IWorkStorage workStorage, IWorkPaymentStorage workPaymentStorage) + public ReportLogic(ILogger logger, IWorkStorage workStorage, IWorkPaymentStorage workPaymentStorage) { - //_logger = logger; + _logger = logger; _workStorage = workStorage; _workPaymentStorage = workPaymentStorage; } public List GetRequestsByWorks(ReportBindingModel model) { + _logger.LogInformation("Reading requests by works"); return _workStorage.GetWorksWithRequest(new() { SelectedWorksIds = model.SelectedWorks }); } public List GetPayments(ReportBindingModel model) { + _logger.LogInformation("Reading payments by works in requests"); return _workPaymentStorage.GetPaymentsByWorks(new() {DateFrom = model.DateFrom, DateTo = model.DateTo }); } public void SaveComponentsToWordFile(ReportBindingModel model) diff --git a/CarService/CarServiceDatabase/Implements/WorkPaymentStorage.cs b/CarService/CarServiceDatabase/Implements/WorkPaymentStorage.cs index fda73ba..67cc16f 100644 --- a/CarService/CarServiceDatabase/Implements/WorkPaymentStorage.cs +++ b/CarService/CarServiceDatabase/Implements/WorkPaymentStorage.cs @@ -47,7 +47,7 @@ namespace CarServiceDatabase.Implements using var context = new CarServiceDbContext(); return context.WorkPayments .Include(wp => wp.WorkInRequest) - .ThenInclude(wir => wir.Work)//добираемся до названия работы + .ThenInclude(wir => wir.Work) .Include(wp => wp.WorkInRequest) .ThenInclude(wir => wir.RepairRequest) .ThenInclude(rr => rr.Vehicle)