Skip to main content

Solution structure

The Damsy ERP codebase is a Visual Studio solution with four projects. Each project has a clear responsibility, and dependencies flow in one direction: the UI references everything; the DAL never references the UI.

Purpose

Understanding project boundaries tells you where to add code — a new payroll screen belongs in DamsyERP.UI/Areas/Payroll, its data calls in DAL, and its transfer objects in BO.

Solution file

Open DamsyERP.sln at the repository root. Set DamsyERP.UI as the startup project before running or debugging.

Projects at a glance

ProjectNamespaceResponsibility
DamsyERP.UIDamsyERP.UIWeb application — controllers, Areas, views, static assets, report viewers, routing
DALDALData access layer — ADO.NET calls to stored procedures via BaseHelper
BOBOBusiness objects / DTOs — BO.Payroll, BO.Employee, BO.User, etc.
UTILITIESUTILITIESShared helpers — cryptography, constants, cross-cutting utilities

Dependency diagram

Rule of thumb: If you need SQL access, add or extend a class in DAL. If you need a shape for form data or SP results, add a class in BO. If both UI and DAL need it (hashing, formatting), put it in UTILITIES.

DamsyERP.UI

The web project contains everything user-facing.

Root controllers

LocationExamples
Controllers/LoginController, DashboardController, EmployeeMController, ManageErrorController

Root controllers handle authentication, the module launcher dashboard, shared employee master screens, and global error pages.

MVC Areas

Each module is an Area under Areas/:

Areas/
├── Payroll/
├── Registration/
├── Bills/
├── Stock/
├── Sales/
├── ESS/
├── ContractedRates/
├── Operation/
├── AttendancePunching/
├── Adminisration/ ← intentional spelling
├── ManagmentDashBoard/ ← intentional spelling
└── VerificationAndApproval/

Each Area includes:

  • Controllers/ — module-specific actions
  • Views/ — Razor templates and _Layout*.cshtml
  • Optional .aspx Crystal report viewer pages

App_Start

RouteConfig.cs, BundleConfig.cs, FilterConfig.cs, and AreaRegistration classes wire routing and static asset bundling at application start.

Static assets

app-assets/ holds shared CSS (shell-modern.css, sidebar-unified.css) and module-specific styles (payroll-modern.css, etc.).

DAL

The data access project contains one or more *_DAL classes per domain (e.g., Login_DAL, PayRollDashBoard_DAL). Methods build SqlParameter arrays and delegate to BaseHelper:

// Pattern used throughout DAL classes
var dt = baseHelper.GetDataTable("dbo.GetLoginUser", parameters);

BaseHelper.ResolveConnectionString() reads MyConnectionString from Web.config (see Connection strings).

BO

Plain C# classes representing entities and form payloads. Controllers populate BO objects from request data and session; DAL methods accept BO instances as inputs to stored procedure parameters.

The BO.User object is especially important — it carries module boolean flags (Payroll, Billing, ZSTOCK, …) deserialized into session as dtVerifyUser after login.

UTILITIES

Shared code with no database dependency:

  • HashCryptography — password encryption before SP comparison
  • Constants and formatting helpers referenced by both UI and DAL

How a feature flows across projects

Developer notes

  • Do not add UI references from DAL or BO — keep dependency direction clean.
  • DAL classes often define a private struct Procedure with SP name constants — search for an existing DAL in the same domain before creating a new one.
  • Report .rpt files live inside the UI project near their Area report viewers.
  • Web.config lives only in DamsyERP.UI — connection strings and appSettings are not duplicated in other projects.
tip

When debugging a module action, set breakpoints in this order: Area controller → DAL method → BaseHelper → SQL Profiler on the stored procedure name from the DAL struct.

Common mistakes

MistakeFix
Adding business logic only in the controllerMove persistence to DAL; keep controller thin
Creating duplicate DTOs in UI projectUse or extend BO classes
Referencing System.Web from DALKeep DAL web-agnostic except where legacy code already does
Renaming Area foldersBreaks routes — see Features for correct spellings

Next steps

With the solution map in hand, proceed to Requirements and Installation to open and run the solution locally.