diff --git a/Bank/BankCashierApp/Controllers/HomeController.cs b/Bank/BankCashierApp/Controllers/HomeController.cs index 3905432..c499a2b 100644 --- a/Bank/BankCashierApp/Controllers/HomeController.cs +++ b/Bank/BankCashierApp/Controllers/HomeController.cs @@ -257,7 +257,7 @@ namespace BankCashierApp.Controllers return Redirect("ErrorPage"); } - APICashier.PostRequest("/api/Account/Register", new AccountBindingModel + APICashier.PostRequest("/api/Account/RegisterAccount", new AccountBindingModel { CashierId = APICashier.Cashier.Id, ClientId = clientId, diff --git a/Bank/BankClientApp/Controllers/HomeController.cs b/Bank/BankClientApp/Controllers/HomeController.cs index 13c10b2..bac904d 100644 --- a/Bank/BankClientApp/Controllers/HomeController.cs +++ b/Bank/BankClientApp/Controllers/HomeController.cs @@ -8,6 +8,7 @@ using BankContracts.ViewModels.Reports; using BankContracts.ViewModels.Reports.Client; using BankDataModels.Enums; using Microsoft.AspNetCore.Mvc; +using Microsoft.IdentityModel.Tokens; using System.Diagnostics; namespace BankClientApp.Controllers @@ -189,7 +190,7 @@ namespace BankClientApp.Controllers } [HttpPost] - public IActionResult CreateCard(string accountId, string number, string cvc, DateTime period) + public IActionResult CreateCard(string accountId, string number, double balance, DateTime period) { if (APIClient.Client == null) { @@ -198,7 +199,7 @@ namespace BankClientApp.Controllers return Redirect("ErrorPage"); } - if (string.IsNullOrEmpty(accountId) || string.IsNullOrEmpty(number) || string.IsNullOrEmpty(cvc) + if (string.IsNullOrEmpty(accountId) || string.IsNullOrEmpty(number) || balance < 0 || period.Year == 0001 || period <= DateTime.Now) { APIClient.SetErrorMessage("Проверьте корректность параметров создаваемой карты"); @@ -211,8 +212,8 @@ namespace BankClientApp.Controllers Id = APIClient.Client.Id, AccountId = int.Parse(accountId), Number = number, + Balance = balance, Period = period, - StatusCard = StatusCard.Открыта }); return Redirect("~/Home/CardsList"); diff --git a/Bank/BankClientApp/Views/Home/CreateCard.cshtml b/Bank/BankClientApp/Views/Home/CreateCard.cshtml index 881299f..794ed50 100644 --- a/Bank/BankClientApp/Views/Home/CreateCard.cshtml +++ b/Bank/BankClientApp/Views/Home/CreateCard.cshtml @@ -9,13 +9,13 @@