+ +
++ Идентификатор покупки + | ++ Цена + | ++ Статус + | ++ Количество сборок в заказе + | ++ Действия + | +
---|---|---|---|---|
+ @Html.DisplayFor(modelItem => item.Item1.Id) + | ++ @Html.DisplayFor(modelItem => item.Item1.Sum) + | ++ @Html.DisplayFor(modelItem => item.Item1.PurchaseStatus) + | ++ @Html.DisplayFor(modelItem => item.Item2) + | +
+
+
+
+
+
+ |
+
@@ -100,10 +99,8 @@
var table = document.getElementById("table");
var remove = document.getElementById("delete");
- var inwork = document.getElementById("inwork");
- var ready = document.getElementById("ready");
var done = document.getElementById("done");
- var order = 0;
+ var purchase = 0;
for (var i = 1; i < table.rows.length; i++) {
table.rows[i].onclick = function () {
// remove the background from the previous selected row
@@ -114,46 +111,30 @@
index = this.rowIndex;
// add class selected to the row
this.classList.toggle("selected");
- order = parseInt(this.cells[0].innerText);
+ purchase = parseInt(this.cells[0].innerText);
remove.addEventListener("click", () => {
- console.log('try to delete order')
+ console.log('try to delete purchase')
$.ajax(
{
- url: `/Storekeeper/DeleteOrder`,
+ url: `/Home/DeletePurchase`,
type: 'POST',
- data: { id: order }
+ data: { purchaseId: purchase }
}
- )
- })
- inwork.addEventListener("click", () => {
- console.log('try to delete order')
- $.ajax(
- {
- url: `/Storekeeper/UpdateOrder`,
- type: 'POST',
- data: { id: order, status: 1 }
- }
- )
- })
- ready.addEventListener("click", () => {
- console.log('try to delete order')
- $.ajax(
- {
- url: `/Storekeeper/UpdateOrder`,
- type: 'POST',
- data: { id: order, status: 2 }
- }
- )
+ ).done(() => window.location.href = '/Home/Purchases')
})
done.addEventListener("click", () => {
- console.log('try to delete order')
+ console.log('try to delete purchase')
$.ajax(
{
- url: `/Storekeeper/UpdateOrder`,
+ url: `/Home/UpdateStatusPurchase`,
type: 'POST',
- data: { id: order, status: 3 }
+ data: { id: purchase, status: 1 }
}
- )
+ ).done(() => window.location.href = '/Home/Purchases')
+ })
+ update.addEventListener("click", () => {
+ console.log('try to update purchase')
+ window.location.href = '/Home/UpdatePurchase?purchaseId=' + purchase
})
};
}
diff --git a/HardwareShop/HardwareShopWorkerApp/Views/Home/UpdatePurchase.cshtml b/HardwareShop/HardwareShopWorkerApp/Views/Home/UpdatePurchase.cshtml
new file mode 100644
index 0000000..c150829
--- /dev/null
+++ b/HardwareShop/HardwareShopWorkerApp/Views/Home/UpdatePurchase.cshtml
@@ -0,0 +1,242 @@
+@using HardwareShopContracts.ViewModels
+@model int
+@{
+ ViewData["Title"] = "UpdatePurchase";
+ Layout = "~/Views/Shared/_LayoutWorker.cshtml";
+}
+
+
+
+
+Редактирование покупки+
+
+
+
+
+@section Scripts
+ {
+
+}
+
+
+@*
+*@
\ No newline at end of file
diff --git a/HardwareShop/HardwareShopWorkerApp/Views/Home/WorkerReport.cshtml b/HardwareShop/HardwareShopWorkerApp/Views/Home/WorkerReport.cshtml
index 45096fa..5c263c2 100644
--- a/HardwareShop/HardwareShopWorkerApp/Views/Home/WorkerReport.cshtml
+++ b/HardwareShop/HardwareShopWorkerApp/Views/Home/WorkerReport.cshtml
@@ -3,13 +3,198 @@
Layout = "~/Views/Shared/_LayoutWorker.cshtml";
}
-
+
+
+
+ Товары+
+
+
+
+
+
+
+ |
---|