Front Cahshier

This commit is contained in:
shadowik 2023-05-19 22:23:50 +04:00
parent 50c28825f8
commit 7c08d94a58
23 changed files with 138 additions and 62 deletions

View File

@ -52,7 +52,7 @@ namespace BankYouBankruptCashierApp.Controllers
//изменение данных Post-ом
[HttpPost]
public void Privacy(string login, string password, string name, string surname, string patronymic, string telephone, string email)
public void Privacy(string login, string password, string name, string surname, string patronymic, string telephone)
{
if (APICashier.Cashier == null)
{
@ -61,7 +61,7 @@ namespace BankYouBankruptCashierApp.Controllers
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(name)
|| string.IsNullOrEmpty(surname) || string.IsNullOrEmpty(patronymic)
|| string.IsNullOrEmpty(telephone) || string.IsNullOrEmpty(email))
|| string.IsNullOrEmpty(telephone))
{
throw new Exception("Введите логин, пароль, ФИО и телефон");
}
@ -83,9 +83,8 @@ namespace BankYouBankruptCashierApp.Controllers
APICashier.Cashier.Email = login;
APICashier.Cashier.Password = password;
APICashier.Cashier.Telephone = telephone;
APICashier.Cashier.Email = email;
Response.Redirect("Index");
Response.Redirect("Enter");
}
[HttpGet]
@ -112,6 +111,13 @@ namespace BankYouBankruptCashierApp.Controllers
Response.Redirect("Enter");
}
[HttpPost]
public IActionResult Logout()
{
APICashier.Cashier = null;
return Redirect("~/Home/Enter");
}
#endregion
#region Вывод ошибок

View File

@ -29,10 +29,7 @@
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Начислить" class="btn btn-primary" />
</div>
<input type="submit" style="width: 100%" value="Начислить" class="btn btn-warning" />
</div>
</form>

View File

@ -29,10 +29,7 @@
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Снять" class="btn btn-primary" />
</div>
<input type="submit" style="width: 100%" value="Снять" class="btn btn-warning" />
</div>
</form>

View File

@ -33,7 +33,7 @@
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Создать" class="btn btn-primary" />
<input type="submit" value="Создать" class="btn btn-warning" />
</div>
</div>
</form>

View File

@ -29,10 +29,7 @@
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Сформировать отчёт" class="btn btn-primary" />
</div>
<input type="submit" style="width:100%" value="Сформировать отчёт" class="btn btn-warning" />
</div>
<hr class="mt-5 mb-3" />
@if (Model != null)

View File

