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();