From 7b7a136b5cd6d2fd228c1d4defef48edd41e794b Mon Sep 17 00:00:00 2001 From: shadowik Date: Wed, 17 May 2023 15:24:20 +0400 Subject: [PATCH 1/2] CreditingFull --- .../Controllers/HomeController.cs | 31 +++++++++++++++++++ .../Views/Home/CreateCrediting.cshtml | 27 ++++++++++++++++ .../Views/Home/CreateDebiting.cshtml | 4 +-- .../Views/Home/CreditingList.cshtml | 2 +- 4 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreateCrediting.cshtml diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs b/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs index 0129b89..bea630d 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs +++ b/BankYouBankrupt/BankYouBankruptClientApp/Controllers/HomeController.cs @@ -202,6 +202,37 @@ namespace BankYouBankruptClientApp.Controllers return View(APIClient.GetRequest>($"api/Client/getUsersCreditings?userId={APIClient.Client.Id}")); } + [HttpGet] + public IActionResult CreateCrediting() + { + if (APIClient.Client == null) + { + return Redirect("~/Home/Enter"); + } + + ViewBag.Cards = APIClient.GetRequest>($"api/Card/GetUsersCardsList?id={APIClient.Client.Id}"); + return View(); + } + + [HttpPost] + public IActionResult CreateCrediting(string cardId, int sum) + { + if (APIClient.Client == null) + { + throw new Exception("Не авторизованы"); + } + + APIClient.PostRequest("api/Card/CreateCreditingOperation", new CreditingBindingModel() + { + CardId = int.Parse(cardId), + Sum = sum, + DateOpen = DateTime.Now, + Status = StatusEnum.Открыта + }); + + return Redirect("~/Home/CreditingList"); + } + #endregion } } \ No newline at end of file diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreateCrediting.cshtml b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreateCrediting.cshtml new file mode 100644 index 0000000..d67cbfd --- /dev/null +++ b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreateCrediting.cshtml @@ -0,0 +1,27 @@ +@{ + ViewData["Title"] = "Операция пополнения"; +} + +
+

Создание операции

+
+
+
+
Номер счета:
+
+ +
+
+
+
Cумма операции:
+
+ +
+
+
+
+
+ +
+
+
\ No newline at end of file diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreateDebiting.cshtml b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreateDebiting.cshtml index 9f14f26..d3a93f4 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreateDebiting.cshtml +++ b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreateDebiting.cshtml @@ -1,9 +1,9 @@ @{ - ViewData["Title"] = "Register"; + ViewData["Title"] = "Операция снятия"; }
-

Создание карты

+

Создание операции

diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreditingList.cshtml b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreditingList.cshtml index 93cc804..1ff2b7c 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreditingList.cshtml +++ b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreditingList.cshtml @@ -18,7 +18,7 @@ return; }

- Пополнить средства + Пополнить средства

From 3ef1163df441131be71deee24bf01b260632b120 Mon Sep 17 00:00:00 2001 From: shadowik Date: Wed, 17 May 2023 15:26:51 +0400 Subject: [PATCH 2/2] Fix text --- .../BankYouBankruptClientApp/Views/Home/CreateCard.cshtml | 2 +- .../BankYouBankruptClientApp/Views/Home/Enter.cshtml | 2 +- .../BankYouBankruptClientApp/Views/Home/Profile.cshtml | 2 +- .../BankYouBankruptClientApp/Views/Home/Register.cshtml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreateCard.cshtml b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreateCard.cshtml index 787b159..993f67b 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreateCard.cshtml +++ b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/CreateCard.cshtml @@ -1,5 +1,5 @@ @{ - ViewData["Title"] = "Register"; + ViewData["Title"] = "Создание карты"; }
diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/Enter.cshtml b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/Enter.cshtml index 067ef37..019802a 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/Enter.cshtml +++ b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/Enter.cshtml @@ -1,5 +1,5 @@ @{ - ViewData["Title"] = "Enter"; + ViewData["Title"] = "Логин"; }
diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/Profile.cshtml b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/Profile.cshtml index bca92be..476cea1 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/Profile.cshtml +++ b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/Profile.cshtml @@ -3,7 +3,7 @@ @model ClientViewModel @{ - ViewData["Title"] = "Home Page"; + ViewData["Title"] = "Страница пользователя"; }
diff --git a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/Register.cshtml b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/Register.cshtml index e2376bf..13e8278 100644 --- a/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/Register.cshtml +++ b/BankYouBankrupt/BankYouBankruptClientApp/Views/Home/Register.cshtml @@ -1,5 +1,5 @@ @{ - ViewData["Title"] = "Register"; + ViewData["Title"] = "Регистрация"; }