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)