diff --git a/Areas/Inventory/Controllers/Admin/InventoryAdminController.cs b/Areas/Inventory/Controllers/Admin/InventoryAdminController.cs new file mode 100644 index 0000000..962176d --- /dev/null +++ b/Areas/Inventory/Controllers/Admin/InventoryAdminController.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Mvc; + +namespace PSTW_CentralSystem.Areas.Inventory.Controllers.Admin +{ + [Area("Inventory")] + public class InventoryAdminController : Controller + { + public IActionResult AdminDashboard() + { + return View(); + } + } +} diff --git a/Areas/Inventory/Controllers/ItemController.cs b/Areas/Inventory/Controllers/ItemController.cs new file mode 100644 index 0000000..056d452 --- /dev/null +++ b/Areas/Inventory/Controllers/ItemController.cs @@ -0,0 +1,94 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace PSTW_CentralSystem.Areas.Inventory.Controllers +{ + [Area("Inventory")] + public class ItemController : Controller + { + // GET: Inventory + public ActionResult Index() + { + return View(); + } + + public IActionResult ItemRegistration() + { + return View(); + } + + public IActionResult ProductRegistration() + { + return View(); + } + + // GET: Inventory/Details/5 + public ActionResult Details(int id) + { + return View(); + } + + // GET: Inventory/Create + public ActionResult Create() + { + 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/Controllers/Inventory/InventoryController.cs b/Areas/Inventory/Controllers/MainController.cs similarity index 90% rename from Controllers/Inventory/InventoryController.cs rename to Areas/Inventory/Controllers/MainController.cs index 74089e1..537dda9 100644 --- a/Controllers/Inventory/InventoryController.cs +++ b/Areas/Inventory/Controllers/MainController.cs @@ -1,9 +1,12 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -namespace PSTW_CentralSystem.Controllers.Inventory +namespace PSTW_CentralSystem.Areas.Inventory.Controllers { - public class InventoryController : Controller + [Area("Inventory")] + + //[Route("Inventory/[controller]/[action]")] + public class MainController : Controller { // GET: Inventory public ActionResult Index() diff --git a/Areas/Inventory/Models/Company.cs b/Areas/Inventory/Models/Company.cs new file mode 100644 index 0000000..6f6e36e --- /dev/null +++ b/Areas/Inventory/Models/Company.cs @@ -0,0 +1,8 @@ +namespace PSTW_CentralSystem.Areas.Inventory.Models +{ + public class Company + { + public string Name { get; set; } + public List Departments { get; set; } + } +} diff --git a/Areas/Inventory/Models/Item.cs b/Areas/Inventory/Models/Item.cs new file mode 100644 index 0000000..dd629df --- /dev/null +++ b/Areas/Inventory/Models/Item.cs @@ -0,0 +1,24 @@ +namespace PSTW_CentralSystem.Areas.Inventory.Models +{ + public class Item + { + public string company { get; set; } + public string Dept { get; set; } + public string productName { get; set; } + public string imageProduct { get; set; } + public string productCategory { get; set; } + public string serialNumber { get; set; } + public int quantity { get; set; } + public string Supplier { get; set; } + public DateTime purchaseDate { get; set; } + public string PO { get; set; } + public string currency { get; set; } + public float priceInRM { get; set; } + public float currencyRate { get; set; } + public float convertPrice { get; set; } + public DateTime DODate { get; set; } + public int warranty { get; set; } + public DateTime EndWDate { get; set; } + public DateTime invoiceDate { get; set; } + } +} diff --git a/Areas/Inventory/Models/Product.cs b/Areas/Inventory/Models/Product.cs new file mode 100644 index 0000000..e889223 --- /dev/null +++ b/Areas/Inventory/Models/Product.cs @@ -0,0 +1,12 @@ +namespace PSTW_CentralSystem.Areas.Inventory.Models +{ + public class Product + { + public string productName { get; set; } + public string manufacturer { get; set; } + public string category { get; set; } + public string modelNo { get; set; } + public int quantityProduct { get; set; } + public string imageProduct { get; set; } + } +} diff --git a/Areas/Inventory/Models/Supplier.cs b/Areas/Inventory/Models/Supplier.cs new file mode 100644 index 0000000..f82a89a --- /dev/null +++ b/Areas/Inventory/Models/Supplier.cs @@ -0,0 +1,10 @@ +namespace PSTW_CentralSystem.Areas.Inventory.Models +{ + public class Supplier + { + public string supplierName { get; set; } + public string supplierGender { get; set; } + public string supplierEmail { get; set; } + public string supplierPhoneNo { get; set; } + } +} diff --git a/Areas/Inventory/Views/InventoryAdmin/AdminDashboard.cshtml b/Areas/Inventory/Views/InventoryAdmin/AdminDashboard.cshtml new file mode 100644 index 0000000..16f9dfc --- /dev/null +++ b/Areas/Inventory/Views/InventoryAdmin/AdminDashboard.cshtml @@ -0,0 +1,11 @@ +@{ + ViewData["Title"] = "PSTW Centralized System"; + Layout = "~/Views/Shared/_Layout.cshtml"; +} + +
+
+

Inventory Admin Dashboard

+

Learn about building Web apps with ASP.NET Core.

+
+
diff --git a/Areas/Inventory/Views/Item/ItemRegistration.cshtml b/Areas/Inventory/Views/Item/ItemRegistration.cshtml new file mode 100644 index 0000000..c028496 --- /dev/null +++ b/Areas/Inventory/Views/Item/ItemRegistration.cshtml @@ -0,0 +1,595 @@ + +@{ + ViewData["Title"] = "Item Form"; + Layout = "~/Views/Shared/_Layout.cshtml"; + +} + +
+
+ +
+
+ @*Left Side*@ +
+ +

Welcome

+

Registration Product! Click button to go Product Page

+ Product Registration
+
+ + @*Right Side*@ +
+
+
+

REGISTRATION ITEM

+
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + + @* Product Name Coding *@ +
+ +
+ +
+
+ + @* Product Image Display *@ +
+ +
+ Product Image + +
+
+ + + + + @* Product Category Coding *@ +
+ +
+ +
+
+ + @* Serial Number and Quantity Coding *@ +
+
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+
+ @* Supplier coding *@ +
+ +
+ +
+
+ + @* Purchase Date coding *@ +
+ +
+ +
+
+ + @* PO coding *@ +
+ +
+ +
+
+
+ +
+ @* Item Price in RM *@ +
+ +
+ +
+
+ + @* Currency Selection *@ +
+ +
+ +
+
+ + @* Currency Rate *@ +
+ +
+ +
+
+ + @* Item Convert Price *@ +
+ +
+ +
+
+ + @* Delivery Order Date *@ +
+ +
+ +
+
+ + @* Warranty *@ +
+ +
+ +
+
+ + @* Warranty End Date *@ +
+ +
+ +
+
+ + @* Invoice Date *@ +
+ +
+ +
+
+ +
+ + @* Submit and Reset Buttons *@ +
+
+ + +
+
+ +
+
+
+
+
+
+
+
+ +@*Vue Js - POST & RESET*@ + + \ No newline at end of file diff --git a/Areas/Inventory/Views/Item/ProductRegistration.cshtml b/Areas/Inventory/Views/Item/ProductRegistration.cshtml new file mode 100644 index 0000000..6b07d28 --- /dev/null +++ b/Areas/Inventory/Views/Item/ProductRegistration.cshtml @@ -0,0 +1,279 @@ +@{ + ViewData["Title"] = "Product Form"; + Layout = "~/Views/Shared/_Layout.cshtml"; +} + +
+
+
+
+ + @*Left Side*@ +
+ +

Welcome

+

Registration Product! Click button to go Registration Item Page

+ Item Registration
+
+ + + @*Right Side*@ +
+
+
+

REGISTRATION PRODUCT

+
+
+ + @* Product Name *@ +
+ +
+ +
+
+ + @* Manufacturer *@ +
+ +
+ +
+
+ + @* Category *@ +
+ +
+ +
+
+ +
+ +
+ + @* Model No Coding *@ +
+ +
+ +
+
+ + @* Min Quantity Coding *@ +
+ +
+ +
+
+ + @* Image Product Coding *@ +
+ +
+ +
+ Image Preview +
+
+ +
+
+
+ + +
+
+
+
+
+
+
+
+
+
+ + + diff --git a/Areas/Inventory/Views/Item/Qr.cshtml b/Areas/Inventory/Views/Item/Qr.cshtml new file mode 100644 index 0000000..b7e421d --- /dev/null +++ b/Areas/Inventory/Views/Item/Qr.cshtml @@ -0,0 +1,107 @@ +@{ + ViewData["Title"] = "QR & Barcode Scanner"; + Layout = "~/Views/Shared/_Layout.cshtml"; +} + +
+

QR & Barcode Scanner

+
+
+

Scan Result:

+

{{ qrCodeResult }}

+
+
+ + \ No newline at end of file diff --git a/Views/Inventory/Index.cshtml b/Areas/Inventory/Views/Main/Index.cshtml similarity index 86% rename from Views/Inventory/Index.cshtml rename to Areas/Inventory/Views/Main/Index.cshtml index 7e1b3e5..8039624 100644 --- a/Views/Inventory/Index.cshtml +++ b/Areas/Inventory/Views/Main/Index.cshtml @@ -1,5 +1,6 @@ @{ ViewData["Title"] = "PSTW Centralized System"; + Layout = "~/Views/Shared/_Layout.cshtml"; }
diff --git a/Areas/Inventory/Views/Main/Supplier.cshtml b/Areas/Inventory/Views/Main/Supplier.cshtml new file mode 100644 index 0000000..abec03e --- /dev/null +++ b/Areas/Inventory/Views/Main/Supplier.cshtml @@ -0,0 +1,147 @@ +@{ + ViewData["Title"] = "User Form"; + Layout = "~/Views/Shared/_Layout.cshtml"; +} +
+
+
+
+ @*Right Side*@ +
+
+
+

REGISTRATION SUPPLIER

+
+
+ + @* Supplier Name *@ +
+ +
+ +
+
+ + @* Supplier Gender *@ +
+ +
+ +
+
+ + @* Supplier Email *@ +
+ +
+ +
+
+ + @* Supplier Number Phone *@ +
+ +
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/Program.cs b/Program.cs index 4b42c94..e34c0b0 100644 --- a/Program.cs +++ b/Program.cs @@ -75,6 +75,9 @@ internal class Program app.MapRazorPages(); app.MapControllerRoute( name: "default", + pattern: "{area:exists}/{controller=Home}/{action=Index}/{id?}"); + app.MapControllerRoute( + name: "root", pattern: "{controller=Home}/{action=Index}/{id?}"); app.Run(); diff --git a/Views/Shared/_Layout.cshtml b/Views/Shared/_Layout.cshtml index 98c84bd..bfe51d0 100644 --- a/Views/Shared/_Layout.cshtml +++ b/Views/Shared/_Layout.cshtml @@ -384,6 +384,36 @@ Dashboard +