From 66292d362b73d794e550a50b7c33151b5623cf96 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 19:21:42 +0400 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BF=D0=B4=D1=84=D0=BA=D0=B8=20=D0=BD=D0=B5=20=D1=80?= =?UTF-8?q?=D0=B0=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 --- .../Worker/WorkerReportLogic.cs | 2 +- .../OfficePackage/AbstractSaveToPdf.cs | 6 ++--- .../Controllers/WorkerReport.cs | 23 ------------------- .../Controllers/HomeController.cs | 1 + 4 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 HardwareShop/HardwareShopRestApi/Controllers/WorkerReport.cs diff --git a/HardwareShop/HardwareShopBusinessLogic/BusinessLogics/Worker/WorkerReportLogic.cs b/HardwareShop/HardwareShopBusinessLogic/BusinessLogics/Worker/WorkerReportLogic.cs index 1460932..9bcadf7 100644 --- a/HardwareShop/HardwareShopBusinessLogic/BusinessLogics/Worker/WorkerReportLogic.cs +++ b/HardwareShop/HardwareShopBusinessLogic/BusinessLogics/Worker/WorkerReportLogic.cs @@ -152,7 +152,7 @@ namespace HardwareShopContracts.BusinessLogicsContracts /// public void SendByMailPurchaseReport(ReportBindingModel model) { - byte[] file = _saveToPdf.GetEquipmentReportFile(new() + byte[] file = _saveToPdf.GetPurchaseReportFile(new() { FileName = model.FileName, Title = "Отчет по покупкам", diff --git a/HardwareShop/HardwareShopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/HardwareShop/HardwareShopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs index 0c04751..f5fefac 100644 --- a/HardwareShop/HardwareShopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs +++ b/HardwareShop/HardwareShopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs @@ -7,7 +7,7 @@ namespace HardwareShopBusinessLogic.OfficePackage { public abstract class AbstractSaveToPdf { - public byte[] GetEquipmentReportFile(PdfInfo info) + public byte[] GetPurchaseReportFile(PdfInfo info) { CreatePdf(info); @@ -26,11 +26,11 @@ namespace HardwareShopBusinessLogic.OfficePackage ParagraphAlignment = PdfParagraphAlignmentType.Center }); - CreateTable(new List { "5cm", "5cm", "5cm" }); + CreateTable(new List { "5cm", "5cm", "5cm", "5cm", "5cm" }); CreateRow(new PdfRowParameters { - Texts = new List { "Комплектация", "Автомобили", "Работы" }, + Texts = new List { "Покупка", "Дата покупки", "Цена", "Комментарии", "Комплектующие" }, Style = "NormalTitle", ParagraphAlignment = PdfParagraphAlignmentType.Center }); diff --git a/HardwareShop/HardwareShopRestApi/Controllers/WorkerReport.cs b/HardwareShop/HardwareShopRestApi/Controllers/WorkerReport.cs deleted file mode 100644 index dbbf344..0000000 --- a/HardwareShop/HardwareShopRestApi/Controllers/WorkerReport.cs +++ /dev/null @@ -1,23 +0,0 @@ -using HardwareShopContracts.BindingModels; -using HardwareShopContracts.BusinessLogicsContracts; -using HardwareShopContracts.SearchModels; -using HardwareShopContracts.ViewModels; -using Microsoft.AspNetCore.Mvc; - -namespace HardwareShopRestApi.Controllers -{ - [Route("api/[controller]/[action]")] - [ApiController] - public class WorkerReport : Controller - { - private readonly ILogger _logger; - - private readonly IWorkerReportLogic _workerReportLogic; - - public WorkerReport(IWorkerReportLogic workerReportLogic, ILogger logger) - { - _logger = logger; - _workerReportLogic = workerReportLogic; - } - } -} \ No newline at end of file diff --git a/HardwareShop/HardwareShopWorkerApp/Controllers/HomeController.cs b/HardwareShop/HardwareShopWorkerApp/Controllers/HomeController.cs index 1110ed2..484b7bf 100644 --- a/HardwareShop/HardwareShopWorkerApp/Controllers/HomeController.cs +++ b/HardwareShop/HardwareShopWorkerApp/Controllers/HomeController.cs @@ -562,6 +562,7 @@ namespace HardwareShopWorkerApp.Controllers return; } reportModel.UserId = APIClient.User.Id; + reportModel.UserEmail = APIClient.User.Email; APIClient.PostRequest("api/report/SendByMailPurchaseReport", reportModel); } }