From e558896d4fe29e56437aa5642b88bf636d43d698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9?= Date: Sun, 2 Apr 2023 12:36:49 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D0=B5=D1=82=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BF=D0=BE=D0=BA=D1=83=D0=BF=D0=BE=D0=BA=20=D0=B3?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HomeController.cs | 2 +- .../Controllers/WorkerController.cs | 19 +++ .../Views/Home/Enter.cshtml | 6 +- .../Views/Worker/Purchase.cshtml | 106 +++++++++++++++ .../Views/Worker/Purchases.cshtml | 121 +++++++++--------- 5 files changed, 194 insertions(+), 60 deletions(-) create mode 100644 HardwareShop/HardwareShopClientApp/Views/Worker/Purchase.cshtml diff --git a/HardwareShop/HardwareShopClientApp/Controllers/HomeController.cs b/HardwareShop/HardwareShopClientApp/Controllers/HomeController.cs index e9c8eec..6db05cc 100644 --- a/HardwareShop/HardwareShopClientApp/Controllers/HomeController.cs +++ b/HardwareShop/HardwareShopClientApp/Controllers/HomeController.cs @@ -88,7 +88,7 @@ namespace HardwareShopClientApp.Controllers } else { - return RedirectToAction("Index", "Worker"); + return Redirect("Index"); } } diff --git a/HardwareShop/HardwareShopClientApp/Controllers/WorkerController.cs b/HardwareShop/HardwareShopClientApp/Controllers/WorkerController.cs index 208c5e8..e43cbaf 100644 --- a/HardwareShop/HardwareShopClientApp/Controllers/WorkerController.cs +++ b/HardwareShop/HardwareShopClientApp/Controllers/WorkerController.cs @@ -46,6 +46,25 @@ namespace HardwareShopClientApp.Controllers return View(APIClient.GetRequest>($"api/client/getpurchases?UserId={APIClient.User.Id}")); } + [HttpPost] + public void Purchases(int id) + { + //return View(); + //string login = (string)TempData["UserId"]; + + Response.Redirect("Purchase"); + } + + + [HttpGet] + public IActionResult Purchase() + { + //return View(); + //string login = (string)TempData["UserId"]; + + return View(); + } + public IActionResult WorkerReport() { return View(); diff --git a/HardwareShop/HardwareShopClientApp/Views/Home/Enter.cshtml b/HardwareShop/HardwareShopClientApp/Views/Home/Enter.cshtml index ccdcae4..42f489e 100644 --- a/HardwareShop/HardwareShopClientApp/Views/Home/Enter.cshtml +++ b/HardwareShop/HardwareShopClientApp/Views/Home/Enter.cshtml @@ -14,6 +14,10 @@ - +
+ + Регистрация +
+ diff --git a/HardwareShop/HardwareShopClientApp/Views/Worker/Purchase.cshtml b/HardwareShop/HardwareShopClientApp/Views/Worker/Purchase.cshtml new file mode 100644 index 0000000..1318430 --- /dev/null +++ b/HardwareShop/HardwareShopClientApp/Views/Worker/Purchase.cshtml @@ -0,0 +1,106 @@ +@using HardwareShopContracts.ViewModels +@{ + ViewData["Title"] = "Purchase"; +} + +@model List + +@section Header { +
+ +
+} +
+
+
+

Товары

+
+
+ + + + + + + + + + + + +
+ Номер + + Название товара + + Цена + + Пользователь + + Количество +
+
+
+
+ + + + +
+ + + + +
diff --git a/HardwareShop/HardwareShopClientApp/Views/Worker/Purchases.cshtml b/HardwareShop/HardwareShopClientApp/Views/Worker/Purchases.cshtml index 85a6a0d..176b942 100644 --- a/HardwareShop/HardwareShopClientApp/Views/Worker/Purchases.cshtml +++ b/HardwareShop/HardwareShopClientApp/Views/Worker/Purchases.cshtml @@ -36,63 +36,68 @@ } - -
-

Регистрация

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

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

- return; - } - - - - - - - - - - - - - @foreach (var item in Model) + +
+
+

Покупки

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

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

+ return; } - -
- Номер - - Блюдо - - Дата создания - - Количество - - Сумма - - Статус -
- @Html.DisplayFor(modelItem => item.Id) - - @Html.DisplayFor(modelItem => item.DatePurchase) - - @Html.DisplayFor(modelItem => item.Sum) - - @Html.DisplayFor(modelItem => item.PurchaseStatus) - - @Html.DisplayFor(modelItem => item.UserLogin) -
- } -
- + + + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + + } + +
+ Номер + + Дата оплаты + + Сумма + + Статус + + Пользователь +
+ @Html.DisplayFor(modelItem => item.Id) + + @Html.DisplayFor(modelItem => item.DatePurchase) + + @Html.DisplayFor(modelItem => item.Sum) + + @Html.DisplayFor(modelItem => item.PurchaseStatus) + + @Html.DisplayFor(modelItem => item.UserLogin) +
+ } + + +
+ + + + +
+