3.0.0.1 Demo repository registration

This commit is contained in:
Andy Howard
2025-02-08 16:41:08 +00:00
parent 0d8e7d5619
commit c4e5712d0a
312 changed files with 13145 additions and 30232 deletions
@@ -13,6 +13,7 @@ using Sarand.BusinessMgr.Net.Standard.Base.Bus;
using Sarand.BusinessMgr.Net.Standard.Base.Consoles;
using Sarand.BusinessMgr.Net.Standard.Base.Core;
using Sarand.BusinessMgr.Net.Standard.Base.Mgr;
using Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control;
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.CodeTypes;
using Sarand.Net.Standard.Base.Core;
@@ -44,6 +45,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Components
{
//-------------------------------------------------------------------
// Data members.
private SbmInternals_Control internals_Control;
//-------------------------------------------------------------------
// Protected construction.
@@ -58,6 +60,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Components
{
if (disposing)
{
if (internals_Control != null) internals_Control.Dispose(); internals_Control = null;
}
base.Dispose(disposing);
}
@@ -65,6 +68,11 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Components
//-------------------------------------------------------------------
// Properties.
protected override SbmSessionContext SessionContext { get { return SessionData?.SessionContext ?? null; } }
// Control database.
protected SbmInternals_Control Internals_Control { get { if (internals_Control == null) { internals_Control = new SbmInternals_Control(); } return internals_Control; } }
protected SbmcAccountMgr ControlAccountMgr { get { return Internals_Control.ControlAccountMgr; } }
protected SbmcInstanceMgr ControlInstanceMgr { get { return Internals_Control.ControlInstanceMgr; } }
protected SbmcItemMgr ControlItemMgr { get { return Internals_Control.ControlItemMgr; } }
//-------------------------------------------------------------------
// Action execution events.
@@ -134,7 +142,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Components
// Online encryption parameters.
//-------------------------------------------------------------------
// Portal Request Password encryption parameters (key & IV) are defined in
// the base Controller so that they can be shared with the Admin application.
// the base Controller so that they can be shared with the Control application.
// NB IV value is generated from the key and fixed so that it doesn't change when the application restarts.
// IV Must be regenerated if key is changed.
protected static string Base64Key_RequestPassword_Portal { get; } = SacsEncryptionHelper.EncodePlainKey("[5Abus1neSSmGR~Request#Password}", SacsEncryptionHelper.KeyLength);
@@ -61,6 +61,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Components
protected SbmSessionContext SessionContext { get { return SessionData_Web?.SessionContext ?? null; } }
protected DbUpdateInfo DbUpdateInfo { get { return SessionData_Web?.DbUpdateInfo ?? new DbUpdateInfo(null, "", Sarand.Net.Standard.Base.App.SacsSystem.ComputerName); } }
protected SbmLocaliser Localiser { get; }
protected virtual SbmInstanceSchemaConsole InstanceSchemaConsole { get; } = null;
// Request properties.
protected SbmController_Web Controller { get; private set; }
internal void SetController(SbmController_Web controller) { Controller = controller; }
@@ -88,14 +89,16 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Components
public int PasswordMaxLength { get; } = 32;
//-------------------------------------------------------------------
// Control max lengths - based on database tabke column length.
/// <summary>
/// Form control value max length - Security tables.
/// <para>In many cases the database columns allow plenty of extra space for the value, in case they need to be encrypted.</para>
/// <para>Hence, several cases where the value entered in the control isn't allowed the full database length.</para>
/// </summary>
public int GetControlMaxLength(SaSecurityDbDfn.ColumnIdx column)
public virtual int GetControlMaxLength(SaSecurityDbDfn.ColumnIdx column)
{
int maxLength = (int)SaSecurityDbDfn.GetColTextLen(column);
int maxLength = (int)(InstanceSchemaConsole?.GetColTextLen(column) ?? SaSecurityDbDfn.GetColTextLen(column));
switch (column)
{
case SaSecurityDbDfn.ColumnIdx.SaSecItem_EmailAddress:
@@ -105,13 +108,13 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Components
}
/// <summary>
/// Form control value max length - code type tables.
/// Form control value max length - Code Type tables.
/// <para>In many cases the database columns allow plenty of extra space for the value, in case they need to be encrypted.</para>
/// <para>Hence, several cases where the value entered in the control isn't allowed the full database length.</para>
/// </summary>
public int GetControlMaxLength(SaCodeTypeDbDfn.ColumnIdx column)
public virtual int GetControlMaxLength(SaCodeTypeDbDfn.ColumnIdx column)
{
int maxLength = (int)SaCodeTypeDbDfn.GetColTextLen(column);
int maxLength = (int)(InstanceSchemaConsole?.GetColTextLen(column) ?? SaCodeTypeDbDfn.GetColTextLen(column));
switch (column)
{
case SaCodeTypeDbDfn.ColumnIdx.SaCodeType_Name:
@@ -121,14 +124,31 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Components
return maxLength;
}
/// <summary>
/// Form control value max length - Item Option tables.
/// <para>In many cases the database columns allow plenty of extra space for the value, in case they need to be encrypted.</para>
/// <para>Hence, several cases where the value entered in the control isn't allowed the full database length.</para>
/// </summary>
public virtual int GetControlMaxLength(SaItemOptionDbDfn.ColumnIdx column)
{
int maxLength = (int)(InstanceSchemaConsole?.GetColTextLen(column) ?? SaItemOptionDbDfn.GetColTextLen(column));
switch (column)
{
case SaItemOptionDbDfn.ColumnIdx.SaItemOption_Name:
case SaItemOptionDbDfn.ColumnIdx.SaItemOption_Context:
return Math.Min(maxLength, 100);
}
return maxLength;
}
/// <summary>
/// Form control value max length - BusinessMgr tables.
/// <para>In many cases the database columns allow plenty of extra space for the value, in case they need to be encrypted.</para>
/// <para>Hence, several cases where the value entered in the control isn't allowed the full database length.</para>
/// </summary>
public int GetControlMaxLength(SbmDbDfn.ColumnIdx column)
public virtual int GetControlMaxLength(SbmDbDfn.ColumnIdx column)
{
int maxLength = (int)SbmDbDfn.GetColTextLen(column);
int maxLength = (int)(InstanceSchemaConsole?.GetColTextLen(column) ?? SbmDbDfn.GetColTextLen(column));
switch (column)
{
case SbmDbDfn.ColumnIdx.Affiliate_Email: