Session Console and Internals.
This commit is contained in:
@@ -20,37 +20,58 @@ using Sarand.Net.Standard.Base.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static Sarand.BusinessMgr.Net.Standard.Base.App.Sbm;
|
||||
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
{
|
||||
//=======================================================================
|
||||
public class SbmInternals : SacsDisposable
|
||||
public class SbmInternals : SacsDisposable, ISbmOrganisationConfig
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
|
||||
/// <summary>
|
||||
/// Internal User Context for read-only database access when this class is used outside of user specific sessions.
|
||||
/// <para>- data caches etc.</para>
|
||||
/// </summary>
|
||||
private class SbmUserContext_Internal : SbmUserContext
|
||||
{
|
||||
public SbmUserContext_Internal(SbmSessionContext sessionContext) : base(sessionContext) { }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly SbmSystem system = SbmGlobals.System;
|
||||
private SbmAccountsDfn accountsDfn;
|
||||
// Managers.
|
||||
private SbmAccountMgr accountMgr;
|
||||
private SbmAssetMgr assetMgr;
|
||||
private SbmCommodityMgr commodityMgr;
|
||||
private SbmPriceMgr priceMgr;
|
||||
private SbmTransactionMgr transactionMgr;
|
||||
private SbmStockMgr stockMgr;
|
||||
private SbmProcessMgr processMgr;
|
||||
private SbmDataItemMgr dataItemMgr;
|
||||
private class Managers
|
||||
{
|
||||
public SbmAccountMgr accountMgr;
|
||||
public SbmAssetMgr assetMgr;
|
||||
public SbmCommodityMgr commodityMgr;
|
||||
public SbmPriceMgr priceMgr;
|
||||
public SbmTransactionMgr transactionMgr;
|
||||
public SbmStockMgr stockMgr;
|
||||
public SbmProcessMgr processMgr;
|
||||
public SbmDataItemMgr dataItemMgr;
|
||||
}
|
||||
private readonly Managers mgr = new Managers();
|
||||
// Consoles.
|
||||
private SbmSessionConsole sessionConsole;
|
||||
private SaDiaryConsole diaryConsole;
|
||||
private SaSecurityConsole securityConsole;
|
||||
private SaCodeTypeConsole codeTypeConsole;
|
||||
private SaReferenceDataConsole referenceDataConsole;
|
||||
private SaUpdateLogConsole updateLogConsole;
|
||||
private SaInterfaceConsole interfaceConsole;
|
||||
private SaItemDocConsole itemDocConsole;
|
||||
private SaItemOptionConsole itemOptionConsole;
|
||||
private SaItemDataConsole itemDataConsole;
|
||||
public SbmEmailConsole emailConsole;
|
||||
private class Consoles
|
||||
{
|
||||
public SbmSessionConsole sessionConsole;
|
||||
public SaDiaryConsole diaryConsole;
|
||||
public SaSecurityConsole securityConsole;
|
||||
public SaCodeTypeConsole codeTypeConsole;
|
||||
public SaReferenceDataConsole referenceDataConsole;
|
||||
public SaUpdateLogConsole updateLogConsole;
|
||||
public SaInterfaceConsole interfaceConsole;
|
||||
public SaItemDocConsole itemDocConsole;
|
||||
public SaItemOptionConsole itemOptionConsole;
|
||||
public SaItemDataConsole itemDataConsole;
|
||||
public SbmEmailConsole emailConsole;
|
||||
}
|
||||
private readonly Consoles con = new Consoles();
|
||||
// Configurations.
|
||||
private SbmStockControlConfig stockControlConfig;
|
||||
private SbmRequirementCostingConfig requirementCostingConfig;
|
||||
@@ -61,46 +82,53 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public SbmInternals(ISbmUserContext_Core userContext)
|
||||
public SbmInternals(SbmSessionContext sessionContext)
|
||||
{
|
||||
UserContext = new SbmUserContext_Internal(sessionContext);
|
||||
ReadOnly = true;
|
||||
}
|
||||
public SbmInternals(ISbmUserOrganisationContext userContext)
|
||||
{
|
||||
UserContext = userContext;
|
||||
ReadOnly = false;
|
||||
}
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
// Managers.
|
||||
if (accountMgr != null) accountMgr.Dispose();
|
||||
if (assetMgr != null) assetMgr.Dispose();
|
||||
if (commodityMgr != null) commodityMgr.Dispose();
|
||||
if (priceMgr != null) priceMgr.Dispose();
|
||||
if (transactionMgr != null) transactionMgr.Dispose();
|
||||
if (stockMgr != null) stockMgr.Dispose();
|
||||
if (processMgr != null) processMgr.Dispose();
|
||||
if (dataItemMgr != null) dataItemMgr.Dispose();
|
||||
if (mgr.accountMgr != null) mgr.accountMgr.Dispose();
|
||||
if (mgr.assetMgr != null) mgr.assetMgr.Dispose();
|
||||
if (mgr.commodityMgr != null) mgr.commodityMgr.Dispose();
|
||||
if (mgr.priceMgr != null) mgr.priceMgr.Dispose();
|
||||
if (mgr.transactionMgr != null) mgr.transactionMgr.Dispose();
|
||||
if (mgr.stockMgr != null) mgr.stockMgr.Dispose();
|
||||
if (mgr.processMgr != null) mgr.processMgr.Dispose();
|
||||
if (mgr.dataItemMgr != null) mgr.dataItemMgr.Dispose();
|
||||
// Reference data.
|
||||
if (currencies != null) currencies.ClearAndDispose();
|
||||
if (taxCodes != null) taxCodes.ClearAndDispose();
|
||||
if (unitsOfMeasure != null) unitsOfMeasure.ClearAndDispose();
|
||||
// Consoles.
|
||||
if (sessionConsole != null) sessionConsole.Dispose();
|
||||
if (diaryConsole != null) diaryConsole.Dispose();
|
||||
if (securityConsole != null) securityConsole.Dispose();
|
||||
if (codeTypeConsole != null) codeTypeConsole.Dispose();
|
||||
if (referenceDataConsole != null) referenceDataConsole.Dispose();
|
||||
if (updateLogConsole != null) updateLogConsole.Dispose();
|
||||
if (interfaceConsole != null) interfaceConsole.Dispose();
|
||||
if (itemDocConsole != null) itemDocConsole.Dispose();
|
||||
if (itemOptionConsole != null) itemOptionConsole.Dispose();
|
||||
if (itemDataConsole != null) itemDataConsole.Dispose();
|
||||
if (itemDataConsole != null) itemDataConsole.Dispose();
|
||||
if (con.sessionConsole != null) con.sessionConsole.Dispose();
|
||||
if (con.diaryConsole != null) con.diaryConsole.Dispose();
|
||||
if (con.securityConsole != null) con.securityConsole.Dispose();
|
||||
if (con.codeTypeConsole != null) con.codeTypeConsole.Dispose();
|
||||
if (con.referenceDataConsole != null) con.referenceDataConsole.Dispose();
|
||||
if (con.updateLogConsole != null) con.updateLogConsole.Dispose();
|
||||
if (con.interfaceConsole != null) con.interfaceConsole.Dispose();
|
||||
if (con.itemDocConsole != null) con.itemDocConsole.Dispose();
|
||||
if (con.itemOptionConsole != null) con.itemOptionConsole.Dispose();
|
||||
if (con.itemDataConsole != null) con.itemDataConsole.Dispose();
|
||||
if (con.itemDataConsole != null) con.itemDataConsole.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Session properties.
|
||||
public SbmApplication Application { get { return SbmGlobals.Application; } }
|
||||
public ISbmUserContext_Core UserContext { get; }
|
||||
public bool ReadOnly { get; }
|
||||
public ISbmUserOrganisationContext UserContext { get; }
|
||||
public SbmSessionContext SessionContext { get { return UserContext.SessionContext; } }
|
||||
public ISbmSecurityProfile_Core SecurityProfile { get { return UserContext.SecurityProfile_Core; } }
|
||||
public SbmAccountsDfn AccountsDfn { get { if (accountsDfn == null) accountsDfn = new SbmAccountsDfn(UserContext); { return accountsDfn; } } }
|
||||
@@ -111,17 +139,75 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
// System codes.
|
||||
private Dictionary<Sbm.SystemCode, List<TypeCodeDesc>> systemCodeCache = new Dictionary<Sbm.SystemCode, List<TypeCodeDesc>>();
|
||||
public List<TypeCodeDesc> GetCodesOfType(Sbm.SystemCode systemCode)
|
||||
public List<TypeCodeDesc> GetSystemCodes(Sbm.SystemCode systemCode)
|
||||
{
|
||||
if (!systemCodeCache.ContainsKey(systemCode))
|
||||
systemCodeCache.Add(systemCode, SbmSystem.GetCodesOfType(UserContext, systemCode));
|
||||
{
|
||||
List<TypeCodeDesc> codes = new List<TypeCodeDesc>();
|
||||
foreach (TypeCodeDesc code in SbmSystem.GetSystemCodes(systemCode))
|
||||
{
|
||||
switch (systemCode)
|
||||
{
|
||||
case Sbm.SystemCode.AffiliateType:
|
||||
if (!SessionConsole.AllowAffiliateType((Sbm.AffiliateType)code.Type)) continue;
|
||||
break;
|
||||
case Sbm.SystemCode.AssociationType:
|
||||
if (!SessionConsole.AllowAssociationType((Sbm.AssociationType)code.Type)) continue;
|
||||
break;
|
||||
case Sbm.SystemCode.TransactionType:
|
||||
if (!SessionConsole.AllowTransactionType((Sbm.TransactionType)code.Type)) continue;
|
||||
break;
|
||||
case Sbm.SystemCode.CommodityType:
|
||||
if (code.Type == (int)Sbm.CommodityType.Asset && (!SessionConsole.AllowOption(Sbm.ConfigOption.Assets) || !AssetMgr.AssetDatabaseIsValid())) continue;
|
||||
break;
|
||||
case Sbm.SystemCode.ProcessCategory:
|
||||
if (code.Type == (int)Sbm.ProcessCategory.Commodity && !SessionConsole.AllowOption(Sbm.ConfigOption.Commodities)) continue;
|
||||
if (code.Type == (int)Sbm.ProcessCategory.Asset && (!SessionConsole.AllowOption(Sbm.ConfigOption.Assets) || !AssetMgr.AssetDatabaseIsValid())) continue;
|
||||
break;
|
||||
case Sbm.SystemCode.FinancialType:
|
||||
if ((code.Type == (int)Sbm.FinancialType.CommoditySupply || code.Type == (int)Sbm.FinancialType.CommoditySales) && !SessionConsole.AllowOption(Sbm.ConfigOption.Commodities)) continue;
|
||||
break;
|
||||
case Sbm.SystemCode.InterfaceType_Website:
|
||||
if (code.Type == (int)Sbm.InterfaceType_Website.WebStore && !SessionConsole.AllowInterface(SaInterfaceCategory.Website, (short)code.Type)) continue;
|
||||
if (code.Type == (int)Sbm.InterfaceType_Website.JoomlaVirtueMart && !SessionConsole.AllowInterface(SaInterfaceCategory.Website, (short)code.Type)) continue;
|
||||
if (code.Type == (int)Sbm.InterfaceType_Website.MiMoWeb && !SessionConsole.AllowInterface(SaInterfaceCategory.Website, (short)code.Type)) continue;
|
||||
break;
|
||||
case Sbm.SystemCode.InterfaceType_System:
|
||||
if (code.Type == (int)Sbm.InterfaceType_System.MSOutlook && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue;
|
||||
if (code.Type == (int)Sbm.InterfaceType_System.PostcodeAnywhere && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue;
|
||||
if (code.Type == (int)Sbm.InterfaceType_System.Bac && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue;
|
||||
if (code.Type == (int)Sbm.InterfaceType_System.Pvh && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue;
|
||||
if (code.Type == (int)Sbm.InterfaceType_System.Cap && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue;
|
||||
if (code.Type == (int)Sbm.InterfaceType_System.Hpi && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue;
|
||||
if (code.Type == (int)Sbm.InterfaceType_System.Anchor_OrderFulfilment && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue;
|
||||
if (code.Type == (int)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Argos && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue;
|
||||
if (code.Type == (int)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Homebase && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue;
|
||||
break;
|
||||
case Sbm.SystemCode.OrgOption_PeriodDays:
|
||||
if (code.Type == (int)Sbm.OrgOption_PeriodDays.UpdateClosedTransaction_DispatchDetails && !SessionConsole.AllowOption(ConfigOption.DeliveryPlanning)) continue;
|
||||
if (code.Type == (int)Sbm.OrgOption_PeriodDays.UpdateStockLevelsInPast && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue;
|
||||
break;
|
||||
case Sbm.SystemCode.OrgOption_PeriodWeeks:
|
||||
if (code.Type == (int)Sbm.OrgOption_PeriodWeeks.Timesheets && !SessionConsole.AllowOption(ConfigOption.TimeRecording)) continue;
|
||||
if (code.Type == (int)Sbm.OrgOption_PeriodWeeks.UpdateTimeRecords_Control && !SessionConsole.AllowOption(ConfigOption.TimeRecording)) continue;
|
||||
if (code.Type == (int)Sbm.OrgOption_PeriodWeeks.ImminentStockDue && !SessionConsole.GetOwnerOption_AllowOption(OrgOption_AllowOption.ImminentStock)) continue;
|
||||
break;
|
||||
case Sbm.SystemCode.OrgOption_Caption:
|
||||
if (!SessionConsole.AllowTransactionType(Sbm.OrgOptionToTransType((Sbm.OrgOption_Caption)code.Type))) continue;
|
||||
break;
|
||||
}
|
||||
codes.Add(code);
|
||||
}
|
||||
systemCodeCache.Add(systemCode, codes);
|
||||
}
|
||||
return new List<TypeCodeDesc>(systemCodeCache.GetValueOrDefault(systemCode, new List<TypeCodeDesc>()));
|
||||
}
|
||||
public List<TypeCodeDesc> AffiliateTypeCodes { get { return GetCodesOfType(Sbm.SystemCode.AffiliateType); } }
|
||||
public List<TypeCodeDesc> AssociationTypeCodes { get { return GetCodesOfType(Sbm.SystemCode.AssociationType); } }
|
||||
public List<TypeCodeDesc> CommodityTypeCodes { get { return GetCodesOfType(Sbm.SystemCode.CommodityType); } }
|
||||
public List<TypeCodeDesc> AssetTypeCodes { get { return GetCodesOfType(Sbm.SystemCode.AssetType); } }
|
||||
public List<TypeCodeDesc> TransactionTypeCodes { get { return GetCodesOfType(Sbm.SystemCode.TransactionType); } }
|
||||
// Selection of specific system code types.
|
||||
public List<TypeCodeDesc> AffiliateTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.AffiliateType); } }
|
||||
public List<TypeCodeDesc> AssociationTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.AssociationType); } }
|
||||
public List<TypeCodeDesc> CommodityTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.CommodityType); } }
|
||||
public List<TypeCodeDesc> AssetTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.AssetType); } }
|
||||
public List<TypeCodeDesc> TransactionTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.TransactionType); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Code types.
|
||||
@@ -143,72 +229,72 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
{
|
||||
get
|
||||
{
|
||||
if (accountMgr == null)
|
||||
accountMgr = system.CreateAccountMgr(UserContext);
|
||||
return accountMgr;
|
||||
if (mgr.accountMgr == null)
|
||||
mgr.accountMgr = system.CreateAccountMgr(this);
|
||||
return mgr.accountMgr;
|
||||
}
|
||||
}
|
||||
public SbmAssetMgr AssetMgr
|
||||
{
|
||||
get
|
||||
{
|
||||
if (assetMgr == null)
|
||||
assetMgr = system.CreateAssetMgr(UserContext);
|
||||
return assetMgr;
|
||||
if (mgr.assetMgr == null)
|
||||
mgr.assetMgr = system.CreateAssetMgr(this);
|
||||
return mgr.assetMgr;
|
||||
}
|
||||
}
|
||||
public SbmCommodityMgr CommodityMgr
|
||||
{
|
||||
get
|
||||
{
|
||||
if (commodityMgr == null)
|
||||
commodityMgr = system.CreateCommodityMgr(UserContext);
|
||||
return commodityMgr;
|
||||
if (mgr.commodityMgr == null)
|
||||
mgr.commodityMgr = system.CreateCommodityMgr(this);
|
||||
return mgr.commodityMgr;
|
||||
}
|
||||
}
|
||||
public SbmPriceMgr PriceMgr
|
||||
{
|
||||
get
|
||||
{
|
||||
if (priceMgr == null)
|
||||
priceMgr = system.CreatePriceMgr(UserContext);
|
||||
return priceMgr;
|
||||
if (mgr.priceMgr == null)
|
||||
mgr.priceMgr = system.CreatePriceMgr(this);
|
||||
return mgr.priceMgr;
|
||||
}
|
||||
}
|
||||
public SbmTransactionMgr TransactionMgr
|
||||
{
|
||||
get
|
||||
{
|
||||
if (transactionMgr == null)
|
||||
transactionMgr = system.CreateTransactionMgr(UserContext);
|
||||
return transactionMgr;
|
||||
if (mgr.transactionMgr == null)
|
||||
mgr.transactionMgr = system.CreateTransactionMgr(this);
|
||||
return mgr.transactionMgr;
|
||||
}
|
||||
}
|
||||
public SbmStockMgr StockMgr
|
||||
{
|
||||
get
|
||||
{
|
||||
if (stockMgr == null)
|
||||
stockMgr = system.CreateStockMgr(UserContext);
|
||||
return stockMgr;
|
||||
if (mgr.stockMgr == null)
|
||||
mgr.stockMgr = system.CreateStockMgr(this);
|
||||
return mgr.stockMgr;
|
||||
}
|
||||
}
|
||||
public SbmProcessMgr ProcessMgr
|
||||
{
|
||||
get
|
||||
{
|
||||
if (processMgr == null)
|
||||
processMgr = system.CreateProcessMgr(UserContext);
|
||||
return processMgr;
|
||||
if (mgr.processMgr == null)
|
||||
mgr.processMgr = system.CreateProcessMgr(this);
|
||||
return mgr.processMgr;
|
||||
}
|
||||
}
|
||||
public SbmDataItemMgr DataItemMgr
|
||||
{
|
||||
get
|
||||
{
|
||||
if (dataItemMgr == null)
|
||||
dataItemMgr = SbmGlobals.System.CreateDataItemMgr(UserContext);
|
||||
return dataItemMgr;
|
||||
if (mgr.dataItemMgr == null)
|
||||
mgr.dataItemMgr = SbmGlobals.System.CreateDataItemMgr(this);
|
||||
return mgr.dataItemMgr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,90 +304,90 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
{
|
||||
get
|
||||
{
|
||||
if (sessionConsole == null)
|
||||
sessionConsole = Application.CreateSessionConsole(UserContext);
|
||||
return sessionConsole;
|
||||
if (con.sessionConsole == null)
|
||||
con.sessionConsole = Application.CreateSessionConsole(UserContext);
|
||||
return con.sessionConsole;
|
||||
}
|
||||
}
|
||||
public SaDiaryConsole DiaryConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
if (diaryConsole == null)
|
||||
diaryConsole = Application.CreateDiaryConsole(UserContext);
|
||||
return DiaryConsole;
|
||||
if (con.diaryConsole == null)
|
||||
con.diaryConsole = Application.CreateDiaryConsole(UserContext);
|
||||
return con.diaryConsole;
|
||||
}
|
||||
}
|
||||
public SaSecurityConsole SecurityConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
if (securityConsole == null)
|
||||
securityConsole = Application.CreateSecurityConsole(UserContext);
|
||||
return securityConsole;
|
||||
if (con.securityConsole == null)
|
||||
con.securityConsole = Application.CreateSecurityConsole(UserContext);
|
||||
return con.securityConsole;
|
||||
}
|
||||
}
|
||||
public SaCodeTypeConsole CodeTypeConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
if (codeTypeConsole == null)
|
||||
codeTypeConsole = Application.CreateCodeTypeConsole(UserContext);
|
||||
return codeTypeConsole;
|
||||
if (con.codeTypeConsole == null)
|
||||
con.codeTypeConsole = Application.CreateCodeTypeConsole(UserContext);
|
||||
return con.codeTypeConsole;
|
||||
}
|
||||
}
|
||||
public SaReferenceDataConsole ReferenceDataConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
if (referenceDataConsole == null)
|
||||
referenceDataConsole = Application.CreateReferenceDataConsole(UserContext);
|
||||
return referenceDataConsole;
|
||||
if (con.referenceDataConsole == null)
|
||||
con.referenceDataConsole = Application.CreateReferenceDataConsole(UserContext);
|
||||
return con.referenceDataConsole;
|
||||
}
|
||||
}
|
||||
public SaUpdateLogConsole UpdateLogConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
if (updateLogConsole == null)
|
||||
updateLogConsole = Application.CreateUpdateLogConsole(UserContext);
|
||||
return updateLogConsole;
|
||||
if (con.updateLogConsole == null)
|
||||
con.updateLogConsole = Application.CreateUpdateLogConsole(UserContext);
|
||||
return con.updateLogConsole;
|
||||
}
|
||||
}
|
||||
public SaInterfaceConsole InterfaceConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
if (interfaceConsole == null)
|
||||
interfaceConsole = Application.CreateInterfaceConsole(UserContext);
|
||||
return interfaceConsole;
|
||||
if (con.interfaceConsole == null)
|
||||
con.interfaceConsole = Application.CreateInterfaceConsole(UserContext);
|
||||
return con.interfaceConsole;
|
||||
}
|
||||
}
|
||||
public SaItemDocConsole ItemDocConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
if (itemDocConsole == null)
|
||||
itemDocConsole = Application.CreateItemDocConsole(UserContext);
|
||||
return itemDocConsole;
|
||||
if (con.itemDocConsole == null)
|
||||
con.itemDocConsole = Application.CreateItemDocConsole(UserContext);
|
||||
return con.itemDocConsole;
|
||||
}
|
||||
}
|
||||
public SaItemOptionConsole ItemOptionConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
if (itemOptionConsole == null)
|
||||
itemOptionConsole = Application.CreateItemOptionConsole(UserContext);
|
||||
return itemOptionConsole;
|
||||
if (con.itemOptionConsole == null)
|
||||
con.itemOptionConsole = Application.CreateItemOptionConsole(UserContext);
|
||||
return con.itemOptionConsole;
|
||||
}
|
||||
}
|
||||
public SaItemDataConsole ItemDataConsole
|
||||
{
|
||||
get
|
||||
{
|
||||
if (itemDataConsole == null)
|
||||
itemDataConsole = Application.CreateItemDataConsole(UserContext);
|
||||
return itemDataConsole;
|
||||
if (con.itemDataConsole == null)
|
||||
con.itemDataConsole = Application.CreateItemDataConsole(UserContext);
|
||||
return con.itemDataConsole;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,9 +398,9 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
{
|
||||
get
|
||||
{
|
||||
if (emailConsole == null)
|
||||
emailConsole = Application.CreateEmailConsole(UserContext);
|
||||
return emailConsole;
|
||||
if (con.emailConsole == null)
|
||||
con.emailConsole = Application.CreateEmailConsole(UserContext);
|
||||
return con.emailConsole;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,6 +524,70 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
return unitsOfMeasure.Find(item => item.Category == uomCategory && item.UnitType == uomType);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Organisation configuration.
|
||||
//-------------------------------------------------------------------
|
||||
public String GetOrganisationOption(Sbm.OrganisationOption option, String context)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOrganisationOption(option, context);
|
||||
}
|
||||
public String GetOrganisationOption(String optionName, String context)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOrganisationOption(optionName, context);
|
||||
}
|
||||
public String GetOwnerOption_Value(Sbm.OrgOption_Value value)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOwnerOption_Value(value);
|
||||
}
|
||||
public String GetOwnerOption_Folder(Sbm.OrgOption_Folder folder)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOwnerOption_Folder(folder);
|
||||
}
|
||||
public bool GetOwnerOption_AllowOption(Sbm.OrgOption_AllowOption option)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOwnerOption_AllowOption(option);
|
||||
}
|
||||
public String GetOwnerOption_Caption(Sbm.OrgOption_Caption caption, String defaultValue)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOwnerOption_Caption(caption, defaultValue);
|
||||
}
|
||||
public bool GetOwnerOption_ShowField(SbmDbDfn.ColumnIdx column)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOwnerOption_ShowField(column);
|
||||
}
|
||||
public bool GetOwnerOption_ShowColumn(Sbm.OrgOption_ShowColumn column)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOwnerOption_ShowColumn(column);
|
||||
}
|
||||
public String GetOwnerOption_FieldLabel(SbmDbDfn.ColumnIdx column, String defautValue)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOwnerOption_FieldLabel(column, defautValue);
|
||||
}
|
||||
public int GetOwnerOption_Minutes(Sbm.OrgOption_Minutes limit, int defautValue)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOwnerOption_Minutes(limit, defautValue);
|
||||
}
|
||||
public int GetOwnerOption_UpdateLimit(Sbm.OrgOption_PeriodDays limit, int defautValue)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOwnerOption_UpdateLimit(limit, defautValue);
|
||||
}
|
||||
public int GetOwnerOption_UpdateLimit(Sbm.OrgOption_PeriodWeeks limit, int defautValue)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOwnerOption_UpdateLimit(limit, defautValue);
|
||||
}
|
||||
public int GetOwnerOption_NumericDecimals(Sbm.OrgOption_NumericDecimals decimals, int defautValue = 2)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOwnerOption_NumericDecimals(decimals, defautValue);
|
||||
}
|
||||
public Sbm.CommodityType GetOwnerOption_CommodityType(Sbm.OrgOption_CommodityType commodityType)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOwnerOption_CommodityType(commodityType);
|
||||
}
|
||||
public SysId GetOwnerOption_StockLocation(Sbm.OrgOption_StockLocation stockLocation)
|
||||
{
|
||||
return SessionConsole.OrganisationConfig.GetOwnerOption_StockLocation(stockLocation);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
Reference in New Issue
Block a user