Administration (Control Panel)
Introduction
The Administration module—gated by the ControlPanel flag—manages user accounts, company linkage, module access flags, email settings, and high-level admin dashboard metrics. It is the control plane for who can access each functional module and how notifications are sent.
Purpose
Administration enables IT and system administrators to:
- Create and maintain user accounts
- Assign companies, roles, branches, and module flags
- Configure SMTP email settings per company context
- Monitor user counts and login activity from the admin dashboard
When to Use
Use Administration when you:
- Onboard a new ERP user or deactivate leavers
- Grant or revoke module tiles (Payroll, Bills, ESS, etc.)
- Fix email delivery for workflows that use
Session["SMTP_*"] - Audit which accounts exist for a company
The MVC Area is Adminisration (missing “t”). URLs must use /Adminisration/... — correcting the spelling without a full migration breaks bookmarks and redirects.
Overview / Architecture
Administration is a compact Area with three functional controllers plus error handling. It uses _Administrator.cshtml and modern dashboard styling (administration-dashboard.css when published).
Entry URL: /Adminisration/UserDashBoard/Index
PageID: Administrator
Module flag: ControlPanel
Controllers
| Controller | Primary responsibility |
|---|---|
| UserDashBoard | Admin home, user statistics |
| UserCreation | Create/edit users, module flags, company linkage |
| EmailConfiguration | SMTP host, port, credentials |
| ManageError | Area-local error handling |
Views / Layout
| Asset | Role |
|---|---|
_Administrator.cshtml | Control panel shell |
| UserDashBoard views | Metrics and navigation |
| UserCreation forms | Account and permission fields |
| EmailConfiguration views | SMTP setup |
Shared sidebar brand and search partials match other modern modules.
DAL
| DAL class | Role |
|---|---|
| UserAccount_DAL | User CRUD |
| LoginUser_DAL | Login-related user queries |
| UserRole_DAL | Role assignment |
| UserPermissions_DAL | Menu permission linkage |
| CompanyMaster_DAL | Company reference |
| UnitPermission_DAL | Unit permission admin |
| EMailConfiguration_DAL | SMTP settings persistence |
Business Objects
Namespace: BO.Administrator
| BO type | Role |
|---|---|
| UserAccount_BO | User profile and flags |
| LoginUser_BO | Login validation payload |
| UserRole_BO | Role rows |
| CompanyMaster_BO | Company selection |
| EMailConfiguration_BO | SMTP configuration |
Module flags on BO.User (Payroll, Webenroll, Billing, etc.) are set through user creation SPs and returned on next login via GetLoginUser.
Typical Workflow
New user provisioning:
Data Flow
- Admin opens UserCreation with valid
CompIDsession (often company 1 admin). - Form posts
UserAccount_BO→UserAccount_DAL→ write SPs. - Passwords stored encrypted via
HashCryptographybefore database insert. - EmailConfiguration updates company mail settings; login loads
SMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PSWDinto session. - UserDashBoard reads aggregate counts for monitoring.
Sensitive actions may require Session["Entryflag"] re-authentication when enabled in specific screens.
Reports
Administration focuses on dashboard metrics rather than Crystal reports. User lists and counts render in Razor grids on UserDashBoard and UserCreation follow-up screens.
Permissions
| Gate | Requirement |
|---|---|
| Module flag | dtVerifyUser.ControlPanel == true |
| Session | Valid CompID |
| PageID for tile | Administrator (not ControlPanel) |
| Self-service | Non-admins must not receive ControlPanel flag |
Dashboard links must use PageID Administrator. Using ControlPanel falls back to the home dashboard.
Common Issues
| Symptom | Likely cause |
|---|---|
| User cannot see module tile | Module flag false on UserAccounts |
| Login works, menus empty | MenuMaster / UserPermissions not seeded |
| Email not sending | SMTP settings or session not refreshed after change |
| 404 on admin URL | Used Administration instead of Adminisration |
Related Pages
Important Notes
Module flag changes apply on next login when GetLoginUser reloads dtVerifyUser.
Blank DB seed may create admin with flags but omit menu permissions—supplement MenuMaster from a reference database.
Common Mistakes
| Mistake | Consequence |
|---|---|
| Granting ControlPanel to all users | Full account exposure |
| Plain-text password in DB | Login failure — must use encryption helper |
| Wrong Area in RedirectToAction | 404 or wrong module |
Next Steps
- Document your company’s role-to-flag matrix.
- Create a test user with one module flag and verify tile visibility.
- Configure SMTP and send a test mail from a workflow that uses session SMTP keys.