From 391a359a9f2152d65dd0a0a0c4bb180ce435145b Mon Sep 17 00:00:00 2001 From: Mohd Ariff Date: Wed, 4 Dec 2024 16:29:41 +0800 Subject: [PATCH] Update --- Areas/Inventory/Controllers/ItemController.cs | 49 +- Areas/Inventory/Controllers/MainController.cs | 50 +- .../Views/Item/ItemRegistration.cshtml | 126 +++- .../Main/ManifacturerRegistration.cshtml | 2 +- .../Inventory/Views/_InventoryPartial.cshtml | 16 +- Controllers/API/AdminAPI.cs | 4 +- Controllers/API/Inventory/InvMainAPI.cs | 39 +- Controllers/API/ModuleAPI.cs | 31 +- Controllers/HomeController.cs | 2 +- Views/Admin/ModuleAdmin.cshtml | 186 +++--- Views/Admin/ModuleCreate.cshtml | 168 ++++- Views/JSA/JSAController.cs | 44 -- Views/Shared/_Layout.cshtml | 23 +- wwwroot/lib/Qrcode/qrcode.js | 614 ++++++++++++++++++ wwwroot/lib/Qrcode/qrcode.min.js | 1 + 15 files changed, 1089 insertions(+), 266 deletions(-) create mode 100644 wwwroot/lib/Qrcode/qrcode.js create mode 100644 wwwroot/lib/Qrcode/qrcode.min.js diff --git a/Areas/Inventory/Controllers/ItemController.cs b/Areas/Inventory/Controllers/ItemController.cs index 056d452..403a41e 100644 --- a/Areas/Inventory/Controllers/ItemController.cs +++ b/Areas/Inventory/Controllers/ItemController.cs @@ -1,9 +1,12 @@ -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace PSTW_CentralSystem.Areas.Inventory.Controllers { [Area("Inventory")] + + //[Authorize(Policy = "RoleModulePolicy")] public class ItemController : Controller { // GET: Inventory @@ -34,61 +37,17 @@ namespace PSTW_CentralSystem.Areas.Inventory.Controllers return View(); } - // POST: Inventory/Create - [HttpPost] - [ValidateAntiForgeryToken] - public ActionResult Create(IFormCollection collection) - { - try - { - return RedirectToAction(nameof(Index)); - } - catch - { - return View(); - } - } - // GET: Inventory/Edit/5 public ActionResult Edit(int id) { return View(); } - // POST: Inventory/Edit/5 - [HttpPost] - [ValidateAntiForgeryToken] - public ActionResult Edit(int id, IFormCollection collection) - { - try - { - return RedirectToAction(nameof(Index)); - } - catch - { - return View(); - } - } - // GET: Inventory/Delete/5 public ActionResult Delete(int id) { return View(); } - // POST: Inventory/Delete/5 - [HttpPost] - [ValidateAntiForgeryToken] - public ActionResult Delete(int id, IFormCollection collection) - { - try - { - return RedirectToAction(nameof(Index)); - } - catch - { - return View(); - } - } } } diff --git a/Areas/Inventory/Controllers/MainController.cs b/Areas/Inventory/Controllers/MainController.cs index 7fade01..526809d 100644 --- a/Areas/Inventory/Controllers/MainController.cs +++ b/Areas/Inventory/Controllers/MainController.cs @@ -1,11 +1,11 @@ -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace PSTW_CentralSystem.Areas.Inventory.Controllers { [Area("Inventory")] - - //[Route("Inventory/[controller]/[action]")] + //[Authorize(Policy = "RoleModulePolicy")] public class MainController : Controller { // GET: Inventory @@ -35,61 +35,17 @@ namespace PSTW_CentralSystem.Areas.Inventory.Controllers return View(); } - // POST: Inventory/Create - [HttpPost] - [ValidateAntiForgeryToken] - public ActionResult Create(IFormCollection collection) - { - try - { - return RedirectToAction(nameof(Index)); - } - catch - { - return View(); - } - } - // GET: Inventory/Edit/5 public ActionResult Edit(int id) { return View(); } - // POST: Inventory/Edit/5 - [HttpPost] - [ValidateAntiForgeryToken] - public ActionResult Edit(int id, IFormCollection collection) - { - try - { - return RedirectToAction(nameof(Index)); - } - catch - { - return View(); - } - } - // GET: Inventory/Delete/5 public ActionResult Delete(int id) { return View(); } - // POST: Inventory/Delete/5 - [HttpPost] - [ValidateAntiForgeryToken] - public ActionResult Delete(int id, IFormCollection collection) - { - try - { - return RedirectToAction(nameof(Index)); - } - catch - { - return View(); - } - } } } diff --git a/Areas/Inventory/Views/Item/ItemRegistration.cshtml b/Areas/Inventory/Views/Item/ItemRegistration.cshtml index f595de3..e25149c 100644 --- a/Areas/Inventory/Views/Item/ItemRegistration.cshtml +++ b/Areas/Inventory/Views/Item/ItemRegistration.cshtml @@ -4,6 +4,11 @@ Layout = "~/Views/Shared/_Layout.cshtml"; } + @await Html.PartialAsync("~/Areas/Inventory/Views/_InventoryPartial.cshtml");
@@ -19,6 +24,20 @@
+