мелкие правки визуала и url-ов

This commit is contained in:
Алексей Крюков 2024-05-28 16:17:08 +04:00
parent 9e270387b6
commit ceecd43f7d
11 changed files with 2042 additions and 832 deletions

View File

@ -10,9 +10,13 @@ namespace BankCashierApp
{
public class APICashier
{
private static readonly HttpClient _cashier = new();
private static readonly HttpClient _client = new();
public static string ErrorMessage = string.Empty;
//Вью-модели, необходимые для дальнейшего генерирования запросов к апишке
public static CashierViewModel? Cashier { get; set; } = null;
public static CreditingViewModel? Crediting { get; set; } = null;
public static DebitingViewModel? Debiting { get; set; } = null;
@ -21,13 +25,11 @@ namespace BankCashierApp
public static CardViewModel? Card { get; set; } = null;
public static string ErrorMessage = string.Empty;
public static void Connect(IConfiguration configuration)
{
_cashier.BaseAddress = new Uri(configuration["IPAddress"]);
_cashier.DefaultRequestHeaders.Accept.Clear();
_cashier.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
_client.BaseAddress = new Uri(configuration["IPAddress"]);
_client.DefaultRequestHeaders.Accept.Clear();
_client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
}
public static void SetErrorMessage(string error)
@ -38,8 +40,7 @@ namespace BankCashierApp
//Get-запрос
public static T? GetRequest<T>(string requestUrl)
{
var response = _cashier.GetAsync(requestUrl);
var response = _client.GetAsync(requestUrl);
var result = response.Result.Content.ReadAsStringAsync().Result;
if (response.Result.IsSuccessStatusCode)
@ -58,7 +59,7 @@ namespace BankCashierApp
var json = JsonConvert.SerializeObject(model);
var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = _cashier.PostAsync(requestUrl, data);
var response = _client.PostAsync(requestUrl, data);
var result = response.Result.Content.ReadAsStringAsync().Result;
@ -74,7 +75,7 @@ namespace BankCashierApp
var json = JsonConvert.SerializeObject(model);
var data = new StringContent(json, Encoding.UTF8, "application/json");
var response = _cashier.PostAsync(requestUrl, data);
var response = _client.PostAsync(requestUrl, data);
var result = response.Result.Content.ReadAsStringAsync().Result;

View File

@ -21,6 +21,9 @@ namespace BankCashierApp.Controllers
{
_logger = logger;
}
#region Загрузка главной страницы
//вытаскивает через API клиента Get-запросом список его собственных заказов
[HttpGet]
public IActionResult Index()
@ -33,7 +36,9 @@ namespace BankCashierApp.Controllers
return View(APICashier.GetRequest<List<AccountViewModel>>($"/api/Account/GetAllAccounts"));
}
// Обновление данных пользователя
#endregion
#region Обновление данных пользователя
//изменемение ланных Get-ом
[HttpGet]
@ -53,7 +58,7 @@ namespace BankCashierApp.Controllers
{
if (APICashier.Cashier == null)
{
throw new Exception("Вы как сюда попали? Сюда вход только авторизованным");
throw new Exception("Вы как сюда попали? Суда вход только авторизованным");
}
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(name)
@ -120,9 +125,9 @@ namespace BankCashierApp.Controllers
return Redirect("Enter");
}
#endregion
// Вывод ошибок
#region Вывод ошибок
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
@ -140,9 +145,9 @@ namespace BankCashierApp.Controllers
}
#endregion
// Вход в приложение
#region Вход в приложение
//просто открытие вьюхи
[HttpGet]
@ -174,9 +179,9 @@ namespace BankCashierApp.Controllers
return Redirect("Index");
}
#endregion
// Регистрация
#region Регистрация
//просто открытие вьюхи
[HttpGet]
@ -211,9 +216,9 @@ namespace BankCashierApp.Controllers
return;
}
#endregion
// Открытие нового счёта
#region Открытие нового счёта
//открытие счёта. Получаем и передаём список изделий во вьюху?
[HttpGet]
@ -264,9 +269,9 @@ namespace BankCashierApp.Controllers
return Redirect("Index");
}
#endregion
// Работа с заявками на зачисление
#region Работа с заявками на зачисление
//для страницы "Заявки на зачисление"
[HttpGet]
@ -336,9 +341,9 @@ namespace BankCashierApp.Controllers
return Redirect("Crediting");
}
#endregion
// Работа с заявками на снятие
#region Работа с заявками на снятие
//для страницы "Заявки на снятие"
[HttpGet]
@ -411,7 +416,7 @@ namespace BankCashierApp.Controllers
return Redirect("Debiting");
}
#endregion
//получение номера запрашиваемого счёта для снятия - для работы с начислениями и списаниями
[HttpPost]
@ -448,7 +453,7 @@ namespace BankCashierApp.Controllers
return AccountNumber;
}
// Работа с переводом со счёта на счёт
#region Работа с переводом со счёта на счёт
[HttpGet]
public IActionResult MoneyTransfers()
@ -491,9 +496,9 @@ namespace BankCashierApp.Controllers
return Redirect("Index");
}
#endregion
// Отчёт с выборкой по счетам
#region Отчёт с выборкой по счетам
[HttpGet]
public IActionResult ReportWithAccounts()
@ -603,9 +608,9 @@ namespace BankCashierApp.Controllers
return View(cashWithdrawals.Concat(moneyTransfers).OrderBy(x => x.DateOperation).ToList());
}
#endregion
// Получение отчёта PDF
#region Получение отчёта PDF
[HttpGet]
public IActionResult CreateReport()
@ -658,9 +663,9 @@ namespace BankCashierApp.Controllers
}));
}
#endregion
// Диаграмма
#region Диаграмма
[HttpGet]
public IActionResult Diagram()
@ -700,7 +705,7 @@ namespace BankCashierApp.Controllers
});
}
#endregion
[HttpGet]
public IActionResult ReportSuccess()