@ -11,17 +11,14 @@
</div>
<form method="post">
<div class="row">
<div class="row mb-2">
<div class="row">Номер счета:</div>
<select id="accountId" name="accountId" class="form-control" asp-items="@(new SelectList( @ViewBag.Accounts, "Id", "AccountNumber"))">
<option disabled selected>Выберите счёт</option>
</select>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Выбрать" class="btn btn-primary"/>
</div>
<input style="width:100%;" type="submit" value="Выбрать" class="btn btn-warning" />
</div>
</form>
@ -67,7 +64,8 @@
datasets: [{
label: 'Денег в этом месяце',
data: data,
borderWidth: 1
borderWidth: 1,
backgroundColor: 'rgb(255, 165, 0)'
}]
},
options: {

View File

@ -1,5 +1,5 @@
@{
ViewData["Title"] = "Страница пользователя";
ViewData["Title"] = "Страница кассира";
}
<div class="text-center">

View File

@ -21,7 +21,7 @@
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Вход" class="btn btn-primary" />
<input type="submit" value="Вход" class="btn btn-warning" />
</div>
</div>
</form>

View File

@ -29,9 +29,6 @@
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Перевести" class="btn btn-primary" />
</div>
<input type="submit" style="width: 100%" value="Перевести" class="btn btn-warning" />
</div>
</form>

View File

@ -32,6 +32,9 @@
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>
<div class="col-4">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="Privacy">Coхранить</button>
<button class="btn btn-lg btn-warning btn-block mr-2" type="submit" asp-controller="Home" asp-action="Logout">Выйти из аккаунта</button>
</div>
</div>
</form>

View File

@ -45,7 +45,7 @@
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Регистрация" class="btn btn-primary" />
<input type="submit" value="Регистрация" class="btn btn-warning" />
</div>
</div>
</form>

View File

@ -16,14 +16,14 @@
<div class="mb-4 mb-md-0 aos-init aos-animate col-md-3" sf-type="container" sf-label="Column" sf-anim-delay="1.5" data-aos="fade-down" data-aos-delay="400" sf-uid="4">
<div sf-type="container" sf-label="Container" class="py-15 h-100 bg-bg-2" sf-uid="5">
<form method="post">
<select id="accountId" name="accountId" class="form-control" asp-items="@(new SelectList(ViewBag.Accounts, "Id", "AccountNumber"))">
<select id="accountId" name="accountId" class="form-control mb-2" asp-items="@(new SelectList(ViewBag.Accounts, "Id", "AccountNumber"))">
<option disabled selected>Выберите счёт</option>
</select>
<div>
<input class="btn btn-primary mt-3" type="submit" value="Submit" />
<div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" style="width: 100%;" type="submit" asp-controller="Home" asp-action="CreateCashierExcelReport">Создать отчёт по аккаунтам</button>
</div>
<div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateCashierExcelReport">Создать отчёт по заявкам снятия</button>
<button class="btn btn-lg btn-warning btn-block" style="width: 100%;" type="submit" asp-controller="Home" asp-action="CreateCashierExcelReport">Создать отчёт по заявкам снятия</button>
</div>
</form>
</div>

View File

@ -15,6 +15,10 @@
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<style>
html {
font-size: 19px;
}
body {
margin-bottom: 60px;
background-color: #cdcdcd;
@ -131,7 +135,7 @@
else
{
<div class="col-md-3 text-end">
<a class="btn btn-warning me-2" id="exit" name="exit" asp-controller="Home" asp-action="Privacy">Личный кабинет</a>
<a class="btn btn-warning me-2" id="exit" name="exit" asp-controller="Home" asp-action="Privacy">@APICashier.Cashier.Surname @APICashier.Cashier.Name</a>
</div>
}
}

View File

@ -108,6 +108,53 @@ namespace BankYouBankruptClientApp.Controllers
return Redirect("~/Home/Enter");
}
[HttpGet]
public IActionResult Privacy()
{
if (APIClient.Client == null)
{
return Redirect("~/Home/Enter");
}
return View(APIClient.Client);
}
[HttpPost]
public void Privacy(string login, string password, string name, string surname, string patronymic, string telephone)
{
if (APIClient.Client == null)
{
throw new Exception("Вы как сюда попали? Суда вход только авторизованным");
}
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(name)
|| string.IsNullOrEmpty(surname) || string.IsNullOrEmpty(patronymic)
|| string.IsNullOrEmpty(telephone))
{
throw new Exception("Введите логин, пароль, ФИО и телефон");
}
APIClient.PostRequest("/api/Client/UpdateData", new ClientBindingModel
{
Id = APIClient.Client.Id,
Name = name,
Surname = surname,
Patronymic = patronymic,
Telephone = telephone,
Email = login,
Password = password
});
APIClient.Client.Name = name;
APIClient.Client.Surname = surname;
APIClient.Client.Patronymic = patronymic;
APIClient.Client.Email = login;
APIClient.Client.Password = password;
APIClient.Client.Telephone = telephone;
Response.Redirect("Enter");
}
#endregion
#region Карты

View File

@ -31,9 +31,6 @@
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Создание" class="btn btn-warning" />
</div>
<input type="submit" value="Создание" style="width: 100%" class="btn btn-warning" />
</div>
</form>

View File

@ -19,9 +19,6 @@
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Создание" class="btn btn-warning" />
</div>
<input type="submit" value="Создание" style="width: 100%" class="btn btn-warning" />
</div>
</form>

View File

@ -19,9 +19,6 @@
</div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<input type="submit" value="Создание" class="btn btn-warning" />
</div>
<input type="submit" style="width: 100%" value="Создание" class="btn btn-warning" />
</div>
</form>

View File

@ -22,10 +22,9 @@
<input id="dateTo" name="dateTo" class="form-control" type="date" />
</div>
</div>
<hr class="mt-5 mb-3" />
<div class="row">
<div class="col">
<input id="createReport" type="submit" value="Сформировать отчёт" class="btn btn-warning" />
</div>
<input id="createReport" style="width:100%;" type="submit" value="Сформировать отчёт" class="btn btn-warning" />
</div>
<hr class="mt-5 mb-3" />
@if (Model != null)

