From d7a85e2d6557ae5789af7e464209b9477e03951e Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Sun, 26 May 2024 15:42:30 +0400 Subject: [PATCH] end my part of ReportLogic --- .../BusinessLogic/ReportLogic.cs | 29 +++++++++++++++++++ .../OfficePackage/AbstractSaveToExcel.cs | 2 +- .../OfficePackage/DocumentModels/ExcelInfo.cs | 10 ++----- .../OfficePackage/DocumentModels/PdfInfo.cs | 3 +- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/Bank/BankBusinessLogic/BusinessLogic/ReportLogic.cs b/Bank/BankBusinessLogic/BusinessLogic/ReportLogic.cs index eb10163..4a6f2af 100644 --- a/Bank/BankBusinessLogic/BusinessLogic/ReportLogic.cs +++ b/Bank/BankBusinessLogic/BusinessLogic/ReportLogic.cs @@ -53,6 +53,19 @@ namespace BankBusinessLogic.BusinessLogic }), }); } + + public void SaveRequestsComponentsToExcelFile(ReportBindingModel model) + { + _saveToExcel.CreateDoc(new ExcelInfo + { + FileName = model.FileName, + Title = "Список заявок", + Requests = CreateReportRequests(new AccountSearchModel + { + SelectedAccountIds = model.SelectedAccountIds, + }), + }); + } #endregion #region//списки переводов по выбранным картам в формате word и excel @@ -74,6 +87,22 @@ namespace BankBusinessLogic.BusinessLogic { return _accountStorage.GetTransfersWithdrawalsReport(model); } + + public void SaveTransfersWithdrawalsToPdfFile(ReportBindingModel model) + { + _saveToPdf.CreateDoc(new PdfInfo + { + FileName = model.FileName, + Title = "Отчёт по счетам", + DateFrom = model.DateFrom!.Value, + DateTo = model.DateTo!.Value, + TransfersWithdrawals = CreateReportTransfersWithdrawals(new AccountSearchModel + { + DateFrom = model.DateFrom.Value, + DateTo = model.DateTo.Value, + }) + }); + } #endregion } } diff --git a/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToExcel.cs index 53470df..32f613f 100644 --- a/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToExcel.cs +++ b/Bank/BankBusinessLogic/OfficePackage/AbstractSaveToExcel.cs @@ -15,7 +15,7 @@ namespace BankBusinessLogic.OfficePackage /// Создание отчета /// /// - public void CreateReport(ExcelInfo info) + public void CreateDoc(ExcelInfo info) { CreateExcel(info); InsertCellInWorksheet(new ExcelCellParameters diff --git a/Bank/BankBusinessLogic/OfficePackage/DocumentModels/ExcelInfo.cs b/Bank/BankBusinessLogic/OfficePackage/DocumentModels/ExcelInfo.cs index 2211109..0f4ce82 100644 --- a/Bank/BankBusinessLogic/OfficePackage/DocumentModels/ExcelInfo.cs +++ b/Bank/BankBusinessLogic/OfficePackage/DocumentModels/ExcelInfo.cs @@ -11,11 +11,7 @@ namespace BankBusinessLogic.OfficePackage.DocumentModels { public string FileName { get; set; } = string.Empty; public string Title { get; set; } = string.Empty; - public List Transfers - { - get; - set; - } = new(); - - } + public List Transfers { get; set; } = new(); + public List Requests { get; set; } = new(); + } } diff --git a/Bank/BankBusinessLogic/OfficePackage/DocumentModels/PdfInfo.cs b/Bank/BankBusinessLogic/OfficePackage/DocumentModels/PdfInfo.cs index 5376ff5..1cb7cbc 100644 --- a/Bank/BankBusinessLogic/OfficePackage/DocumentModels/PdfInfo.cs +++ b/Bank/BankBusinessLogic/OfficePackage/DocumentModels/PdfInfo.cs @@ -14,5 +14,6 @@ namespace BankBusinessLogic.OfficePackage.DocumentModels public DateTime DateFrom { get; set; } public DateTime DateTo { get; set; } public List OperationsRequests { get; set; } = new(); - } + public List TransfersWithdrawals { get; set; } = new(); + } }