This commit is contained in:
Programmist73 2023-05-20 00:30:22 +04:00
parent b66f3733a6
commit 0d36a17036
2 changed files with 12 additions and 6 deletions

View File

@ -12,7 +12,7 @@
<form method="post">
<div class="row mb-2">
<div class="row">Номер счета:</div>
<div class="row">Номер карты:</div>
<div class="col">
<select id="cardId" name="cardId" class="form-control" asp-items="@(new SelectList( @ViewBag.Cards, "Id", "Number"))"></select>
</div>

View File

@ -38,6 +38,7 @@ namespace BankYouBankruptDatabaseImplement.Implements
return context.Cards
.Include(x => x.Client)
.Include(x => x.Account)
.FirstOrDefault(x => (!string.IsNullOrEmpty(model.Number) && x.Number == model.Number) ||
(model.Id.HasValue && x.Id == model.Id))
?.GetViewModel;
@ -51,7 +52,8 @@ namespace BankYouBankruptDatabaseImplement.Implements
{
return context.Cards
.Include(x => x.Client)
.Where(x => x.Number.Contains(model.Number))
.Include(x => x.Account)
.Where(x => x.Number.Contains(model.Number))
.Select(x => x.GetViewModel)
.ToList();
}
@ -60,7 +62,8 @@ namespace BankYouBankruptDatabaseImplement.Implements
{
return context.Cards
.Include(x => x.Client)
.Where(x => x.ClientID == model.ClientID)
.Include(x => x.Account)
.Where(x => x.ClientID == model.ClientID)
.Select(x => x.GetViewModel)
.ToList();
}
@ -69,14 +72,16 @@ namespace BankYouBankruptDatabaseImplement.Implements
{
return context.Cards
.Include(x => x.Client)
.Where(x => x.AccountId == model.AccountId)
.Include(x => x.Account)
.Where(x => x.AccountId == model.AccountId)
.Select(x => x.GetViewModel)
.ToList();
}
return context.Cards
.Include(x => x.Client)
.Select(x => x.GetViewModel)
.Include(x => x.Account)
.Select(x => x.GetViewModel)
.ToList();
}
@ -86,7 +91,8 @@ namespace BankYouBankruptDatabaseImplement.Implements
return context.Cards
.Include(x => x.Client)
.Select(x => x.GetViewModel)
.Include(x => x.Account)
.Select(x => x.GetViewModel)
.ToList();
}