View File

@ -1,3 +1,5 @@
using BankCashierApp;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
@ -5,6 +7,8 @@ builder.Services.AddControllersWithViews();
var app = builder.Build();
APICashier.Connect(builder.Configuration);
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{

View File

@ -1,67 +0,0 @@
@using BankContracts.ViewModels
@model List<AccountViewModel>
@{
ViewData["Title"] = "Cписок счетов";
}
<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="CreateAccount">Открыть счёт</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.AccountNumber)
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Patronymic)
</td>
<td>
@Html.DisplayFor(modelItem => item.Balance)
</td>
<td>
@Html.DisplayFor(modelItem => item.DateOpen)
</td>
</tr>
}
</tbody>
</table>
}
</div>

View File

@ -1,19 +1,21 @@
@{
ViewData["Title"] = "Enter";
ViewData["Title"] = "Страница кассира";
}
<div class="text-center">
<h2 class="display-4">Вход в приложение</h2>
<h1 class="display-4">Страница кассира</h1>
</div>
<form method="post">
<div class="mb-3">
<label for="login" class="form-label">Логин:</label>
<input type="text" name="login" id="login" class="form-control" required />
<div class="text-center">
@{
<img src="~/lib/logo.png" style="width: 700px" />
if (APICashier.Cashier == null)
{
<h3 class="display-4">Сначала авторизируйтесь</h3>
return;
}
<h3 class="display-4">Здравствуйтe, @APICashier.Cashier.Name @APICashier.Cashier.Patronymic</h3>
}
</div>
<div class="mb-3">
<label for="password" class="form-label">Пароль:</label>
<input type="password" name="password" id="password" class="form-control" required />
</div>
<button type="submit" class="btn btn-primary">Вход</button>
</form>

View File

