мелкие правки визуала и 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,24 +10,26 @@ namespace BankCashierApp
{ {
public class APICashier 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 CashierViewModel? Cashier { get; set; } = null;
public static CreditingViewModel? Crediting { get; set; } = null;
public static DebitingViewModel? Debiting { get; set; } = null; public static CreditingViewModel? Crediting { get; set; } = null;
public static AccountViewModel? Account { get; set; } = null; public static DebitingViewModel? Debiting { get; set; } = null;
public static CardViewModel? Card { get; set; } = null; public static AccountViewModel? Account { get; set; } = null;
public static string ErrorMessage = string.Empty; public static CardViewModel? Card { get; set; } = null;
public static void Connect(IConfiguration configuration) public static void Connect(IConfiguration configuration)
{ {
_cashier.BaseAddress = new Uri(configuration["IPAddress"]); _client.BaseAddress = new Uri(configuration["IPAddress"]);
_cashier.DefaultRequestHeaders.Accept.Clear(); _client.DefaultRequestHeaders.Accept.Clear();
_cashier.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); _client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
} }
public static void SetErrorMessage(string error) public static void SetErrorMessage(string error)
@ -35,11 +37,10 @@ namespace BankCashierApp
ErrorMessage = error; ErrorMessage = error;
} }
// Get-запрос //Get-запрос
public static T? GetRequest<T>(string requestUrl) public static T? GetRequest<T>(string requestUrl)
{ {
var response = _cashier.GetAsync(requestUrl); var response = _client.GetAsync(requestUrl);
var result = response.Result.Content.ReadAsStringAsync().Result; var result = response.Result.Content.ReadAsStringAsync().Result;
if (response.Result.IsSuccessStatusCode) if (response.Result.IsSuccessStatusCode)
@ -52,13 +53,13 @@ namespace BankCashierApp
} }
} }
// Post-запрос //Post-запрос
public static void PostRequest<T>(string requestUrl, T model) public static void PostRequest<T>(string requestUrl, T model)
{ {
var json = JsonConvert.SerializeObject(model); var json = JsonConvert.SerializeObject(model);
var data = new StringContent(json, Encoding.UTF8, "application/json"); 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; var result = response.Result.Content.ReadAsStringAsync().Result;
@ -68,13 +69,13 @@ namespace BankCashierApp
} }
} }
// Post-запрос для получения данных //Post-запрос для получения данных
public static T? PostRequestReport<T, U>(string requestUrl, U model) public static T? PostRequestReport<T, U>(string requestUrl, U model)
{ {
var json = JsonConvert.SerializeObject(model); var json = JsonConvert.SerializeObject(model);
var data = new StringContent(json, Encoding.UTF8, "application/json"); 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; var result = response.Result.Content.ReadAsStringAsync().Result;

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,5 @@
using BankCashierApp;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
// Add services to the container. // Add services to the container.
@ -5,12 +7,14 @@ builder.Services.AddControllersWithViews();
var app = builder.Build(); var app = builder.Build();
APICashier.Connect(builder.Configuration);
// Configure the HTTP request pipeline. // Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment()) if (!app.Environment.IsDevelopment())
{ {
app.UseExceptionHandler("/Home/Error"); app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts(); app.UseHsts();
} }
app.UseHttpsRedirection(); app.UseHttpsRedirection();
@ -21,7 +25,7 @@ app.UseRouting();
app.UseAuthorization(); app.UseAuthorization();
app.MapControllerRoute( app.MapControllerRoute(
name: "default", name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}"); pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run(); app.Run();

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

View File

@ -1,10 +1,67 @@
@{ @using BankContracts.ViewModels
ViewData["Title"] = "Добро пожаловать";
@model List<AccountViewModel>
@{
ViewData["Title"] = "Cписок счетов";
} }
<div class="text-center"> <div class="text-center">
<h1 class="display-4">Добро пожаловать, кассир</h1> <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;">
</div> </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"> <div class="text-center">
@ -10,5 +10,5 @@
<h1 class="h3 mb-3 font-weight-normal">Логин</h1> <h1 class="h3 mb-3 font-weight-normal">Логин</h1>
<input type="email" id="login" name="login" class="form-control" placeholder="Почта" required autofocus> <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> <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> </form>

View File

@ -11,86 +11,65 @@
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script> <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</head> </head>
<body> <body class="MyBody">
<header> <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 ">
<nav class="navbar navbar-expand-sm navbar-light bg-white border-bottom box-shadow mb-3"> <div class="col-md-3 mb-2 mb-md-0">
<div class="container-fluid"> <a asp-controller="Home" asp-action="Enter" class="d-inline-flex link-body-emphasis text-decoration-none">
<a asp-controller="Home" asp-action="Index"> <span class="fs-4 text-light ">Банк "Вы банкрот"</span>
<img src="https://img.icons8.com/?size=80&id=CvryVUzkqqMu&format=png" alt="*" class="navbar-toggler" style="display: block; margin: 0 auto; height:"> </a>
</a> </div>
<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>
</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><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>
</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>
</ul>
</li>
</ul> <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0 nav-main">
<ul class="navbar-nav"> <li>
<li class="nav-item"> <a class="nav-link px-2 link-light" asparea="" asp-controller="Home" asp-action="Index">Счета</a>
<a class="nav-link" asp-controller="Home" asp-action="Privacy">Личные данные</a> </li>
</li> <li class="dropdown">
<li class="nav-item"> <a href="#" class="nav-link px-2 link-light">Операции</a>
<a class="btn btn-primary me-2" asp-controller="Home" asp-action="Register">Регистрация</a> <ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="navbarDarkDropdownMenuLink">
</li> <li><a class="dropdown-item" asp-controller="Home" asp-action="Debiting">Заявки на снятие</a></li>
<li class="nav-item"> <li><a class="dropdown-item" asp-controller="Home" asp-action="Crediting">Заявки на начисление</a></li>
<a class="btn btn-primary" asp-controller="Home" asp-action="Enter">Вход</a> <li><a class="dropdown-item" asp-controller="Home" asp-controller="Home" asp-action="MoneyTransfers">Заявки на перевод</a></li>
</li> </ul>
</ul> </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>
@{
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> </div>
</div> }
</nav> 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>
}
}
</header> </header>
<div class="container"> <div class="container">
<main role="main" class="pb-3"> <main role="main" class="pb-3">
@RenderBody() @RenderBody()
</main> </main>
</div> </div>
<footer class="border-top footer text-muted"> <footer class="border-top bg-dark border-dark footer text-light">
<div class="container"> <div class="container">
&copy; 2024 - BankCashierApp - <a asp-controller="Home" asp-action="Privacy">Privacy</a> &copy; 2023 - BankYouBankruptCashierApp
</div> </div>
</footer> </footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script> <script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.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 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) @await RenderSectionAsync("Scripts", required: false)
</body> </body>
</html> </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
}
}
}