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) +
+ } + + +
+ + + + +
+