diff --git a/Bank/BankContracts/BindingModels/DealBindingModel.cs b/Bank/BankContracts/BindingModels/DealBindingModel.cs index a0110b9..8580f65 100644 --- a/Bank/BankContracts/BindingModels/DealBindingModel.cs +++ b/Bank/BankContracts/BindingModels/DealBindingModel.cs @@ -11,7 +11,7 @@ namespace BankContracts.BindingModels { public int ClientId { get; set; } - public DateTime DealDate { get; set; } = DateTime.Now.Date; + public DateTime DealDate { get; set; } = DateTime.Now; public int OperatorId { get; set; } diff --git a/Bank/BankContracts/BindingModels/PaymentBindingModel.cs b/Bank/BankContracts/BindingModels/PaymentBindingModel.cs index 9a9748c..315c4f3 100644 --- a/Bank/BankContracts/BindingModels/PaymentBindingModel.cs +++ b/Bank/BankContracts/BindingModels/PaymentBindingModel.cs @@ -10,7 +10,7 @@ namespace BankContracts.BindingModels public class PaymentBindingModel : IPaymentModel { public int Id { get; set; } - public DateTime PaymentDate {get;set;} = DateTime.Now.Date; + public DateTime PaymentDate {get;set;} = DateTime.Now; public Dictionary DealPayments { get; set; } = new(); diff --git a/Bank/BankContracts/ViewModels/DealViewModel.cs b/Bank/BankContracts/ViewModels/DealViewModel.cs index f756ccb..7ec15d8 100644 --- a/Bank/BankContracts/ViewModels/DealViewModel.cs +++ b/Bank/BankContracts/ViewModels/DealViewModel.cs @@ -14,7 +14,7 @@ namespace BankContracts.ViewModels [DisplayName("Номер клиента")] public int ClientId {get;set;} [DisplayName("Дата сделки")] - public DateTime DealDate {get;set;} = DateTime.Now.Date; + public DateTime DealDate {get;set;} = DateTime.Now; public int OperatorId { get;set;} [DisplayName("ФИО оператора")] public string OperatorName { get; set; } = string.Empty; diff --git a/Bank/BankContracts/ViewModels/PaymentViewModel.cs b/Bank/BankContracts/ViewModels/PaymentViewModel.cs index 563e50a..2cf40d4 100644 --- a/Bank/BankContracts/ViewModels/PaymentViewModel.cs +++ b/Bank/BankContracts/ViewModels/PaymentViewModel.cs @@ -13,7 +13,7 @@ namespace BankContracts.ViewModels [DisplayName("Номер платы")] public int Id { get; set; } [DisplayName("Дата платы")] - public DateTime PaymentDate { get; set; } = DateTime.Now.Date; + public DateTime PaymentDate { get; set; } = DateTime.Now; public Dictionary DealPayments { get; set; } = new(); public Dictionary CurrencyPayments { get; set; } = new(); public int OperatorId { get; set; } diff --git a/Bank/OperatorApp/Controllers/HomeController.cs b/Bank/OperatorApp/Controllers/HomeController.cs index 74ef502..53b2b46 100644 --- a/Bank/OperatorApp/Controllers/HomeController.cs +++ b/Bank/OperatorApp/Controllers/HomeController.cs @@ -134,5 +134,33 @@ namespace OperatorApp.Controllers }); Response.Redirect("Index"); } + public IActionResult Payments() + { + if (APIClient.Operator == null) + { + return Redirect("~/Home/Enter"); + } + return View(APIClient.GetRequest>($"api/payment/getpayments?operatorId={APIClient.Operator.Id}")); + } + [HttpGet] + public IActionResult CreatePayment() + { + ViewBag.Deals = APIClient.GetRequest>("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"); + } } } \ No newline at end of file diff --git a/Bank/OperatorApp/Views/Home/CreatePayment.cshtml b/Bank/OperatorApp/Views/Home/CreatePayment.cshtml index b4179a9..00905bf 100644 --- a/Bank/OperatorApp/Views/Home/CreatePayment.cshtml +++ b/Bank/OperatorApp/Views/Home/CreatePayment.cshtml @@ -6,15 +6,11 @@
-
Изделие:
+
Сделки:
- +
-
-
ID клиента:
-
-
diff --git a/Bank/OperatorApp/Views/Home/Payments.cshtml b/Bank/OperatorApp/Views/Home/Payments.cshtml new file mode 100644 index 0000000..70a7072 --- /dev/null +++ b/Bank/OperatorApp/Views/Home/Payments.cshtml @@ -0,0 +1,57 @@ +@using BankContracts.ViewModels + +@model List + +@{ + ViewData["Title"] = "Payments"; +} + +
+

Выплаты

+
+ + +
+ @{ + if (Model == null) + { +

Авторизируйтесь

+ return; + } + +

+ Создать выплату +

+ + + + + + + + + + @foreach (var item in Model) + { + + + + + + } + +
+ Номер выплаты + + ФИО оператора + + Дата +
+ @Html.DisplayFor(modelItem => item.Id) + + @Html.DisplayFor(modelItem => item.OperatorName) + + @Html.DisplayFor(modelItem => item.PaymentDate) +
+ } +
\ No newline at end of file diff --git a/Bank/OperatorApp/Views/Shared/_Layout.cshtml b/Bank/OperatorApp/Views/Shared/_Layout.cshtml index 3576b99..61df6a9 100644 --- a/Bank/OperatorApp/Views/Shared/_Layout.cshtml +++ b/Bank/OperatorApp/Views/Shared/_Layout.cshtml @@ -24,10 +24,10 @@ Сделки