NonInventPurchasingSystem/CPRNIMS.WebApps/ViewComponents/Dashboard/DashboardViewComponent.cs
2026-01-20 07:44:30 +08:00

23 lines
853 B
C#

using Microsoft.AspNetCore.Mvc;
namespace CPRNIMS.WebApps.ViewComponents.Dashboard
{
public class DashboardViewComponent : ViewComponent
{
public IViewComponentResult Invoke(int dashboardId)
{
string viewName = dashboardId switch
{
1 => "~/Views/Components/Dashboard/CentralRequestor.cshtml",
2 => "~/Views/Components/Dashboard/DeptApprover.cshtml",
3 => "~/Views/Components/Dashboard/HeadApprover.cshtml",
4 => "~/Views/Components/Dashboard/Purchaser.cshtml",
5 => "~/Views/Components/Dashboard/POApprover.cshtml",
6 => "~/Views/Components/Dashboard/Finance.cshtml",
_ => "~/Views/Components/Dashboard/Requestor.cshtml"
};
return View(viewName);
}
}
}