Skip to main content

Naming conventions

Damsy ERP inherits naming from years of incremental development. Some spellings look like typos but are fixed contracts in routes, session keys, and SQL. New code should follow existing patterns unless a deliberate migration is planned.

Introduction​

Consistency reduces broken links, failed publishes, and session bugs. This page documents observed conventions in Areas, C# session keys, stored procedures, and known legacy identifiers — not aspirational style guides.

Purpose​

Prevent accidental "fixes" that break production URLs and help new developers name DAL methods, BO types, and parameters in ways that match the surrounding module.

When to use​

  • Creating a new controller, DAL class, or stored procedure wrapper
  • Debugging route 404s or session null references
  • Code review on authentication or module redirect logic

How naming layers stack​


MVC Areas and routes​

Intentional spelling (do not rename casually)​

Folder / routeCommon misspellingNotes
AdminisrationAdministrationMissing second t — Area registration, links, bookmarks
ManagmentDashBoardManagementDashboardMissing e in Management; camel DashBoard

URLs must match exactly:

/Adminisration/UserDashBoard
/ManagmentDashBoard/ManagmentDashBoard
warning

Renaming Area folders without updating AreaRegistration, routes, views, and every Html.ActionLink breaks the application.

Area naming pattern​

  • PascalCase folder names: Payroll, AttendancePunching, VerificationAndApproval
  • Dashboard controllers often named *DashboardController
  • Default action Index

PageID vs Area name​

LoginController.ModuleManagement uses PageID tokens that do not always equal Area folder names:

PageIDRedirect target Area
PayrollPayroll
BillingBills
StockStock
RegistrationRegistration

When adding modules, follow the existing ModuleManagement switch pattern.


Session and C# identifiers​

RoleId (session) vs RoleID (database)​

ContextConvention
Session keyRoleId — camelCase Id
SQL column UserRoleRoleID — uppercase ID
Session RoleRole display name string

Custom code reading session must use:

Session["RoleId"] // correct
Session["RoleID"] // wrong — returns null

Other session keys​

  • CompID, CompName, UserID, UserName, BranchCode
  • dtVerifyUser — holds BO.User (prefix dt legacy naming)
  • Module context: Module, admin re-auth: Entryflag

Controller naming​

  • Root: LoginController, DashboardController, ManageErrorController
  • Areas: <Feature>Controller in Areas/<Area>/Controllers/

DAL and BO naming​

DAL classes​

Patterns observed:

PatternExample
<Feature>_DAL.csLogin_DAL.cs
Module subfolderDAL/Payroll/SalaryProcess_DAL.cs
Module prefixBillDashBoard_DAL.cs

Methods often mirror SP names:

public DataTable GetEmployeeList(...) // → dbo.GetEmployeeList
public int InsertUpdateEmployee(...) // → dbo.InsertUpdateEmployee

BO classes​

  • Suffix _BO: SalaryProcess_BO.cs, UserPermissions_BO.cs
  • Namespace by module: BO.Payroll, BO.Bills, BO.Administrator
  • Properties match column names from SP result sets (PascalCase in C#)

Stored procedure naming​

Dominant prefixes in ERP schema (~887 procedures):

PrefixTypical purposeExamples
Get*Select lists, single record, reports dataGetLoginUser, GetCompany, GetEmployee
InsertUpdate*Combined insert/update upsertInsertUpdateEmployee, InsertUpdateBillHeader
Delete*Soft or hard deletesModule-specific
Rpt* / report namesReporting proceduresPayroll statutory extracts

Parameters often include:

  • @CompID — company scope
  • @UserID / @CreatedByUserID — audit
  • @BranchCode — branch filter

C# DAL passes parameters in the same names SQL expects.


Legacy identifiers and typos in data model​

These appear in columns and flags — preserve when writing SQL or seeds:

NameNote
BulkGenrateIRN"Generate" misspelled Genrate
ZContratedRates"Contracted" misspelled Contrated
AttendancePuncging"Punching" misspelled on user flag column
CompanyUser.CompidLowercase id in column name
WebenrollRegistration module flag — lowercase enroll

Module boolean columns on UserAccounts use Z prefix for some products: ZStock, ZSales, ZManagementDashboard.


Views, assets, and publish​

Razor views​

  • Index.cshtml — default action view
  • Partials: _PartialName.cshtml leading underscore
  • Module layouts: _Layout.cshtml, _PayrollLayout.cshtml, etc.

CSS / JS​

  • Shell: app-assets/css/shell-modern.css, sidebar-unified.css
  • Module dashboards: *-dashboard.css, *-modern.css
  • Cache bust: layout links append ?v=YYYYMMDD

csproj Content paths​

Backslashes in project file:

<Content Include="Areas\Payroll\Views\EmployeeM\Index.cshtml" />

Reports (Crystal)​

  • .rpt files: Rpt* prefix common — RptPFDetails.rpt
  • Code-behind classes mirror report name
  • Viewer .aspx under *ReportViewerForm/ folders

Examples​

Example — Correct admin URL​

https://server/Adminisration/UserDashBoard/Index

Not /Administration/....

Example — DAL method to SP mapping​

// Login_DAL.cs conceptually
cmd.CommandText = "GetLoginUser";
cmd.CommandType = CommandType.StoredProcedure;

Example — BO property matching SP column​

If SP returns EmpCode, BO property is EmpCode, not EmployeeCode, unless mapped explicitly.

Important notes​

  • Consistency beats correctness for legacy spellings in public routes and column names.
  • New stored procedures should still follow Get* / InsertUpdate* for discoverability.
  • Search both spellings when grepping history (e.g. Administration vs Adminisration).

Common mistakes​

MistakeImpact
"Fix" Area folder spellingAll module links 404
Session RoleIDAuthorization checks fail silently
New CSS without csproj ContentMissing CSS on IIS
Rename SP without updating DALRuntime SQL errors
Assume PageID equals Area folderWrong redirect in ModuleManagement

Next steps​