Compare commits
No commits in common. "be529b33bead0e2765c07a0fd2534b55896fcf85" and "eae58286194413014cdf5f0a4b827006607c9f71" have entirely different histories.
be529b33be
...
eae5828619
@ -11,7 +11,7 @@ namespace BankContracts.BindingModels
|
||||
{
|
||||
public int ClientId { get; set; }
|
||||
|
||||
public DateTime DealDate { get; set; } = DateTime.Now;
|
||||
public DateTime DealDate { get; set; } = DateTime.Now.Date;
|
||||
|
||||
public int OperatorId { get; set; }
|
||||
|
||||
|
@ -10,7 +10,7 @@ namespace BankContracts.BindingModels
|
||||
public class PaymentBindingModel : IPaymentModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime PaymentDate {get;set;} = DateTime.Now;
|
||||
public DateTime PaymentDate {get;set;} = DateTime.Now.Date;
|
||||
|
||||
public Dictionary<int, IDealModel> DealPayments { get; set; } = new();
|
||||
|
||||
|
@ -14,7 +14,7 @@ namespace BankContracts.ViewModels
|
||||
[DisplayName("Номер клиента")]
|
||||
public int ClientId {get;set;}
|
||||
[DisplayName("Дата сделки")]
|
||||
public DateTime DealDate {get;set;} = DateTime.Now;
|
||||
public DateTime DealDate {get;set;} = DateTime.Now.Date;
|
||||
public int OperatorId { get;set;}
|
||||
[DisplayName("ФИО оператора")]
|
||||
public string OperatorName { get; set; } = string.Empty;
|
||||
|
@ -13,7 +13,7 @@ namespace BankContracts.ViewModels
|
||||
[DisplayName("Номер платы")]
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Дата платы")]
|
||||
public DateTime PaymentDate { get; set; } = DateTime.Now;
|
||||
public DateTime PaymentDate { get; set; } = DateTime.Now.Date;
|
||||
public Dictionary<int, IDealModel> DealPayments { get; set; } = new();
|
||||
public Dictionary<int, ICurrencyModel> CurrencyPayments { get; set; } = new();
|
||||
public int OperatorId { get; set; }
|
||||
|
@ -134,33 +134,5 @@ namespace OperatorApp.Controllers
|
||||
});
|
||||
Response.Redirect("Index");
|
||||
}
|
||||
public IActionResult Payments()
|
||||
{
|
||||
if (APIClient.Operator == null)
|
||||
{
|
||||
return Redirect("~/Home/Enter");
|
||||
}
|
||||
return View(APIClient.GetRequest<List<PaymentViewModel>>($"api/payment/getpayments?operatorId={APIClient.Operator.Id}"));
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult CreatePayment()
|
||||
{
|
||||
ViewBag.Deals = APIClient.GetRequest<List<DealViewModel>>("api/deal/getdealslist");
|
||||
return View();
|
||||
}
|
||||
[HttpPost]
|
||||
public void CreatePayment(int clientid)
|
||||
{
|
||||
if (APIClient.Operator == null)
|
||||
{
|
||||
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
|
||||
}
|
||||
APIClient.PostRequest("api/deal/createdeal", new PaymentBindingModel
|
||||
{
|
||||
|
||||
OperatorId = APIClient.Operator.Id,
|
||||
});
|
||||
Response.Redirect("Index");
|
||||
}
|
||||
}
|
||||
}
|
@ -6,11 +6,15 @@
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="col-4">Сделки:</div>
|
||||
<div class="col-4">Изделие:</div>
|
||||
<div class="col-8">
|
||||
<select id="deals" name="deals" class="form-control" asp-items="@(new SelectList(@ViewBag.Deals,"Id", "DealDate"))"></select>
|
||||
<select id="product" name="product" class="form-control" asp-items="@(new SelectList(@ViewBag.Pastrys,"Id", "PastryName"))"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">ID клиента:</div>
|
||||
<div class="col-8"><input type="text" name="clientid" id="clientid" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-8"></div>
|
||||
<div class="col-4"><input type="submit" value="Создать" class="btn btn-primary" /></div>
|
||||
|
@ -1,57 +0,0 @@
|
||||
@using BankContracts.ViewModels
|
||||
|
||||
@model List<PaymentViewModel>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Payments";
|
||||
}
|
||||
|
||||
<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="CreatePayment">Создать выплату</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Номер выплаты
|
||||
</th>
|
||||
<th>
|
||||
ФИО оператора
|
||||
</th>
|
||||
<th>
|
||||
Дата
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Id)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.OperatorName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.PaymentDate)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
@ -24,10 +24,10 @@
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Сделки</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Payments">Выплаты</a>
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Выплаты</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Зачисления</a>
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">З</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Личные данные</a>
|
||||
@ -51,7 +51,7 @@
|
||||
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© 2023 - OperationApp - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
© 2023 - ConfectioneryClientApp - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user