From f89deb35509a7ecd5f9f134c6be9b232213b411e Mon Sep 17 00:00:00 2001 From: "a.puchkina" Date: Thu, 30 May 2024 12:13:54 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BE=D1=82=D1=87=D0=B5=D1=82=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=B0=D0=B5=D1=82!!!!!!!!!!!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HomeController.cs | 16 ++++++---- .../LawFirmGuarantorApp.csproj | 2 ++ LawFim/LawFirmGuarantorApp/Program.cs | 29 ++++++++++++++++++- .../Controllers/ReportGuarantorController.cs | 10 +++---- 4 files changed, 45 insertions(+), 12 deletions(-) diff --git a/LawFim/LawFirmGuarantorApp/Controllers/HomeController.cs b/LawFim/LawFirmGuarantorApp/Controllers/HomeController.cs index 5a1ba9f..e6d1b78 100644 --- a/LawFim/LawFirmGuarantorApp/Controllers/HomeController.cs +++ b/LawFim/LawFirmGuarantorApp/Controllers/HomeController.cs @@ -1,4 +1,5 @@ using LawFirmContracts.BindingModels; +using LawFirmContracts.BusinessLogicContracts; using LawFirmContracts.ViewModels; using LawFirmGuarantorApp.Models; using Microsoft.AspNetCore.Mvc; @@ -10,10 +11,12 @@ namespace LawFirmGuarantorApp.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; } // СТРАНИЦЫ КОНСУЛЬТАЦИЙ @@ -168,11 +171,12 @@ namespace LawFirmGuarantorApp.Controllers List result; try { - string dateFromS = dateFrom.ToString("s", CultureInfo.InvariantCulture); - string dateToS = dateTo.ToString("s", CultureInfo.InvariantCulture); - result = APIClient.GetRequest> - ($"api/reportguarantor/getconsultationhearingreport?datefrom={dateFromS}&dateto={dateToS}&guarantorid={APIClient.Guarantor.Id}")!; - + result = _report.GetConsultationHearing(new ReportConsultationHearingBindingModel + { + GuarantorId = APIClient.Guarantor.Id, + DateFrom = dateFrom, + DateTo = dateTo + }); } catch (Exception ex) { diff --git a/LawFim/LawFirmGuarantorApp/LawFirmGuarantorApp.csproj b/LawFim/LawFirmGuarantorApp/LawFirmGuarantorApp.csproj index 5dd4a85..44446a0 100644 --- a/LawFim/LawFirmGuarantorApp/LawFirmGuarantorApp.csproj +++ b/LawFim/LawFirmGuarantorApp/LawFirmGuarantorApp.csproj @@ -11,6 +11,8 @@ + + diff --git a/LawFim/LawFirmGuarantorApp/Program.cs b/LawFim/LawFirmGuarantorApp/Program.cs index 31eb6d0..76acbcc 100644 --- a/LawFim/LawFirmGuarantorApp/Program.cs +++ b/LawFim/LawFirmGuarantorApp/Program.cs @@ -1,11 +1,38 @@ +using LawFirmContracts.BusinessLogicContracts; using LawFirmContracts.StoragesContracts; using LawFirmDatabaseImplement.Implements; using LawFirmGuarantorApp; +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(); diff --git a/LawFim/LawFirmRestApi/Controllers/ReportGuarantorController.cs b/LawFim/LawFirmRestApi/Controllers/ReportGuarantorController.cs index 903fae3..a6d101a 100644 --- a/LawFim/LawFirmRestApi/Controllers/ReportGuarantorController.cs +++ b/LawFim/LawFirmRestApi/Controllers/ReportGuarantorController.cs @@ -32,7 +32,7 @@ namespace LawFirmRestApi.Controllers { DateFrom = report.DateFrom, DateTo = report.DateTo, - FileName = "E:\\reports\\pdfConsultationHearingsReport.pdf", + FileName = "D:\\CourseWork\\pdfConsultationHearingsReport.pdf", GuarantorId = report.GuarantorId, }); } @@ -51,7 +51,7 @@ namespace LawFirmRestApi.Controllers { DateFrom = report.DateFrom, DateTo = report.DateTo, - FileName = "E:\\reports\\pdfCaseHearingsReport.pdf", + FileName = "D:\\CourseWork\\pdfCaseHearingsReport.pdf", GuarantorId = report.GuarantorId, LawyerId =report.LawyerId, }); @@ -70,7 +70,7 @@ namespace LawFirmRestApi.Controllers _reportLogic.SaveVisitLawyerToWordFile(new ReportVisitLawyerBindingModel { GuarantorId = report.GuarantorId, - FileName = "E:\\reports\\wordVisitLawyerReport.docx", + FileName = "D:\\CourseWork\\wordVisitLawyerReport.docx", LawyerId = report.LawyerId }); } @@ -88,7 +88,7 @@ namespace LawFirmRestApi.Controllers _reportLogic.SaveVisitLawyerToExcelFile(new ReportVisitLawyerBindingModel { GuarantorId = report.GuarantorId, - FileName = "E:\\reports\\excelVisitLawyerReport.xlsx", + FileName = "D:\\CourseWork\\excelVisitLawyerReport.xlsx", LawyerId = report.LawyerId }); } @@ -108,7 +108,7 @@ namespace LawFirmRestApi.Controllers { DateFrom = report.DateFrom, DateTo = report.DateTo, - FileName = "E:\\reports\\pdffile.pdf", + FileName = "D:\\CourseWork\\pdffile.pdf", GuarantorId = report.GuarantorId, LawyerId = report.LawyerId, Email = report.Email,