Skip to main content

Module Routing

Introduction

Navigation from the home dashboard into functional modules is centralized in LoginController.ModuleManagement. Each dashboard tile passes a PageID query parameter; the action returns an MVC RedirectToAction into the appropriate Area dashboard controller.

Individual Area controllers then enforce the CompID session gate before executing business logic.

Purpose

This page is the routing reference for module entry — mapping PageID values, module flags, Area names, and destination URLs, including historical spelling in Area routes.

When to Use

Use this page when you:

  • Add a new module tile and redirect
  • Debug a tile that sends users to the wrong dashboard
  • Link to a module from custom code or documentation
  • Verify Area gate behavior on deep links

How It Works

ModuleManagement flow

PageID redirect table

PageIDAreaControllerActionFull path
PayrollPayrollPayrollDashboardIndex/Payroll/PayrollDashboard/Index
RegistrationRegistrationRegistrationDashboardIndex/Registration/RegistrationDashboard/Index
BillsBillsBillsDashboardIndex/Bills/BillsDashboard/Index
StockStockStockDashboardIndex/Stock/StockDashboard/Index
SalesSalesSalesDashboardIndex/Sales/SalesDashboard/Index
ESSESSEssDashboardIndex/ESS/EssDashboard/Index
AttPunchAttendancePunchingAttendanceDashboardIndex/AttendancePunching/AttendanceDashboard/Index
OperationOperationOperationDashboardIndex/Operation/OperationDashboard/Index
AdministratorAdminisrationUserDashBoardIndex/Adminisration/UserDashBoard/Index
ManagementDashManagmentDashBoardManagmentDashBoardIndex/ManagmentDashBoard/ManagmentDashBoard/Index
ContractedRatesContractedRatesContractedDashboardIndex/ContractedRates/ContractedDashboard/Index
VerificationAndApprovalVerificationAndApprovalVerificationApprovalDashboardIndex/VerificationAndApproval/VerificationApprovalDashboard/Index
(any other value)DashboardIndex/Dashboard/Index

Implementation reference: LoginController.ModuleManagement(string PageID).

Module flag → Area map

Dashboard tiles should only appear when the corresponding dtVerifyUser flag is true. Mapping from flag to Area (not always identical to PageID string):

Module flag (User property)MVC AreaTypical PageID
PayrollPayrollPayroll
WebenrollRegistrationRegistration
BillingBillsBills
ZSTOCKStockStock
ZSalesSalesSales
EssESSESS
ControlPanelAdminisrationAdministrator
AttPunchAttendancePunchingAttPunch
OperationOperationOperation
ManagementDashboardManagmentDashBoardManagementDash
ContractedRatesContractedRatesContractedRates
VerificationAndApprovalVerificationAndApprovalVerificationAndApproval
PageID ≠ flag name

Control Panel uses PageID Administrator but flag ControlPanel. Management uses PageID ManagementDash but flag ManagementDashboard. Registration uses PageID Registration but flag Webenroll.

Area gate — CompID check

After redirect, nearly every Area action begins with:

if (string.IsNullOrEmpty(Convert.ToString(Session["CompID"])))
return RedirectToAction("UserLogin", "Login", new { Area = "" });
CheckBehavior
CompID emptyRedirect to login (UserLoginIndex)
CompID presentContinue to action; pass CompID to DAL

Note: ModuleManagement itself does not re-check module flags — if a user manually crafts a URL, the Area may still load unless individual controllers verify permissions. Production UIs rely on hidden tiles plus menu permission SPs.

Area URL pattern

https://{host}/{Area}/{Controller}/{Action}/{id}

Examples with intentional typos preserved:

  • /Adminisration/UserDashBoard/Index
  • /ManagmentDashBoard/ManagmentDashBoard/Index

Developer Notes

  • ModuleManagement1 is a legacy/debug action — do not use in production links.
  • Registration Area name differs from Webenroll flag — UI labels often say "Registration".
  • Shared screens: Root controllers like EmployeeM use Session["Module"] when opened from multiple modules.
  • Deep linking: Users can bookmark Area dashboard URLs; session must remain valid.

Examples

<a href="@Url.Action("ModuleManagement", "Login", new { PageID = "Bills" })">
Billing
</a>

Programmatic redirect (same as ModuleManagement)

return RedirectToAction("Index", "BillsDashboard", new { area = "Bills" });

Manual URL entry

/Login/ModuleManagement?PageID=Payroll

Equivalent to clicking the Payroll tile.

Flag mismatch scenario

User has Payroll = false but visits /Payroll/PayrollDashboard/Index directly:

  • Session gate passes if logged in
  • Menu permissions may hide navigation items
  • Individual actions may fail or show empty data depending on SP permissions

Important Notes

Preserve Area typos

Adminisration and ManagmentDashBoard must match folder names and AreaRegistration classes. "Fixing" spelling without full route migration breaks bookmarks and redirects.

Unknown PageID is safe

Unrecognized PageID values fall back to /Dashboard/Index — they do not throw.

Common Mistakes

MistakeResult
Using PageID WebenrollFalls back to dashboard — use Registration
Using PageID ControlPanelFalls back — use Administrator
Using PageID ManagementDashboardFalls back — use ManagementDash
Omitting area in RedirectToActionWrong controller namespace
Assuming ModuleManagement checks flagsUser can deep-link if they know URL

Next Steps

  1. Read Session Lifecycle for full login → module → logout flow.
  2. Open target module's Area dashboard controller for feature-specific navigation.