This commit is contained in:
MOHD ARIFF 2025-01-09 14:42:47 +08:00
parent 0d511921e8
commit 6e9ec353b9
22 changed files with 416 additions and 72 deletions

View File

@ -1,9 +1,10 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace PSTW_CentralSystem.Areas.Inventory.Controllers.Admin namespace PSTW_CentralSystem.Areas.Inventory.Controllers.Admin
{ {
[Area("Inventory")] [Area("Inventory")]
//[Authorize(Policy = "RoleModulePolicy")] [Authorize(Policy = "RoleModulePolicy")]
public class InventoryMasterController : Controller public class InventoryMasterController : Controller
{ {
public IActionResult AdminDashboard() public IActionResult AdminDashboard()

View File

@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using PSTW_CentralSystem.Areas.Inventory.Models;
namespace PSTW_CentralSystem.Areas.Inventory.Controllers namespace PSTW_CentralSystem.Areas.Inventory.Controllers
{ {
@ -15,5 +16,12 @@ namespace PSTW_CentralSystem.Areas.Inventory.Controllers
return View(); return View();
} }
[Authorize]
[HttpPost("/i/{id}")]
public IActionResult ItemRecognization(string id, [FromBody] ItemModel item)
{
return View();
}
} }
} }

View File

@ -14,14 +14,5 @@ namespace PSTW_CentralSystem.Areas.Inventory.Controllers
return View(); return View();
} }
public IActionResult SupplierRegistration()
{
return View();
}
public IActionResult ManifacturerRegistration()
{
return View();
}
} }
} }

View File

@ -33,6 +33,7 @@ namespace PSTW_CentralSystem.Areas.Inventory.Models
[Comment("1 = In stock; 2 = Item Moving; 3 = Item Out; 4 = Item Broken; 5 = Item Lost; 6 = Item Stolen; 7 = Item Damaged; 8 = Item Discarded; 9 = Item Destroyed; 10 = Item Finished;")] [Comment("1 = In stock; 2 = Item Moving; 3 = Item Out; 4 = Item Broken; 5 = Item Lost; 6 = Item Stolen; 7 = Item Damaged; 8 = Item Discarded; 9 = Item Destroyed; 10 = Item Finished;")]
public int ItemStatus { get; set; } = 1; public int ItemStatus { get; set; } = 1;
public int? MovementId { get; set; } public int? MovementId { get; set; }
public string PartNumber { get; set; } = string.Empty;
public int CreatedByUserId { get; set; } public int CreatedByUserId { get; set; }
[ForeignKey("CreatedByUserId")] [ForeignKey("CreatedByUserId")]
public virtual UserModel? CreatedBy { get; set; } public virtual UserModel? CreatedBy { get; set; }

View File

@ -177,6 +177,14 @@
</div> </div>
</div> </div>
@* Part Number Coding *@
<div class="form-group row">
<label class="col-sm-4 col-form-label">Part Number:</label>
<div class="col-sm-8">
<input type="text" id="partNumber" name="partNumber" v-model="partNumber" class="form-control" required />
</div>
</div>
@* Serial Number and Quantity Coding *@ @* Serial Number and Quantity Coding *@
<div v-if="showSerialNumber"> <div v-if="showSerialNumber">
<div class="form-group row align-items-center"> <div class="form-group row align-items-center">
@ -394,6 +402,7 @@
EndWDate: null, EndWDate: null,
invoiceNo: null, invoiceNo: null,
invoiceDate: null, invoiceDate: null,
partNumber: null,
products: [], products: [],
depts: [], depts: [],
suppliers: [ suppliers: [
@ -478,6 +487,7 @@
InvoiceDate: this.invoiceDate, InvoiceDate: this.invoiceDate,
CreatedByUserId: this.currentUser.id, CreatedByUserId: this.currentUser.id,
TeamType: this.selectedTeamType, TeamType: this.selectedTeamType,
PartNumber: this.partNumber,
}; };
try { try {
@ -789,6 +799,7 @@
this.selectedCompany = this.currentUserCompanyDept.companyId; this.selectedCompany = this.currentUserCompanyDept.companyId;
this.selectedDepartment = ''; this.selectedDepartment = '';
this.selectedTeamType = ''; this.selectedTeamType = '';
this.partNumber = null;
}, },
// FRONT END FUNCTIONS // FRONT END FUNCTIONS
@ -925,7 +936,7 @@
// Populate the virtual DOM with content // Populate the virtual DOM with content
virtualElement.innerHTML = ` virtualElement.innerHTML = `
<div class="container-fluid my-3" style="font-family: 'OCR A', monospace;"> <div class="container-fluid my-3" style="font-family: 'OCR A', monospace;">
<div class="row mx-1" > <div class="row" >
<div class="col-5 text-center d-flex align-items-center justify-content-center"> <div class="col-5 text-center d-flex align-items-center justify-content-center">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">

