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
| PageID | Area | Controller | Action | Full path |
|---|---|---|---|---|
Payroll | Payroll | PayrollDashboard | Index | /Payroll/PayrollDashboard/Index |
Registration | Registration | RegistrationDashboard | Index | /Registration/RegistrationDashboard/Index |
Bills | Bills | BillsDashboard | Index | /Bills/BillsDashboard/Index |
Stock | Stock | StockDashboard | Index | /Stock/StockDashboard/Index |
Sales | Sales | SalesDashboard | Index | /Sales/SalesDashboard/Index |
ESS | ESS | EssDashboard | Index | /ESS/EssDashboard/Index |
AttPunch | AttendancePunching | AttendanceDashboard | Index | /AttendancePunching/AttendanceDashboard/Index |
Operation | Operation | OperationDashboard | Index | /Operation/OperationDashboard/Index |
Administrator | Adminisration | UserDashBoard | Index | /Adminisration/UserDashBoard/Index |
ManagementDash | ManagmentDashBoard | ManagmentDashBoard | Index | /ManagmentDashBoard/ManagmentDashBoard/Index |
ContractedRates | ContractedRates | ContractedDashboard | Index | /ContractedRates/ContractedDashboard/Index |
VerificationAndApproval | VerificationAndApproval | VerificationApprovalDashboard | Index | /VerificationAndApproval/VerificationApprovalDashboard/Index |
| (any other value) | — | Dashboard | Index | /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 Area | Typical PageID |
|---|---|---|
Payroll | Payroll | Payroll |
Webenroll | Registration | Registration |
Billing | Bills | Bills |
ZSTOCK | Stock | Stock |
ZSales | Sales | Sales |
Ess | ESS | ESS |
ControlPanel | Adminisration | Administrator |
AttPunch | AttendancePunching | AttPunch |
Operation | Operation | Operation |
ManagementDashboard | ManagmentDashBoard | ManagementDash |
ContractedRates | ContractedRates | ContractedRates |
VerificationAndApproval | VerificationAndApproval | VerificationAndApproval |
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 = "" });
| Check | Behavior |
|---|---|
CompID empty | Redirect to login (UserLogin → Index) |
CompID present | Continue 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
ModuleManagement1is a legacy/debug action — do not use in production links.- Registration Area name differs from
Webenrollflag — UI labels often say "Registration". - Shared screens: Root controllers like
EmployeeMuseSession["Module"]when opened from multiple modules. - Deep linking: Users can bookmark Area dashboard URLs; session must remain valid.
Examples
Tile link from dashboard view
<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
Related Pages
Important Notes
Adminisration and ManagmentDashBoard must match folder names and AreaRegistration classes. "Fixing" spelling without full route migration breaks bookmarks and redirects.
Unrecognized PageID values fall back to /Dashboard/Index — they do not throw.
Common Mistakes
| Mistake | Result |
|---|---|
Using PageID Webenroll | Falls back to dashboard — use Registration |
Using PageID ControlPanel | Falls back — use Administrator |
Using PageID ManagementDashboard | Falls back — use ManagementDash |
Omitting area in RedirectToAction | Wrong controller namespace |
| Assuming ModuleManagement checks flags | User can deep-link if they know URL |
Next Steps
- Read Session Lifecycle for full login → module → logout flow.
- Open target module's Area dashboard controller for feature-specific navigation.