Skip to main content

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.UI is the startup project
  • Connection strings configured — MyConnectionString points at a database with schema + seed
  • SQL Server service running

Start the application

  1. Open DamsyERP.sln in Visual Studio.
  2. Confirm DamsyERP.UI is the startup project.
  3. 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.

info

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:

FieldValue
CompanyDamsy Technologies
Login IDadmin
PasswordAdmin@123

The password is stored encrypted in SQL Server via HashCryptography.Encrypt — the plaintext above is for login only.

tip

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

KeyDescription
CompID / CompNameSelected company
UserID / UserNameAccount identity
Role / RoleIdRole name and ID
dtVerifyUserFull user object with module booleans
BranchCodeUser branch
StartMonth / StartYearDefault 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:

  1. 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.
  2. Seed — minimal company, role, branch, admin user, and module flags via 04-seed-minimal.sql.
warning

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

SymptomCheck
Company dropdown emptyGetCompany SP missing or DB unreachable
Invalid loginPassword hash, CompanyUser linkage, CompID match
Dashboard blank tilesModule flags on user record
Redirect loopForceHttps true without HTTPS

Common mistakes

MistakeResult
Running against schema-less DBException on first DB call
Wrong company selectedValid user but login rejected for that CompID
Expecting full menus from minimal seedEmpty navigation — copy permissions tables
Typo in admin passwordSeed uses Admin@123 with capital A

Next steps

Tune application behavior in Configuration, or review Connection strings if you need to switch databases or align legacy Crystal connection names.