From b92d13c0ee56d63a4f7677492fec46eb40666413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D1=81=D0=B5=D0=BD=D0=B8=D1=8F?= Date: Mon, 16 Dec 2024 11:40:30 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CompShop/CompShop/DocumentsBuilder/ChartReport.cs | 6 +++--- CompShop/CompShop/DocumentsBuilder/TableReport.cs | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CompShop/CompShop/DocumentsBuilder/ChartReport.cs b/CompShop/CompShop/DocumentsBuilder/ChartReport.cs index c1e34ac..39f4609 100644 --- a/CompShop/CompShop/DocumentsBuilder/ChartReport.cs +++ b/CompShop/CompShop/DocumentsBuilder/ChartReport.cs @@ -11,12 +11,12 @@ internal class ChartReport private readonly IConnectionString _connectionString; private readonly ILogger _logger; - public ChartReport(IConnectionString connectionString, ICheckRepository checkRepository, IProductRepository productRepository, ILoggerFactory loggerFactory) + public ChartReport(ICheckRepository checkRepository, IProductRepository productRepository, ILoggerFactory loggerFactory) { _checkRepository = checkRepository ?? throw new ArgumentNullException(nameof(checkRepository)); _productRepository = productRepository ?? throw new ArgumentNullException(nameof(productRepository)); _logger = loggerFactory.CreateLogger(); - _connectionString = connectionString ?? throw new ArgumentNullException(nameof(checkRepository)); + } public bool CreateChart(string filePath, DateTime dateTime) @@ -25,7 +25,7 @@ internal class ChartReport { new PdfBuilder(filePath) .AddHeader("Отчет по продажам товаров") - .AddPieChart("Проданные товары за" + dateTime.ToLongDateString(), GetData(dateTime)) // Диаграмма с продуктами + .AddPieChart("Проданные товары", GetData(dateTime)) .Build(); return true; diff --git a/CompShop/CompShop/DocumentsBuilder/TableReport.cs b/CompShop/CompShop/DocumentsBuilder/TableReport.cs index 2158ea4..d9babab 100644 --- a/CompShop/CompShop/DocumentsBuilder/TableReport.cs +++ b/CompShop/CompShop/DocumentsBuilder/TableReport.cs @@ -12,11 +12,10 @@ internal class TableReport internal static readonly string[] Headers = { "Клиент", "Дата", "Количество" }; - public TableReport(IClientRepository clientRepository, ICheckRepository checkRepository, IProductRepository productRepository, ILoggerFactory loggerFactory) + public TableReport(ICheckRepository checkRepository, IProductRepository productRepository, ILoggerFactory loggerFactory) { _checkRepository = checkRepository ?? throw new ArgumentNullException(nameof(checkRepository)); _productRepository = productRepository ?? throw new ArgumentNullException(nameof(productRepository)); - _clientRepository = clientRepository ?? throw new ArgumentNullException(nameof(clientRepository)); _logger = loggerFactory.CreateLogger(); } @@ -25,7 +24,7 @@ internal class TableReport try { new ExcelBuilder(filePath) - .AddHeader("Отчет по продажам товара " + _productRepository.Read(productId).Name, 0, 3) + .AddHeader("Отчет по продажам товара ", 0, 3) .AddParagraph($"за период с {startDate.ToShortDateString()} по {endDate.ToShortDateString()}", 0) .AddTable(new[] { 20, 20, 15 }, GetData(productId, startDate, endDate)) .Build();