Skip to main content

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
Route spelling

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​

ControllerPrimary responsibility
UserDashBoardAdmin home, user statistics
UserCreationCreate/edit users, module flags, company linkage
EmailConfigurationSMTP host, port, credentials
ManageErrorArea-local error handling

Views / Layout​

AssetRole
_Administrator.cshtmlControl panel shell
UserDashBoard viewsMetrics and navigation
UserCreation formsAccount and permission fields
EmailConfiguration viewsSMTP setup

Shared sidebar brand and search partials match other modern modules.

DAL​

DAL classRole
UserAccount_DALUser CRUD
LoginUser_DALLogin-related user queries
UserRole_DALRole assignment
UserPermissions_DALMenu permission linkage
CompanyMaster_DALCompany reference
UnitPermission_DALUnit permission admin
EMailConfiguration_DALSMTP settings persistence

Business Objects​

Namespace: BO.Administrator

BO typeRole
UserAccount_BOUser profile and flags
LoginUser_BOLogin validation payload
UserRole_BORole rows
CompanyMaster_BOCompany selection
EMailConfiguration_BOSMTP 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​

  1. Admin opens UserCreation with valid CompID session (often company 1 admin).
  2. Form posts UserAccount_BO → UserAccount_DAL → write SPs.
  3. Passwords stored encrypted via HashCryptography before database insert.
  4. EmailConfiguration updates company mail settings; login loads SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PSWD into session.
  5. 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​

GateRequirement
Module flagdtVerifyUser.ControlPanel == true
SessionValid CompID
PageID for tileAdministrator (not ControlPanel)
Self-serviceNon-admins must not receive ControlPanel flag
PageID mismatch

Dashboard links must use PageID Administrator. Using ControlPanel falls back to the home dashboard.

Common Issues​

SymptomLikely cause
User cannot see module tileModule flag false on UserAccounts
Login works, menus emptyMenuMaster / UserPermissions not seeded
Email not sendingSMTP settings or session not refreshed after change
404 on admin URLUsed Administration instead of Adminisration

Important Notes​

Re-login required

Module flag changes apply on next login when GetLoginUser reloads dtVerifyUser.

Minimal seed limitations

Blank DB seed may create admin with flags but omit menu permissions—supplement MenuMaster from a reference database.

Common Mistakes​

MistakeConsequence
Granting ControlPanel to all usersFull account exposure
Plain-text password in DBLogin failure — must use encryption helper
Wrong Area in RedirectToAction404 or wrong module

Next Steps​

  1. Document your company’s role-to-flag matrix.
  2. Create a test user with one module flag and verify tile visibility.
  3. Configure SMTP and send a test mail from a workflow that uses session SMTP keys.