Running locally
Once Visual Studio is configured and your database connection string is set, you can run Damsy ERP locally with IIS Express and sign in using the default seed account.
Purpose
This page covers the day-to-day developer loop: press F5, land on the login screen, authenticate, and navigate into module dashboards.
Prerequisites
- Installation complete —
DamsyERP.UIis the startup project - Connection strings configured —
MyConnectionStringpoints at a database with schema + seed - SQL Server service running
Start the application
- Open
DamsyERP.slnin Visual Studio. - Confirm
DamsyERP.UIis the startup project. - Press F5 (Debug) or Ctrl+F5 (without debugging).
IIS Express starts and your browser opens to the default route.
Default route — Login
Routing is configured in RouteConfig.cs:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Login", action = "Index", id = UrlParameter.Optional }
);
You land on /Login/Index — the company dropdown, login ID, and password form.
Production UX begins at Login, not the scaffold Home/Index pages. Those root controllers are legacy ASP.NET MVC template remnants.
Sign in with seed credentials
If you applied the minimal blank-database seed (database-backup/scripts-blank-db/04-seed-minimal.sql), use:
| Field | Value |
|---|---|
| Company | Damsy Technologies |
| Login ID | admin |
| Password | Admin@123 |
The password is stored encrypted in SQL Server via HashCryptography.Encrypt — the plaintext above is for login only.
If login fails after seeding, run 04b-fix-admin-login.sql from the script pack to diagnose and repair the admin account chain.
Login flow
Session keys set on success
| Key | Description |
|---|---|
CompID / CompName | Selected company |
UserID / UserName | Account identity |
Role / RoleId | Role name and ID |
dtVerifyUser | Full user object with module booleans |
BranchCode | User branch |
StartMonth / StartYear | Default payroll period |
After login — home dashboard
Successful authentication redirects to /Dashboard/Index. The dashboard shows module tiles based on flags on dtVerifyUser — Payroll, Bills, Stock, ESS, etc.
Clicking a tile calls LoginController.ModuleManagement(PageID), which redirects to the appropriate Area dashboard (e.g., /Payroll/PayrollDashboard/Index).
Database setup reminder
A fresh blank database requires two steps beyond creating the empty catalog:
- Schema — export from a working database (~185 tables, ~887 stored procedures). Scripts in
database-backup/scripts-blank-db/document the process; schema is not fully stored in Git. - Seed — minimal company, role, branch, admin user, and module flags via
04-seed-minimal.sql.
Minimal seed may omit MenuMaster and UserPermissions. Login can succeed while sidebar menus are empty or individual pages error until permissions data is copied from a working environment.
Developer notes
Area session gate
Every Area action typically verifies Session["CompID"]. If session expires (30-minute InProc timeout), users redirect to login via UserLogin.
HTTPS in local dev
Keep ForceHttps=false in Web.config until you have local SSL configured. See Configuration.
Debugging tips
| Symptom | Check |
|---|---|
| Company dropdown empty | GetCompany SP missing or DB unreachable |
| Invalid login | Password hash, CompanyUser linkage, CompID match |
| Dashboard blank tiles | Module flags on user record |
| Redirect loop | ForceHttps true without HTTPS |
Common mistakes
| Mistake | Result |
|---|---|
| Running against schema-less DB | Exception on first DB call |
| Wrong company selected | Valid user but login rejected for that CompID |
| Expecting full menus from minimal seed | Empty navigation — copy permissions tables |
| Typo in admin password | Seed uses Admin@123 with capital A |
Related pages
Next steps
Tune application behavior in Configuration, or review Connection strings if you need to switch databases or align legacy Crystal connection names.