View File

@ -216,11 +216,11 @@
} }
}, },
async addProduct() { async addProduct() {
const existingProduct = this.products.find(p => p.modelNo === this.modelNo); // const existingProduct = this.products.find(p => p.modelNo === this.modelNo);
if (existingProduct) { // if (existingProduct) {
alert(`Product Error: The model number ${this.modelNo} already exists.`, 'error'); // alert(`Product Error: The model number ${this.modelNo} already exists.`, 'error');
return; // Exit early if the modelNo exists // return; // Exit early if the modelNo exists
} // }
// Create the payload // Create the payload
const formData = { const formData = {

View File

@ -1,7 +1,31 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<div class="row"> <div class="row">
<div class="col-6 col-md-6 col-lg-3"> <div class="col-6 col-md-6 col-lg-3">
<a href="@Url.Action("ProductRegistration", "Item", new { area = "Inventory" })"> <div class="card card-hover">
<a asp-area="Inventory" asp-controller="InventoryMaster" asp-action="SupplierRegistration">
<div class="box bg-info text-center">
<h1 class="font-light text-white">
<i class="mdi mdi-truck"></i>
</h1>
<h6 class="text-white">Supplier</h6>
</div>
</a>
</div>
</div>
<div class="col-6 col-md-6 col-lg-3">
<div class="card card-hover">
<a asp-area="Inventory" asp-controller="InventoryMaster" asp-action="ManifacturerRegistration">
<div class="box bg-warning text-center">
<h1 class="font-light text-white">
<i class="mdi mdi-factory"></i>
</h1>
<h6 class="text-white">Manifacturer</h6>
</div>
</a>
</div>
</div>
<div class="col-6 col-md-6 col-lg-3">
<a href="@Url.Action("ProductRegistration", "InventoryMaster", new { area = "Inventory" })">
<div class="card card-hover"> <div class="card card-hover">
<div class="box bg-cyan text-center"> <div class="box bg-cyan text-center">
<h1 class="font-light text-white"> <h1 class="font-light text-white">
@ -14,7 +38,7 @@
</div> </div>
<div class="col-6 col-md-6 col-lg-3"> <div class="col-6 col-md-6 col-lg-3">
<div class="card card-hover"> <div class="card card-hover">
<a asp-area="Inventory" asp-controller="Item" asp-action="ItemRegistration"> <a asp-area="Inventory" asp-controller="InventoryMaster" asp-action="ItemRegistration">
<div class="box bg-success text-center"> <div class="box bg-success text-center">
<h1 class="font-light text-white"> <h1 class="font-light text-white">
<i class="mdi mdi-checkbox-multiple-blank-circle"></i> <i class="mdi mdi-checkbox-multiple-blank-circle"></i>
@ -24,28 +48,4 @@
</a> </a>
</div> </div>
</div> </div>
<div class="col-6 col-md-6 col-lg-3">
<div class="card card-hover">
<a asp-area="Inventory" asp-controller="Main" asp-action="SupplierRegistration">
<div class="box bg-info text-center">
<h1 class="font-light text-white">
<i class="mdi mdi-truck"></i>
</h1>
<h6 class="text-white">Supplier</h6>
</div>
</a>
</div>
</div>
<div class="col-6 col-md-6 col-lg-3">
<div class="card card-hover">
<a asp-area="Inventory" asp-controller="Main" asp-action="ManifacturerRegistration">
<div class="box bg-warning text-center">
<h1 class="font-light text-white">
<i class="mdi mdi-factory"></i>
</h1>
<h6 class="text-white">Manifacturer</h6>
</div>
</a>
</div>
</div>
</div> </div>

View File

@ -1,8 +1,8 @@
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
namespace PSTW_CentralSystem.Controllers.JSA namespace PSTW_CentralSystem.Areas.JSA.Controllers
{ {
[Area("JSA")]
public class JSAController : Controller public class JSAController : Controller
{ {
// GET: JSAController // GET: JSAController

View File

@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Mvc;
namespace PSTW_CentralSystem.Areas.Report.Controllers
{
[Area("Report")]
public class ReportingController : Controller
{
public IActionResult Index()
{
return View();
}
public IActionResult InventoryReport()
{
return View();
}
}
}

View File

@ -0,0 +1,5 @@
@*
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}

View File

@ -0,0 +1,160 @@
@{
ViewData["Title"] = "Dashboard";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="container" id="invAdmin">
<div class="row">
<div class="text-center">
<p><h1 class="display-4">Reporting Dashboard</h1></p>
<p v-show="currentUserCompanyDept.departmentName"><h2 class="display-6">Store: {{ currentUserCompanyDept.departmentName }}</h2></p>
</div>
</div>
<div class="row card">
<div class="card-header">
<h3 class="card-title">Report Filter</h3>
</div>
<div class="card-body">
<div v-if="reportData">
<div class="row justify-content-center">
<div class="col-3">
<h4>Statistic</h4>
</div>
<div class="col-3">
<h4>Item Registered </h4>
</div>
<div class="col-3">
<h4>Item Stock Out </h4>
</div>
</div>
</div>
</div>
</div>
<div class="row card">
<div class="card-header">
<h3 class="card-title">Inventory Report</h3>
</div>
<div class="card-body">
<div v-if="reportData">
<div class="row justify-content-center">
<div class="col-3">
<h4>Statistic</h4>
<p>Total Number of Item Registered: {{ reportData.itemCountRegistered }}</p>
<p>Total Number of Item Still in Stock: {{ reportData.itemCountStillInStock }}</p>
</div>
<div class="col-3">
<h4>Item Registered </h4>
<p>This Month: {{ reportData.itemCountRegisteredThisMonth }}</p>
<p>Last Month: {{ reportData.itemCountRegisteredLastMonth }}</p>
</div>
<div class="col-3">
<h4>Item Stock Out </h4>
<p>This Month: {{ reportData.itemCountStockOutThisMonth }}</p>
<p>Last Month: {{ reportData.itemCountStockOutLastMonth }}</p>
</div>
</div>
</div>
</div>
</div>
</div>
@section Scripts {
@{
await Html.RenderPartialAsync("_ValidationScriptsPartial");
}
<script>
$(function () {
app.mount('#invAdmin');
$('.closeModal').on('click', function () {
// Show the modal with the ID 'addManufacturerModal'.
$('.modal').modal('hide');
});
});
const app = Vue.createApp({
data() {
return {
currentUser: null,
currentUserCompanyDept: {
departmentName: null,
departmentId: null
},
reportData: null,
compDeptList: {},
}
},
mounted() {
this.fetchUser();
this.fetchDepartmentsCompaniesList();
},
methods: {
async fetchUser() {
try {
const response = await fetch(`/IdentityAPI/GetUserInformation/`, {
method: 'POST',
});
if (response.ok) {
const data = await response.json();
this.currentUser = data?.userInfo || null;
const companyDeptData = await this.currentUser.department;
const userRole = this.currentUser.role;
if(userRole == "SuperAdmin" || userRole == "SystemAdmin"){
this.currentUserCompanyDept = {departmentId : 0, departmentName : "All"}
this.fetchInventoryReport(0);
}
else{
this.currentUserCompanyDept = companyDeptData;
this.fetchInventoryReport(0);
}
}
else {
console.error(`Failed to fetch user: ${response.statusText}`);
}
}
catch (error) {
console.error('There was a problem with the fetch operation:', error);
}
},
async fetchInventoryReport(deptId){
try {
const response = await fetch(`/ReportingAPI/GetInventoryReport/` + deptId, {
method: 'POST',
});
if (response.ok) {
const data = await response.json();
this.reportData = data;
}
else {
console.error(`Failed to fetch user: ${response.statusText}`);
}
}
catch (error) {
console.error('There was a problem with the fetch operation:', error);
}
},
async fetchDepartmentsCompaniesList(){
try {
const response = await fetch(`/AdminAPI/GetDepartmentWithCompanyList/`, {
method: 'POST',
});
if (response.ok) {
const data = await response.json();
this.compDeptList = data.map(company => company.departments.map(department =>
({
companyId: company.companyId,
companyName: company.companyName,
departmentName: department.departmentName,
departmentCode: department.departmentCode
)).flat();
console.log(this.compDeptList);
}
else {
console.error(`Failed to fetch comapny & department list: ${response.statusText}`);
}
}
catch (error) {
console.error('There was a problem with the fetch operation:', error);
}
},
},
});
</script>
}

View File

@ -76,6 +76,14 @@ namespace PSTW_CentralSystem.Controllers.API
// Iterate over the controller types and get their methods // Iterate over the controller types and get their methods
foreach (var controllerType in controllerTypes) { foreach (var controllerType in controllerTypes) {
// Get the [Area] attribute, if it exists
var areaAttribute = controllerType.GetCustomAttributes(true)
.OfType<AreaAttribute>()
.FirstOrDefault();
var areaName = areaAttribute?.RouteValue ?? null;
var methods = controllerType?.GetMethods(BindingFlags.Public | BindingFlags.Instance) var methods = controllerType?.GetMethods(BindingFlags.Public | BindingFlags.Instance)
.Where(m => m.DeclaringType == controllerType) // Filter methods declared directly in the controller (ignoring inherited ones) .Where(m => m.DeclaringType == controllerType) // Filter methods declared directly in the controller (ignoring inherited ones)
.Select(m => m.Name) // Get the method names .Select(m => m.Name) // Get the method names
@ -83,6 +91,7 @@ namespace PSTW_CentralSystem.Controllers.API
controllerAndMethodList.Add(new controllerAndMethodList.Add(new
{ {
Module = areaName,
Controller = controllerType?.Name.Replace("Controller", string.Empty), Controller = controllerType?.Name.Replace("Controller", string.Empty),
Methods = methods Methods = methods
}); });
@ -103,7 +112,7 @@ namespace PSTW_CentralSystem.Controllers.API
// Fetch all users excluding those with roles SuperAdmin or SystemAdmin // Fetch all users excluding those with roles SuperAdmin or SystemAdmin
var allUsers = await _centralDbContext.Users var allUsers = await _centralDbContext.Users
.Include(u => u.Department.Company) .Include(u => u.Department!.Company)
.ToListAsync(); .ToListAsync();
if (userRole == null || userRole.Count == 0) if (userRole == null || userRole.Count == 0)
@ -200,7 +209,7 @@ namespace PSTW_CentralSystem.Controllers.API
.Select(c => new { .Select(c => new {
c.CompanyId, c.CompanyId,
c.CompanyName, c.CompanyName,
Departments = c.Departments Departments = c.Departments!
.OrderBy(d => d.DepartmentId) .OrderBy(d => d.DepartmentId)
.Select(d => new { d.DepartmentId, d.DepartmentName, d.DepartmentCode }) .Select(d => new { d.DepartmentId, d.DepartmentName, d.DepartmentCode })
}) })

View File

@ -318,6 +318,7 @@ namespace PSTW_CentralSystem.Controllers.API.Inventory
item.ConvertPrice, item.ConvertPrice,
item.DODate, item.DODate,
item.Warranty, item.Warranty,
item.PartNumber,
EndWDate = item.EndWDate.ToString("dd/MM/yyyy"), EndWDate = item.EndWDate.ToString("dd/MM/yyyy"),
InvoiceDate = item.InvoiceDate?.ToString("dd/MM/yyyy"), InvoiceDate = item.InvoiceDate?.ToString("dd/MM/yyyy"),
item.Department?.DepartmentName, item.Department?.DepartmentName,
@ -439,6 +440,7 @@ namespace PSTW_CentralSystem.Controllers.API.Inventory
savedItem.Warranty, savedItem.Warranty,
savedItem.EndWDate, savedItem.EndWDate,
savedItem.InvoiceDate, savedItem.InvoiceDate,
savedItem.PartNumber,
}; };
return Json(updatedItem); return Json(updatedItem);
} }

View File

@ -0,0 +1,120 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using PSTW_CentralSystem.Areas.Inventory.Models;
using PSTW_CentralSystem.DBContext;
using PSTW_CentralSystem.Models;
namespace PSTW_CentralSystem.Controllers.API.Reporting
{
[ApiController]
[Route("[controller]")]
[Authorize]
public class ReportingAPI : Controller
{
private readonly ILogger<ReportingAPI> _logger;
private readonly CentralSystemContext _centralDbContext;
private readonly UserManager<UserModel> _userManager;
private readonly RoleManager<RoleModel> _roleManager;
public ReportingAPI(ILogger<ReportingAPI> logger, CentralSystemContext centralDbContext, UserManager<UserModel> userManager, RoleManager<RoleModel> roleManager)
{
_logger = logger;
_centralDbContext = centralDbContext;
_userManager = userManager;
_roleManager = roleManager;
}
#region ItemReport
[HttpPost("GetInventoryReport/{deptId}")]
public async Task<IActionResult> GetInventoryReport(int? deptId)
{
try
{
var user = await _userManager.GetUserAsync(User);
List<ItemModel> items = new List<ItemModel>();
if (deptId == null || deptId == 0)
{
items = await _centralDbContext.Items
.Include("CreatedBy")
.Include("Department")
.Include("Product")
.ToListAsync();
}
else
{
items = await _centralDbContext.Items
.Include("CreatedBy")
.Include("Department")
.Include("Product")
.Where(i => i.DepartmentId == deptId)
.ToListAsync();
}
var itemListWithDetails = items.Select(item => new
{
item.ItemID,
item.UniqueID,
item.CompanyId,
item.DepartmentId,
item.ProductId,
item.SerialNumber,
item.Quantity,
item.Supplier,
PurchaseDate = item.PurchaseDate.ToString("dd/MM/yyyy"),
item.PONo,
item.Currency,
item.DefaultPrice,
item.CurrencyRate,
item.ConvertPrice,
item.DODate,
item.Warranty,
EndWDate = item.EndWDate.ToString("dd/MM/yyyy"),
InvoiceDate = item.InvoiceDate?.ToString("dd/MM/yyyy"),
item.Department?.DepartmentName,
CreatedBy = item.CreatedBy!.UserName,
item.Product!.ProductName,
item.Product!.Category,
//CurrentUser = item.Movement?.FromUser?.UserName,
CurrentUser = item.Movement?.FromUser?.UserName,
CurrentStore = item.Movement?.FromStore?.StoreName,
CurrentStation = item.Movement?.FromStation?.StationName,
QRString = $"{HttpContext.Request.Scheme}://{HttpContext.Request.Host.Value}/I/{item.UniqueID}" // Generate QR String
}).ToList();
int itemCountRegistered = items.Count;
int itemCountStillInStock = items.Where(i => i.Quantity > 0).Count();
var itemsMovementsThisMonth = _centralDbContext.ItemMovements
.Where(i => i.Date.Month == DateTime.Now.Month);
int itemCountRegisteredThisMonth = itemsMovementsThisMonth.Count(i => i.Action == "Register");
int itemCountStockOutThisMonth = itemsMovementsThisMonth.Count(i => i.Action == "Stock Out");
var lastMonth = DateTime.Now.AddMonths(-1).Month;
var itemsMovementsLastMonth = _centralDbContext.ItemMovements
.Where(i => i.Date.Month == lastMonth);
int itemCountRegisteredLastMonth = itemsMovementsLastMonth.Count(i => i.Action == "Register");
int itemCountStockOutLastMonth = itemsMovementsLastMonth.Count(i => i.Action == "Stock Out");
var report = new
{
itemCountRegistered,
itemCountStillInStock,
itemCountRegisteredThisMonth,
itemCountStockOutThisMonth,
itemCountRegisteredLastMonth,
itemCountStockOutLastMonth
};
return Json(report);
}
catch (Exception ex)
{
return BadRequest(ex.Message);
}
}
#endregion
}
}

View File

@ -14,13 +14,13 @@ namespace PSTW_CentralSystem.Controllers.API
public class RoleAPI : Controller public class RoleAPI : Controller
{ {
private readonly ILogger<RoleAPI> _logger; private readonly ILogger<RoleAPI> _logger;
private readonly CentralSystemContext _authDbContext; private readonly CentralSystemContext _centralDbContext;
private readonly RoleManager<RoleModel> _roleManager; private readonly RoleManager<RoleModel> _roleManager;
public RoleAPI(ILogger<RoleAPI> logger, CentralSystemContext authDbContext, RoleManager<RoleModel> roleManager) public RoleAPI(ILogger<RoleAPI> logger, CentralSystemContext centralDbContext, RoleManager<RoleModel> roleManager)
{ {
_logger = logger; _logger = logger;
_authDbContext = authDbContext; _centralDbContext = centralDbContext;
_roleManager = roleManager; _roleManager = roleManager;
} }

View File

@ -8,11 +8,11 @@ using PSTW_CentralSystem.Models;
namespace PSTW_CentralSystem.Controllers namespace PSTW_CentralSystem.Controllers
{ {
public class InventoryController : Controller public class PublicInventoryController : Controller
{ {
private readonly ILogger<InventoryController> _logger; private readonly ILogger<PublicInventoryController> _logger;
private readonly CentralSystemContext _centralDbContext; private readonly CentralSystemContext _centralDbContext;
public InventoryController(ILogger<InventoryController> logger, CentralSystemContext centralDbContext) public PublicInventoryController(ILogger<PublicInventoryController> logger, CentralSystemContext centralDbContext)
{ {
_logger = logger; _logger = logger;
_centralDbContext = centralDbContext; _centralDbContext = centralDbContext;
@ -24,12 +24,5 @@ namespace PSTW_CentralSystem.Controllers
ViewData["ItemId"] = Id; ViewData["ItemId"] = Id;
return View("ItemInformation"); return View("ItemInformation");
} }
[Authorize]
[HttpPost("/i/{id}")]
public IActionResult ItemRecognization(string id, [FromBody] ItemModel item)
{
return View();
}
} }
} }

View File

@ -27,13 +27,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Areas\Report\Controller\" /> <Folder Include="Areas\JSA\Models\" />
<Folder Include="Areas\Report\Model\" /> <Folder Include="Areas\JSA\Views\" />
<Folder Include="Areas\Report\Views\" /> <Folder Include="Areas\Report\Models\" />
<Folder Include="Controllers\JSA\API\" />
<Folder Include="Logs\" /> <Folder Include="Logs\" />
<Folder Include="Migrations\" /> <Folder Include="Migrations\" />
<Folder Include="Views\JSA\" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -18,7 +18,7 @@
<div class="col-md-6"> <div class="col-md-6">
<select class="form-select" name="ModuleName" v-model="moduleData.moduleName" > <select class="form-select" name="ModuleName" v-model="moduleData.moduleName" >
<option value="" disabled selected>Select Module</option> <option value="" disabled selected>Select Module</option>
<option v-for="(item, index) in controllerMethodData" :key="index" :value="item.controller">{{ item.controller }}</option> <option v-for="(item, index) in controllerMethodData" :key="index" :value="item.controller">{{ item.controller }} {{ item.module ? ' - [ ' + item.module + ' ]' : '' }}</option>
</select> </select>
</div> </div>
</div> </div>
@ -182,10 +182,14 @@
throw new Error('Name module already exist'); throw new Error('Name module already exist');
} }
alert('Module information saved successfully'); alert('Module information saved successfully');
window.history.back();
}) })
.catch(error => { .catch(error => {
console.error('There was a problem with the update operation:', error); console.error('There was a problem with the update operation:', error);
alert('Failed to save data: ' + error.message); alert('Failed to save data: ' + error.message);
})
.finally(() => {
}); });
}, },
fetchControllerMethodList() { fetchControllerMethodList() {

View File

@ -156,7 +156,12 @@
"title": "Delete", "title": "Delete",
"data": "id", "data": "id",
"render": function (data, type, row, meta) { "render": function (data, type, row, meta) {
if(row.name != "Inventory Master"){
var deleteButton = `<button type="button" class="btn btn-danger delete-btn" data-id="${data}" data-name="${row.name}">Delete</button>`; var deleteButton = `<button type="button" class="btn btn-danger delete-btn" data-id="${data}" data-name="${row.name}">Delete</button>`;
}
else{
var deleteButton = ""
}
return deleteButton; return deleteButton;
}, },
} }

View File

@ -438,20 +438,39 @@
</li> </li>
<li class="sidebar-item"> <li class="sidebar-item">
<a class="sidebar-link waves-effect waves-dark sidebar-link" <a class="sidebar-link waves-effect waves-dark sidebar-link"
asp-area="Inventory" asp-controller="Item" asp-action="ProductRegistration" asp-area="Inventory" asp-controller="InventoryMaster" asp-action="ProductRegistration"
aria-expanded="false"> aria-expanded="false">
<i class="mdi mdi-view-dashboard"></i><span class="hide-menu">Product Registration</span> <i class="mdi mdi-view-dashboard"></i><span class="hide-menu">Product Registration</span>
</a> </a>
</li> </li>
<li class="sidebar-item"> <li class="sidebar-item">
<a class="sidebar-link waves-effect waves-dark sidebar-link" <a class="sidebar-link waves-effect waves-dark sidebar-link"
asp-area="Inventory" asp-controller="Item" asp-action="ItemRegistration" asp-area="Inventory" asp-controller="InventoryMaster" asp-action="ItemRegistration"
aria-expanded="false"> aria-expanded="false">
<i class="mdi mdi-view-dashboard"></i><span class="hide-menu">Item Registration</span> <i class="mdi mdi-view-dashboard"></i><span class="hide-menu">Item Registration</span>
</a> </a>
</li> </li>
</ul> </ul>
</li> </li>
<li class="sidebar-item">
<a class="sidebar-link has-arrow waves-effect waves-dark"
href="javascript:void(0)"
aria-expanded="false">
<i class="mdi mdi-receipt"></i><span class="hide-menu">Report </span>
</a>
<ul aria-expanded="false" class="collapse first-level">
<li class="sidebar-item">
<a class="sidebar-link waves-effect waves-dark sidebar-link" asp-area="Report" asp-controller="Reporting" asp-action="Index" aria-expanded="false">
<i class="mdi mdi-view-dashboard"></i><span class="hide-menu">Admin Dashboard</span>
</a>
</li>
<li class="sidebar-item">
<a class="sidebar-link waves-effect waves-dark sidebar-link" asp-area="Report" asp-controller="Reporting" asp-action="InventoryReport" aria-expanded="false">
<i class="mdi mdi-view-dashboard"></i><span class="hide-menu">Inventory Report</span>
</a>
</li>
</ul>
</li>
<!-- <li class="sidebar-item"> <!-- <li class="sidebar-item">
<a class="sidebar-link waves-effect waves-dark sidebar-link" <a class="sidebar-link waves-effect waves-dark sidebar-link"
href="charts.html" href="charts.html"