From c77ed0a6e546514bcd28c8fa7e290758267748ee Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Sun, 26 May 2024 17:51:03 +0400 Subject: [PATCH] [HttpPost] public void RequestsListReport(string format, List accounts) --- .../Controllers/HomeController.cs | 27 +++++++++++++++++-- .../Views/Home/RequestsListReport.cshtml | 12 ++++++--- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/Bank/BankManagersClientApp/Controllers/HomeController.cs b/Bank/BankManagersClientApp/Controllers/HomeController.cs index 5902ee8..46a5af9 100644 --- a/Bank/BankManagersClientApp/Controllers/HomeController.cs +++ b/Bank/BankManagersClientApp/Controllers/HomeController.cs @@ -464,7 +464,6 @@ namespace BankManagersClientApp.Controllers #region//Reports [HttpGet] - public IActionResult RequestsListReport() { if (APIClient.Client == null) @@ -473,7 +472,31 @@ namespace BankManagersClientApp.Controllers } ViewBag.Accounts = APIClient.GetRequest>($"api/account/getaccountlist?managerid={APIClient.Client.Id}"); return View(); - } + } + + [HttpPost] + public void RequestsListReport(string format, List accounts) + { + if (APIClient.Client == null) + throw new Exception("Вы как суда попали? Суда вход только авторизованным"); + switch (format) + { + case "word": + APIClient.PostRequest("/api/report/saverequeststoword", new ReportBindingModel + { + SelectedAccountIds = accounts + }); + break; + case "excel": + APIClient.PostRequest("/api/report/saverequeststoexcel", new ReportBindingModel + { + SelectedAccountIds = accounts + }); + break; + default: + break; + } + } [HttpGet] public IActionResult TransfersWithdrawalsListReport() diff --git a/Bank/BankManagersClientApp/Views/Home/RequestsListReport.cshtml b/Bank/BankManagersClientApp/Views/Home/RequestsListReport.cshtml index 0abab9f..93834a3 100644 --- a/Bank/BankManagersClientApp/Views/Home/RequestsListReport.cshtml +++ b/Bank/BankManagersClientApp/Views/Home/RequestsListReport.cshtml @@ -18,10 +18,14 @@ } - - - - + +
+ + +
+
+ +