Skip to content

SAIF.Presentation.Web.MVC operations and processes

This page is the operation catalog and cross-operation hub for this library. Each operation's detailed, step-by-step logic lives in its own page under operations/.

Operation catalog

Operation Intent Trigger Inputs Outputs Rules Tables SQL
Page/control lifecycle initialization Orchestrate the WebForms page/control request lifecycle: timeout check, authentication, menu authorization, model pre-init, query-string handling ViewPageBase.Page_Init / ViewControlBase.Page_Init Current HttpContext (session, query string, request path) Populated Model, Session("navdata"), possible redirect/response termination BR-MVC-001, BR-MVC-002, BR-MVC-003 — SQL-MVC-003
Cross-application context hand-off Merge context values left by a prior application into the current model when arriving via a cross-application referrer clsControllerBase.CheckContext (referrer present, step 9 of initialization) Referring URL path, current session ID Merged context values, possible navigation BR-MVC-005 Context SQL-MVC-002, SQL-MVC-004
Cross-application navigation Persist context and redirect/pop-up to a target application or view, optionally with a new model instance Explicit controller call (Navigate/Navigate2) from concrete application code Target app/view, popup flags HTTP redirect or window.open script, persisted context row(s) BR-MVC-004, BR-MVC-005 Context SQL-MVC-001, SQL-MVC-004
Model write pipeline Validate model state before persisting it Explicit controller/page call (typically a save postback) Model's in-memory state populated by the concrete Retrieve Boolean success BR-MVC-006 — —
Error handling Centralize unhandled-exception routing, logging, and redirect to an error page ViewPageBase.Page_Error The unhandled exception User-facing message and/or redirect — — —

Process flow diagram

The following diagram visualizes the primary operational flow across operations.

flowchart TD
    Start([HTTP request arrives]) --> Init[Page/control lifecycle initialization]
    Init --> SecCheck{Authenticated?}
    SecCheck -->|No, clsEnvironment.InternalAddress true| Challenge([401 NTLM/Basic challenge])
    SecCheck -->|No, clsEnvironment.InternalAddress false| Deny([Throw Not Authorized])
    SecCheck -->|Yes| MenuCheck{Menu authorized?}
    MenuCheck -->|No| LoginRedirect([Redirect to OnlineLogin/LoginScreen.aspx])
    MenuCheck -->|Yes| Referrer{Referrer present?}
    Referrer -->|Yes, different app| ContextHandoff[Cross-application context hand-off]
    Referrer -->|No / same app| Retrieve[CallRetrieve: concrete Retrieve hook]
    ContextHandoff --> Retrieve
    Retrieve --> UserAction{User navigates or saves?}
    UserAction -->|Navigate| Navigation[Cross-application navigation]
    UserAction -->|Save| Write[Model write pipeline]
    UserAction -->|Unhandled error| ErrorHandling[Error handling]
    Navigation --> EndNav([Redirect / popup])
    Write --> EndWrite([Persisted or rejected])
    ErrorHandling --> EndErr([Error page redirect])

Database interactions

The following table summarizes which operations read from or write to the database. Per-step SQL and table citations live in each operation's detail page under operations/.

Operation SQL Tables Type
Page/control lifecycle initialization SQL-MVC-003 Context Read
Cross-application context hand-off SQL-MVC-002, SQL-MVC-004 Context Read, Delete
Cross-application navigation SQL-MVC-004, SQL-MVC-001 Context Delete, Write

Failure and edge-case behavior

  • Session-timeout redirects swallow the ThreadAbortException raised by Response.Redirect/Response.End via Thread.ResetAbort(), so the abort does not propagate as an unhandled error.
  • clsContextRepository.Delete/Retrieve/Save wrap all ADO.NET failures in an ApplicationException with a fixed message (e.g., "Context Repository Delete Failed."), losing the original exception's type but preserving it as InnerException.
  • No rowcount/contention validation exists around the delete-then-insert (SaveContext) or read-then-delete (RetrieveContext) flows against the Context table — a concurrent request for the same session could race with these operations.
  • Navigate2 requires SupportsMultiModel = True; calling it otherwise throws ApplicationException("Navigate2 only supported with Multiple Model configuration.") (BR-MVC-004).

Sources

  • SAIF.Presentation.Web.MVC\clsControllerBase.vb
  • SAIF.Presentation.Web.MVC\clsContext.vb
  • SAIF.Presentation.Web.MVC\clsModelBase.vb
  • SAIF.Presentation.Web.MVC\ViewPageBase.aspx.vb
  • SAIF.Presentation.Web.MVC\NavigationContext.vb