Dashboard
Introduction
After successful login, users land on the dashboard — a module hub that displays tiles for each ERP area the user is allowed to access. The dashboard reads module boolean flags from Session["dtVerifyUser"] and exposes them to the view through ViewData keys that control tile visibility.
The dashboard does not load module-specific business data; it is a navigation shell gated by CompID.
Purpose
This page explains how the home screen works, which flags drive each tile, and how users proceed into functional modules.
When to Use
Refer to this page when you:
- Add or hide a module tile on the home screen
- Debug why a user does not see a expected module link
- Trace navigation from login to first module screen
- Extend dashboard with new summary widgets (requires controller changes)
How It Works
Request flow
DashboardController
URL: /Dashboard/Index
File: DamsyERP.UI/Controllers/DashboardController.cs
public ActionResult Index()
{
if (string.IsNullOrEmpty(Convert.ToString(Session["CompID"])))
return Redirect("~/Login/Index");
var dtVerifyUser = Session["dtVerifyUser"] as User;
if (dtVerifyUser != null)
{
ViewData["Payroll"] = dtVerifyUser.Payroll;
ViewData["Webenroll"] = dtVerifyUser.Webenroll;
ViewData["Billing"] = dtVerifyUser.Billing;
ViewData["StockModuleAccess"] = dtVerifyUser.ZSTOCK;
ViewData["ZSales"] = dtVerifyUser.ZSales;
ViewData["Ess"] = dtVerifyUser.Ess;
ViewData["ControlPanel"] = dtVerifyUser.ControlPanel;
ViewData["AttPunch"] = dtVerifyUser.AttPunch;
ViewData["Operation"] = dtVerifyUser.Operation;
ViewData["ManagementDashboard"] = dtVerifyUser.ManagementDashboard;
ViewData["ContractedRates"] = dtVerifyUser.ContractedRates;
ViewData["VerificationAndApproval"] = dtVerifyUser.VerificationAndApproval;
}
return View();
}
ViewData flag reference
| ViewData key | Source property | Tile label (typical) |
|---|---|---|
Payroll | User.Payroll | Payroll |
Webenroll | User.Webenroll | Registration / Web Enroll |
Billing | User.Billing | Bills |
StockModuleAccess | User.ZSTOCK | Stock |
ZSales | User.ZSales | Sales |
Ess | User.Ess | ESS |
ControlPanel | User.ControlPanel | Control Panel / Administrator |
AttPunch | User.AttPunch | Attendance Punching |
Operation | User.Operation | Operation |
ManagementDashboard | User.ManagementDashboard | Management Dashboard |
ContractedRates | User.ContractedRates | Contracted Rates |
VerificationAndApproval | User.VerificationAndApproval | Verification & Approval |
The ViewData key StockModuleAccess maps to User.ZSTOCK — not ViewData["ZSTOCK"].
View behavior
Views/Dashboard/Index.cshtml (and partials) conditionally render tiles:
@if (Convert.ToBoolean(ViewData["Payroll"]))
{
<a href="@Url.Action("ModuleManagement", "Login", new { PageID = "Payroll" })">Payroll</a>
}
Each tile links to LoginController.ModuleManagement with a PageID that redirects into the correct Area dashboard. See Module Routing.
Layout and assets
The dashboard uses the root layout (Views/Shared/_Layout.cshtml) with shared shell CSS:
app-assets/css/shell-modern.cssapp-assets/css/sidebar-unified.css
Unlike module pages, there is no _LayoutPayroll or module sidebar until the user enters an Area.
Developer Notes
- No DAL on dashboard: Current implementation is flag-driven only. KPI widgets would require new DAL calls and ViewBag data.
- Session dependency: If
dtVerifyUseris null (corrupt session), no tiles render — user should re-login. - CompID gate: Empty
CompIDalways redirects to login, notUserLoginaction — direct~/Login/Index.
Examples
User with Payroll + Billing only
After login, dtVerifyUser.Payroll = true, dtVerifyUser.Billing = true, all others false → dashboard shows two tiles.
Navigation to Payroll
Click Payroll tile
→ GET /Login/ModuleManagement?PageID=Payroll
→ Redirect /Payroll/PayrollDashboard/Index
Direct URL attempt without session
GET /Dashboard/Index without CompID
→ Redirect /Login/Index
Related Pages
Important Notes
Tiles reflect module-level flags from GetLoginUser. Individual pages may still check GetDataUserPermissions for menu CRUD rights.
All users see the same dashboard view; differences are only which tiles appear.
Common Mistakes
| Mistake | Result |
|---|---|
| Setting ViewData in view instead of controller | Tiles wrong on postback |
| Linking tile directly to Area without ModuleManagement | Works but bypasses central redirect table — inconsistent PageIDs |
Expecting ViewData["ZSTOCK"] | Key is StockModuleAccess |
| Forgetting to update dashboard when adding new module | New module flag exists but no tile |
Next Steps
- Read Module Routing for the complete PageID → URL table.
- Enter a module and follow its Area dashboard documentation in module-specific guides (when available).