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 @@
+