clsAppModelBase¶
clsAppModelBase is a thin, MustInherit extension of clsModelBase (from SAIF.Presentation.Web.MVC, not SAIF.Framework) that adds SAIF-specific conventions for consuming applications' own model classes: standard save/delete user-message constants, outbound-mail plumbing properties, and an Infragistics grid-customizer list. It also satisfies clsModelBase's MustOverride ValidateData/WriteData requirements with no-op stub implementations that descendant models are expected to override with real logic.
Purpose¶
- Provide a shared set of standard user-facing messages (
MSG_SAVE,MSG_SAVE_FAILED,MSG_DELETE_CONFIRM,MSG_NO_SAVE,MSG_SELECT_ROW) so consuming models present consistent save/delete feedback. - Carry outbound-mail intent state (
SendMail,SendTo,SendBody,SendMsg) for models that trigger email notifications as part of their save workflow. - Lazily provide an
InfragisticsGridCustomizerList(GridCustomizers) for models that customize Infragistics grid rendering. - Satisfy
clsModelBase's abstractValidateData/WriteDatacontract with stub overrides that always returnFalse, deferring real validation/persistence logic to descendant models.
Context¶
- Namespace:
SAIF.Presentation.Web.Core - Assembly/package:
SAIF.Presentation.Web.Core.Infragistics103(merged intoSAIF.BOF.Presentation.Web.Infragistics103NuGet package)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| MSG_DELETE_CONFIRM | Public Const MSG_DELETE_CONFIRM As String = "Click Save to confirm delete. <BR>" |
Standard user-facing prompt confirming a pending delete requires a save to take effect. |
| MSG_SAVE | Public Const MSG_SAVE As String = "Changes saved. <BR>" |
Standard user-facing confirmation that a save succeeded. |
| MSG_NO_SAVE | Public Const MSG_NO_SAVE As String = "No Changes to Save. <BR>" |
Standard user-facing message indicating no changes were pending. |
| MSG_SAVE_FAILED | Public Const MSG_SAVE_FAILED As String = "Save failed. <BR>" |
Standard user-facing message indicating a save attempt failed. |
| MSG_SELECT_ROW | Public Const MSG_SELECT_ROW As String = "Please select a row to delete.<br>" |
Standard user-facing prompt requiring row selection before a delete action. |
| SendBody | Property SendBody As String |
Gets or sets the body text for an outbound mail notification triggered by this model. |
| SendMail | Property SendMail As Boolean |
Gets or sets whether this model's current operation should trigger an outbound mail notification. |
| SendMsg | Property SendMsg As String |
Gets or sets an additional message to include in an outbound mail notification. |
| SendTo | Property SendTo As String |
Gets or sets the recipient address for an outbound mail notification triggered by this model. |
| GridCustomizers | ReadOnly Property GridCustomizers As InfragisticsGridCustomizerList |
Lazily instantiates and returns the model's list of Infragistics grid customizers on first access. |
| StringUtil | Public StringUtil As Utilities.clsStringUtilities |
Field providing model code direct access to the shared string-cleaning utility class. |
Inherited public members¶
Members in this section are inherited from clsModelBase in SAIF.Presentation.Web.MVC (not SAIF.Framework). All entries are retrieved from SAIF.Presentation.Web.MVC's own documentation and are listed here directly so this page is self-contained; see that library's clsModelBase API reference for full detail.
From clsModelBase (SAIF.Presentation.Web.MVC)¶
| Member | Signature | Purpose | Origin |
|---|---|---|---|
Context |
Public Property Context() As clsContext |
The cross-application context bag for this model instance; initialized to a new clsContext in the constructor.† |
SAIF.Presentation.Web.MVC — clsModelBase |
LastError |
Public Property LastError() As String |
Holds the most recent error message set by the concrete model, e.g., during validation failures.† | SAIF.Presentation.Web.MVC — clsModelBase |
Preferences |
Public ReadOnly Property Preferences() As clsPreferences |
The current user's preferences for this model's application, populated during Pre_Init(); Nothing until Pre_Init() has run.† |
SAIF.Presentation.Web.MVC — clsModelBase |
SecurityPrincipal |
Public Property SecurityPrincipal() As clsSecurityPrincipal (marked Obsolete) |
Forwards to Context.SecurityPrincipal; deprecated in favor of accessing Context.SecurityPrincipal directly.† |
SAIF.Presentation.Web.MVC — clsModelBase |
New() |
Public Sub New() |
Initializes Context to a new clsContext instance.† |
SAIF.Presentation.Web.MVC — clsModelBase |
Inherited protected/friend members¶
The following non-public members are also inherited from clsModelBase (SAIF.Presentation.Web.MVC) and are available to clsAppModelBase-derived model code but are not part of the public surface. ValidateData and WriteData are omitted here because clsAppModelBase overrides both locally (see the local Protected members table above).
| Member | Signature | Purpose | Origin |
|---|---|---|---|
Initialize |
Protected Friend Overridable Sub Initialize() |
Overridable hook for one-time concrete-model setup, invoked exactly once per model instance from Pre_Init(); no-op by default.† |
SAIF.Presentation.Web.MVC — clsModelBase |
UnInitialize |
Protected Friend Overridable Sub UnInitialize() |
Overridable hook for concrete-model teardown; no-op by default.† | SAIF.Presentation.Web.MVC — clsModelBase |
Write |
Protected Friend Function Write() As Boolean |
Template method: calls ValidateData(), and only if it returns True, calls WriteData(); returns the eventual result or False if validation failed.† |
SAIF.Presentation.Web.MVC — clsModelBase |
IsValidString |
Protected Function IsValidString(ByVal Value As String) As Boolean |
Returns False if Value is Nothing or, after trimming, an empty string; otherwise True.† |
SAIF.Presentation.Web.MVC — clsModelBase |
IsValidNumber |
Protected Function IsValidNumber(ByVal Value As String) As Boolean |
Returns True only if Value passes IsValidString and IsNumeric(Value).† |
SAIF.Presentation.Web.MVC — clsModelBase |
IsValidDate |
Protected Function IsValidDate(ByVal Value As String) As Boolean |
Returns True only if Value passes IsValidString and IsDate(Value).† |
SAIF.Presentation.Web.MVC — clsModelBase |
IsValidFutureDate (String overload) |
Protected Function IsValidFutureDate(ByVal Value As String) As Boolean |
Returns True only if Value is a valid, non-empty date strictly later than today's date (compared by short-date string).† |
SAIF.Presentation.Web.MVC — clsModelBase |
IsValidFutureDate (Date overload) |
Protected Function IsValidFutureDate(ByVal Value As Date) As Boolean |
Returns True only if Value is strictly later than today's date (compared by short-date string).† |
SAIF.Presentation.Web.MVC — clsModelBase |
Protected members¶
| Member | Signature | Purpose |
|---|---|---|
| ValidateData | Protected Overrides Function ValidateData() As Boolean |
Stub override of the abstract clsModelBase.ValidateData requirement; always returns False. Descendant models are expected to override this with real validation logic. |
| WriteData | Protected Overrides Function WriteData() As Boolean |
Stub override of the abstract clsModelBase.WriteData requirement; always returns False. Descendant models are expected to override this with real persistence logic. |
Behavioral notes¶
ValidateDataandWriteDataare intentionally no-op stubs — they exist solely to satisfyclsModelBase'sMustOverridecontract at this layer, and any descendant model that does not override them will always report validation/write failure.
Constraints and usage notes¶
clsAppModelBaseisMustInherit; consuming applications define their own concrete model classes deriving from it and are expected to overrideValidateData/WriteData.
Note: Statements marked with
†are derived from dependency library documentation via the Legends CLI. They describe inherited behavior from the indicated origin library and should be verified if the dependency version changes.
Sources¶
- SAIF.Presentation.Web.Core.Infragistics103\clsAppModelBase.vb