Еще поделал

This commit is contained in:
Artyom_Yashin 2024-05-01 15:31:11 +04:00
parent 8aef75d227
commit 4972ad851c
6 changed files with 157 additions and 94 deletions

View File

@ -30,21 +30,6 @@
<div class="col-4">Срок действия:</div>
<div class="col-8"><input type="datetime-local" id="expirationdate" name="expirationdate" class="form-control" required /></div>
</div>
<table class="table">
<thead>
<tr>
<th>
Компьютеры
</th>
<th>
Количество
</th>
</tr>
</thead>
<tbody id="table-elements">
</tbody>
</table>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>

View File

@ -11,22 +11,16 @@
<input type="text" name="sum" id="sum" />
</div>
</div>
<div class="row">
<div class="col-4">CVV:</div>
<div class="col-8">
<input type="text" name="cvv" id="cvv" />
</div>
</div>
<div class="row">
<div class="col-4">Отправитель:</div>
<div class="col-8">
<select id="card" name="card" class="form-control" asp-items="@(new SelectList(@ViewBag.Cards, "Id", "Number"))"></select>
<select id="sendercard" name="sendercard" class="form-control" asp-items="@(new SelectList(@ViewBag.Cards, "Id", "Number"))"></select>
</div>
</div>
<div class="row">
<div class="col-4">Получатель:</div>
<div class="col-8">
<select id="card" name="card" class="form-control" asp-items="@(new SelectList(@ViewBag.Cards, "Id", "Number"))"></select>
<select id="recipientcard" name="recipientcard" class="form-control" asp-items="@(new SelectList(@ViewBag.Cards, "Id", "Number"))"></select>
</div>
</div>
</form>

View File

@ -0,0 +1,129 @@
//todo выводить список только для выбранного клиента
@{
ViewData["Title"] = "OperationTransfer";
}
<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">
<select id="operation" name="operation" class="form-control" asp-items="@(new SelectList(@ViewBag.Operations, "Id", "Id"))"></select>
</div>
</div>
<div class="row">
<div class="col-4">Перевод:</div>
<div class="col-8">
<select id="transfer" name="transfer" class="form-control" asp-items="@(new SelectList(@ViewBag.Transfers, "Id", "Id"))"></select>
</div>
</div>
<div class="text-center">
<h4 class="display-4">Перевод</h4>
</div>
<div class="row">
<div class="col-4">Сумма:</div>
<div class="col-8">
<input type="number" readonly name="transfersum" id="transfersum" />
</div>
</div>
<div class="row">
<div class="col-4">Номер счета отправителя:</div>
<div class="col-8">
<input type="text" readonly name="transfersender-number" id="transfersender-number" />
</div>
</div>
<div class="row">
<div class="col-4">Номер счета получателя:</div>
<div class="col-8">
<input type="text" readonly name="treansferrecipient-number" id="transferrecipient-number" />
</div>
</div>
<div class="row">
<div class="col-4">Дата:</div>
<div class="col-8">
<input type="datetime-local" readonly name="transferdate" id="transferdate" />
</div>
</div>
<div class="text-center">
<h4 class="display-4">Операция</h4>
</div>
<div class="row">
<div class="col-4">Сумма:</div>
<div class="col-8">
<input type="text" readonly name="operationsum" id="operationsum" />
</div>
</div>
<div class="row">
<div class="col-4">Отправитель:</div>
<div class="col-8">
<input type="text" readonly name="operationrecipient-number" id="operationrecipient-number" />
</div>
</div>
<div class="row">
<div class="col-4">Получатель:</div>
<div class="col-8">
<input type="text" readonly name="operationrecipient-number" id="operationrecipient-number" />
</div>
</div>
<div class="row">
<div class="col-4">Дата:</div>
<div class="col-8">
<input type="datetime-local" readonly name="operationdate" id="operationdate" />
</div>
</div>
<div class="row">
<div class="col-4"></div>
<div class="col-8"><input type="submit" value="Связать" class="btn btn-danger" /></div>
</div>
</form>
@section Scripts
{
<script>
function checkTrensfer() {
var transfer = $('#transfer').val();
if (transfer) {
$.ajax({
method: "GET",
url: "/Home/GetTransfer",
data: { transferId: transfer },
success: function (result) {
$('#sum').val(result.item1.Sum);
$('#transfersender-number').val(result.item1.senderAccountNumber);
$('#transferrecipient-number').val(result.item1.recipientAccountNumber);
$('#transferdate').val(result.item1.transferTime);
}
});
};
}
function checkOperation() {
var operation = $('#operation').val();
if (operation) {
$.ajax({
method: "GET",
url: "/Home/GetOperation",
data: { operationId: operation },
success: function (result) {
$('#sum').val(result.item1.Sum);
$('#operationsender-number').val(result.item1.senderCardNumber);
$('#operationrecipient-number').val(result.item1.recipientCardNumber);
$('#operationdate').val(result.item1.transferTime);
}
});
};
}
checkTransfer();
checkOperation();
$('#transfer').on('change', function () {
checkTransfer();
});
$('#operation').on('change', function () {
checkOperation();
});
</script>
}

View File

@ -26,7 +26,10 @@
Сумма
</th>
<th>
Время выполнения
Время создания
</th>
<th>
Статус
</th>
</tr>
</thead>
@ -46,6 +49,10 @@
@Html.DisplayFor(modelItem =>
item.RequestTime)
</td>
<td>
@Html.DisplayFor(modelItem =>
item.Status)
</td>
</tr>
}
</tbody>

View File

@ -1,53 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - BankClientApp</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" />
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bgwhite border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Компьютерный магазин</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex flex-smrow-reverse">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Карты</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Enter">Вход</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2020 - Абстрактный магазин - <a asp-area="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
</div>
</footer>
<script src="~/js/site.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false)
</body>
</html>

View File

@ -5,28 +5,32 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - BankClientApp</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/BankClientApp.styles.css" asp-append-version="true" />
<link rel="stylesheet" href="~/css/site.css" />
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">BankClientApp</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bgwhite border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Компьютерный магазин</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<div class="navbar-collapse collapse d-sm-inline-flex flex-smrow-reverse">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Карты</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Enter">Вход</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Register">Регистрация</a>
</li>
</ul>
</div>
@ -38,15 +42,12 @@
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2024 - BankClientApp - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
&copy; 2020 - Абстрактный магазин - <a asp-area="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
@RenderSection("Scripts", required: false)
</body>
</html>
</html>