Architecture#
ManexCloud is an ASP.NET / .NET Framework solution. The important thing for a developer looking at business logic is: controllers are thin, and almost all business rules live in the MnxEFModel helpers. If you’re chasing “how does kitting a work order actually work”, start in a *Helper class — not in a controller and not in the DB.
Solution layout#
| Project | Role |
|---|---|
newSite/ | Main ASP.NET MVC + Web API host. Contains ~192 controllers (Controllers/*.cs), Razor views under Views/, static assets, SignalR hubs, and the Web API surface. Controllers delegate to helpers. |
MnxEFModel/ | The business-logic core. Entity Framework context (MnxEFContext), entities (ContextClasses/), configuration (EntityConfigurationClasses/), stored-procedure wrappers (ProcedureClasses/, ProcedureHelper/), view models, and — most importantly — the Helper/ tree that implements every business flow. |
BLL/ | Older business-logic project. Some legacy helpers (BOM.cs, Customer.cs, Order.cs, Part.cs, LicManager.cs), form scaffolding (GenericAddForm.cs, GenericForm.cs), and API response types. New business logic goes in MnxEFModel/Helper/, not here. |
DAL/ | Data-access classes and DB helpers (DBHelper.cs, GridHelper.cs, per-domain DAL classes). Wraps ADO.NET / stored-procedure calls that pre-date the EF migration. |
ManExService/ | Windows Service host for background jobs — pollers and triggers (AegisSynchronizationTrigger, NotificationPoller, LcPoller, MxNoteReminderTrigger, CalenderTrigger, AutoLogoutPoller, MirsNotificationTrigger). This is where scheduled / event-driven business logic runs outside a web request. |
TSQL/ | Every schema change, stored-procedure update, and data-migration script the app depends on. Organized by module and by ticket (e.g. MD-4693 aspmnxSP_GetRoles4Group SP update.sql). |
site/ and site.Tests/ | Older MVC site plus its test project (largely superseded by newSite). |
src/Manex.Web/ | Newer web project — inspect before adding controllers to see whether new code should go here instead of newSite/. |
ManexQbApplication/ | QuickBooks Desktop connector — the client-side piece of the QuickBooks integration. See Integrations → QuickBooks. |
Resources/ | Localization resource files (.resx). Business messages surfaced to end users should be added here, not hard-coded. |
Request flow#
A typical business request goes:
Browser → newSite Controller → MnxEFModel Helper → MnxEFContext (EF) → SQL Server
↘ ProcedureClasses / ProcedureHelper → stored procs- Controllers validate the request, resolve the current user / IP-key / warehouse context, and call a helper. They return JSON or a Razor view.
- Helpers own the business rules. They open an
MnxEFContext(often inside aTransactionScope), run reads / writes, invoke stored procs where needed, and either return a view model or throw a domain exception with a localized message from a*ResourceStringsclass. - Stored procs are used for the heavy set-based work (kit allocation, MRP, aging, GL posting, reports). Their C# wrappers live in
MnxEFModel/ProcedureClasses/andProcedureHelper/. ManExServiceruns the same helpers on a schedule for background flows (LC polling, notification dispatch, calendar events, sync jobs).
Helper conventions#
- Every business-logic helper implements an
I*Helperinterface fromMnxEFModel/Interfaces/. Prefer coding against the interface — it’s what unit tests and DI wiring use. - Multi-step writes are wrapped in
TransactionScope. If you add a new flow that touches more than one aggregate, keep the transaction — mid-flow failures should roll the whole thing back. - User-facing messages come from a resource class named after the module (e.g.
ShopFloorTrackingResourceStrings,ApResourceStrings). Do not hard-code English strings in helpers. - Row-level context (IP-Key / warehouse / user / date-format) is threaded via helper classes like
IpKeyHelper,CultureDateFormatHelper— don’t readHttpContextdeep inside a helper.
Where things live at a glance#
| I want to change… | Look in |
|---|---|
| A business rule (kitting, MRP, aging, posting) | MnxEFModel/Helper/<module>/ |
| A stored-procedure call | MnxEFModel/ProcedureClasses/ + ProcedureHelper/ |
| The DB schema / an SP definition | TSQL/<module>/ |
| A screen or JSON endpoint | newSite/Controllers/, newSite/Views/, newSite/Scripts/ |
| A background job | ManExService/*Trigger.cs or *Poller.cs |
| An integration adapter (Juki, Aegis, QB, Smart Storage) | Its integration folder under MnxEFModel/Helper/ + ManExService/ triggers |
| A localized string | Resources/*.resx and the matching *ResourceStrings.cs |