View File

@ -11,7 +11,7 @@
</div>
<form method="post">
<div class="row">
<div class="row mb-2">
<div class="row">Номер счета:</div>
<div class="col">
<select id="cardId" name="cardId" class="form-control" asp-items="@(new SelectList( @ViewBag.Cards, "Id", "Number"))"></select>
@ -19,7 +19,7 @@
</div>
<div class="row">
<div class="col">
<input type="submit" value="Выбрать" class="btn btn-warning"/>
<input style="width: 100%" type="submit" value="Выбрать" class="btn btn-warning"/>
</div>
</div>
</form>

View File

@ -0,0 +1,40 @@
@using BankYouBankruptContracts.ViewModels.Client.Default
@model ClientViewModel
@{
ViewData["Title"] = "Личный кабинет";
}
<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=@Html.DisplayFor(modelItem => Model.Email) /></div>
</div>
<div class="row">
<div class="col-4">Пароль:</div>
<div class="col-8"><input type="password" name="password" value=@Html.DisplayFor(modelItem => Model.Password) /></div>
</div>
<div class="row">
<div class="col-4">Имя:</div>
<div class="col-8"><input type="text" name="name" value=@Html.DisplayFor(modelItem => Model.Name) /></div>
<div class="col-4">Фамилия:</div>
<div class="col-8"><input type="text" name="surname" value=@Html.DisplayFor(modelItem => Model.Surname) /></div>
<div class="col-4">Отчество:</div>
<div class="col-8"><input type="text" name="patronymic" value=@Html.DisplayFor(modelItem => Model.Patronymic) /></div>
</div>
<div class="row">
<div class="col-4">Телефон:</div>
<div class="col-8"><input type="text" name="telephone" value=@Html.DisplayFor(modelItem => Model.Telephone) /></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="Privacy">Coхранить</button>
<button class="btn btn-lg btn-warning btn-block mr-2" type="submit" asp-controller="Home" asp-action="Logout">Выйти из аккаунта</button>
</div>
</div>
</form>

View File

@ -16,6 +16,7 @@
<div class="mb-4 mb-md-0 aos-init aos-animate col-md-3" sf-type="container" sf-label="Column" sf-anim-delay="1.5" data-aos="fade-down" data-aos-delay="400" sf-uid="4">
<div sf-type="container" sf-label="Container" class="py-15 h-100 bg-bg-2" sf-uid="5">
<form method="post">
<h3>Карты:</h3>
@for (var item = 0; item < @Model.Cards.Count(); item++)
{
<div class="form-check form-switch">
@ -25,17 +26,18 @@
<input type="hidden" asp-for="@Model.Cards[item].LabelName" />
</div>
}
<hr>
<div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="ReportWithCards">Создать отчёт</button>
<button style="width:100%" class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="ReportWithCards">Создать отчёт</button>
</div>
<div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateExcelReport">Создать отчёт по переводам</button>
<button style="width:100%" class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateExcelReport">Создать отчёт по переводам</button>
</div>
<div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateCreditingExcelReport">Создать отчёт по пополнениям</button>
<button style="width:100%" class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateCreditingExcelReport">Создать отчёт по пополнениям</button>
</div>
<div class="mb-2">
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateDebitingExcelReport">Создать отчёт по снятиям</button>
<button style="width:100%" class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="CreateDebitingExcelReport">Создать отчёт по снятиям</button>
</div>
</form>
</div>

View File

@ -50,10 +50,9 @@
</div>
}
else {
<form method="post" class="col-md-3 text-end">
<label for="exit" class="text-light">@APIClient.Client.Name @APIClient.Client.Surname </label>
<button class="btn btn-warning me-2" id="exit" name="exit" type="submit" asp-controller="Home" asp-action="Logout">Выход</button>
</form>
<div class="col-md-3 text-end">
<a class="btn btn-warning me-2" id="exit" name="exit" asp-controller="Home" asp-action="Privacy">@APIClient.Client.Surname @APIClient.Client.Name</a>
</div>
}
}
</header>

View File

@ -140,6 +140,5 @@ namespace BankYouBankruptRestApi.Controllers
}
}
}
}