3.0.1.4 Fix pre-login crash in GetCurrencyDecimals()
This commit is contained in:
@@ -89,6 +89,19 @@ namespace Sarand.BusinessMgr.Web.Portal.Components
|
||||
}
|
||||
}
|
||||
public bool HasInternals() { return mbr.internalsSupplied != null || mbr.internals != null; }
|
||||
/// <summary>
|
||||
/// Get Currency Decimals.
|
||||
/// <br/>- NB Prior to login, Internals are invalid as no database selected.
|
||||
/// <br/>- Hence check for Session Data abnd default value if not initialised.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public ushort GetCurrentCurrencyDecimals()
|
||||
{
|
||||
if (SessionData_Portal == null)
|
||||
return SbmInternals.CurrencyDecimalsDefault;
|
||||
return Internals.GetCurrentCurrencyDecimals();
|
||||
}
|
||||
|
||||
/// <summary>Retrieve internals. Public method to avoid access by ModelBinder.</summary>
|
||||
public SbmInternals GetInternals() { return Internals; }
|
||||
/// <summary>Internals supplied from aother component, eg. the Controller.</summary>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
sbm.msg.dataNoneFound = '@Localiser.GetJavascriptText("msg.data.noneFound")';
|
||||
sbm.maxProfileImageSize = 2 * 10 ** 6;
|
||||
sbm.sessionCookieName = '@Model.SessionCookieName';
|
||||
sbm.data.decimalsCurrency = @Model.GetInternals().GetCurrentCurrencyDecimals();
|
||||
sbm.data.decimalsCurrency = @Model.GetCurrentCurrencyDecimals();
|
||||
sbm.awaitingLogin = @awaitingLogin;
|
||||
sbm.keepLoggedIn = @keepLoggedIn;
|
||||
sbm.keepLoggedInDelay = @(Sbm.Config.Control.Session.Cookie.KeepLoggedInTimeoutMillis);
|
||||
|
||||
Reference in New Issue
Block a user