@ -1,10 +1,67 @@
@{
ViewData["Title"] = "Добро пожаловать";
@using BankContracts.ViewModels
@model List<AccountViewModel>
@{
ViewData["Title"] = "Cписок счетов";
}
<div class="text-center">
<h1 class="display-4">Добро пожаловать, кассир</h1>
<img src="https://sun9-23.userapi.com/impg/RgpJNh6qIEd2V0pMH7WFORJvhO1AGF6Rm7eLfg/97sHI_zVlkk.jpg?size=807x688&quality=96&sign=17dd944d545af33ac0ece7c5af1a9904&c_uniq_tag=eFM1QnUaoeGpkGFaMZvVo9XpvQKNYZM8EYd9ZaGj5gw&type=album" alt="*" class="img-fluid" style="display: block; margin: 0 auto;">
<h1 class="display-4">Счета</h1>
</div>
<div class="text-center">
@{
if (Model == null)
{
<h3 class="display-4">Сначала авторизируйтесь</h3>
return;
}
<p>
<a asp-action="CreateAccount">Открыть счёт</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.AccountNumber)
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Patronymic)
</td>
<td>
@Html.DisplayFor(modelItem => item.Balance)
</td>
<td>
@Html.DisplayFor(modelItem => item.DateOpen)
</td>
</tr>
}
</tbody>
</table>
}
</div>

View File

@ -1,5 +1,5 @@
@{
ViewData["Title"] = "Логин";
ViewData["Title"] = "Авторизация";
}
<div class="text-center">
@ -10,5 +10,5 @@
<h1 class="h3 mb-3 font-weight-normal">Логин</h1>
<input type="email" id="login" name="login" class="form-control" placeholder="Почта" required autofocus>
<input type="password" id="password" name="password" class="form-control" placeholder="Пароль" required>
<button class="btn btn-lg btn-warning btn-block" type="submit" asp-controller="Home" asp-action="Login">Войти</button>
<button class="btn btn-lg btn-dark btn-block" type="submit" asp-controller="Home" asp-action="Login">Войти</button>
</form>

View File

