From 259791b69390be862f1f08dbb466ce563406e8ef Mon Sep 17 00:00:00 2001 From: Programmist73 Date: Mon, 3 Apr 2023 17:22:59 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=82=D1=87=D1=91=D1=82=D0=B0=20?= =?UTF-8?q?=D0=B2=20=D0=BF=D1=80=D0=B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BA=D0=B0=D1=81=D1=81=D0=B8=D1=80=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HomeController.cs | 35 +++++++++++++++- .../Views/Home/CreateReport.cshtml | 42 +++++++++++++++++++ .../Views/Shared/_Layout.cshtml | 2 +- 3 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/CreateReport.cshtml diff --git a/BankYouBankrupt/BankYouBankruptCashierApp/Controllers/HomeController.cs b/BankYouBankrupt/BankYouBankruptCashierApp/Controllers/HomeController.cs index f8b6cbc..aac6730 100644 --- a/BankYouBankrupt/BankYouBankruptCashierApp/Controllers/HomeController.cs +++ b/BankYouBankrupt/BankYouBankruptCashierApp/Controllers/HomeController.cs @@ -176,5 +176,38 @@ namespace BankYouBankruptCashierApp.Controllers Response.Redirect("Index"); } - } + + //открытие формы отчёта. Получаем и передаём список изделий во вьюху? + [HttpGet] + public IActionResult CreateReport() + { + //ViewBag.Accountes = APICashier.GetRequest>("api/main/getaccountlist"); + + return View(); + } + + //создание отчёта Post-запросом + [HttpPost] + public void CreateReport(DateTime DateFrom, DateTime DateTo) + { + if (APICashier.Cashier == null) + { + //throw new Exception("Вы как сюда попали? Суда вход только авторизованным"); + } + + if (DateFrom > DateTo) + { + throw new Exception("Дата начала периода не может быть позже даты конца периода"); + } + + APICashier.PostRequest("api/main/createreport", new ReportBindingModel + { + FileName = APICashier.Cashier.Surname + + //TODO + }); + + Response.Redirect("Index"); + } + } } \ No newline at end of file diff --git a/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/CreateReport.cshtml b/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/CreateReport.cshtml new file mode 100644 index 0000000..3f63ef0 --- /dev/null +++ b/BankYouBankrupt/BankYouBankruptCashierApp/Views/Home/CreateReport.cshtml @@ -0,0 +1,42 @@ +@{ + ViewData["Title"] = "CreateReport"; +} + +
+

Создание отчёта

+
+
+
+
+
+
С
+
+
+
+ + +
+
+
+
по
+
+
+
+ + +
+
+
+
+
+
Отчёт:
+
+
\ No newline at end of file diff --git a/BankYouBankrupt/BankYouBankruptCashierApp/Views/Shared/_Layout.cshtml b/BankYouBankrupt/BankYouBankruptCashierApp/Views/Shared/_Layout.cshtml index 02abbc1..a32b0aa 100644 --- a/BankYouBankrupt/BankYouBankruptCashierApp/Views/Shared/_Layout.cshtml +++ b/BankYouBankrupt/BankYouBankruptCashierApp/Views/Shared/_Layout.cshtml @@ -26,7 +26,7 @@ Счета