Правки
This commit is contained in:
parent
a0a8308343
commit
4da35faa7a
@ -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,
|
||||
|
@ -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");
|
||||
|
@ -9,13 +9,13 @@
|
||||
<div class="row mb-2">
|
||||
<div class="col-4">Номер счёта:</div>
|
||||
<div class="col-8">
|
||||
<select id="account" name="accountId" class="form-control" asp-items="@(new SelectList( @ViewBag.Accounts, "Id", "FullName"))"></select>
|
||||
<select id="account" name="accountId" class="form-control" asp-items="@(new SelectList( @ViewBag.Accounts, "Id", "AccountNumber"))"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-4">Номер карты:</div>
|
||||
<div class="col-8">
|
||||
<input type="text" id="cardnumber" class="form-control" name="cardnumber" required />
|
||||
<input type="text" id="number" class="form-control" name="number" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
@ -49,7 +49,7 @@
|
||||
return str;
|
||||
}
|
||||
|
||||
document.getElementById("cardnumber").value = createNum(16);
|
||||
document.getElementById("number").value = createNum(16);
|
||||
let year = new Date();
|
||||
year.setFullYear(year.getFullYear() + 5)
|
||||
document.getElementById("period").valueAsDate = new Date(year);
|
||||
|
Loading…
Reference in New Issue
Block a user