From 9e470873d8023895f2b69939850fc3f37c4caabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9?= Date: Thu, 18 May 2023 20:38:05 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=BD=D0=BE=20=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=B0=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogics/Worker/WorkerReportLogic.cs | 1 + .../OfficePackage/AbstractSaveToPdf.cs | 2 +- .../HardwareShopDatabase.cs | 2 +- .../Controllers/ReportController.cs | 10 +++++++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/HardwareShop/HardwareShopBusinessLogic/BusinessLogics/Worker/WorkerReportLogic.cs b/HardwareShop/HardwareShopBusinessLogic/BusinessLogics/Worker/WorkerReportLogic.cs index 87bada3..af2f990 100644 --- a/HardwareShop/HardwareShopBusinessLogic/BusinessLogics/Worker/WorkerReportLogic.cs +++ b/HardwareShop/HardwareShopBusinessLogic/BusinessLogics/Worker/WorkerReportLogic.cs @@ -152,6 +152,7 @@ namespace HardwareShopContracts.BusinessLogicsContracts /// public void SendByMailPurchaseReport(ReportBindingModel model) { + model.FileName = "temp.pdf"; _saveToPdf.GetPurchaseReportFile(new() { FileName = model.FileName, diff --git a/HardwareShop/HardwareShopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/HardwareShop/HardwareShopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs index 6ac6744..07e14cb 100644 --- a/HardwareShop/HardwareShopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs +++ b/HardwareShop/HardwareShopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs @@ -26,7 +26,7 @@ namespace HardwareShopBusinessLogic.OfficePackage ParagraphAlignment = PdfParagraphAlignmentType.Center }); - CreateTable(new List { "5cm", "5cm", "5cm", "5cm", "5cm" }); + CreateTable(new List { "3cm", "4cm", "3cm", "4cm", "4cm" }); CreateRow(new PdfRowParameters { diff --git a/HardwareShop/HardwareShopDatabaseImplement/HardwareShopDatabase.cs b/HardwareShop/HardwareShopDatabaseImplement/HardwareShopDatabase.cs index 939b6a4..4246e31 100644 --- a/HardwareShop/HardwareShopDatabaseImplement/HardwareShopDatabase.cs +++ b/HardwareShop/HardwareShopDatabaseImplement/HardwareShopDatabase.cs @@ -10,7 +10,7 @@ namespace HardwareShopDatabaseImplement { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { - optionsBuilder.UseNpgsql("Host=localhost;Port=5433;Database=Computer_Hardware_Store;Username=user;Password=12345"); + optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=Computer_Hardware_Store4;Username=postgres;Password=1234"); AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); } diff --git a/HardwareShop/HardwareShopRestApi/Controllers/ReportController.cs b/HardwareShop/HardwareShopRestApi/Controllers/ReportController.cs index 656316c..f32fe9e 100644 --- a/HardwareShop/HardwareShopRestApi/Controllers/ReportController.cs +++ b/HardwareShop/HardwareShopRestApi/Controllers/ReportController.cs @@ -122,7 +122,15 @@ namespace HardwareShopRestApi.Controllers [HttpPost] public void SendByMailPurchaseReport(ReportBindingModel reportModel) { - _reportWorkerLogic.SendByMailPurchaseReport(reportModel); + try + { + _reportWorkerLogic.SendByMailPurchaseReport(reportModel); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка получения сведений по полученным пользователем комплектующим за период"); + throw; + } } }