From 1fb64d83c88a4e73221637fe4907ae71588dff14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B0=D0=BB=D0=B8=D0=BD=D0=B0=20=D0=A4=D0=B5=D0=B4?= =?UTF-8?q?=D0=BE=D1=80=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Thu, 30 May 2024 12:29:12 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=83=D0=BF=D1=83=D0=BF=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HomeController.cs | 17 +++++++----- .../LawFirmExecutorApp.csproj | 2 ++ LawFim/LawFirmExecutorApp/Program.cs | 27 +++++++++++++++++++ 3 files changed, 40 insertions(+), 6 deletions(-) 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();