diff --git a/LawFim/LawFirmExecutorApp/Controllers/HomeController.cs b/LawFim/LawFirmExecutorApp/Controllers/HomeController.cs index 31ee482..861104d 100644 --- a/LawFim/LawFirmExecutorApp/Controllers/HomeController.cs +++ b/LawFim/LawFirmExecutorApp/Controllers/HomeController.cs @@ -3,6 +3,7 @@ using LawFirmContracts.ViewModels; using LawFirmExecutorApp.Models; using Microsoft.AspNetCore.Mvc; using System.Diagnostics; +using LawFirmContracts.BusinessLogicContracts; using System.Globalization; namespace LawFirmExecutorApp.Controllers @@ -10,10 +11,12 @@ namespace LawFirmExecutorApp.Controllers public class HomeController : Controller { private readonly ILogger _logger; + private readonly IReportLogic _report; - public HomeController(ILogger logger) + public HomeController(ILogger logger, IReportLogic report) { _logger = logger; + _report = report; } // СТРАНИЦА ДЕЛ @@ -161,12 +164,14 @@ namespace LawFirmExecutorApp.Controllers List result; try { - string dateFromS = dateFrom.ToString("s", CultureInfo.InvariantCulture); - string dateToS = dateTo.ToString("s", CultureInfo.InvariantCulture); - result = APIClient.GetRequest> - ($"api/reportexecutor/getconsultationhearingreport?datefrom={dateFromS}&dateto={dateToS}&executorid={APIClient.Executor.Id}")!; + result = _report.GetGetClients(new ReportBindingModel + { + ExecutorId = APIClient.Executor.Id, + DateFrom = dateFrom, + DateTo = dateTo + }); - } + } catch (Exception ex) { _logger.LogError(ex, "Ошибка создания отчета"); diff --git a/LawFim/LawFirmExecutorApp/LawFirmExecutorApp.csproj b/LawFim/LawFirmExecutorApp/LawFirmExecutorApp.csproj index 5dd4a85..44446a0 100644 --- a/LawFim/LawFirmExecutorApp/LawFirmExecutorApp.csproj +++ b/LawFim/LawFirmExecutorApp/LawFirmExecutorApp.csproj @@ -11,6 +11,8 @@ + + diff --git a/LawFim/LawFirmExecutorApp/Program.cs b/LawFim/LawFirmExecutorApp/Program.cs index e59e712..e2a407a 100644 --- a/LawFim/LawFirmExecutorApp/Program.cs +++ b/LawFim/LawFirmExecutorApp/Program.cs @@ -1,11 +1,38 @@ +using LawFirmContracts.BusinessLogicContracts; using LawFirmExecutorApp; using LawFirmContracts.StoragesContracts; using LawFirmDatabaseImplement.Implements; +using LawFirmBusinessLogic.BusinessLogics; +using LawFirmBusinessLogic.OfficePackages; +using LawFirmBusinessLogic.MailWorker; +using LawFirmBusinessLogic.OfficePackages.Implements; var builder = WebApplication.CreateBuilder(args); //builder.Services.AddTransient(); //builder.Services.AddTransient(); //builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); + +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); + +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddTransient(); +builder.Services.AddSingleton(); // Add services to the container. builder.Services.AddControllersWithViews();