From 26ff7a9296b7946f449aba7f969a6845bf370b0c Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Wed, 1 May 2024 15:57:46 +0400 Subject: [PATCH] change HomeController + some refactoring --- .../Controllers/HomeController.cs | 100 +++++++++++++++--- ...Create.cshtml => WithdrawalRequest.cshtml} | 4 +- .../Views/Home/Withdrawals.cshtml | 2 +- 3 files changed, 89 insertions(+), 17 deletions(-) rename Bank/BankManagersClientApp/Views/Home/{WithdrawalCreate.cshtml => WithdrawalRequest.cshtml} (89%) diff --git a/Bank/BankManagersClientApp/Controllers/HomeController.cs b/Bank/BankManagersClientApp/Controllers/HomeController.cs index a719aa2..54f17de 100644 --- a/Bank/BankManagersClientApp/Controllers/HomeController.cs +++ b/Bank/BankManagersClientApp/Controllers/HomeController.cs @@ -13,6 +13,30 @@ namespace BankManagersClientApp.Controllers _logger = logger; } + public IActionResult Privacy() + { + if (APIClient.Manager == null) + { + return Redirect("~/Home/Enter"); + } + return View(APIClient.Manager); + } + + public IActionResult Register() + { + if (APIClient.Manager == null) + { + return Redirect("~/Home/Enter"); + } + return View(); + } + + [HttpGet] + public IActionResult Enter() + { + return View(); + } + public IActionResult Index() { if (APIClient.Manager == null) @@ -22,22 +46,70 @@ namespace BankManagersClientApp.Controllers return View(); } - public IActionResult Privacy() - { - if (APIClient.Manager == null) - { - return Redirect("~/Home/Enter"); - } - return View(); - } + public IActionResult AccountCreate() + { + if (APIClient.Manager == null) + { + return Redirect("~/Home/Enter"); + } + return View(); + } - [HttpGet] - public IActionResult Enter() - { - return View(); - } + public IActionResult AccountUpdate() + { + if (APIClient.Manager == null) + { + return Redirect("~/Home/Enter"); + } + return View(); + } - [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public IActionResult AccountDelete() + { + if (APIClient.Manager == null) + { + return Redirect("~/Home/Enter"); + } + return View(); + } + + public IActionResult Transfers() + { + if (APIClient.Manager == null) + { + return Redirect("~/Home/Enter"); + } + return View(); + } + + public IActionResult TransferCreate() + { + if (APIClient.Manager == null) + { + return Redirect("~/Home/Enter"); + } + return View(); + } + + public IActionResult Withdrawals() + { + if (APIClient.Manager == null) + { + return Redirect("~/Home/Enter"); + } + return View(); + } + + public IActionResult WithdrawalRequest() + { + if (APIClient.Manager == null) + { + return Redirect("~/Home/Enter"); + } + return View(); + } + + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); diff --git a/Bank/BankManagersClientApp/Views/Home/WithdrawalCreate.cshtml b/Bank/BankManagersClientApp/Views/Home/WithdrawalRequest.cshtml similarity index 89% rename from Bank/BankManagersClientApp/Views/Home/WithdrawalCreate.cshtml rename to Bank/BankManagersClientApp/Views/Home/WithdrawalRequest.cshtml index 20eeb29..da6dbea 100644 --- a/Bank/BankManagersClientApp/Views/Home/WithdrawalCreate.cshtml +++ b/Bank/BankManagersClientApp/Views/Home/WithdrawalRequest.cshtml @@ -1,8 +1,8 @@ @{ - ViewData["Title"] = "WithdrawalCreate"; + ViewData["Title"] = "WithdrawalRequest"; }
-

Создание выдач наличных

+

Выдача наличных

diff --git a/Bank/BankManagersClientApp/Views/Home/Withdrawals.cshtml b/Bank/BankManagersClientApp/Views/Home/Withdrawals.cshtml index a9255d0..a28c193 100644 --- a/Bank/BankManagersClientApp/Views/Home/Withdrawals.cshtml +++ b/Bank/BankManagersClientApp/Views/Home/Withdrawals.cshtml @@ -14,7 +14,7 @@ return; }

- Сделать выдачу + Выполнить заявку на выдачу