From 3891f325fce9fcf78910e6fc2d2e303184a8f80f Mon Sep 17 00:00:00 2001 From: Artyom_Yashin Date: Tue, 28 May 2024 22:01:25 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=90=D0=99=D0=9B=D0=AB=20=D0=A1=D0=9A?= =?UTF-8?q?=D0=90=D0=A7=D0=98=D0=92=D0=90=D0=AE=D0=A2=D0=A1=D0=AF=20=D0=A7?= =?UTF-8?q?=D0=95=D0=A0=D0=95=D0=97=20=D0=98=D0=9D=D0=95=D0=A2!!!!!!=205?= =?UTF-8?q?=20=D0=9C=D0=98=D0=9D=D0=A3=D0=A2=20=D0=90=D0=90=D0=90=D0=90?= =?UTF-8?q?=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90?= =?UTF-8?q?=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90?= =?UTF-8?q?=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90?= =?UTF-8?q?=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90?= =?UTF-8?q?=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90=D0=90?= =?UTF-8?q?=D0=90=D0=90=D0=90=D0=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HomeController.cs | 18 +++++++++++++++--- .../Controllers/HomeController.cs | 18 +++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Bank/BankClientApp/Controllers/HomeController.cs b/Bank/BankClientApp/Controllers/HomeController.cs index f24006e..27e7ac3 100644 --- a/Bank/BankClientApp/Controllers/HomeController.cs +++ b/Bank/BankClientApp/Controllers/HomeController.cs @@ -693,20 +693,32 @@ namespace BankClientApp.Controllers case "word": APIClient.PostRequest($"api/report/savetransferstoword", new ReportBindingModel { - FileName = "C:\\Users\\123\\Desktop\\wordfile.docx", + FileName = "C:\\forpdf\\wordfile.docx", SelectedCardIds = cards, }); + Response.Redirect("ReportWord"); break; case "excel": APIClient.PostRequest($"api/report/savetransferstoexcel", new ReportBindingModel { - FileName = "C:\\Users\\123\\Desktop\\excelfile.xlsx", + FileName = "C:\\forpdf\\excelfile.xlsx", SelectedCardIds = cards, }); + Response.Redirect("ReportExcel"); break; default: break; } - Response.Redirect("TransferListReport"); + } + + [HttpGet] + public IActionResult ReportWord() + { + return new PhysicalFileResult("C:\\forpdf\\wordfile.docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"); + } + [HttpGet] + public IActionResult ReportExcel() + { + return new PhysicalFileResult("C:\\forpdf\\excelfile.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); } #endregion diff --git a/Bank/BankManagersClientApp/Controllers/HomeController.cs b/Bank/BankManagersClientApp/Controllers/HomeController.cs index 812afc2..52463c8 100644 --- a/Bank/BankManagersClientApp/Controllers/HomeController.cs +++ b/Bank/BankManagersClientApp/Controllers/HomeController.cs @@ -488,20 +488,32 @@ namespace BankManagersClientApp.Controllers APIClient.PostRequest("/api/report/saverequeststoword", new ReportBindingModel { SelectedAccountIds = accounts, - FileName = "C:\\Users\\user\\Downloads\\RequestList.docx", + FileName = "C:\\forpdf\\wordfile.docx", }); + Response.Redirect("ReportWord"); break; case "excel": APIClient.PostRequest("/api/report/saverequeststoexcel", new ReportBindingModel { SelectedAccountIds = accounts, - FileName = "C:\\Users\\user\\Downloads\\RequestList.xlsx", + FileName = "C:\\forpdf\\excelfile.xlsx", }); + Response.Redirect("ReportExcel"); break; default: break; } - Response.Redirect("Index"); + } + + [HttpGet] + public IActionResult ReportWord() + { + return new PhysicalFileResult("C:\\forpdf\\wordfile.docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"); + } + [HttpGet] + public IActionResult ReportExcel() + { + return new PhysicalFileResult("C:\\forpdf\\excelfile.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); } [HttpGet]