@ -11,86 +11,65 @@
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid">
<a asp-controller="Home" asp-action="Index">
<img src="https://img.icons8.com/?size=80&id=CvryVUzkqqMu&format=png" alt="*" class="navbar-toggler" style="display: block; margin: 0 auto; height:">
<body class="MyBody">
<header class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between py-3 px-4 mg-5 mb-4 border-bottom bg-dark ">
<div class="col-md-3 mb-2 mb-md-0">
<a asp-controller="Home" asp-action="Enter" class="d-inline-flex link-body-emphasis text-decoration-none">
<span class="fs-4 text-light ">Банк "Вы банкрот"</span>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto mb-2 mb-sm-0">
<li class="nav-item">
<a class="nav-link" asp-controller="Home" asp-action="Accounts">Счета</a>
</div>
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0 nav-main">
<li>
<a class="nav-link px-2 link-light" asparea="" asp-controller="Home" asp-action="Index">Счета</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="operationsDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">Операции</a>
<ul class="dropdown-menu" aria-labelledby="operationsDropdown">
<li class="dropdown">
<a href="#" class="nav-link px-2 link-light">Операции</a>
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="navbarDarkDropdownMenuLink">
<li><a class="dropdown-item" asp-controller="Home" asp-action="Debiting">Заявки на снятие</a></li>
<li><a class="dropdown-item" asp-controller="Home" asp-action="Crediting">Заявки на начисление</a></li>
<li><a class="dropdown-item" asp-controller="Home" asp-action="MoneyTransfers">Заявки на перевод</a></li>
<li><a class="dropdown-item" asp-controller="Home" asp-controller="Home" asp-action="MoneyTransfers">Заявки на перевод</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="reportsDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">Отчеты</a>
<ul class="dropdown-menu" aria-labelledby="reportsDropdown">
<li><a class="dropdown-item" asp-controller="Home" asp-action="ReportWithAccounts">Отчёт по аккаунтам</a></li>
<li><a class="dropdown-item" asp-controller="Home" asp-action="CreateReport">Отчёт за период</a></li>
<li><a class="dropdown-item" asp-controller="Home" asp-action="Diagram">Диаграмма</a></li>
<li class="dropdown">
<a href="#" class="nav-link px-2 link-light">Отчеты</a>
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="navbarDarkDropdownMenuLink">
<li><a class="dropdown-item" asp-controller="Home" asp-controller="Home" asp-action="ReportWithAccounts">Отчёт по аккаунтам</a></li>
<li><a class="dropdown-item" asp-controller="Home" asp-controller="Home" asp-action="CreateReport">Отчёт за период</a></li>
<li><a class="dropdown-item" asp-controller="Home" asp-controller="Home" asp-action="Diagram">Диаграмма</a></li>
</ul>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" asp-controller="Home" asp-action="Privacy">Личные данные</a>
</li>
<li class="nav-item">
<a class="btn btn-primary me-2" asp-controller="Home" asp-action="Register">Регистрация</a>
</li>
<li class="nav-item">
<a class="btn btn-primary" asp-controller="Home" asp-action="Enter">Вход</a>
</li>
</ul>
@{
if (APICashier.Cashier == null)
{
<div class="col-md-3 text-end">
<a class="btn btn-warning me-2" asp-controller="Home" asp-action="Login">Войти</a>
<a class="btn btn-warning" asp-controller="Home" asp-action="Register">Регистрация</a>
</div>
}
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">@APICashier.Cashier.Surname @APICashier.Cashier.Name</a>
</div>
</nav>
}
}
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<footer class="border-top bg-dark border-dark footer text-light">
<div class="container">
&copy; 2024 - BankCashierApp - <a asp-controller="Home" asp-action="Privacy">Privacy</a>
&copy; 2023 - BankYouBankruptCashierApp
</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>
<script>
$(document).ready(function () {
// Добавьте событие hover для элементов навигации с классом dropdown
$('.nav-item.dropdown').hover(
function () {
// Показываем выпадающее меню при наведении мыши
$(this).find('.dropdown-menu').stop(true, true).slideDown(300);
},
function () {
// Скрываем выпадающее меню при выходе мыши
$(this).find('.dropdown-menu').stop(true, true).slideUp(300);
}
);
});
</script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>

View File

