Portal signin via Control Instance
This commit is contained in:
@@ -7,6 +7,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;
|
||||
@@ -31,14 +32,14 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers
|
||||
//=======================================================================
|
||||
public abstract class SbmController_Base : SaController
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private SbmInternals internals;
|
||||
private SbmSysParamCache sysParamCache = null;
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private SbmInternals internals;
|
||||
private SbmInternals_Control internals_Control;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Protected construction.
|
||||
protected SbmController_Base(SbmLocaliser localiser)
|
||||
//-------------------------------------------------------------------
|
||||
// Protected construction.
|
||||
protected SbmController_Base(SbmLocaliser localiser)
|
||||
{
|
||||
Localiser = localiser;
|
||||
|
||||
@@ -51,26 +52,26 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (sysParamCache != null) sysParamCache.Dispose();
|
||||
sysParamCache = null;
|
||||
if (internals != null) internals.Dispose();
|
||||
internals = null;
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
if (internals != null) internals.Dispose();
|
||||
internals = null;
|
||||
if (internals_Control != null) internals_Control.Dispose();
|
||||
internals_Control = null;
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
protected SbmLocaliser Localiser { get; }
|
||||
public SbmLocaliser Localiser { get; }
|
||||
protected SbmApplication_Web App { get { return SbmGlobals_Web.Application; } }
|
||||
public SbmAppConfig AppConfig { get { return App.AppConfig; } }
|
||||
public abstract SbmSessionContext SessionContext { get; }
|
||||
public abstract ISbmUserContext UserContext { get; }
|
||||
// Business components.
|
||||
public SbmInternals Internals { get { if (internals == null) internals = new SbmInternals(UserContext); return internals; } }
|
||||
protected SbmSysParamCache SysParamCache { get { if (sysParamCache == null) sysParamCache = new SbmSysParamCache(UserContext); return sysParamCache; } }
|
||||
// Managers.
|
||||
public SbmAccountMgr AccountMgr { get { return Internals.AccountMgr; } }
|
||||
public abstract ISbmUserContext_Core UserContext_Core { get; }
|
||||
// Business components.
|
||||
public SbmInternals Internals { get { if (internals == null) internals = new SbmInternals(UserContext_Core); return internals; } }
|
||||
public SbmInternals_Control Internals_Control { get { if (internals_Control == null) internals_Control = new SbmInternals_Control(); return internals_Control; } }
|
||||
// Managers.
|
||||
public SbmAccountMgr AccountMgr { get { return Internals.AccountMgr; } }
|
||||
public SbmAssetMgr AssetMgr { get { return Internals.AssetMgr; } }
|
||||
public SbmCommodityMgr CommodityMgr { get { return Internals.CommodityMgr; } }
|
||||
public SbmPriceMgr PriceMgr { get { return Internals.PriceMgr; } }
|
||||
@@ -78,6 +79,10 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers
|
||||
public SbmStockMgr StockMgr { get { return Internals.StockMgr; } }
|
||||
public SbmProcessMgr ProcessMgr { get { return Internals.ProcessMgr; } }
|
||||
public SbmDataItemMgr DataItemMgr { get { return Internals.DataItemMgr; } }
|
||||
// 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; } }
|
||||
// Consoles.
|
||||
public SbmConfigConsole ConfigConsole { get { return Internals.ConfigConsole; } }
|
||||
public SaDiaryConsole DiaryConsole { get { return Internals.DiaryConsole; } }
|
||||
@@ -103,24 +108,12 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers
|
||||
//-------------------------------------------------------------------
|
||||
public override void OnActionExecuting(ActionExecutingContext filterContext)
|
||||
{
|
||||
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn}" + (ViewData.Model != null ? " Model: " + ViewData.Model : ""));
|
||||
|
||||
//if (DebugMode) SaLogger.Debug($"{SysUtil.Fn}" + (ViewData.Model != null ? " Model: " + ViewData.Model : ""));
|
||||
base.OnActionExecuting(filterContext);
|
||||
}
|
||||
public override void OnActionExecuted(ActionExecutedContext filterContext)
|
||||
{
|
||||
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn}" + (ViewData.Model != null ? " Model: " + ViewData.Model : ""));
|
||||
|
||||
// ToDo Store system params.
|
||||
if (sysParamCache != null)
|
||||
{
|
||||
if (sysParamCache.Modified)
|
||||
{
|
||||
sysParamCache.Store();
|
||||
SaLogger.Info($"{SysUtil.Fn} User params stored.");
|
||||
}
|
||||
}
|
||||
|
||||
//if (DebugMode) SaLogger.Debug($"{SysUtil.Fn}" + (ViewData.Model != null ? " Model: " + ViewData.Model : ""));
|
||||
base.OnActionExecuted(filterContext);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user