576 lines
24 KiB
C#
576 lines
24 KiB
C#
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.Net.Standard.Base.App;
|
|
using Sarand.Net.Standard.Base.Bus;
|
|
using Sarand.Net.Standard.Base.CodeTypes;
|
|
using Sarand.Net.Standard.Base.Core;
|
|
using Sarand.Net.Standard.Base.Dbas;
|
|
using Sarand.Net.Standard.Base.Diary;
|
|
using Sarand.Net.Standard.Base.Interfaces;
|
|
using Sarand.Net.Standard.Base.ItemData;
|
|
using Sarand.Net.Standard.Base.ItemDocs;
|
|
using Sarand.Net.Standard.Base.ItemOptions;
|
|
using Sarand.Net.Standard.Base.ReferenceData;
|
|
using Sarand.Net.Standard.Base.Security;
|
|
using Sarand.Net.Standard.Base.UpdateLog;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
|
{
|
|
//=======================================================================
|
|
// Internals.
|
|
//=======================================================================
|
|
public partial class SbmInternals : SacsDisposable, ISbmOrganisationConfig
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Definitions.
|
|
|
|
/// <summary>
|
|
/// Internal core Session Data for Core database access when this
|
|
/// class is used outside of user specific core sessions, eg.
|
|
/// <para>- Pre-login.</para>
|
|
/// <para>- Data caches.</para>
|
|
/// <para>- Control application session interacting with a core database.</para>
|
|
/// </summary>
|
|
private class SbmSessionData_Internals : SbmSessionData, ISbmUserOrganisationContext
|
|
{
|
|
public SbmSessionData_Internals(SbmSessionContext sessionContext) : base(sessionContext) { }
|
|
// User properties.
|
|
public override string UserEmailAddress => "";
|
|
public override string UserDisplayName => "";
|
|
public override bool ValidUser => false;
|
|
public SysId UserSecurityItemId => new SysId();
|
|
public SysId UserAffiliateId => new SysId();
|
|
public override DbUpdateInfo DbUpdateInfo => new DbUpdateInfo(UserSecurityItemId, UserDisplayName, SacsSystem.ComputerName);
|
|
// User security.
|
|
public ISbmSecurityProfile_Core SecurityProfile => throw new NotImplementedException();
|
|
// Organisation.
|
|
public SysId OrganisationAffiliateId => new SysId();
|
|
public Sbm.AffiliateType OrganisationAffiliateType => Sbm.AffiliateType.Unknown;
|
|
public SysId OrganisationAssociationId => new SysId();
|
|
public string OrganisationDisplayName => "";
|
|
public string OrganisationInterfaceContext => "";
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
private class DataMembers
|
|
{
|
|
public SbmSystem system { get; } = SbmGlobals.System;
|
|
public ISacsDatabase busMgrDatabase { get; set; }
|
|
// Managers.
|
|
public 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;
|
|
}
|
|
public Managers mgr { get; } = new Managers();
|
|
// Consoles.
|
|
public class Consoles
|
|
{
|
|
public SbmInstanceSchemaConsole instanceSchemaConsole;
|
|
public SbmSessionConsole sessionConsole;
|
|
public SbmAccountsConsole accountsConsole;
|
|
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;
|
|
}
|
|
public Consoles con { get; } = new Consoles();
|
|
// System and Application codes.
|
|
public Dictionary<SaSysCodeType, List<TypeCodeDesc>> systemCodeCache { get; } = new Dictionary<SaSysCodeType, List<TypeCodeDesc>>();
|
|
public Dictionary<Sbm.ApplicationCode, List<TypeCodeDesc>> applicationCodeCache = new Dictionary<Sbm.ApplicationCode, List<TypeCodeDesc>>();
|
|
// Configurations.
|
|
public SbmStockControlConfig stockControlConfig { get; set; }
|
|
public SbmRequirementCostingConfig requirementCostingConfig { get; set; }
|
|
}
|
|
private DataMembers mbr { get; } = new DataMembers();
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
/// <summary>
|
|
/// Sessionless construction - minimal context information.
|
|
/// <para>- Used by Instance Data Cache and Control application.</para>
|
|
/// </summary>
|
|
public SbmInternals(SbmSessionContext sessionContext)
|
|
{
|
|
UserContext = new SbmSessionData_Internals(sessionContext);
|
|
ReadOnly = true;
|
|
}
|
|
/// <summary>
|
|
/// Session dependent construction.
|
|
/// </summary>
|
|
public SbmInternals(ISbmUserOrganisationContext userContext)
|
|
{
|
|
UserContext = userContext;
|
|
ReadOnly = false;
|
|
}
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing)
|
|
{
|
|
// Managers.
|
|
if (mbr.mgr.accountMgr != null) mbr.mgr.accountMgr.Dispose();
|
|
if (mbr.mgr.assetMgr != null) mbr.mgr.assetMgr.Dispose();
|
|
if (mbr.mgr.commodityMgr != null) mbr.mgr.commodityMgr.Dispose();
|
|
if (mbr.mgr.priceMgr != null) mbr.mgr.priceMgr.Dispose();
|
|
if (mbr.mgr.transactionMgr != null) mbr.mgr.transactionMgr.Dispose();
|
|
if (mbr.mgr.stockMgr != null) mbr.mgr.stockMgr.Dispose();
|
|
if (mbr.mgr.processMgr != null) mbr.mgr.processMgr.Dispose();
|
|
if (mbr.mgr.dataItemMgr != null) mbr.mgr.dataItemMgr.Dispose();
|
|
// Consoles.
|
|
// Database console doesn't require disposal.
|
|
if (mbr.con.sessionConsole != null) mbr.con.sessionConsole.Dispose();
|
|
if (mbr.con.diaryConsole != null) mbr.con.diaryConsole.Dispose();
|
|
if (mbr.con.securityConsole != null) mbr.con.securityConsole.Dispose();
|
|
if (mbr.con.codeTypeConsole != null) mbr.con.codeTypeConsole.Dispose();
|
|
if (mbr.con.referenceDataConsole != null) mbr.con.referenceDataConsole.Dispose();
|
|
if (mbr.con.updateLogConsole != null) mbr.con.updateLogConsole.Dispose();
|
|
if (mbr.con.interfaceConsole != null) mbr.con.interfaceConsole.Dispose();
|
|
if (mbr.con.itemDocConsole != null) mbr.con.itemDocConsole.Dispose();
|
|
if (mbr.con.itemOptionConsole != null) mbr.con.itemOptionConsole.Dispose();
|
|
if (mbr.con.itemDataConsole != null) mbr.con.itemDataConsole.Dispose();
|
|
if (mbr.con.itemDataConsole != null) mbr.con.itemDataConsole.Dispose();
|
|
}
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Session properties.
|
|
public SbmApplication Application { get { return SbmGlobals.Application; } }
|
|
public bool ReadOnly { get; }
|
|
public ISbmUserOrganisationContext UserContext { get; }
|
|
public SbmSessionContext SessionContext { get { return UserContext?.SessionContext; } }
|
|
public ISbmSecurityProfile_Core SecurityProfile { get { return UserContext.SecurityProfile; } }
|
|
public SbmAccountsConsole AccountsConsole { get { if (mbr.con.accountsConsole == null) mbr.con.accountsConsole = new SbmAccountsConsole(this); { return mbr.con.accountsConsole; } } }
|
|
|
|
//-------------------------------------------------------------------
|
|
// Database.
|
|
public ISacsDatabase BusMgrDatabase
|
|
{
|
|
get
|
|
{
|
|
if (mbr.busMgrDatabase == null)
|
|
mbr.busMgrDatabase = Application.CreateBusMgrDatabase(SessionContext);
|
|
return mbr.busMgrDatabase;
|
|
}
|
|
}
|
|
public DbUpdateInfo DbUpdateInfo { get { return UserContext.DbUpdateInfo; } }
|
|
// Schema.
|
|
public bool TableExists(String tableName)
|
|
{
|
|
return BusMgrDatabase.TableExists(tableName);
|
|
}
|
|
public bool ColumnExists(String tableName, String columnName)
|
|
{
|
|
return BusMgrDatabase.ColumnExists(tableName, columnName);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Database Column lengths - taking into account current database schema for selected columns.
|
|
// BusMgr tables.
|
|
public ulong GetColTextLen(SbmDbDfn.ColumnIdx column)
|
|
{
|
|
return InstanceSchemaConsole.GetColTextLen(column);
|
|
}
|
|
// Security tables.
|
|
public ulong GetColTextLen(SaSecurityDbDfn.ColumnIdx column)
|
|
{
|
|
return InstanceSchemaConsole.GetColTextLen(column);
|
|
}
|
|
// Code Type tables.
|
|
public ulong GetColTextLen(SaCodeTypeDbDfn.ColumnIdx column)
|
|
{
|
|
return InstanceSchemaConsole.GetColTextLen(column);
|
|
}
|
|
// Item Option tables.
|
|
public ulong GetColTextLen(SaItemOptionDbDfn.ColumnIdx column)
|
|
{
|
|
return InstanceSchemaConsole.GetColTextLen(column);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// System codes.
|
|
public List<TypeCodeDesc> GetSystemCodes(SaSysCodeType systemCode)
|
|
{
|
|
if (!mbr.systemCodeCache.ContainsKey(systemCode))
|
|
mbr.systemCodeCache[systemCode] = SacsSystem.GetCodesOfType(systemCode);
|
|
return new List<TypeCodeDesc>(mbr.systemCodeCache.GetValueOrDefault(systemCode, new List<TypeCodeDesc>()));
|
|
}
|
|
public List<TypeCodeDesc> MessageLevelCodes { get { return GetSystemCodes(SaSysCodeType.MessageLevel); } }
|
|
public List<TypeCodeDesc> InterfaceCategoryCodes { get { return GetSystemCodes(SaSysCodeType.InterfaceCategory); } }
|
|
public List<TypeCodeDesc> InterfaceProcessDirectionCodes { get { return GetSystemCodes(SaSysCodeType.InterfaceProcessDirection); } }
|
|
|
|
// Application codes.
|
|
public List<TypeCodeDesc> GetApplicationCodes(Sbm.ApplicationCode applicationCode)
|
|
{
|
|
if (!mbr.applicationCodeCache.ContainsKey(applicationCode))
|
|
{
|
|
List<TypeCodeDesc> codes = new List<TypeCodeDesc>();
|
|
foreach (TypeCodeDesc code in SbmSystem.GetSystemCodes(applicationCode))
|
|
{
|
|
switch (applicationCode)
|
|
{
|
|
case Sbm.ApplicationCode.AffiliateType:
|
|
if (!SessionConsole.AllowAffiliateType((Sbm.AffiliateType)code.Type)) continue;
|
|
break;
|
|
case Sbm.ApplicationCode.AssociationType:
|
|
if (!SessionConsole.AllowAssociationType((Sbm.AssociationType)code.Type)) continue;
|
|
break;
|
|
case Sbm.ApplicationCode.TransactionType:
|
|
if (!SessionConsole.AllowTransactionType((Sbm.TransactionType)code.Type)) continue;
|
|
break;
|
|
case Sbm.ApplicationCode.CommodityType:
|
|
if (code.Type == (int)Sbm.CommodityType.Asset && (!SessionConsole.AllowOption(Sbm.ConfigOption.Assets) || !AssetMgr.AssetDatabaseIsValid())) continue;
|
|
break;
|
|
case Sbm.ApplicationCode.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.ApplicationCode.FinancialType:
|
|
if ((code.Type == (int)Sbm.FinancialType.CommoditySupply || code.Type == (int)Sbm.FinancialType.CommoditySales) && !SessionConsole.AllowOption(Sbm.ConfigOption.Commodities)) continue;
|
|
break;
|
|
case Sbm.ApplicationCode.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.ApplicationCode.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.ApplicationCode.OrgOption_PeriodDays:
|
|
if (code.Type == (int)Sbm.OrgOption_PeriodDays.UpdateClosedTransaction_DispatchDetails && !SessionConsole.AllowOption(Sbm.ConfigOption.DeliveryPlanning)) continue;
|
|
if (code.Type == (int)Sbm.OrgOption_PeriodDays.UpdateStockLevelsInPast && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue;
|
|
break;
|
|
case Sbm.ApplicationCode.OrgOption_PeriodWeeks:
|
|
if (code.Type == (int)Sbm.OrgOption_PeriodWeeks.Timesheets && !SessionConsole.AllowOption(Sbm.ConfigOption.TimeRecording)) continue;
|
|
if (code.Type == (int)Sbm.OrgOption_PeriodWeeks.UpdateTimeRecords_Control && !SessionConsole.AllowOption(Sbm.ConfigOption.TimeRecording)) continue;
|
|
if (code.Type == (int)Sbm.OrgOption_PeriodWeeks.ImminentStockDue && !SessionConsole.GetOwnerOption_AllowOption(Sbm.OrgOption_AllowOption.ImminentStock)) continue;
|
|
break;
|
|
case Sbm.ApplicationCode.OrgOption_Caption:
|
|
if (!SessionConsole.AllowTransactionType(Sbm.OrgOptionToTransType((Sbm.OrgOption_Caption)code.Type))) continue;
|
|
break;
|
|
}
|
|
codes.Add(code);
|
|
}
|
|
mbr.applicationCodeCache.Add(applicationCode, codes);
|
|
}
|
|
return new List<TypeCodeDesc>(mbr.applicationCodeCache.GetValueOrDefault(applicationCode, new List<TypeCodeDesc>()));
|
|
}
|
|
// Selection of specific system code types.
|
|
public List<TypeCodeDesc> ItemTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.ItemType); } }
|
|
public List<TypeCodeDesc> AffiliateTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.AffiliateType); } }
|
|
public List<TypeCodeDesc> AddressTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.AddressType); } }
|
|
public List<TypeCodeDesc> AssociationTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.AssociationType); } }
|
|
public List<TypeCodeDesc> CommodityTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.CommodityType); } }
|
|
public List<TypeCodeDesc> AssetTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.AssetType); } }
|
|
public List<TypeCodeDesc> VehicleTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.VehicleType); } }
|
|
public List<TypeCodeDesc> TransactionTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.TransactionType); } }
|
|
public List<TypeCodeDesc> RequirementTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.RequirementType); } }
|
|
|
|
//-------------------------------------------------------------------
|
|
// Code types.
|
|
private Dictionary<Sbm.ApplCodeType, List<SaCode>> codeTypeCodes { get; } = new Dictionary<Sbm.ApplCodeType, List<SaCode>>();
|
|
public String GetCodeTypeCode(Sbm.ApplCodeType codeType)
|
|
{
|
|
return SbmSystem.GetCodeTypeCode(codeType);
|
|
}
|
|
public List<SaCode> GetCodesForCodeType(Sbm.ApplCodeType codeType, bool activeOnly = true)
|
|
{
|
|
if (!codeTypeCodes.ContainsKey(codeType))
|
|
codeTypeCodes.Add(codeType, CodeTypeConsole.GetCodesForCodeType(GetCodeTypeCode(codeType), false));
|
|
return new List<SaCode>(codeTypeCodes.GetValueOrDefault(codeType, new List<SaCode>()).Where(c => !activeOnly || c.IsStatusActive));
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Managers.
|
|
public SbmAccountMgr AccountMgr
|
|
{
|
|
get
|
|
{
|
|
if (mbr.mgr.accountMgr == null)
|
|
mbr.mgr.accountMgr = mbr.system.CreateAccountMgr(this);
|
|
return mbr.mgr.accountMgr;
|
|
}
|
|
}
|
|
public SbmAssetMgr AssetMgr
|
|
{
|
|
get
|
|
{
|
|
if (mbr.mgr.assetMgr == null)
|
|
mbr.mgr.assetMgr = mbr.system.CreateAssetMgr(this);
|
|
return mbr.mgr.assetMgr;
|
|
}
|
|
}
|
|
public SbmCommodityMgr CommodityMgr
|
|
{
|
|
get
|
|
{
|
|
if (mbr.mgr.commodityMgr == null)
|
|
mbr.mgr.commodityMgr = mbr.system.CreateCommodityMgr(this);
|
|
return mbr.mgr.commodityMgr;
|
|
}
|
|
}
|
|
public SbmPriceMgr PriceMgr
|
|
{
|
|
get
|
|
{
|
|
if (mbr.mgr.priceMgr == null)
|
|
mbr.mgr.priceMgr = mbr.system.CreatePriceMgr(this);
|
|
return mbr.mgr.priceMgr;
|
|
}
|
|
}
|
|
public SbmTransactionMgr TransactionMgr
|
|
{
|
|
get
|
|
{
|
|
if (mbr.mgr.transactionMgr == null)
|
|
mbr.mgr.transactionMgr = mbr.system.CreateTransactionMgr(this);
|
|
return mbr.mgr.transactionMgr;
|
|
}
|
|
}
|
|
public SbmStockMgr StockMgr
|
|
{
|
|
get
|
|
{
|
|
if (mbr.mgr.stockMgr == null)
|
|
mbr.mgr.stockMgr = mbr.system.CreateStockMgr(this);
|
|
return mbr.mgr.stockMgr;
|
|
}
|
|
}
|
|
public SbmProcessMgr ProcessMgr
|
|
{
|
|
get
|
|
{
|
|
if (mbr.mgr.processMgr == null)
|
|
mbr.mgr.processMgr = mbr.system.CreateProcessMgr(this);
|
|
return mbr.mgr.processMgr;
|
|
}
|
|
}
|
|
public SbmDataItemMgr DataItemMgr
|
|
{
|
|
get
|
|
{
|
|
if (mbr.mgr.dataItemMgr == null)
|
|
mbr.mgr.dataItemMgr = SbmGlobals.System.CreateDataItemMgr(this);
|
|
return mbr.mgr.dataItemMgr;
|
|
}
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Consoles.
|
|
public SbmInstanceSchemaConsole InstanceSchemaConsole
|
|
{
|
|
get
|
|
{
|
|
if (mbr.con.instanceSchemaConsole == null) { mbr.con.instanceSchemaConsole = new SbmInstanceSchemaConsole(BusMgrDatabase); }
|
|
return mbr.con.instanceSchemaConsole;
|
|
}
|
|
}
|
|
public SbmSessionConsole SessionConsole
|
|
{
|
|
get
|
|
{
|
|
if (mbr.con.sessionConsole == null) { mbr.con.sessionConsole = SbmGlobals.System.CreateSessionConsole(this); }
|
|
return mbr.con.sessionConsole;
|
|
}
|
|
}
|
|
public SaDiaryConsole DiaryConsole
|
|
{
|
|
get
|
|
{
|
|
if (mbr.con.diaryConsole == null) { mbr.con.diaryConsole = SbmGlobals.System.CreateDiaryConsole(this); }
|
|
return mbr.con.diaryConsole;
|
|
}
|
|
}
|
|
public SaSecurityConsole SecurityConsole
|
|
{
|
|
get
|
|
{
|
|
if (mbr.con.securityConsole == null) { mbr.con.securityConsole = SbmGlobals.System.CreateSecurityConsole(this); }
|
|
return mbr.con.securityConsole;
|
|
}
|
|
}
|
|
public SaCodeTypeConsole CodeTypeConsole
|
|
{
|
|
get
|
|
{
|
|
if (mbr.con.codeTypeConsole == null) { mbr.con.codeTypeConsole = SbmGlobals.System.CreateCodeTypeConsole(this); }
|
|
return mbr.con.codeTypeConsole;
|
|
}
|
|
}
|
|
public SaReferenceDataConsole ReferenceDataConsole
|
|
{
|
|
get
|
|
{
|
|
if (mbr.con.referenceDataConsole == null) { mbr.con.referenceDataConsole = SbmGlobals.System.CreateReferenceDataConsole(this); }
|
|
return mbr.con.referenceDataConsole;
|
|
}
|
|
}
|
|
public SaUpdateLogConsole UpdateLogConsole
|
|
{
|
|
get
|
|
{
|
|
if (mbr.con.updateLogConsole == null) { mbr.con.updateLogConsole = SbmGlobals.System.CreateUpdateLogConsole(this); }
|
|
return mbr.con.updateLogConsole;
|
|
}
|
|
}
|
|
public SaInterfaceConsole InterfaceConsole
|
|
{
|
|
get
|
|
{
|
|
if (mbr.con.interfaceConsole == null) { mbr.con.interfaceConsole = SbmGlobals.System.CreateInterfaceConsole(this); }
|
|
return mbr.con.interfaceConsole;
|
|
}
|
|
}
|
|
public SaItemDocConsole ItemDocConsole
|
|
{
|
|
get
|
|
{
|
|
if (mbr.con.itemDocConsole == null) { mbr.con.itemDocConsole = SbmGlobals.System.CreateItemDocConsole(this); }
|
|
return mbr.con.itemDocConsole;
|
|
}
|
|
}
|
|
public SaItemOptionConsole ItemOptionConsole
|
|
{
|
|
get
|
|
{
|
|
if (mbr.con.itemOptionConsole == null)
|
|
mbr.con.itemOptionConsole = SbmGlobals.System.CreateItemOptionConsole(this);
|
|
return mbr.con.itemOptionConsole;
|
|
}
|
|
}
|
|
public SaItemDataConsole ItemDataConsole
|
|
{
|
|
get
|
|
{
|
|
if (mbr.con.itemDataConsole == null) { mbr.con.itemDataConsole = SbmGlobals.System.CreateItemDataConsole(this); }
|
|
return mbr.con.itemDataConsole;
|
|
}
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Email.
|
|
public SbmEmailConfig EmailConfig { get { return Application.EmailConfig; } }
|
|
public SbmEmailConsole EmailConsole
|
|
{
|
|
get
|
|
{
|
|
if (mbr.con.emailConsole == null) { mbr.con.emailConsole = SbmGlobals.System.CreateEmailConsole(EmailConfig); }
|
|
return mbr.con.emailConsole;
|
|
}
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Configurations.
|
|
public SbmStockControlConfig StockControlConfig
|
|
{
|
|
get
|
|
{
|
|
if (mbr.stockControlConfig == null)
|
|
mbr.stockControlConfig = SessionConsole.GetStockControlConfig();
|
|
return mbr.stockControlConfig;
|
|
}
|
|
}
|
|
public SbmRequirementCostingConfig RequirementCostingConfig
|
|
{
|
|
get
|
|
{
|
|
if (mbr.requirementCostingConfig == null)
|
|
mbr.requirementCostingConfig = SessionConsole.GetRequirementCostingConfig();
|
|
return mbr.requirementCostingConfig;
|
|
}
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// 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);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|