@ -0,0 +1,454 @@
// <auto-generated />
using System;
using BankDatabaseImplement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace BankDatabaseImplement.Migrations
{
[DbContext(typeof(BankDatabase))]
[Migration("20240528115207_init")]
partial class init
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.18")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.Account", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AccountNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<double>("Balance")
.HasColumnType("float");
b.Property<int>("CashierId")
.HasColumnType("int");
b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<DateTime>("DateOpen")
.HasColumnType("datetime2");
b.Property<int>("StatusAccount")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CashierId");
b.HasIndex("ClientId");
b.ToTable("Accounts");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.CashWithdrawal", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("AccountId")
.HasColumnType("int");
b.Property<int>("CashierId")
.HasColumnType("int");
b.Property<DateTime>("DateWithdrawal")
.HasColumnType("datetime2");
b.Property<int>("DebitingId")
.HasColumnType("int");
b.Property<double>("Sum")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("AccountId");
b.HasIndex("CashierId");
b.HasIndex("DebitingId");
b.ToTable("CashWithdrawals");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.Cashier", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("MobilePhone")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Patronymic")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Surname")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Cashiers");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.MoneyTransfer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("AccountPayeeId")
.HasColumnType("int");
b.Property<int>("AccountPayeerId")
.HasColumnType("int");
b.Property<int?>("AccountSenderId")
.HasColumnType("int");
b.Property<int>("CashierId")
.HasColumnType("int");
b.Property<int?>("CreditingId")
.HasColumnType("int");
b.Property<DateTime>("DateTransfer")
.HasColumnType("datetime2");
b.Property<double>("Sum")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("AccountPayeerId");
b.HasIndex("AccountSenderId");
b.HasIndex("CashierId");
b.HasIndex("CreditingId");
b.ToTable("MoneyTransfers");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Card", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("AccountId")
.HasColumnType("int");
b.Property<double>("Balance")
.HasColumnType("float");
b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("ClientSurname")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Number")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("Period")
.HasColumnType("datetime2");
b.Property<int>("StatusCard")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("AccountId");
b.HasIndex("ClientId");
b.ToTable("Cards");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("MobilePhone")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Patronymic")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Surname")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Crediting", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CardId")
.HasColumnType("int");
b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<DateTime>("DateCredit")
.HasColumnType("datetime2");
b.Property<double>("Sum")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("CardId");
b.ToTable("Creditings");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Debiting", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CardId")
.HasColumnType("int");
b.Property<DateTime>("DateDebit")
.HasColumnType("datetime2");
b.Property<double>("Sum")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("CardId");
b.ToTable("Debitings");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.Account", b =>
{
b.HasOne("BankDatabaseImplement.Models.CashierModels.Cashier", null)
.WithMany("Accounts")
.HasForeignKey("CashierId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BankDatabaseImplement.Models.ClientModels.Client", "Client")
.WithMany()
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Client");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.CashWithdrawal", b =>
{
b.HasOne("BankDatabaseImplement.Models.CashierModels.Account", "Account")
.WithMany("CashWithdrawals")
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BankDatabaseImplement.Models.CashierModels.Cashier", "Cashier")
.WithMany("CashWithdrawals")
.HasForeignKey("CashierId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BankDatabaseImplement.Models.ClientModels.Debiting", "Debiting")
.WithMany()
.HasForeignKey("DebitingId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Account");
b.Navigation("Cashier");
b.Navigation("Debiting");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.MoneyTransfer", b =>
{
b.HasOne("BankDatabaseImplement.Models.CashierModels.Account", "AccountPayeer")
.WithMany()
.HasForeignKey("AccountPayeerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BankDatabaseImplement.Models.CashierModels.Account", "AccountSender")
.WithMany()
.HasForeignKey("AccountSenderId");
b.HasOne("BankDatabaseImplement.Models.CashierModels.Cashier", "Cashier")
.WithMany("MoneyTransfers")
.HasForeignKey("CashierId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BankDatabaseImplement.Models.ClientModels.Crediting", null)
.WithMany("MoneyTransfers")
.HasForeignKey("CreditingId");
b.Navigation("AccountPayeer");
b.Navigation("AccountSender");
b.Navigation("Cashier");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Card", b =>
{
b.HasOne("BankDatabaseImplement.Models.CashierModels.Account", "Account")
.WithMany("Cards")
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BankDatabaseImplement.Models.ClientModels.Client", "Client")
.WithMany("Cards")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Account");
b.Navigation("Client");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Crediting", b =>
{
b.HasOne("BankDatabaseImplement.Models.ClientModels.Card", "Card")
.WithMany("creditings")
.HasForeignKey("CardId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Card");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Debiting", b =>
{
b.HasOne("BankDatabaseImplement.Models.ClientModels.Card", "Card")
.WithMany("debitings")
.HasForeignKey("CardId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Card");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.Account", b =>
{
b.Navigation("Cards");
b.Navigation("CashWithdrawals");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.Cashier", b =>
{
b.Navigation("Accounts");
b.Navigation("CashWithdrawals");
b.Navigation("MoneyTransfers");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Card", b =>
{
b.Navigation("creditings");
b.Navigation("debitings");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Client", b =>
{
b.Navigation("Cards");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Crediting", b =>
{
b.Navigation("MoneyTransfers");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,324 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BankDatabaseImplement.Migrations
{
/// <inheritdoc />
public partial class init : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Cashiers",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Password = table.Column<string>(type: "nvarchar(max)", nullable: false),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
Surname = table.Column<string>(type: "nvarchar(max)", nullable: false),
Patronymic = table.Column<string>(type: "nvarchar(max)", nullable: false),
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
MobilePhone = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Cashiers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Clients",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
Surname = table.Column<string>(type: "nvarchar(max)", nullable: false),
Patronymic = table.Column<string>(type: "nvarchar(max)", nullable: false),
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
Password = table.Column<string>(type: "nvarchar(max)", nullable: false),
MobilePhone = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Clients", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Accounts",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AccountNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
CashierId = table.Column<int>(type: "int", nullable: false),
ClientId = table.Column<int>(type: "int", nullable: false),
Balance = table.Column<double>(type: "float", nullable: false),
DateOpen = table.Column<DateTime>(type: "datetime2", nullable: false),
StatusAccount = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Accounts", x => x.Id);
table.ForeignKey(
name: "FK_Accounts_Cashiers_CashierId",
column: x => x.CashierId,
principalTable: "Cashiers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Accounts_Clients_ClientId",
column: x => x.ClientId,
principalTable: "Clients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Cards",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ClientId = table.Column<int>(type: "int", nullable: false),
AccountId = table.Column<int>(type: "int", nullable: false),
Number = table.Column<string>(type: "nvarchar(max)", nullable: false),
Balance = table.Column<double>(type: "float", nullable: false),
Period = table.Column<DateTime>(type: "datetime2", nullable: false),
StatusCard = table.Column<int>(type: "int", nullable: false),
ClientSurname = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Cards", x => x.Id);
table.ForeignKey(
name: "FK_Cards_Accounts_AccountId",
column: x => x.AccountId,
principalTable: "Accounts",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Cards_Clients_ClientId",
column: x => x.ClientId,
principalTable: "Clients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Creditings",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CardId = table.Column<int>(type: "int", nullable: false),
ClientId = table.Column<int>(type: "int", nullable: false),
Sum = table.Column<double>(type: "float", nullable: false),
DateCredit = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Creditings", x => x.Id);
table.ForeignKey(
name: "FK_Creditings_Cards_CardId",
column: x => x.CardId,
principalTable: "Cards",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Debitings",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CardId = table.Column<int>(type: "int", nullable: false),
Sum = table.Column<double>(type: "float", nullable: false),
DateDebit = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Debitings", x => x.Id);
table.ForeignKey(
name: "FK_Debitings_Cards_CardId",
column: x => x.CardId,
principalTable: "Cards",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "MoneyTransfers",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Sum = table.Column<double>(type: "float", nullable: false),
AccountSenderId = table.Column<int>(type: "int", nullable: true),
AccountPayeeId = table.Column<int>(type: "int", nullable: false),
DateTransfer = table.Column<DateTime>(type: "datetime2", nullable: false),
CreditingId = table.Column<int>(type: "int", nullable: true),
CashierId = table.Column<int>(type: "int", nullable: false),
AccountPayeerId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_MoneyTransfers", x => x.Id);
table.ForeignKey(
name: "FK_MoneyTransfers_Accounts_AccountPayeerId",
column: x => x.AccountPayeerId,
principalTable: "Accounts",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_MoneyTransfers_Accounts_AccountSenderId",
column: x => x.AccountSenderId,
principalTable: "Accounts",
principalColumn: "Id");
table.ForeignKey(
name: "FK_MoneyTransfers_Cashiers_CashierId",
column: x => x.CashierId,
principalTable: "Cashiers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_MoneyTransfers_Creditings_CreditingId",
column: x => x.CreditingId,
principalTable: "Creditings",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "CashWithdrawals",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DebitingId = table.Column<int>(type: "int", nullable: false),
AccountId = table.Column<int>(type: "int", nullable: false),
CashierId = table.Column<int>(type: "int", nullable: false),
Sum = table.Column<double>(type: "float", nullable: false),
DateWithdrawal = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CashWithdrawals", x => x.Id);
table.ForeignKey(
name: "FK_CashWithdrawals_Accounts_AccountId",
column: x => x.AccountId,
principalTable: "Accounts",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_CashWithdrawals_Cashiers_CashierId",
column: x => x.CashierId,
principalTable: "Cashiers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_CashWithdrawals_Debitings_DebitingId",
column: x => x.DebitingId,
principalTable: "Debitings",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Accounts_CashierId",
table: "Accounts",
column: "CashierId");
migrationBuilder.CreateIndex(
name: "IX_Accounts_ClientId",
table: "Accounts",
column: "ClientId");
migrationBuilder.CreateIndex(
name: "IX_Cards_AccountId",
table: "Cards",
column: "AccountId");
migrationBuilder.CreateIndex(
name: "IX_Cards_ClientId",
table: "Cards",
column: "ClientId");
migrationBuilder.CreateIndex(
name: "IX_CashWithdrawals_AccountId",
table: "CashWithdrawals",
column: "AccountId");
migrationBuilder.CreateIndex(
name: "IX_CashWithdrawals_CashierId",
table: "CashWithdrawals",
column: "CashierId");
migrationBuilder.CreateIndex(
name: "IX_CashWithdrawals_DebitingId",
table: "CashWithdrawals",
column: "DebitingId");
migrationBuilder.CreateIndex(
name: "IX_Creditings_CardId",
table: "Creditings",
column: "CardId");
migrationBuilder.CreateIndex(
name: "IX_Debitings_CardId",
table: "Debitings",
column: "CardId");
migrationBuilder.CreateIndex(
name: "IX_MoneyTransfers_AccountPayeerId",
table: "MoneyTransfers",
column: "AccountPayeerId");
migrationBuilder.CreateIndex(
name: "IX_MoneyTransfers_AccountSenderId",
table: "MoneyTransfers",
column: "AccountSenderId");
migrationBuilder.CreateIndex(
name: "IX_MoneyTransfers_CashierId",
table: "MoneyTransfers",
column: "CashierId");
migrationBuilder.CreateIndex(
name: "IX_MoneyTransfers_CreditingId",
table: "MoneyTransfers",
column: "CreditingId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CashWithdrawals");
migrationBuilder.DropTable(
name: "MoneyTransfers");
migrationBuilder.DropTable(
name: "Debitings");
migrationBuilder.DropTable(
name: "Creditings");
migrationBuilder.DropTable(
name: "Cards");
migrationBuilder.DropTable(
name: "Accounts");
migrationBuilder.DropTable(
name: "Cashiers");
migrationBuilder.DropTable(
name: "Clients");
}
}
}

View File

@ -0,0 +1,451 @@
// <auto-generated />
using System;
using BankDatabaseImplement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace BankDatabaseImplement.Migrations
{
[DbContext(typeof(BankDatabase))]
partial class BankDatabaseModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.18")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.Account", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AccountNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<double>("Balance")
.HasColumnType("float");
b.Property<int>("CashierId")
.HasColumnType("int");
b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<DateTime>("DateOpen")
.HasColumnType("datetime2");
b.Property<int>("StatusAccount")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CashierId");
b.HasIndex("ClientId");
b.ToTable("Accounts");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.CashWithdrawal", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("AccountId")
.HasColumnType("int");
b.Property<int>("CashierId")
.HasColumnType("int");
b.Property<DateTime>("DateWithdrawal")
.HasColumnType("datetime2");
b.Property<int>("DebitingId")
.HasColumnType("int");
b.Property<double>("Sum")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("AccountId");
b.HasIndex("CashierId");
b.HasIndex("DebitingId");
b.ToTable("CashWithdrawals");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.Cashier", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("MobilePhone")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Patronymic")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Surname")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Cashiers");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.MoneyTransfer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("AccountPayeeId")
.HasColumnType("int");
b.Property<int>("AccountPayeerId")
.HasColumnType("int");
b.Property<int?>("AccountSenderId")
.HasColumnType("int");
b.Property<int>("CashierId")
.HasColumnType("int");
b.Property<int?>("CreditingId")
.HasColumnType("int");
b.Property<DateTime>("DateTransfer")
.HasColumnType("datetime2");
b.Property<double>("Sum")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("AccountPayeerId");
b.HasIndex("AccountSenderId");
b.HasIndex("CashierId");
b.HasIndex("CreditingId");
b.ToTable("MoneyTransfers");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Card", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("AccountId")
.HasColumnType("int");
b.Property<double>("Balance")
.HasColumnType("float");
b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("ClientSurname")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Number")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("Period")
.HasColumnType("datetime2");
b.Property<int>("StatusCard")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("AccountId");
b.HasIndex("ClientId");
b.ToTable("Cards");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("MobilePhone")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Patronymic")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Surname")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Crediting", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CardId")
.HasColumnType("int");
b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<DateTime>("DateCredit")
.HasColumnType("datetime2");
b.Property<double>("Sum")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("CardId");
b.ToTable("Creditings");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Debiting", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CardId")
.HasColumnType("int");
b.Property<DateTime>("DateDebit")
.HasColumnType("datetime2");
b.Property<double>("Sum")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("CardId");
b.ToTable("Debitings");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.Account", b =>
{
b.HasOne("BankDatabaseImplement.Models.CashierModels.Cashier", null)
.WithMany("Accounts")
.HasForeignKey("CashierId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BankDatabaseImplement.Models.ClientModels.Client", "Client")
.WithMany()
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Client");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.CashWithdrawal", b =>
{
b.HasOne("BankDatabaseImplement.Models.CashierModels.Account", "Account")
.WithMany("CashWithdrawals")
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BankDatabaseImplement.Models.CashierModels.Cashier", "Cashier")
.WithMany("CashWithdrawals")
.HasForeignKey("CashierId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BankDatabaseImplement.Models.ClientModels.Debiting", "Debiting")
.WithMany()
.HasForeignKey("DebitingId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Account");
b.Navigation("Cashier");
b.Navigation("Debiting");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.MoneyTransfer", b =>
{
b.HasOne("BankDatabaseImplement.Models.CashierModels.Account", "AccountPayeer")
.WithMany()
.HasForeignKey("AccountPayeerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BankDatabaseImplement.Models.CashierModels.Account", "AccountSender")
.WithMany()
.HasForeignKey("AccountSenderId");
b.HasOne("BankDatabaseImplement.Models.CashierModels.Cashier", "Cashier")
.WithMany("MoneyTransfers")
.HasForeignKey("CashierId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BankDatabaseImplement.Models.ClientModels.Crediting", null)
.WithMany("MoneyTransfers")
.HasForeignKey("CreditingId");
b.Navigation("AccountPayeer");
b.Navigation("AccountSender");
b.Navigation("Cashier");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Card", b =>
{
b.HasOne("BankDatabaseImplement.Models.CashierModels.Account", "Account")
.WithMany("Cards")
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BankDatabaseImplement.Models.ClientModels.Client", "Client")
.WithMany("Cards")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Account");
b.Navigation("Client");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Crediting", b =>
{
b.HasOne("BankDatabaseImplement.Models.ClientModels.Card", "Card")
.WithMany("creditings")
.HasForeignKey("CardId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Card");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Debiting", b =>
{
b.HasOne("BankDatabaseImplement.Models.ClientModels.Card", "Card")
.WithMany("debitings")
.HasForeignKey("CardId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Card");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.Account", b =>
{
b.Navigation("Cards");
b.Navigation("CashWithdrawals");
});
modelBuilder.Entity("BankDatabaseImplement.Models.CashierModels.Cashier", b =>
{
b.Navigation("Accounts");
b.Navigation("CashWithdrawals");
b.Navigation("MoneyTransfers");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Card", b =>
{
b.Navigation("creditings");
b.Navigation("debitings");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Client", b =>
{
b.Navigation("Cards");
});
modelBuilder.Entity("BankDatabaseImplement.Models.ClientModels.Crediting", b =>
{
b.Navigation("MoneyTransfers");
});
#pragma warning restore 612, 618
}
}
}