diff --git a/Areas/Inventory/Models/SupplierModel.cs b/Areas/Inventory/Models/SupplierModel.cs index 4d46cf7..9d6f4f2 100644 --- a/Areas/Inventory/Models/SupplierModel.cs +++ b/Areas/Inventory/Models/SupplierModel.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; namespace PSTW_CentralSystem.Areas.Inventory.Models { @@ -6,9 +7,13 @@ namespace PSTW_CentralSystem.Areas.Inventory.Models { [Key] public int SupplierId { get; set; } - public required string SupplierName { get; set; } - public required string SupplierGender { get; set; } - public required string SupplierEmail { get; set; } - public required string SupplierPhoneNo { get; set; } + public required string SupplierCompName { get; set; } + public required string SupplierAddress { get; set; } + [AllowNull] + public string? SupplierPIC { get; set; } + [AllowNull] + public string? SupplierEmail { get; set; } + [AllowNull] + public string? SupplierPhoneNo { get; set; } } } diff --git a/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml b/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml index 2fbac6c..70b03ae 100644 --- a/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml @@ -568,6 +568,7 @@ var printButton = ``; return printButton; }, + "className": "align-middle", }, { "title": "Item Short Name", @@ -627,11 +628,12 @@ }, { "title": "Delete", - "data": "productId", + "data": "itemID", "render": function (data) { var deleteButton = ``; return deleteButton; }, + "className": "align-middle", } ], responsive: true, @@ -853,7 +855,7 @@ return; } try { - const response = await fetch(`/InvMainAPI/DeleteProduct/${itemId}`, { + const response = await fetch(`/InvMainAPI/DeleteItem/${itemId}`, { method: 'DELETE', headers: { 'Content-Type': 'application/json', diff --git a/Areas/Inventory/Views/InventoryMaster/SupplierRegistration.cshtml b/Areas/Inventory/Views/InventoryMaster/SupplierRegistration.cshtml index aad6ef2..82e1712 100644 --- a/Areas/Inventory/Views/InventoryMaster/SupplierRegistration.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/SupplierRegistration.cshtml @@ -18,30 +18,35 @@ @* Supplier Name *@
- +
- +
@* Supplier Gender *@
- +
+ @* Supplier PIC *@ +
+ +
+ +
+
+ @* Supplier Email *@
- +
@@ -49,7 +54,7 @@
- +
@@ -97,10 +102,11 @@ const app = Vue.createApp({ data() { return { - supplierName : null, + supplierCompName : null, supplierEmail : null, - supplierGender : '', + supplierAddress : null, supplierPhoneNo : null, + supplierPIC : null, suuppliers: null, supplierDatatable: null, gender: ["Male", "Female", "Helicopter"], @@ -145,15 +151,16 @@ $('#loadingModal').modal('show'); // Create the payload const formData = { - supplierName: this.supplierName, + supplierCompName: this.supplierCompName, + supplierAddress: this.supplierAddress, + supplierPIC: this.supplierPIC, supplierEmail: this.supplierEmail, - supplierGender: this.supplierGender, - supplierPhoneNo: this.supplierPhoneNo + supplierPhoneNo: this.supplierPhoneNo, }; try { // List of required fields - const requiredFields = ['supplierName', 'supplierEmail', 'supplierGender', 'supplierPhoneNo']; + const requiredFields = ['supplierCompName', 'supplierAddress']; // Loop through required fields and check if any are null or empty for (let field of requiredFields) { @@ -196,10 +203,11 @@ } }, resetForm() { - this.supplierName = null; + this.supplierCompName = null; + this.supplierAddress = null; this.supplierEmail = null; - this.supplierGender = ''; this.supplierPhoneNo = null; + this.supplierPIC = null; }, initiateTable() { self = this; @@ -207,12 +215,16 @@ "data": this.suppliers, "columns": [ { - "title": "Supplier Name", - "data": "supplierName", + "title": "Supplier Company Name", + "data": "supplierCompName", }, { - "title": "Supplier Gender", - "data": "supplierGender", + "title": "Supplier Address", + "data": "supplierAddress", + }, + { + "title": "Company PIC", + "data": "supplierPIC", }, { "title": "Supplier Email", diff --git a/Views/Shared/_Layout.cshtml b/Views/Shared/_Layout.cshtml index 2cd56f2..17213b5 100644 --- a/Views/Shared/_Layout.cshtml +++ b/Views/Shared/_Layout.cshtml @@ -22,7 +22,6 @@ type="image/png" sizes="16x16" href="/assets/images/favicon.png" /> - ~/assets/fonts/ocraext.ttf