3.0.0.3 Control Repository Schema & Logs.

This commit is contained in:
Andy Howard
2025-02-10 18:25:40 +00:00
parent 75185ed302
commit a7bec4e806
36 changed files with 1272 additions and 94 deletions
@@ -280,7 +280,8 @@ namespace Sarand.BusinessMgr.Web.Portal.App
{
// New Session context.
ushort sessionContextIdx = sessionContextIdx_Next++;
sessionContextData = new SessionContextData_Control(new SbmSessionContext_Web(sessionContextIdx, Sbm.Application.WebPortal), owner.Id, repository.Id);
bool demoRepository = repositoryContext.EqualsCI(Sbm.RepositoryContext_Demo);
sessionContextData = new SessionContextData_Control(new SbmSessionContext_Web(sessionContextIdx, demoRepository ? Sbm.Application.WebDemo : Sbm.Application.WebPortal), owner.Id, repository.Id);
sessionContexts.Add(sessionContextData.SessionContext.Index, sessionContextData);
SaLogger.Info($"{SysUtil.Fn} Control Instance initialised: Context: {repository.Context}. Database: {repository.DatabaseName}.");
}
@@ -65,6 +65,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Components
// Business components.
// NB Keep these accessors protected to avoid them being called by the model binding logic before the session data is ready.
protected SbmInternals Internals { get { if (internals == null) internals = new SbmInternals(SessionData_Portal); return internals; } }
public SbmInternals GetInternals() { return Internals; }
// Managers.
protected SbmAccountMgr AccountMgr { get { return Internals.AccountMgr; } }
protected SbmCommodityMgr CommodityMgr { get { return Internals.CommodityMgr; } }
@@ -49,7 +49,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Contacts
}
public Sbm.AffiliateType GetFilterContactType()
{
Sbm.AffiliateType affiliateType = (Sbm.AffiliateType)Internals.AffiliateTypeCodes.GetTypeForCode(Filter.ContactType);
Sbm.AffiliateType affiliateType = (Sbm.AffiliateType)SbmSystem.GetSystemCodes(Sbm.SystemCode.AffiliateType).GetTypeForCode(Filter.ContactType);
if (affiliateType == 0 && !StringUtil.IsBlank(Filter.ContactType) && StringUtil.IsNumeric(Filter.ContactType, true))
affiliateType = (Sbm.AffiliateType)StringUtil.ToInt(Filter.ContactType);
return affiliateType;