This commit is contained in:
abazov73 2023-05-19 23:50:09 +04:00
commit 85c1a88c19
8 changed files with 252 additions and 12 deletions

View File

@ -218,7 +218,7 @@ namespace BankOperatorApp.Controllers
return View();
}
[HttpPost]
public void CreateCurrencyPurchasr(string amount, int currencyId)
public void CreateCurrencyPurchase(string amount, int currencyId)
{
if (APIClient.BankOperator == null)
{
@ -226,10 +226,12 @@ namespace BankOperatorApp.Controllers
}
_currencyPurchaseLogic.Create(new CurrencyPurchaseBindingModel
{ BankOperatorId = APIClient.BankOperator.Id,
{ BankOperatorId = APIClient.BankOperator.Id,
Amount = (float)Convert.ToDouble(amount),
CurrencyId = currencyId });
Response.Redirect("Transfers");
CurrencyId = currencyId,
});
Response.Redirect("CurrencyPurchases");
}
}
}

View File

@ -0,0 +1,32 @@
@using BankContracts.ViewModels
@model CreditProgramViewModel
@{
ViewData["Title"] = "CreditProgram";
}
<div class="text-center">
<h1>Кредитная программа№@Model.Id</h1>
</div>
<div class="text-center">
@{
if (Model == null)
{
<h3 class="display-4">Авторизируйтесь</h3>
return;
}
}
<h3 class="display-4">ФИО оператора: @Model.BankOperatorFIO</h3>
<h3 class="display-4">Название кредитной программы: @Model.Name</h3>
<h3 class="display-4">Процент кредитования: @Model.Percent</h3>
<h3 class="display-4">Валюты:</h3>
@foreach (var currency in Model.CreditProgramCurrencies)
{
<h5 class="display-4"><b>Валюта №@currency.Value.Id</b>,
@currency.Value.Name</h5>
}
</div>

View File

@ -0,0 +1,5 @@
@*
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}

View File

@ -0,0 +1,68 @@
@using BankContracts.ViewModels
@model List<CurrencyPurchaseViewModel>
@{
ViewData["Title"] = "CurrencyPurchases";
}
<div class="text-center">
<h1 class="display-4">Покупки валют</h1>
</div>
<div class="text-center">
@{
if (Model == null)
{
<h3 class="display-4">Авторизируйтесь</h3>
return;
}
<p>
<a asp-action="CreateCurrencyPurchase">Купить валюту</a>
</p>
<table class="table">
<thead>
<tr>
<th>
Номер покупки
</th>
<th>
Дата покупки
</th>
<th>
Название валюты
</th>
<th>
Количество валюты
</th>
<th>
ФИО оператора
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.PurchaseDate )
</td>
<td>
@Html.DisplayFor(modelItem => item.CurrencyName)
</td>
<td>
@Html.DisplayFor(modelItem => item.Amount)
</td>
<td>
@Html.DisplayFor(modelItem => item.BankOperatorName)
</td>
</tr>
}
</tbody>
</table>
}
</div>

View File

@ -0,0 +1,21 @@
@{
ViewData["Title"] = "Enter";
}
<div class="text-center">
<h2 class="display-4">Вход в приложение</h2>
</div>
<form method="post">
<div class="row">
<div class="col-4">Логин:</div>
<div class="col-8"><input type="text" name="login" /></div>
</div>
<div class="row">
<div class="col-4">Пароль:</div>
<div class="col-8"><input type="password" name="password" /></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Вход" class="btn btn-primary" /></div>
</div>
</form>

View File

@ -1,8 +1,57 @@
@{
@using BankContracts.ViewModels
@model List<CurrencyViewModel>
@{
ViewData["Title"] = "Home Page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
<h1 class="display-4">Валюты</h1>
</div>
<div class="text-center">
@{
if (Model == null)
{
<h3 class="display-4">Авторизируйтесь!</h3>
return;
}
<p>
<a asp-action="CreateCurrency">Создать валюту</a>
</p>
<table class="table">
<thead>
<tr>
<th>
Номер
</th>
<th>
Название валюты
</th>
<th>
ФИО оператора
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.BankOperatorName)
</td>
</tr>
}
</tbody>
</table>
}
</div>

View File

@ -1,6 +1,36 @@
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
@using BankContracts.ViewModels
<p>Use this page to detail your site's privacy policy.</p>
@model BankOperatorViewModel
@{
ViewData["Title"] = "Privacy Policy";
}
<div class="text-center">
<h2 class="display-4">Личные данные</h2>
</div>
<form method="post">
<div class="row">
<div class="col-4">Логин:</div>
<div class="col-8"><input type="text" name="login" value="@Model.Login"/></div>
</div>
<div class="row">
<div class="col-4">Пароль:</div>
<div class="col-8"><input type="password" name="password" value="@Model.Password"/></div>
</div>
<div class="row">
<div class="col-4">Фамилия:</div>
<div class="col-8"><input type="text" name="lastname" value="@Model.LastName"/></div>
</div>
<div class="row">
<div class="col-4">Имя:</div>
<div class="col-8"><input type="text" name="firstlename" value="@Model.FirstName"/></div>
</div>
<div class="row">
<div class="col-4">Отчество:</div>
<div class="col-8"><input type="text" name="middlename" value="@Model.MiddleName"/></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>
</div>
</form>

View File

@ -0,0 +1,33 @@
@{
ViewData["Title"] = "Register";
}
<div class="text-center">
<h2 class="display-4">Регистрация</h2>
</div>
<form method="post">
<div class="row">
<div class="col-4">Логин:</div>
<div class="col-8"><input type="text" name="login" /></div>
</div>
<div class="row">
<div class="col-4">Пароль:</div>
<div class="col-8"><input type="password" name="password" /></div>
</div>
<div class="row">
<div class="col-4">Фамилия:</div>
<div class="col-8"><input type="text" name="lastname" /></div>
</div>
<div class="row">
<div class="col-4">Имя:</div>
<div class="col-8"><input type="text" name="firstname" /></div>
</div>
<div class="row">
<div class="col-4">Отчество (необязательно):</div>
<div class="col-8"><input type="text" name="middlename" /></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Регистрация" class="btn btn-primary" /></div>
</div>
</form>