From e2d7a4ae143d313eb174959e575063b3d01d8e30 Mon Sep 17 00:00:00 2001 From: shadowik Date: Sat, 20 May 2023 04:14:32 +0400 Subject: [PATCH] ReportSuccess --- .../Controllers/HomeController.cs | 32 ++++++++++++------- .../Views/Home/ReportSuccess.cshtml | 16 ++++++++++ 2 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 BankYouBankrupt/BankYouBankruptClientApp/Views/Home/ReportSuccess.cshtml diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs b/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs index d86b531..e63d530 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs +++ b/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs @@ -341,9 +341,19 @@ namespace BankYouBankruptClientApp.Controllers CardList = cards.Where(x => x.IsChecked).Select(x => x.Id).ToList() }); - return Redirect("~/Home/Enter"); + return Redirect("ReportSuccess"); } + [HttpGet] + public IActionResult ReportSuccess() { + if (APIClient.Client == null) + { + throw new Exception("Не авторизованы"); + } + return View(); + } + + //отчёт клиента по пополнениям [HttpPost] public IActionResult CreateCreditingExcelReport(List cards) @@ -358,8 +368,8 @@ namespace BankYouBankruptClientApp.Controllers CardList = cards.Where(x => x.IsChecked).Select(x => x.Id).ToList() }); - return Redirect("~/Home/Enter"); - } + return Redirect("ReportSuccess"); + } //отчёт клиента по снятиям [HttpPost] @@ -375,8 +385,8 @@ namespace BankYouBankruptClientApp.Controllers CardList = cards.Where(x => x.IsChecked).Select(x => x.Id).ToList() }); - return Redirect("~/Home/Enter"); - } + return Redirect("ReportSuccess"); + } #endregion @@ -396,8 +406,8 @@ namespace BankYouBankruptClientApp.Controllers CardList = cards.Where(x => x.IsChecked).Select(x => x.Id).ToList() }); - return Redirect("~/Home/Enter"); - } + return Redirect("ReportSuccess"); + } //отчёт клиента по пополнениям [HttpPost] @@ -413,8 +423,8 @@ namespace BankYouBankruptClientApp.Controllers CardList = cards.Where(x => x.IsChecked).Select(x => x.Id).ToList() }); - return Redirect("~/Home/Enter"); - } + return Redirect("ReportSuccess"); + } //отчёт клиента по снятиям [HttpPost] @@ -430,8 +440,8 @@ namespace BankYouBankruptClientApp.Controllers CardList = cards.Where(x => x.IsChecked).Select(x => x.Id).ToList() }); - return Redirect("~/Home/Enter"); - } + return Redirect("ReportSuccess"); + } #endregion diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/ReportSuccess.cshtml b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/ReportSuccess.cshtml new file mode 100644 index 0000000..81d53b4 --- /dev/null +++ b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/ReportSuccess.cshtml @@ -0,0 +1,16 @@ +@using BankYouBankruptСlientApp +@{ + ViewData["Title"] = "Список карт"; +} + + +
+ @{ + if (APIClient.Client == null) + { +

Сначала авторизируйтесь

+ return; + } + } +

Отчeт был отправлен на почту @APIClient.Client.Email

+
\ No newline at end of file