From f74486a4dfb9204b747d9c666b643c6a500efd2c Mon Sep 17 00:00:00 2001 From: Artyom_Yashin Date: Sun, 26 May 2024 17:55:39 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BD=D1=82=D1=80=D0=BE=D0=BB=D0=BB=D0=B5=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HomeController.cs | 21 ++++++++-- .../Views/Home/TransferListReport.cshtml | 8 +++- .../Controllers/ReportController.cs | 41 +++++++++++++++++++ 3 files changed, 64 insertions(+), 6 deletions(-) create mode 100644 Bank/BankRestApi/Controllers/ReportController.cs diff --git a/Bank/BankClientApp/Controllers/HomeController.cs b/Bank/BankClientApp/Controllers/HomeController.cs index b90ec0f..38bd465 100644 --- a/Bank/BankClientApp/Controllers/HomeController.cs +++ b/Bank/BankClientApp/Controllers/HomeController.cs @@ -512,15 +512,28 @@ namespace BankClientApp.Controllers } [HttpPost] - public void TransferListReport(List cards, bool word, bool excel) + public void TransferListReport(List cards, string format) { if (APIClient.Client == null) { throw new Exception("Вы как суда попали? Суда вход только авторизованным"); } - APIClient.PostRequest($"api/report/savetransferword", new ReportBindingModel{ - - }); + switch (format) + { + case "word": + APIClient.PostRequest($"api/report/savetransferstoword", new ReportBindingModel + { + SelectedCardIds = cards, + }); + break; + case "excel": + APIClient.PostRequest($"api/report/savetransferstoword", new ReportBindingModel + { + SelectedCardIds = cards, + }); + break; + default: break; + } } #endregion diff --git a/Bank/BankClientApp/Views/Home/TransferListReport.cshtml b/Bank/BankClientApp/Views/Home/TransferListReport.cshtml index 79b2229..91fe67b 100644 --- a/Bank/BankClientApp/Views/Home/TransferListReport.cshtml +++ b/Bank/BankClientApp/Views/Home/TransferListReport.cshtml @@ -18,9 +18,13 @@ } - + +
+ - +
+
+
diff --git a/Bank/BankRestApi/Controllers/ReportController.cs b/Bank/BankRestApi/Controllers/ReportController.cs new file mode 100644 index 0000000..7682a05 --- /dev/null +++ b/Bank/BankRestApi/Controllers/ReportController.cs @@ -0,0 +1,41 @@ +using BankContracts.BindingModels; +using BankContracts.BusinessLogicsContracts; +using Microsoft.AspNetCore.Mvc; + +namespace BankRestApi.Controllers +{ + [Route("api/[controller]/[action]")] + [ApiController] + public class ReportController + { + private readonly ILogger _logger; + private readonly IReportLogic _logic; + + public ReportController(ILogger logger, IReportLogic logic) + { + _logger = logger; + _logic = logic; + } + + [HttpPost] + public void SaveRequestsToWord(ReportBindingModel? model) + { + + } + [HttpPost] + public void SaveRequestsToExcel(ReportBindingModel? model) + { + + } + [HttpPost] + public void SaveTransfersToWord(ReportBindingModel? model) + { + + } + [HttpPost] + public void SaveTransfersToExcel(ReportBindingModel? model) + { + + } + } +}