diff --git a/SaBusMgrCoreProcs/Procs/Interfaces/SbmInterfaceProcess_Commodity_Export.cs b/SaBusMgrCoreProcs/Procs/Interfaces/SbmInterfaceProcess_Commodity_Export.cs
index a3435f3..67a96df 100644
--- a/SaBusMgrCoreProcs/Procs/Interfaces/SbmInterfaceProcess_Commodity_Export.cs
+++ b/SaBusMgrCoreProcs/Procs/Interfaces/SbmInterfaceProcess_Commodity_Export.cs
@@ -320,7 +320,7 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces
public SbmCommodity.Params GetParams()
{
SbmCommodity.Params prmCommodity = config.CommodityParams ?? new SbmCommodity.Params();
- prmCommodity.IncludedIds.AddRange(config.ItemIds);
+ prmCommodity.IdsIncluded.AddRange(config.ItemIds);
return prmCommodity;
}
private DbResultSet ExecuteQuery()
@@ -715,7 +715,7 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces
AddColumnValue(SbmCommodity.Column.Length, "Cmd_Length", "Length");
//AddColumnValue(SbmCommodity.Column.LengthUomId, "Cmd_LengthUomId", "Length","UOM Id");
AddColumnValue(SbmCommodity.Column.Length_ValueUnits, "Cmd_Length_ValueUnits", "Length", "", "", "value & units");
- if (ConfigConsole.DisplayAttribute(UserContext, SbmDbDfn.ColumnIdx.Commodity_Volume))
+ if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_Volume))
{
AddColumnValue(SbmCommodity.Column.Volume, "Cmd_Volume", "Volume");
//AddColumnValue(SbmCommodity.Column.VolumeUomId, "Cmd_VolumeUomId", "Volume","UOM Id");
@@ -724,7 +724,7 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces
AddColumnValue(SbmCommodity.Column.Density, "Cmd_Density", "Density");
//AddColumnValue(SbmCommodity.Column.DensityUomId, "Cmd_DensityUomId", "Density","UOM Id");
AddColumnValue(SbmCommodity.Column.Density_ValueUnits, "Cmd_Density_ValueUnits", "Density", "", "", "value & units");
- if (ConfigConsole.DisplayAttribute(UserContext, SbmDbDfn.ColumnIdx.Commodity_BoxQuantity))
+ if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_BoxQuantity))
{
AddColumnValue(SbmCommodity.Column.BoxQuantity, "Cmd_BoxQuantity", "Box qty");
//AddColumnValue(SbmCommodity.Column.BoxUomId, "Cmd_BoxUomId", "Box","UOM Id");
@@ -732,7 +732,7 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces
}
AddColumnValue(SbmCommodity.Column.Dimensions, "Cmd_Dimensions", "Dimensions");
AddColumnValue(SbmCommodity.Column.SpecSummary, "Cmd_SpecSummary", "Specification");
- if (ConfigConsole.DisplayAttribute(UserContext, SbmDbDfn.ColumnIdx.Commodity_ICNTariffCode))
+ if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_ICNTariffCode))
AddColumnValue(SbmCommodity.Column.ICNTariffCode, "Cmd_ICNTariffCode", "Tariff code");
// Codings:
if (CommodityMgr.CodeTypeHasCodes(Sbm.ApplCodeType.CommodityRange))
@@ -800,7 +800,7 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces
AddColumnValue(SbmCommodity.Column.ReorderQty, "Cmd_ReorderQty", "Reorder qty");
AddColumnValue(SbmCommodity.Column.QtyOnOrder, "Cmd_QtyOnOrder", "Qty on order");
// Sales:
- if (ConfigConsole.AllowOption(UserContext, Sbm.ConfigOption.CommodityExclusiveToCustomer))
+ if (SessionConsole.AllowOption(Sbm.ConfigOption.CommodityExclusiveToCustomer))
AddColumnValue(SbmCommodity.Column.Customer_Name, "Cmd_CustomerName", "Customer name");
AddColumnValue(SbmCommodity.Column.SalesPrice, "Cmd_SalesPrice", "Sales price");
AddColumnValue(SbmCommodity.Column.SalesPrice_Fmt, "Cmd_SalesPrice_Fmt", "Sales price (fmt)");
@@ -824,7 +824,7 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces
AddColumnValue(SbmCommodity.Column.LastOrderDate, "Cmd_LastOrderDate", "Last order date");
AddColumnValue(SbmCommodity.Column.LastOrderQty, "Cmd_LastOrderQty", "Last order qty");
// Customer definition:
- if (ConfigConsole.AllowOption(UserContext, Sbm.ConfigOption.CommodityCustomers) && CommodityMgr.TableExists(SbmDbDfn.TableIdx.CommodityCustomer))
+ if (SessionConsole.AllowOption(Sbm.ConfigOption.CommodityCustomers) && CommodityMgr.TableExists(SbmDbDfn.TableIdx.CommodityCustomer))
{
String commodityCustomerComment = "Only relevant for customer commodity exports";
AddColumnValue(SbmCommodity.Column.Cust_ProductCode, "CmdCust_ProductCode", "Customer product code", "", "", commodityCustomerComment);
@@ -902,13 +902,13 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces
AddColumnValue(SbmCommodity.Column.Stock_AvailVsReorder, "Cmd_Stock_AvailVsReorder", "Stock - avail vs reorder");
AddColumnValue(SbmCommodity.Column.Stock_ImminentAvailVsReorder, "Cmd_Stock_ImminentAvailVsReorder", "Stock - imminent avail vs reorder");
// Stock bays by location.
- if (ConfigConsole.DisplayAttribute(UserContext, SbmDbDfn.ColumnIdx.StockLevel_Bay1))
+ if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.StockLevel_Bay1))
AddColumnValue(SbmCommodity.Column.Stock_Bays, "Cmd_Stock_Bays", "Stock bays");
- if (ConfigConsole.DisplayAttribute(UserContext, SbmDbDfn.ColumnIdx.StockLevel_Bay1))
+ if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.StockLevel_Bay1))
AddColumnValue(SbmCommodity.Column.Stock_Bay1, "Cmd_Stock_Bay1", "Bay 1", "Stock - ", "", "Selected location");
- if (ConfigConsole.DisplayAttribute(UserContext, SbmDbDfn.ColumnIdx.StockLevel_Bay2))
+ if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.StockLevel_Bay2))
AddColumnValue(SbmCommodity.Column.Stock_Bay2, "Cmd_Stock_Bay2", "Bay 2", "Stock - ", "", "Selected location");
- if (ConfigConsole.DisplayAttribute(UserContext, SbmDbDfn.ColumnIdx.StockLevel_Bay3))
+ if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.StockLevel_Bay3))
AddColumnValue(SbmCommodity.Column.Stock_Bay3, "Cmd_Stock_Bay3", "Bay 3", "Stock - ", "", "Selected location");
// Stock due:
AddColumnValue(SbmCommodity.Column.Stock_NextDue_Commodity_Date, "Cmd_Stock_NextDue_Commodity_Date", "Stock - next date due commodity");
@@ -1003,7 +1003,7 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces
AddColumnValue(SbmCommodity.Column.Stock_EndOfMonth_12, "Cmd_Stock_EndOfMonth_12", "Stock - end of month 12");
// Requirements.
AddColumnValue(SbmCommodity.Column.Reqnt_AmountUnit_Earliest_ById, "Cmd_Reqnt_AmountUnit_Earliest_ById", "Earliest item price (regardless of item status)");
- if (ConfigConsole.DisplayAttribute(UserContext, SbmDbDfn.ColumnIdx.Commodity_DrawingIssue))
+ if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_DrawingIssue))
AddColumnValue(SbmCommodity.Column.Reqnt_AmountUnit_Earliest_ByCode, "Cmd_Reqnt_AmountUnit_Earliest_ByCode", "Earliest item price (regardless of issue or item status");
// Processes:
if (ProcessMgr.HasProcesses(Sbm.ProcessCategory.Commodity))
@@ -1031,25 +1031,25 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces
bool allowColumn = true;
SbmDbDfn.ColumnIdx eDbCol = (SbmDbDfn.ColumnIdx)CommodityMgr.GetCommodityColumnDfn(eCol).DbColumn;
// Some columns excluded by console.
- if (allowColumn) allowColumn = ((int)eDbCol < 1 || ConfigConsole.DisplayAttribute(UserContext, eDbCol));
+ if (allowColumn) allowColumn = ((int)eDbCol < 1 || SessionConsole.DisplayAttribute(eDbCol));
if (allowColumn)
{
// Some tables require console permission.
switch (SbmDbDfn.GetTableForColumn(eDbCol))
{
case SbmDbDfn.TableIdx.PortfolioItem:
- allowColumn = ConfigConsole.AllowOption(UserContext, Sbm.ConfigOption.AllowPortfolios);
+ allowColumn = SessionConsole.AllowOption(Sbm.ConfigOption.AllowPortfolios);
if (allowColumn)
allowColumn = CommodityMgr.PortfolioDatabaseIsValid;
break;
case SbmDbDfn.TableIdx.StockLevel:
- allowColumn = ConfigConsole.GetStockControlConfig(UserContext).AllowStockControl();
+ allowColumn = SessionConsole.GetStockControlConfig().AllowStockControl();
if (allowColumn)
allowColumn = StockMgr.DatabaseIsValid();
break;
case SbmDbDfn.TableIdx.Transaction:
case SbmDbDfn.TableIdx.Requirement:
- allowColumn = ConfigConsole.AllowOption(UserContext, Sbm.ConfigOption.AllowTransactions);
+ allowColumn = SessionConsole.AllowOption(Sbm.ConfigOption.AllowTransactions);
break;
}
@@ -1058,7 +1058,7 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces
{
String sDescPrefix = pcDescPrefix;
String sDescSuffix = pcDescSuffix;
- optionValues_Column.Add(eCol, sCode, (sDescPrefix + " " + ConfigConsole.GetAttributeCaption(UserContext, eDbCol, sDesc) + " " + sDescSuffix).Trim(), pcComment);
+ optionValues_Column.Add(eCol, sCode, (sDescPrefix + " " + SessionConsole.GetAttributeCaption(eDbCol, sDesc) + " " + sDescSuffix).Trim(), pcComment);
bAddValue = true;
}
return bAddValue;
diff --git a/SaBusMgrCoreProcs/Procs/Procs/SbmProcess_Base.cs b/SaBusMgrCoreProcs/Procs/Procs/SbmProcess_Base.cs
index e8e40f1..7346eac 100644
--- a/SaBusMgrCoreProcs/Procs/Procs/SbmProcess_Base.cs
+++ b/SaBusMgrCoreProcs/Procs/Procs/SbmProcess_Base.cs
@@ -25,8 +25,8 @@ using Sarand.BusinessMgr.Net.Standard.Base.Consoles;
namespace Sarand.BusinessMgr.Net.Core.Procs.Procs
{
- //=======================================================================
- public abstract partial class SbmProcess_Base : SaProcess
+ //=======================================================================
+ public abstract partial class SbmProcess_Base : SaProcess
{
//-------------------------------------------------------------------
// Configuration.
@@ -126,8 +126,8 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Procs
public static Color ExcelColumnHeadingColor { get; } = Color.LightYellow;
// Security.
protected ISbmSecurityProfile_Core SecurityProfile { get { return Internals.SecurityProfile; } }
- protected bool UserCanUpdateContacts { get { return (SecurityProfile != null && SecurityProfile.UserCanUpdateContacts); } }
- protected bool UserCanCreateContacts { get { return (SecurityProfile != null && SecurityProfile.UserCanCreateContacts); } }
+ protected bool UserCanUpdateContacts { get { return (SecurityProfile != null && SecurityProfile.UserCanUpdateContacts()); } }
+ protected bool UserCanCreateContacts { get { return (SecurityProfile != null && SecurityProfile.UserCanCreateContacts()); } }
protected bool UserCanViewFinancials { get { return (SecurityProfile != null && SecurityProfile.UserCanViewFinancials()); } }
protected bool UserCanUpdateFinancials { get { return (SecurityProfile != null && SecurityProfile.UserCanUpdateFinancials()); } }
protected bool UserCanManageFinancials { get { return (SecurityProfile != null && SecurityProfile.UserCanUpdateFinancials()); } }
@@ -146,7 +146,7 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Procs
protected SbmProcessMgr ProcessMgr { get { return Internals.ProcessMgr; } }
protected SbmDataItemMgr DataItemMgr { get { return Internals.DataItemMgr; } }
// Consoles.
- protected SbmConfigConsole ConfigConsole { get { return Internals.ConfigConsole; } }
+ protected SbmSessionConsole SessionConsole { get { return Internals.SessionConsole; } }
protected SaSecurityConsole SecurityConsole { get { return Internals.SecurityConsole; } }
protected SaCodeTypeConsole CodeTypeConsole { get { return Internals.CodeTypeConsole; } }
protected SaReferenceDataConsole ReferenceDataConsole { get { return Internals.ReferenceDataConsole; } }
diff --git a/SaBusMgrCoreProcs/Procs/Procs/SbmProcess_Commodity_Export.cs b/SaBusMgrCoreProcs/Procs/Procs/SbmProcess_Commodity_Export.cs
index 41b0fbf..94e49d3 100644
--- a/SaBusMgrCoreProcs/Procs/Procs/SbmProcess_Commodity_Export.cs
+++ b/SaBusMgrCoreProcs/Procs/Procs/SbmProcess_Commodity_Export.cs
@@ -182,9 +182,9 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Procs
// Processing options - flags.
if (optionContexts_Flag.Count == 0)
{
- optionContexts_Flag.Add(ProcessOptionFlag.IncludeCol_MaterialCost, "IncludeCol_MaterialCost", "Include column - " + ConfigConsole.GetAttributeCaption(UserContext, SbmDbDfn.ColumnIdx.Commodity_MaterialCost, "Material cost"));
- optionContexts_Flag.Add(ProcessOptionFlag.IncludeCol_CostPrice, "IncludeCol_CostPrice", "Include column - " + ConfigConsole.GetAttributeCaption(UserContext, SbmDbDfn.ColumnIdx.Commodity_CostPrice, "Cost price"));
- optionContexts_Flag.Add(ProcessOptionFlag.IncludeCol_RetailPrice, "IncludeCol_RetailPrice", "Include column - " + ConfigConsole.GetAttributeCaption(UserContext, SbmDbDfn.ColumnIdx.Commodity_RetailPrice, "Retail price"));
+ optionContexts_Flag.Add(ProcessOptionFlag.IncludeCol_MaterialCost, "IncludeCol_MaterialCost", "Include column - " + SessionConsole.GetAttributeCaption(SbmDbDfn.ColumnIdx.Commodity_MaterialCost, "Material cost"));
+ optionContexts_Flag.Add(ProcessOptionFlag.IncludeCol_CostPrice, "IncludeCol_CostPrice", "Include column - " + SessionConsole.GetAttributeCaption(SbmDbDfn.ColumnIdx.Commodity_CostPrice, "Cost price"));
+ optionContexts_Flag.Add(ProcessOptionFlag.IncludeCol_RetailPrice, "IncludeCol_RetailPrice", "Include column - " + SessionConsole.GetAttributeCaption(SbmDbDfn.ColumnIdx.Commodity_RetailPrice, "Retail price"));
optionContexts_Flag.Add(ProcessOptionFlag.IncludeCol_StockCurrent, "IncludeCol_StockCurrent", "Include column - Stock: current");
optionContexts_Flag.Add(ProcessOptionFlag.IncludeCol_StockAvailable, "IncludeCol_StockAvailable", "Include column - Stock: available");
optionContexts_Flag.Add(ProcessOptionFlag.IncludeCol_StockDue_MonthTo03, "IncludeCol_StockDue_MonthTo03", "Include column - Stock: due to 3 months");
@@ -415,18 +415,18 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Procs
displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.Weight_ValueUnits));
if (UserContext.GetOwnerOption_ShowColumn(Sbm.OrgOption_ShowColumn.Commodity_PackQtySale))
displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.PackQtySale));
- if (ConfigConsole.DisplayAttribute(UserContext, SbmDbDfn.ColumnIdx.Commodity_Volume))
+ if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_Volume))
{
// Aug16 Cadix Was just SbmCommodity.Column.Volume_ValueUnits
displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.Volume));
//displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.Volume_Unit));
}
- if (ConfigConsole.DisplayAttribute(UserContext, SbmDbDfn.ColumnIdx.Commodity_BoxQuantity))
+ if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_BoxQuantity))
displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.BoxQuantity_ValueUnits));
displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.Dimensions));
if (CommodityMgr.CodeTypeHasCodes(Sbm.ApplCodeType.CommodityMaterial)) displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.MaterialDesc));
if (CommodityMgr.CodeTypeHasCodes(Sbm.ApplCodeType.CommodityFinish)) displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.FinishDesc));
- if (ConfigConsole.DisplayAttribute(UserContext, SbmDbDfn.ColumnIdx.Commodity_ICNTariffCode))
+ if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_ICNTariffCode))
displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.ICNTariffCode));
if (config.ExportType == ExportType.PurchasePlanning)
@@ -533,13 +533,13 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Procs
else
{
// Standard column list.
- if (ConfigConsole.DisplayAttribute(UserContext, SbmDbDfn.ColumnIdx.Commodity_DrawingIssue))
+ if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_DrawingIssue))
displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.DrawingIssue));
displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.Status_Current_X));
// Only show 'Type' column if type not selected:
if (config.CommodityParams.CommodityType <= 0)
displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.Type_Desc));
- if (ConfigConsole.AllowOption(UserContext, Sbm.ConfigOption.CommodityExclusiveToCustomer))
+ if (SessionConsole.AllowOption(Sbm.ConfigOption.CommodityExclusiveToCustomer))
displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.Customer_Name));
displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.SalesPrice));
if (CommodityMgr.CodeTypeHasCodes(Sbm.ApplCodeType.CommodityRange)) displayColumns.Add(CommodityMgr.GetCommodityColumnDfn(SbmCommodity.Column.RangeDesc));
diff --git a/SaBusMgrCoreProcs/SaBusMgrCoreProcs.csproj b/SaBusMgrCoreProcs/SaBusMgrCoreProcs.csproj
index 75c228f..a765282 100644
--- a/SaBusMgrCoreProcs/SaBusMgrCoreProcs.csproj
+++ b/SaBusMgrCoreProcs/SaBusMgrCoreProcs.csproj
@@ -16,4 +16,8 @@
+
+
+
+
diff --git a/SaBusMgrCoreWeb/SaBusMgrCoreWeb.csproj b/SaBusMgrCoreWeb/SaBusMgrCoreWeb.csproj
index 7610589..8cee9bf 100644
--- a/SaBusMgrCoreWeb/SaBusMgrCoreWeb.csproj
+++ b/SaBusMgrCoreWeb/SaBusMgrCoreWeb.csproj
@@ -7,6 +7,7 @@
+
diff --git a/SaBusMgrCoreWeb/Web/App/SbmApplication_Web.cs b/SaBusMgrCoreWeb/Web/App/SbmApplication_Web.cs
index 2d2ddbc..0202e16 100644
--- a/SaBusMgrCoreWeb/Web/App/SbmApplication_Web.cs
+++ b/SaBusMgrCoreWeb/Web/App/SbmApplication_Web.cs
@@ -24,8 +24,8 @@ using System.Text;
namespace Sarand.BusinessMgr.Net.Core.Web.App
{
- //=======================================================================
- public abstract class SbmApplication_Web : SbmApplication
+ //=======================================================================
+ public abstract class SbmApplication_Web : SbmApplication
{
//-------------------------------------------------------------------
// Data members.
@@ -98,9 +98,9 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App
//-------------------------------------------------------------------
// Create consoles.
- public override SbmConfigConsole CreateConfigConsole(SbmSessionContext sessionContext)
+ public override SbmSessionConsole CreateSessionConsole(ISbmUserContext_Core userContext)
{
- return SbmConfigConsole.CreateConsole(sessionContext);
+ return SbmSessionConsole.CreateConsole(userContext);
}
public override SaDiaryConsole CreateDiaryConsole(ISbmUserContext_Core userContext)
{
@@ -114,10 +114,6 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App
{
return new SbmCodeTypeConsole_Web(userContext);
}
- public override SaReferenceDataConsole CreateReferenceDataConsole(ISbmUserContext_Core userContext)
- {
- return null;
- }
public override SaItemDataConsole CreateItemDataConsole(ISbmUserContext_Core userContext)
{
return null;
diff --git a/SaBusMgrCoreWeb/Web/App/SbmInstanceConfig_Core.cs b/SaBusMgrCoreWeb/Web/App/SbmInstanceConfig_Core.cs
new file mode 100644
index 0000000..d1bc856
--- /dev/null
+++ b/SaBusMgrCoreWeb/Web/App/SbmInstanceConfig_Core.cs
@@ -0,0 +1,74 @@
+using DocumentFormat.OpenXml.Drawing.Diagrams;
+using Sarand.BusinessMgr.Net.Standard.Base.App;
+using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
+using Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control;
+using Sarand.Net.Standard.Base.App;
+using Sarand.Net.Standard.Base.Bus;
+using Sarand.Net.Standard.Base.Core;
+using Sarand.Net.Standard.Base.Utils;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+
+namespace Sarand.BusinessMgr.Net.Core.Web.App
+{
+ //=======================================================================
+ ///
+ /// Facade Instance configuration for core databases without Control configuration.
+ ///
+ public class SbmInstanceConfig_Core : SbmInstanceConfig
+ {
+ //-------------------------------------------------------------------
+ // Definitions.
+
+ //-------------------------------------------------------------------
+ // Data members.
+
+ //-------------------------------------------------------------------
+ // Construction.
+ public SbmInstanceConfig_Core(SbmSessionContext_Web sessionContext)
+ {
+ this.SessionContext = sessionContext;
+ }
+
+ //-------------------------------------------------------------------
+ // Properties.
+ private SbmSessionContext_Web SessionContext { get; }
+
+ //-------------------------------------------------------------------
+ // Allowed data component types.
+ //-------------------------------------------------------------------
+
+ // Supported affiliate types.
+ public override bool AllowAffiliateType(Sbm.AffiliateType affiliateType, bool defaultResponse)
+ {
+ return defaultResponse;
+ }
+
+ // Supported affiliate types.
+ public override bool AllowAssociationType(Sbm.AssociationType affiliateType, bool defaultResponse)
+ {
+ return defaultResponse;
+ }
+
+ // Supported affiliate types.
+ public override bool AllowTransactionType(Sbm.TransactionType affiliateType, bool defaultResponse)
+ {
+ return defaultResponse;
+ }
+
+ //-------------------------------------------------------------------
+
+ // Supported application options.
+ public override bool AllowApplicationOption(Sbm.ConfigOption option, bool defaultResponse)
+ {
+ return defaultResponse;
+ }
+
+ //-------------------------------------------------------------------
+ }
+ //=======================================================================
+}
diff --git a/SaBusMgrCoreWeb/Web/App/SbmLocaliser.cs b/SaBusMgrCoreWeb/Web/App/SbmLocaliser.cs
index e1b420d..bb3e13f 100644
--- a/SaBusMgrCoreWeb/Web/App/SbmLocaliser.cs
+++ b/SaBusMgrCoreWeb/Web/App/SbmLocaliser.cs
@@ -28,7 +28,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App
// Properties.
public abstract IStringLocalizer MainProperties { get; }
public virtual List AlternativeProperties { get; } = new List();
- private HashSet MissingKeysLogged { get; } = new HashSet(StringComparer.OrdinalIgnoreCase);
+ private HashSet MissingKeysLogged { get; } = new HashSet(StringComparer.OrdinalIgnoreCase);
//-------------------------------------------------------------------
// Generic phrase translation.
@@ -36,7 +36,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App
/// Retrieve localised text.
public LocalizedString GetText(string key, bool logMissingKey = true)
{
- return GetText(key, new object[] { }, logMissingKey );
+ return GetText(key, new object[] { }, logMissingKey);
}
public LocalizedString GetText(string key, object param)
{
@@ -49,22 +49,22 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App
public LocalizedString GetText(string key, object[] parameters, bool logMissingKey = true)
{
LocalizedString text = MainProperties.GetString(key, parameters);
- if (text.ResourceNotFound)
- {
- // Look up key in alternative property files.
- foreach (IStringLocalizer properties in AlternativeProperties ?? new List())
- {
- text = parameters == null || parameters.IsEmpty() ? properties.GetString(key) : properties.GetString(key, parameters);
- if (!text.ResourceNotFound)
- break;
- }
- }
- if (text.ResourceNotFound && logMissingKey && !MissingKeysLogged.Contains(key))
- {
- MissingKeysLogged.Add(key);
- SaLogger.Debug($"{SysUtil.Fn} Key not found: {key}");
- }
- return text;
+ if (text.ResourceNotFound)
+ {
+ // Look up key in alternative property files.
+ foreach (IStringLocalizer properties in AlternativeProperties ?? new List())
+ {
+ text = parameters == null || parameters.IsEmpty() ? properties.GetString(key) : properties.GetString(key, parameters);
+ if (!text.ResourceNotFound)
+ break;
+ }
+ }
+ if (text.ResourceNotFound && logMissingKey && !MissingKeysLogged.Contains(key))
+ {
+ MissingKeysLogged.Add(key);
+ SaLogger.Debug($"{SysUtil.Fn} Key not found: {key}");
+ }
+ return text;
}
// Square bracket indexing.
@@ -162,6 +162,15 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App
return affiliateTypeCodes.GetDescForType(affiliateType, affiliateTypeCodes.GetCodeForType(affiliateType));
}
+ // Association Type.
+ public String GetAssociationTypeCaption(Sbm.AssociationType associationType)
+ {
+ if ((int)associationType < 1) return "";
+ // ToDo Association Type localisation.
+ List associationTypeCodes = codes.GetCodesOfType(Sbm.SystemCode.AssociationType);
+ return associationTypeCodes.GetDescForType(associationType, associationTypeCodes.GetCodeForType(associationType));
+ }
+
// Asset Type.
public String GetAssetTypeCaption(Sbm.AssetType assetType)
{
diff --git a/SaBusMgrCoreWeb/Web/Controllers/SbmController_Base.cs b/SaBusMgrCoreWeb/Web/Controllers/SbmController_Base.cs
index 07453f4..48ba1b0 100644
--- a/SaBusMgrCoreWeb/Web/Controllers/SbmController_Base.cs
+++ b/SaBusMgrCoreWeb/Web/Controllers/SbmController_Base.cs
@@ -29,8 +29,8 @@ using System.Threading.Tasks;
namespace Sarand.BusinessMgr.Net.Core.Web.Controllers
{
- //=======================================================================
- public abstract class SbmController_Base : SaController
+ //=======================================================================
+ public abstract class SbmController_Base : SaController
{
//-------------------------------------------------------------------
// Data members.
@@ -64,7 +64,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers
// Properties.
public SbmLocaliser Localiser { get; }
protected SbmApplication_Web App { get { return SbmGlobals_Web.Application; } }
- public SbmAppConfig AppConfig { get { return App.AppConfig; } }
+ public App.SbmAppConfig AppConfig { get { return App.AppConfig; } }
public abstract SbmSessionContext SessionContext { get; }
public abstract ISbmUserContext_Core UserContext_Core { get; }
// Business components.
@@ -84,7 +84,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers
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 SbmSessionConsole SessionConsole { get { return Internals.SessionConsole; } }
public SaDiaryConsole DiaryConsole { get { return Internals.DiaryConsole; } }
public SaSecurityConsole SecurityConsole { get { return Internals.SecurityConsole; } }
public SaCodeTypeConsole CodeTypeConsole { get { return Internals.CodeTypeConsole; } }
diff --git a/SaBusMgrCoreWeb/Web/Helpers/SbmAppConfigHelper.cs b/SaBusMgrCoreWeb/Web/Helpers/SbmAppConfigHelper.cs
index 76391c8..9d929fd 100644
--- a/SaBusMgrCoreWeb/Web/Helpers/SbmAppConfigHelper.cs
+++ b/SaBusMgrCoreWeb/Web/Helpers/SbmAppConfigHelper.cs
@@ -12,17 +12,17 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Helpers
public static class SbmAppConfigHelper
{
//-------------------------------------------------------------------
- public static Dictionary ExtractAppConfigs(IConfigurationSection appConfigsSection)
+ public static Dictionary ExtractAppConfigs(IConfigurationSection appConfigsSection)
{
- // NB The set of configurations will only allow one per context.
- // Only the last configuration found for each context will be stored (NB usually only one of each apart from 'Defaults').
- Dictionary appConfigs = new Dictionary();
+ // NB The set of configurations will only allow one per context.
+ // Only the last configuration found for each context will be stored (NB usually only one of each apart from 'Defaults').
+ Dictionary appConfigs = new Dictionary();
- // Start the list with a default 'Defaults' configuration - values set to application defaults (defined in Sbm).
- // NB This can be overridden in each level of configuration.
- // Settings from the 'Defaults' configuration provide values where they are missing from other configurations.
- // NB Coverage may not be 100% - just where it's proven needed.
- SbmAppConfig defaultsAppConfig = new SbmAppConfig(Sbm.Config.Context_Defaults, null, null);
+ // Start the list with a default 'Defaults' configuration - values set to application defaults (defined in Sbm).
+ // NB This can be overridden in each level of configuration.
+ // Settings from the 'Defaults' configuration provide values where they are missing from other configurations.
+ // NB Coverage may not be 100% - just where it's proven needed.
+ App.SbmAppConfig defaultsAppConfig = new App.SbmAppConfig(Sbm.Config.Context_Defaults, null, null);
appConfigs.Add(defaultsAppConfig.Context, defaultsAppConfig);
// Load session configurations.
@@ -30,8 +30,8 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Helpers
{
if (StringUtil.IsEmpty(appConfigSection.Key)) continue;
- // Extract the configuration, supplying current 'Defaults' to supply missing values, and add to the list.
- SbmAppConfig appConfig = new SbmAppConfig(appConfigSection.Key, appConfigSection, defaultsAppConfig);
+ // Extract the configuration, supplying current 'Defaults' to supply missing values, and add to the list.
+ App.SbmAppConfig appConfig = new App.SbmAppConfig(appConfigSection.Key, appConfigSection, defaultsAppConfig);
appConfigs.Remove(appConfigSection.Key);
appConfigs.Add(appConfigSection.Key, appConfig);
@@ -48,13 +48,13 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Helpers
//=======================================================================
public static class AppConfigList
{
- public static SbmAppConfig getConfigForApplication(this List appConfigs)
+ public static App.SbmAppConfig getConfigForApplication(this List appConfigs)
{
- SbmAppConfig defaultsAppConfig = new SbmAppConfig("", null, null);
+ App.SbmAppConfig defaultsAppConfig = new App.SbmAppConfig("", null, null);
SbmApplication app = SbmGlobals_Web.Application;
if (app != null)
{
- foreach (SbmAppConfig appConfig in appConfigs)
+ foreach (App.SbmAppConfig appConfig in appConfigs)
{
if (appConfig.Environments.ContainsCI(app.EnvironmentName))
return appConfig;
diff --git a/SaBusMgrCoreWeb/Web/Helpers/SbmEmailConfigHelper.cs b/SaBusMgrCoreWeb/Web/Helpers/SbmEmailConfigHelper.cs
index 758e342..ea366b7 100644
--- a/SaBusMgrCoreWeb/Web/Helpers/SbmEmailConfigHelper.cs
+++ b/SaBusMgrCoreWeb/Web/Helpers/SbmEmailConfigHelper.cs
@@ -75,7 +75,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Helpers
//=======================================================================
public static class EmailConfigList
{
- public static SbmEmailConfig getConfigForSession(this List emailConfigs, SbmAppConfig appConfig)
+ public static SbmEmailConfig getConfigForSession(this List emailConfigs, App.SbmAppConfig appConfig)
{
if (appConfig != null && !StringUtil.IsEmpty(appConfig.Email.Context))
{
diff --git a/SaBusMgrCoreWeb/Web/Models/SbmModel_Base.cs b/SaBusMgrCoreWeb/Web/Models/SbmModel_Base.cs
index 4bfcf8a..d2d0c6f 100644
--- a/SaBusMgrCoreWeb/Web/Models/SbmModel_Base.cs
+++ b/SaBusMgrCoreWeb/Web/Models/SbmModel_Base.cs
@@ -58,7 +58,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Models
//-------------------------------------------------------------------
// Application properties.
private SbmApplication_Web App { get { return SbmGlobals_Web.Application; } }
- protected SbmAppConfig AppConfig { get { return App.AppConfig; } }
+ protected App.SbmAppConfig AppConfig { get { return App.AppConfig; } }
protected SbmSystem_Web System { get { return App.System_Web; } }
public String SessionCookieName { get { return App.SessionCookieName; } }
public SbmSessionData SessionData { get { return SessionData_Web; } }
@@ -94,7 +94,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Models
protected SbmcInstanceMgr ControlInstanceMgr { get { return Internals_Control.ControlInstanceMgr; } }
protected SbmcItemMgr ControlItemMgr { get { return Internals_Control.ControlItemMgr; } }
// Consoles.
- protected SbmConfigConsole ConfigConsole { get { return Internals.ConfigConsole; } }
+ protected SbmSessionConsole SessionConsole { get { return Internals.SessionConsole; } }
protected SaDiaryConsole DiaryConsole { get { return Internals.DiaryConsole; } }
protected SaSecurityConsole SecurityConsole { get { return Internals.SecurityConsole; } }
protected SaCodeTypeConsole CodeTypeConsole { get { return Internals.CodeTypeConsole; } }
@@ -251,17 +251,26 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Models
// NB Use methods rathe rthan accessors for properties that depend on session data
// to avoid the model binding logic invoking a getter before it's ready for use.
- /// List of Address Types for dropdown.
+ /// List of Code Types for dropdown.
public IEnumerable GetCodeTypesForSelect()
{
- List codeTypes = new List();
- SaCodeType.Params prmCodeType = new SaCodeType.Params();
- prmCodeType.SortColumns.Add(CodeTypeConsole.GetCodeTypeColumnDfn(SaCodeType.Column.Name));
+ List codeTypes = new List();
+ SaCodeType.Params prmCodeType = new SaCodeType.Params();
+ prmCodeType.SortColumns.Add(CodeTypeConsole.GetCodeTypeColumnDfn(SaCodeType.Column.Name));
foreach (SaCodeType codeType in CodeTypeConsole.GetCodeTypeList(prmCodeType))
- codeTypes.Add(codeType.Code, codeType.Name);
+ codeTypes.Add(codeType.Code, codeType.Name);
return new SelectList(codeTypes, "Code", "Desc");
}
+ /// List of Code Type Codes for dropdown.
+ public IEnumerable GetCodeTypeCodesForSelect(Sbm.ApplCodeType codeType, bool activeOnly = true)
+ {
+ List codes = new List();
+ foreach (SaCode code in CodeTypeConsole.GetCodesForCodeType(SbmSystem.GetCodeTypeCode(codeType), activeOnly))
+ codes.Add(code.Code, code.Description);
+ return new SelectList(codes, "Code", "Desc");
+ }
+
/// List of Address Types for dropdown.
public IEnumerable GetAddressTypeCodesForSelect()
{
@@ -270,12 +279,12 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Models
/// List of Affiliate Types for dropdown.
public IEnumerable GetAffiliateTypeCodesForSelect()
- {
- return new SelectList(GetCodesOfType(Sbm.SystemCode.AffiliateType), "Code", "Desc");
- }
+ {
+ return new SelectList(GetCodesOfType(Sbm.SystemCode.AffiliateType), "Code", "Desc");
+ }
- /// List of Association Types for dropdown.
- public IEnumerable GetAssociationTypeCodesForSelect()
+ /// List of Association Types for dropdown.
+ public IEnumerable GetAssociationTypeCodesForSelect()
{
return new SelectList(GetCodesOfType(Sbm.SystemCode.AssociationType), "Code", "Desc");
}
@@ -283,7 +292,6 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Models
/// List of Commodity Types for dropdown.
public IEnumerable GetCommodityTypeCodesForSelect()
{
-
return new SelectList(GetCodesOfType(Sbm.SystemCode.CommodityType), "Code", "Desc");
}
diff --git a/SaBusMgrStandardBase/Base/App/Sbm.cs b/SaBusMgrStandardBase/Base/App/Sbm.cs
index 66439f1..b4082d3 100644
--- a/SaBusMgrStandardBase/Base/App/Sbm.cs
+++ b/SaBusMgrStandardBase/Base/App/Sbm.cs
@@ -112,7 +112,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
//-------------------------------------------------------------------
// Configuration console.
- public enum ConfigConsole
+ public enum SessionConfig
{
Generic,
Sarand,
@@ -127,7 +127,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
{
Text,
Html
- };
+ }
//-------------------------------------------------------------------
///
@@ -408,7 +408,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
CommoditySuppliers,
CommodityItemDocs,
//---------------------------------------------------------------
- };
+ }
//-------------------------------------------------------------------
///
@@ -469,7 +469,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
ItemOption = SaDataItemType.ItemOption,
SecurityItem = SaDataItemType.SecurityItem,
SecurityLink = SaDataItemType.SecurityLink,
- };
+ }
//-------------------------------------------------------------------
///
@@ -538,7 +538,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Asset,
VehicleClass,
Vehicle,
- };
+ }
//-------------------------------------------------------------------
/// Association Tab.
@@ -553,7 +553,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Time,
Task,
Doc,
- };
+ }
//-------------------------------------------------------------------
///
@@ -564,7 +564,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Create,
Update,
Remove,
- };
+ }
//-------------------------------------------------------------------
///
@@ -580,7 +580,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
DataTaxRate,
DataUnitMeasure,
DataUomCategory, // has it own right of UOM Cat
- };
+ }
//-------------------------------------------------------------------
/// ItemBatchType link between data items.
@@ -589,7 +589,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Any = -1,
Unknown = 0, // Do not change existing values - these are tied to the database.
SalesOrder = 10,
- };
+ }
//-------------------------------------------------------------------
///
@@ -614,7 +614,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
ItemCodeList_JobTrade = 101,
ItemCodeList_JobEngineer = 102,
ItemCodeList_SeasonalCategory = 103,
- };
+ }
+
+ public enum AssociatedItemMode
+ {
+ Unknown,
+ Commodity_Parent, // 'From' item is fixed commodity - list associated 'To' items.
+ Commodity_Child, // 'To' item is fixed commodity - list associated 'From' items.
+ Requirement_Parent, // etc.
+ Requirement_Child,
+ }
+
//-------------------------------------------------------------------
///
@@ -635,7 +645,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Process_LabourCost_Job = 311,
Currency = 312,
Region = 313,
- };
+ }
//-------------------------------------------------------------------
///
@@ -646,7 +656,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Any = 0,
Security = 1, // Security parameter.
UserParam = 2, // User configuration parameter.
- };
+ }
//-------------------------------------------------------------------
///
@@ -702,7 +712,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Contact_Update,
Contact_Manage,
*/
- };
+ }
//-------------------------------------------------------------------
///
@@ -714,7 +724,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Unknown = 0,
CommoditySupply = 10,
CommoditySales = 20,
- };
+ }
//-------------------------------------------------------------------
///
@@ -825,7 +835,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// Generic file interface options.
FileInterface_RowColValue,
FileInterface_Mode,
- };
+ }
//-------------------------------------------------------------------
///
@@ -897,7 +907,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// Item documents:
DocType_Pdf,
DocType_Image,
- };
+ }
//-------------------------------------------------------------------
///
@@ -908,7 +918,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
EstimateType_QuoteDefault = 1,
DocType_Pdf_WebPublish,
DocType_Image_WebPublish,
- };
+ }
//-------------------------------------------------------------------
///
@@ -917,7 +927,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
public enum SystemUserOption
{
Right = 1000,
- };
+ }
//-------------------------------------------------------------------
///
@@ -929,7 +939,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
AllAccounts = 1,
Admin,
Test,
- };
+ }
//-------------------------------------------------------------------
///
@@ -942,7 +952,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Transactions, // Transactions
Utilities, // Utilities
Appl, // Application specific
- };
+ }
//-------------------------------------------------------------------
///
@@ -962,7 +972,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Utilities_Codes,
Utilities_Security,
Appl, // Application specific
- };
+ }
//-------------------------------------------------------------------
///
@@ -1004,7 +1014,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Util_Security_Stats,
Util_Security_Manage,
Appl, // Application specific
- };
+ }
//-------------------------------------------------------------------
///
@@ -1028,7 +1038,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
CommodityFilterInitialStockCat,
StatusCaption_Container,
SalesLocation,
- };
+ }
//-------------------------------------------------------------------
///
@@ -1070,7 +1080,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
File_ColumnWidth,
File_ColumnCaption,
File_Unit,
- };
+ }
//-------------------------------------------------------------------
///
@@ -1088,13 +1098,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
TransTimeChunk2Caption,
EmailSubject,
EmailBody,
- };
+ }
//-------------------------------------------------------------------
public enum OrgOption_Folder
{
CommodityImage,
CommodityBarcodeImage,
- };
+ }
//-------------------------------------------------------------------
public enum OrgOption_AllowOption
{
@@ -1125,7 +1135,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
PurchaseItem_AssociatedSalesItems,
Asset_Sale,
Asset_Rental,
- };
+ }
//-------------------------------------------------------------------
public enum OrgOption_Caption
{
@@ -1161,7 +1171,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
MenuOpt_PurchaseDeliveries,
MenuOpt_ProformaPurchaseInvoices,
MenuOpt_PurchaseInvoices,
- };
+ }
//-------------------------------------------------------------------
public enum OrgOption_ShowColumn
{
@@ -1190,7 +1200,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
SalesOrderItem_QtyInvoiced,
SalesOrderItem_NextProcess,
Vehicle_KeyLocation,
- };
+ }
//-------------------------------------------------------------------
///
@@ -1216,7 +1226,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
StockLevel_Bay1 = SbmDbDfn.ColumnIdx.StockLevel_Bay1,
StockLevel_Bay2 = SbmDbDfn.ColumnIdx.StockLevel_Bay2,
StockLevel_Bay3 = SbmDbDfn.ColumnIdx.StockLevel_Bay3,
- };
+ }
//-------------------------------------------------------------------
///
@@ -1254,12 +1264,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
StockLevel_Bay1 = SbmDbDfn.ColumnIdx.StockLevel_Bay1,
StockLevel_Bay2 = SbmDbDfn.ColumnIdx.StockLevel_Bay2,
StockLevel_Bay3 = SbmDbDfn.ColumnIdx.StockLevel_Bay3,
- };
+ }
public enum OrgOption_TransCreateStatus
{
ProformaSalesOrder,
SalesOrder,
- };
+ }
public enum OrgOption_StatusContainer
{
Provisional,
@@ -1267,24 +1277,24 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Active,
Actioned,
Cancelled,
- };
+ }
public enum OrgOption_PeriodDays
{
TransactionDatesInFuture,
UpdateClosedTransaction,
UpdateClosedTransaction_DispatchDetails,
UpdateStockLevelsInPast,
- };
+ }
public enum OrgOption_Minutes
{
AutoSaveTransaction,
- };
+ }
public enum OrgOption_PeriodWeeks
{
ImminentStockDue,
Timesheets,
UpdateTimeRecords_Control,
- };
+ }
public enum OrgOption_NumericDecimals
{
OrderQuantity,
@@ -1292,23 +1302,23 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
CommodityLength,
CommodityVolume,
CommodityDensity,
- };
+ }
public enum OrgOption_CommodityType
{
CommodityCreationDefault,
- };
+ }
public enum OrgOption_StockLocation
{
SalesOrderDefault,
PurchaseOrderDefault,
TransactionFilterDefault,
- };
+ }
public enum OrgOption_CmdFilterStockCat
{
MaintView,
SalesSearch,
PurchaseSearch,
- };
+ }
//-------------------------------------------------------------------
///
@@ -1321,26 +1331,26 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
StockLevels,
Accounts,
SalesProfile,
- };
+ }
public enum WebUploadMethod
{
Unknown = 0,
None = 10,
Ftp,
Webstore,
- };
+ }
public enum WebDownloadData
{
Unknown = 0,
Orders = 10,
- };
+ }
public enum WebDownloadMethod
{
Unknown = 0,
None = 10,
Ftp,
Webstore,
- };
+ }
//-------------------------------------------------------------------
///
@@ -1350,7 +1360,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
{
IncludeImminentStock,
AllowZeroOrderItemAmount,
- };
+ }
//-------------------------------------------------------------------
/// FileInterface option.
@@ -1360,14 +1370,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Row = 10,
Col,
Value,
- };
+ }
/// File interface mode.
public enum FileInterface_Mode
{
Unknown = 0,
Csv = 1,
MsExcel,
- };
+ }
//-------------------------------------------------------------------
///
@@ -1377,7 +1387,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
{
Unknown = 0,
Customer = 10,
- };
+ }
//-------------------------------------------------------------------
///
@@ -1392,7 +1402,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
JobBooking = 30, // Allows period across more than one day.
JobActionDue = 31,
StaffHoliday = 900,
- };
+ }
//-------------------------------------------------------------------
///
@@ -1403,7 +1413,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Unknown = -1,
Individual = 0,
Organisation = 1,
- };
+ }
//-------------------------------------------------------------------
///
@@ -1423,7 +1433,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
PublicSector = 5, // 'PUB'
Charity = 6, // 'CHA'
ContactGroup = 10, // 'GRP'
- };
+ }
//---------------------------------------------------------------------------
public enum AddressType
@@ -1435,7 +1445,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Home = 3, // 'HOM'
Delivery = 4, // 'DEL'
Billing = 5, // 'BIL'
- };
+ }
//-------------------------------------------------------------------
///
@@ -1447,7 +1457,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
None,
Full,
Partial,
- };
+ }
//-------------------------------------------------------------------
///
@@ -1458,7 +1468,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Any = -1,
Unknown = 0,
Stock = 10,
- };
+ }
//-------------------------------------------------------------------
public enum LocationFilter
@@ -1468,7 +1478,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
All = -2, // All locations.
Any = -1,
Unknown = 0,
- };
+ }
//-------------------------------------------------------------------
// Containers.
@@ -1478,7 +1488,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Unknown = 0,
// NB Do not change the positive values, as tied to the database.
Stock = 10,
- };
+ }
public enum ContainerType
{
Any = -1,
@@ -1491,7 +1501,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Container = 200,
Wagon,
Pallet = 300,
- };
+ }
//-------------------------------------------------------------------
///
@@ -1502,7 +1512,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Unknown = 0,
// NB Do not change the positive values, as tied to the database.
Requirement_AssocItem_PurchaseCostProportion = 1,
- };
+ }
//-------------------------------------------------------------------
@@ -1516,12 +1526,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Portfolio = 10,
Category = 20,
Commodity = 30,
- };
+ }
public enum PortfolioItemStatusCat
{
Current = -2,
Any = -1,
- };
+ }
//-------------------------------------------------------------------
// Commodity.
@@ -1535,7 +1545,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
NonStock = 2, // 'NST'
Service = 3, // 'SRV'
Asset = 4, // 'AST'
- };
+ }
//-------------------------------------------------------------------
// Stock Movement.
@@ -1548,7 +1558,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
StockTransfer = 10,
SalesAllocation = 20,
PurchaseAllocation = 30,
- };
+ }
public enum StockLevelType
{
Any = -1,
@@ -1556,7 +1566,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// NB Do not change the positive values, as tied to the database.
CurrentLevel = 10,
StockTake = 20,
- };
+ }
public enum StockEventType
{
Any = -1,
@@ -1564,7 +1574,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// NB Do not change the positive values, as tied to the database.
Movement = 1,
StockLevel,
- };
+ }
public enum StockLevelSource
{
Any = -1,
@@ -1573,7 +1583,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Manual = 10,
System = 20,
Sage = 30, // NB Needs to be corrected from '21' on Cadix db [Apr2012].
- };
+ }
//-------------------------------------------------------------------
// Pricing.
@@ -1583,7 +1593,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Customer = 10,
Supplier = 20,
Special = 30,
- };
+ }
public enum PriceCalcMethod
{
Unknown = 0,
@@ -1601,39 +1611,39 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
MarkupValue = 15,
/// Increase sales price by a percentage
MarkupSales = 16,
- };
+ }
public enum PriceRounderMethod
{
Unknown = 0,
- };
+ }
public enum PriceRounderDirection
{
Unknown = 0,
- };
+ }
//-------------------------------------------------------------------
// Associations.
public enum AssociationType
{
Personal = -2, // Task management only.
- Any = -1,
- Unknown = 0,
+ NotInternal = -1,
+ Any = 0,
// NB Do not change the positive values, as tied to the database.
- Internal = 1, // 'INT'
- Customer = 2, // 'CUS'
- Supplier = 3, // 'SUP'
- Associate = 4, // 'ASS'
- Member = 5, // 'MEM'
- Contractor = 6, // 'CON'
- Stockist = 7, // 'STK'
- FinanceAgency = 8, // 'FIN'
- };
+ Internal = 1,
+ Customer = 2,
+ Supplier = 3,
+ Associate = 4,
+ Member = 5,
+ Contractor = 6,
+ Stockist = 7,
+ FinanceAgency = 8,
+ }
public enum AssociationTypeContext
{
Any,
TimeRecording, // Association types that can have time records.
Action, // Association types that can have actions.
- };
+ }
//-------------------------------------------------------------------
// Transaction.
@@ -1658,13 +1668,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
SalesInvoice = 51, // 'SAI'
PurchaseInvoice = 52, // 'PUV'
ProformaPurchaseInvoice = 53, // 'PPI'
- };
+ }
public enum TransactionTypeContext
{
Any,
TimeRecording, // Transaction types that can have time records.
Action, // Transaction types that can have actions.
- };
+ }
//-------------------------------------------------------------------
// Requirements.
@@ -1673,13 +1683,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Any = 0,
Detail = 1,
Job = 2,
- };
+ }
public enum TaskCodeType
{
Any = 0,
Project = 1,
Job = 2,
- };
+ }
//-------------------------------------------------------------------
// Constituents.
@@ -1695,7 +1705,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Consumable = 14,
Expense = 15,
Process = 20,
- };
+ }
//-------------------------------------------------------------------
// Cost Estimates.
@@ -1705,7 +1715,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// NB Do not change the positive values, as tied to the database.
Cost = 1,
Labour
- };
+ }
//-------------------------------------------------------------------
public enum CostEstimateCategory
{
@@ -1716,14 +1726,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
CostPerJob = 2,
LabourPerUnit = 3,
LabourPerJob = 4,
- };
+ }
//-------------------------------------------------------------------
public enum DiscountMarkup
{
Discount = 10,
Markup = 20,
- };
+ }
public enum DiscountType
{
// Values 0 - 6 are in line with Sage Sales Order definition.
@@ -1734,7 +1744,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
QtyDiscountC = 4, // Discount Applied by Banding C
QtyDiscountD = 5, // Discount Applied by Banding D
QtyDiscountE = 6, // Discount Applied by Banding E
- };
+ }
//-------------------------------------------------------------------
public enum ProcessCategory
@@ -1744,7 +1754,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// NB Do not change the positive values, as tied to the database.
Commodity = 10,
Asset = 20,
- };
+ }
public enum ProcessType
{
Any = -1,
@@ -1754,7 +1764,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Production = 11,
Finishing = 12,
External = 20,
- };
+ }
//-------------------------------------------------------------------
public enum PaymentType
@@ -1767,7 +1777,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Cheque = 30,
DebitCard = 40,
CreditCard = 50,
- };
+ }
//-------------------------------------------------------------------
// Assets.
@@ -1779,7 +1789,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Furniture = 11,
Vehicle = 50,
ComputerHardware = 60,
- };
+ }
public enum AssetIncomeType
{
Unknown = 0,
@@ -1787,7 +1797,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// NB Do not change the positive values, as tied to the database.
Sale = 10,
Rental = 20,
- };
+ }
//-------------------------------------------------------------------
// Vehicles.
@@ -1801,7 +1811,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Van = 12,
Truck = 13,
Coach = 14,
- };
+ }
public enum VehicleEventType
{
Any = -1,
@@ -1812,7 +1822,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Incident = 12,
Repair = 13,
Comment = 14,
- };
+ }
public enum VehicleFeatureSource
{
Any = -1,
@@ -1823,7 +1833,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
CAP = 12,
DVLA = 13,
SMMT = 14,
- };
+ }
public enum VehicleFeatureType
{
Any = -1,
@@ -1847,7 +1857,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Equipment = 101, // Standard equipment.
OptionalExtra = 102, // Manufacturer option.
SelectedOption = 103,
- };
+ }
public enum VehicleOptionType
{
Any = -1,
@@ -1858,7 +1868,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Wheels,
PaintFinish,
Packs,
- };
+ }
public enum VehicleTransType
{
Any = -1,
@@ -1866,7 +1876,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// NB Do not change the positive values, as tied to the database.
Manual = 10,
Automatic = 20,
- };
+ }
public enum VehicleFuelType
{
Any = -1,
@@ -1877,7 +1887,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Lpg = 12,
Electric = 13,
Hybrid = 20,
- };
+ }
public enum VehicleOdometerUnits
{
Any = -1,
@@ -1885,7 +1895,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// NB Do not change the positive values, as tied to the database.
Mile = 10,
Kilometre = 11,
- };
+ }
//-------------------------------------------------------------------
// Interface types.
@@ -1896,14 +1906,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
WebStore = 10,
JoomlaVirtueMart = 40,
MiMoWeb = 150, // MiMo website.
- };
+ }
public enum InterfaceType_Accounts
{
Unknown = 0,
// NB Do not change the positive values, as tied to the database.
SageLine50 = 50,
QuickBooks = 60,
- };
+ }
public enum InterfaceType_System
{
Unknown = 0,
@@ -1918,7 +1928,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
Anchor_OrderFulfilment = 200, // Order fulfilment for Anchor Storage.
Cadix_OrderSpreadsheet_Argos = 220,
Cadix_OrderSpreadsheet_Homebase = 221,
- };
+ }
public enum InterfaceType_File
{
Unknown = 0,
@@ -1950,7 +1960,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
TransToWord_PurchaseDelivery = 1500 + TransactionType.PurchaseDelivery,
//TransToWord_ProformaPurchaseInvoice = 1500+ProformaPurchaseInvoice, - Use Purchase Invoice interface.
TransToWord_PurchaseInvoice = 1500 + TransactionType.PurchaseInvoice,
- };
+ }
//-------------------------------------------------------------------
// Interface Data Types.
@@ -1998,7 +2008,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
ConstituentTime,
// Utility data:
Pricing,
- };
+ }
//-------------------------------------------------------------------
// Action to be performed for each Stock Type on import.
@@ -2006,7 +2016,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
{
Import,
Ignore
- };
+ }
//-------------------------------------------------------------------
}
diff --git a/SaBusMgrStandardBase/Base/App/SbmAppConsole.cs b/SaBusMgrStandardBase/Base/App/SbmAppConfig.cs
similarity index 61%
rename from SaBusMgrStandardBase/Base/App/SbmAppConsole.cs
rename to SaBusMgrStandardBase/Base/App/SbmAppConfig.cs
index 224bf87..75cc212 100644
--- a/SaBusMgrStandardBase/Base/App/SbmAppConsole.cs
+++ b/SaBusMgrStandardBase/Base/App/SbmAppConfig.cs
@@ -8,19 +8,22 @@ using System;
namespace Sarand.BusinessMgr.Net.Standard.Base.App
{
- //=======================================================================
- public static class SbmAppConsole
+ //=======================================================================
+ ///
+ /// Application configuration:
+ /// - Availability of UI components - menu options, views etc.
+ ///
+ public static class SbmAppConfig
{
- private static readonly String ClassName = "SbmAppConsole";
+ private const String ClassName = nameof(SbmAppConfig);
//-------------------------------------------------------------------
// A p p l i c a t i o n V i e w s
//-------------------------------------------------------------------
- // Jul-2021 ConfigConsole parameter added to avoid local creation. To be reviewed/replaced.
- public static bool IsViewApplicable(ISbmUserContext_Core userContext, SbmConfigConsole configConsole, Sbm.View view)
+ // Jul-2021 SessionConfig parameter added to avoid local creation. To be reviewed/replaced.
+ public static bool IsViewApplicable(SbmSessionConsole sessionConfig, Sbm.View view)
{
- //SbmConfigConsole configConsole = SbmGlobals.GetConfigConsole(userContext.SessionContext);
- ISbmSecurityProfile_Core securityProfile = userContext.SecurityProfile_Core;
+ ISbmSecurityProfile_Core securityProfile = sessionConfig.UserContext.SecurityProfile_Core;
switch (view)
{
//-----------------------------------------------------------
@@ -29,210 +32,210 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
case Sbm.View.Main:
return true;
case Sbm.View.Console:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowConsoleView)) return false;
- if (!configConsole.GetConsoleViewDfn().HasContent()) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowConsoleView)) return false;
+ if (!sessionConfig.GetConsoleViewDfn().HasContent()) return false;
return true;
case Sbm.View.Diary:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.DiaryView)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.DiaryView)) return false;
return true;
//-----------------------------------------------------------
// Contacts.
case Sbm.View.Contacts_Affiliates:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowContacts)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowContacts)) return false;
return true;
case Sbm.View.Contacts_ContactGroups:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowContacts)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowContacts)) return false;
return true;
case Sbm.View.Contacts_Associations:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowContacts)) return false;
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AnyAssociationView)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowContacts)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AnyAssociationView)) return false;
return true;
case Sbm.View.Contacts_Associations_Customer:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowContacts)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Customer)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowContacts)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Customer)) return false;
return true;
case Sbm.View.Contacts_Associations_Supplier:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowContacts)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Supplier)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowContacts)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Supplier)) return false;
return true;
case Sbm.View.Contacts_Associations_Associate:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowContacts)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Associate)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowContacts)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Associate)) return false;
return true;
case Sbm.View.Contacts_Associations_Stockist:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowContacts)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Stockist)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowContacts)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Stockist)) return false;
return true;
case Sbm.View.Contacts_Associations_FinanceAgency:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowContacts)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.FinanceAgency)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowContacts)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.FinanceAgency)) return false;
return true;
case Sbm.View.Contacts_Associations_Member:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowContacts)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Member)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowContacts)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Member)) return false;
return true;
case Sbm.View.Contacts_Associations_Contractor:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowContacts)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Contractor)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowContacts)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Contractor)) return false;
return true;
//-----------------------------------------------------------
// Commodities.
case Sbm.View.Commodities:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowCommodities)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowCommodities)) return false;
return true;
case Sbm.View.Commodity_Locations:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowCommodities)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowCommodities)) return false;
return true;
case Sbm.View.Commodity_Containers:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowCommodities)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowCommodities)) return false;
return true;
case Sbm.View.Commodity_Portfolio:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowCommodities)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowCommodities)) return false;
return true;
case Sbm.View.Commodity_SalesBudget:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowCommodities)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowCommodities)) return false;
return true;
case Sbm.View.PriceSets:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowCommodities)) return false;
- //if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowPriceSets)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowCommodities)) return false;
+ //if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowPriceSets)) return false;
return true;
//-----------------------------------------------------------
// Assets.
case Sbm.View.AssetCategories:
case Sbm.View.Assets:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowAssets)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowAssets)) return false;
return true;
case Sbm.View.VehicleClasses:
case Sbm.View.Vehicles:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowAssets)) return false;
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowVehicles)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowAssets)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowVehicles)) return false;
return true;
//-----------------------------------------------------------
// Transactions.
case Sbm.View.Transactions:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AnyTransactionView)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AnyTransactionView)) return false;
return true;
case Sbm.View.Transactions_Project:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.Project)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.Project)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.Project)) return false;
return true;
case Sbm.View.Transactions_PurchaseQuote:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Supplier)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseQuote)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Supplier)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.PurchaseQuote)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.PurchaseQuote)) return false;
return true;
case Sbm.View.Transactions_ProformaPurchaseOrder:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Supplier)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaPurchaseOrder)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Supplier)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.ProformaPurchaseOrder)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.ProformaPurchaseOrder)) return false;
return true;
case Sbm.View.Transactions_PurchaseOrder:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Supplier)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseOrder)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Supplier)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.PurchaseOrder)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.PurchaseOrder)) return false;
return true;
case Sbm.View.Transactions_PurchaseSO:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Supplier)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseSO)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Supplier)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.PurchaseSO)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.PurchaseSO)) return false;
return true;
case Sbm.View.Transactions_PurchaseDelivery:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Supplier)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseDelivery)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Supplier)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.PurchaseDelivery)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.PurchaseDelivery)) return false;
return true;
case Sbm.View.Transactions_ProformaPurchaseInvoice:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Supplier)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaPurchaseInvoice)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Supplier)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.ProformaPurchaseInvoice)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.ProformaPurchaseInvoice)) return false;
return true;
case Sbm.View.Transactions_PurchaseInvoice:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Supplier)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseInvoice)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Supplier)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.PurchaseInvoice)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.PurchaseInvoice)) return false;
return true;
case Sbm.View.Transactions_SalesLead:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Customer)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesLead)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Customer)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.SalesLead)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.SalesLead)) return false;
return true;
case Sbm.View.Transactions_SalesQuote:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Customer)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesQuote)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Customer)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.SalesQuote)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.SalesQuote)) return false;
return true;
case Sbm.View.Transactions_ProformaSalesOrder:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Customer)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaSalesOrder)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Customer)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.ProformaSalesOrder)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.ProformaSalesOrder)) return false;
return true;
case Sbm.View.Transactions_SalesOrder:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Customer)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesOrder)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Customer)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.SalesOrder)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.SalesOrder)) return false;
return true;
case Sbm.View.Transactions_SalesPO:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Customer)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesPO)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Customer)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.SalesPO)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.SalesPO)) return false;
return true;
case Sbm.View.Transactions_SalesDispatch:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Customer)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesDispatch)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Customer)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.SalesDispatch)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.SalesDispatch)) return false;
return true;
case Sbm.View.Transactions_ProformaSalesInvoice:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Customer)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesInvoice)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Customer)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.SalesInvoice)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.SalesInvoice)) return false;
return true;
case Sbm.View.Transactions_SalesInvoice:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowAssociationType(userContext, Sbm.AssociationType.Customer)) return false;
- if (!configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesInvoice)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowAssociationType(Sbm.AssociationType.Customer)) return false;
+ if (!sessionConfig.AllowTransactionType(Sbm.TransactionType.SalesInvoice)) return false;
if (!securityProfile.UserCanAccessTransactionsOfType(Sbm.TransactionType.SalesInvoice)) return false;
return true;
//-----------------------------------------------------------
// Planning.
case Sbm.View.Transactions_PurchasingPlanning:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowPurchasingPlanning)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowPurchasingPlanning)) return false;
return true;
case Sbm.View.Transactions_ProductionControl:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowProductionControl)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowProductionControl)) return false;
return true;
case Sbm.View.Transactions_DeliveryPlanning:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTransactions)) return false;
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowDeliveryPlanning)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowDeliveryPlanning)) return false;
return true;
//-----------------------------------------------------------
// Other.
case Sbm.View.SystemAccounts:
case Sbm.View.SystemUsers:
- if (!configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowContacts)) return false;
+ if (!sessionConfig.AllowOption(Sbm.ConfigOption.AllowContacts)) return false;
// Interfaces must be available.
- using (SaInterfaceConsole interfaceConsole = SbmGlobals.Application.CreateInterfaceConsole(userContext))
+ using (SaInterfaceConsole interfaceConsole = SbmGlobals.Application.CreateInterfaceConsole(sessionConfig.UserContext))
{
if (interfaceConsole == null || !interfaceConsole.DatabaseIsValid) return false;
// System Account & User tables must be available.
- ISacsDatabase busMgrDb = SbmGlobals.Application.GetBusMgrDatabase(userContext.SessionContext);
+ ISacsDatabase busMgrDb = SbmGlobals.Application.GetBusMgrDatabase(sessionConfig.UserContext.SessionContext);
if (!SbmGlobals.Application.DbTableExists(busMgrDb, SbmDbDfn.TableIdx.SystemAccount)) return false;
if (!SbmGlobals.Application.DbTableExists(busMgrDb, SbmDbDfn.TableIdx.SystemUser)) return false;
}
@@ -265,17 +268,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
//-------------------------------------------------------------------
// A p p l i c a t i o n M e n u
//-------------------------------------------------------------------
- public static bool IsMenuOptionApplicable(ISbmUserContext_Core userContext, SbmConfigConsole configConsole, Sbm.MenuOption menuOption)
+ public static bool IsMenuOptionApplicable(SbmSessionConsole sessionConfig, Sbm.MenuOption menuOption)
{
- if (!userContext.ValidUser)
+ if (!sessionConfig.UserContext.ValidUser)
{
// ToDo Only Login menu option available.
return false;
}
- Sbm.View view = GetViewForMenuOption(userContext.SessionContext, menuOption);
+ Sbm.View view = GetViewForMenuOption(sessionConfig.UserContext.SessionContext, menuOption);
if (view != Sbm.View.Unknown)
// View options.
- return IsViewApplicable(userContext, configConsole, GetViewForMenuOption(userContext.SessionContext, menuOption));
+ return IsViewApplicable(sessionConfig, GetViewForMenuOption(sessionConfig.UserContext.SessionContext, menuOption));
// Non-view options.
switch (menuOption)
@@ -293,7 +296,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
//-----------------------------------------------------------
// Actions.
case Sbm.MenuOption.Timesheet:
- return configConsole.AllowOption(userContext, Sbm.ConfigOption.TimeRecording);
+ return sessionConfig.AllowOption(Sbm.ConfigOption.TimeRecording);
//-----------------------------------------------------------
}
SaLogger.Warn($"{SysUtil.Fn} Unsupport menu option - {menuOption.ToString()}");
diff --git a/SaBusMgrStandardBase/Base/App/SbmApplication.cs b/SaBusMgrStandardBase/Base/App/SbmApplication.cs
index 852d454..709769f 100644
--- a/SaBusMgrStandardBase/Base/App/SbmApplication.cs
+++ b/SaBusMgrStandardBase/Base/App/SbmApplication.cs
@@ -16,8 +16,8 @@ using System.Collections.Generic;
namespace Sarand.BusinessMgr.Net.Standard.Base.App
{
- //=======================================================================
- public abstract class SbmApplication : SacsDisposable
+ //=======================================================================
+ public abstract class SbmApplication : SacsDisposable
{
//-------------------------------------------------------------------
// Data members.
@@ -58,6 +58,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
{
return GetBusMgrDatabase(sessionContext).CreateDbInfo();
}
+ // Instance configuration.
+ public abstract SbmInstanceConfig GetInstanceConfig(SbmSessionContext sessionContext);
// Database utilities.
public IDatabaseInfo CreateDbInfo(ISacsDatabase db)
{
@@ -82,7 +84,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
//-------------------------------------------------------------------
// Create consoles.
- public abstract SbmConfigConsole CreateConfigConsole(SbmSessionContext sessionContext);
+ public abstract SbmSessionConsole CreateSessionConsole(ISbmUserContext_Core userContext);
public abstract SaDiaryConsole CreateDiaryConsole(ISbmUserContext_Core userContext);
public abstract SaSecurityConsole CreateSecurityConsole(ISbmUserContext_Core userContext);
public abstract SaCodeTypeConsole CreateCodeTypeConsole(ISbmUserContext_Core userContext);
diff --git a/SaBusMgrStandardBase/Base/App/SbmInstanceConfig.cs b/SaBusMgrStandardBase/Base/App/SbmInstanceConfig.cs
index 1fb8f02..8113836 100644
--- a/SaBusMgrStandardBase/Base/App/SbmInstanceConfig.cs
+++ b/SaBusMgrStandardBase/Base/App/SbmInstanceConfig.cs
@@ -1,4 +1,5 @@
-using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
+using Org.BouncyCastle.Math.EC;
+using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control;
using Sarand.BusinessMgr.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using System;
@@ -16,102 +17,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
///
public abstract class SbmInstanceConfig
{
- //-------------------------------------------------------------------
- // Definitions.
- protected const String ParamContext_Config = "Config";
- protected const String ParamContext_ConfigPrefix = "Config-";
- protected const String ApplicationOptionValue_Allow = "Allow";
- protected const String ApplicationOptionValue_Disallow = "Disallow";
- protected const String ApplicationOptionValue_Default= "Default";
-
- //-------------------------------------------------------------------
- // Owner/Instance configuration parameters.
- public enum ConfigParamType
- {
- // Affiliate types.
- AllowedAffiliateTypes,
- DisallowedAffiliateTypes,
- // Association types.
- AllowedAssociationTypes,
- DisallowedAssociationTypes,
- // Transaction types.
- AllowedTransactionTypes,
- DisallowedTransactionTypes,
- // Application options.
- ApplicationOption,
- }
- public class ConfigParamData
- {
- public ConfigParamType ConfigParam { get; set; }
- public String Context { get; set; }
- public String Name { get; set; }
- public HashSet Values { get; } = new HashSet();
- public bool Password { get; set; }
- }
-
- public bool IsConfigParamOfType(ConfigParamType configParam, SbmcItemParam itemParam)
- {
- switch (configParam)
- {
- // Affiliate types.
- case ConfigParamType.AllowedAffiliateTypes:
- case ConfigParamType.DisallowedAffiliateTypes:
- // Association types.
- case ConfigParamType.AllowedAssociationTypes:
- case ConfigParamType.DisallowedAssociationTypes:
- // Transaction types.
- case ConfigParamType.AllowedTransactionTypes:
- case ConfigParamType.DisallowedTransactionTypes:
- return itemParam.Context.EqualsCI(ParamContext_Config) && itemParam.Name.EqualsCI(configParam.ToString());
- // Application options.
- case ConfigParamType.ApplicationOption:
- return itemParam.Context.EqualsCI($"{ParamContext_ConfigPrefix}{ConfigParamType.ApplicationOption.ToString()}");
- }
- return false;
- }
-
- public ConfigParamData GetConfigParamData(ConfigParamType configParam)
- {
- switch (configParam)
- {
- // Affiliate types.
- case ConfigParamType.AllowedAffiliateTypes:
- case ConfigParamType.DisallowedAffiliateTypes:
- // Association types.
- case ConfigParamType.AllowedAssociationTypes:
- case ConfigParamType.DisallowedAssociationTypes:
- // Transaction types.
- case ConfigParamType.AllowedTransactionTypes:
- case ConfigParamType.DisallowedTransactionTypes:
- return new ConfigParamData() { ConfigParam = configParam, Context = ParamContext_Config, Name = configParam.ToString() };
- }
- return null;
- }
-
- public ConfigParamData GetAllowOptionConfigParamData(Sbm.ConfigOption option)
- {
- ConfigParamData configParamData = new ConfigParamData() { ConfigParam = ConfigParamType.ApplicationOption, Context = $"{ParamContext_ConfigPrefix}{ConfigParamType.ApplicationOption.ToString()}", Name = option.ToString() };
- configParamData.Values.UnionWith(new List() { ApplicationOptionValue_Allow, ApplicationOptionValue_Disallow, ApplicationOptionValue_Default });
- return configParamData;
- }
-
//-------------------------------------------------------------------
// Application options.
- //-------------------------------------------------------------------
+
public abstract bool AllowApplicationOption(Sbm.ConfigOption option, bool defaultResponse);
//-------------------------------------------------------------------
// Allowed data component types.
- //-------------------------------------------------------------------
- // Supported affiliate types.
- public abstract bool AllowAffiliateType(Sbm.AffiliateType type);
- // Supported Association types.
- public abstract bool AllowAssociationType(Sbm.AssociationType type);
- // Supported Transaction types.
- public abstract bool AllowTransactionType(Sbm.TransactionType type);
- //-------------------------------------------------------------------
- // Allow Option.
+ // Supported affiliate types.
+ public abstract bool AllowAffiliateType(Sbm.AffiliateType type, bool defaultResponse);
+ // Supported Association types.
+ public abstract bool AllowAssociationType(Sbm.AssociationType type, bool defaultResponse);
+ // Supported Transaction types.
+ public abstract bool AllowTransactionType(Sbm.TransactionType type, bool defaultResponse);
//-------------------------------------------------------------------
}
diff --git a/SaBusMgrStandardBase/Base/App/SbmInternals.cs b/SaBusMgrStandardBase/Base/App/SbmInternals.cs
index 0fbbb6c..d56f795 100644
--- a/SaBusMgrStandardBase/Base/App/SbmInternals.cs
+++ b/SaBusMgrStandardBase/Base/App/SbmInternals.cs
@@ -40,7 +40,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
private SbmProcessMgr processMgr;
private SbmDataItemMgr dataItemMgr;
// Consoles.
- private SbmConfigConsole configConsole;
+ private SbmSessionConsole sessionConsole;
private SaDiaryConsole diaryConsole;
private SaSecurityConsole securityConsole;
private SaCodeTypeConsole codeTypeConsole;
@@ -83,7 +83,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
if (taxCodes != null) taxCodes.ClearAndDispose();
if (unitsOfMeasure != null) unitsOfMeasure.ClearAndDispose();
// Consoles.
- if (configConsole != null) configConsole.Dispose();
+ if (sessionConsole != null) sessionConsole.Dispose();
if (diaryConsole != null) diaryConsole.Dispose();
if (securityConsole != null) securityConsole.Dispose();
if (codeTypeConsole != null) codeTypeConsole.Dispose();
@@ -213,13 +213,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
//-------------------------------------------------------------------
// Consoles.
- public SbmConfigConsole ConfigConsole
+ public SbmSessionConsole SessionConsole
{
get
{
- if (configConsole == null)
- configConsole = Application.CreateConfigConsole(SessionContext);
- return configConsole;
+ if (sessionConsole == null)
+ sessionConsole = Application.CreateSessionConsole(UserContext);
+ return sessionConsole;
}
}
public SaDiaryConsole DiaryConsole
@@ -324,7 +324,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
get
{
if (stockControlConfig == null)
- stockControlConfig = ConfigConsole.GetStockControlConfig(UserContext);
+ stockControlConfig = SessionConsole.GetStockControlConfig();
return stockControlConfig;
}
}
@@ -333,7 +333,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
get
{
if (requirementCostingConfig == null)
- requirementCostingConfig = ConfigConsole.GetRequirementCostingConfig(UserContext);
+ requirementCostingConfig = SessionConsole.GetRequirementCostingConfig();
return requirementCostingConfig;
}
}
@@ -351,7 +351,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
public List GetCurrencies()
{
populateCurrencies();
- return currencies;
+ return new List(currencies);
}
public SaCurrency GetCurrencyById(SysId currencyId)
{
@@ -393,7 +393,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
public List GetTaxCodes()
{
populateTaxCodes();
- return taxCodes;
+ return new List(taxCodes);
}
public SaTaxCode GetTaxCodeById(SysId currencyId)
{
@@ -415,7 +415,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
public List GetUnitsOfMeasure()
{
populateUnitsOfMeasure();
- return unitsOfMeasure;
+ return new List(unitsOfMeasure);
+ }
+ public String GetUnitOfMeasureCaption(SysId currencyId)
+ {
+ if (!SysId.IsValid(currencyId)) return null;
+ populateUnitsOfMeasure();
+ SaUnitMeasure uom = unitsOfMeasure.Find(item => item.Id.Equals(currencyId));
+ return uom?.Single ?? "";
}
public SaUnitMeasure GetUnitOfMeasureById(SysId currencyId)
{
diff --git a/SaBusMgrStandardBase/Base/App/SbmSecurityProfile.cs b/SaBusMgrStandardBase/Base/App/SbmSecurityProfile.cs
index 2178753..9b316ef 100644
--- a/SaBusMgrStandardBase/Base/App/SbmSecurityProfile.cs
+++ b/SaBusMgrStandardBase/Base/App/SbmSecurityProfile.cs
@@ -21,19 +21,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
private bool includeHostSecurityProfile = false;
private SaSecurityProfile userSecurityProfile;
private SaSecurityProfile hostSecurityProfile;
- private readonly List securityRights = new List();
+ private readonly List securityRights = new List();
//-------------------------------------------------------------------
// Construction.
+ [JsonConstructor]
+ private SbmSecurityProfile() { }
public SbmSecurityProfile(ISbmUserContext_Core userContext, bool includeHostSecurityProfile)
{
this.UserContext = userContext;
this.includeHostSecurityProfile = includeHostSecurityProfile;
- Admin = new AdminProfile(this);
- Manage = new ManageProfile(this);
- Financial = new FinancialProfile(this);
- Contacts = new ContactsProfile(this);
- Transaction = new TransactionsProfile(this);
+ Admin = new AdminProfile();
+ Manage = new ManageProfile();
+ Financial = new FinancialProfile();
+ Contacts = new ContactsProfile();
+ Transaction = new TransactionsProfile();
}
//-------------------------------------------------------------------
@@ -43,7 +45,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
//-------------------------------------------------------------------
// Refresh profile.
- public void RefreshProfile(SbmConfigConsole configConsole, SaSecurityConsole securityConsole, SysId userId, List securityRights)
+ public void RefreshProfile(SbmSessionConsole sessionConsole, SaSecurityConsole securityConsole, SysId userId, List securityRights)
{
ClearErrorState();
@@ -65,33 +67,33 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
}
SaLogger.Debug($"{SysUtil.Fn} User: '{UserDisplayName}' [Id: {UserId}]" + (SysId.IsValid(previousUserId) ? ". Previous UserId: " + SysId.ToString(previousUserId) : ""));
- RefreshProfileSettings(configConsole);
+ RefreshProfileSettings(sessionConsole);
}
- protected void RefreshProfile(SbmConfigConsole configConsole, SaSecurityProfile userSecurityProfile, SaSecurityProfile hostSecurityProfile)
+ protected void RefreshProfile(SbmSessionConsole sessionConsole, SaSecurityProfile userSecurityProfile, SaSecurityProfile hostSecurityProfile)
{
this.userSecurityProfile = userSecurityProfile;
this.hostSecurityProfile = hostSecurityProfile;
- RefreshProfileSettings(configConsole);
+ RefreshProfileSettings(sessionConsole);
}
- private void RefreshProfileSettings(SbmConfigConsole configConsole)
+ private void RefreshProfileSettings(SbmSessionConsole sessionConfig)
{
- RefreshAdminProfile(configConsole);
- RefreshManageProfile(configConsole);
- RefreshFinancialProfile(configConsole);
- RefreshContactsProfile(configConsole);
- RefreshTransactionProfile(configConsole);
- RefreshItemTypeProfile(configConsole);
+ RefreshAdminProfile(sessionConfig);
+ RefreshManageProfile(sessionConfig);
+ RefreshFinancialProfile(sessionConfig);
+ RefreshContactsProfile(sessionConfig);
+ RefreshTransactionProfile(sessionConfig);
+ RefreshItemTypeProfile(sessionConfig);
// ToDo Commodities.
}
private void ClearProfile()
{
// Reset security profiles.
- Admin = new AdminProfile(this);
- Manage = new ManageProfile(this);
- Financial = new FinancialProfile(this);
- Contacts = new ContactsProfile(this);
- Transaction = new TransactionsProfile(this);
+ Admin = new AdminProfile();
+ Manage = new ManageProfile();
+ Financial = new FinancialProfile();
+ Contacts = new ContactsProfile();
+ Transaction = new TransactionsProfile();
}
//-------------------------------------------------------------------
@@ -126,18 +128,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// Security rights - Admin.
public class AdminProfile
{
- private readonly SbmSecurityProfile securityProfile;
- internal AdminProfile(SbmSecurityProfile securityProfile)
- {
- this.securityProfile = securityProfile;
- }
+ internal AdminProfile() { }
public bool CanManageSecurity { get; internal set; } = false;
public bool CanManageDatabase { get; internal set; } = false;
public bool CanManageReferenceData { get; internal set; } = false;
public bool CanManageInterfaces { get; internal set; } = false;
}
public AdminProfile Admin { get; internal set; }
- private void RefreshAdminProfile(SbmConfigConsole configConsole)
+ private void RefreshAdminProfile(SbmSessionConsole sessionConfig)
{
Admin.CanManageSecurity = UserHasSecurityRight(Sbm.SecurityRight.Security_Admin);
Admin.CanManageDatabase = UserHasSecurityRight(Sbm.SecurityRight.Database_Admin);
@@ -149,16 +147,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// Security rights - Manage.
public class ManageProfile
{
- private readonly SbmSecurityProfile securityProfile;
- internal ManageProfile(SbmSecurityProfile securityProfile)
- {
- this.securityProfile = securityProfile;
- }
+ internal ManageProfile() { }
public bool CanManageTasks { get; internal set; } = false;
public bool CanManageTimesheets { get; internal set; } = false;
}
public ManageProfile Manage { get; internal set; }
- private void RefreshManageProfile(SbmConfigConsole configConsole)
+ private void RefreshManageProfile(SbmSessionConsole sessionConfig)
{
Manage.CanManageTasks = UserHasSecurityRight(Sbm.SecurityRight.TaskManager);
Manage.CanManageTimesheets = UserHasSecurityRight(Sbm.SecurityRight.TimesheetManager);
@@ -168,36 +162,32 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// Security rights - Financials.
public class FinancialProfile
{
- private readonly SbmSecurityProfile securityProfile;
- internal FinancialProfile(SbmSecurityProfile securityProfile)
- {
- this.securityProfile = securityProfile;
- }
- public bool CanViewFinancials { get; internal set; }
- public bool CanUpdateFinancials { get; internal set; }
- public bool CanViewCommoditySupplyFinancials { get; internal set; }
- public bool CanUpdateCommoditySupplyFinancials { get; internal set; }
- public bool CanViewCommoditySalesFinancials { get; internal set; }
- public bool CanUpdateCommoditySalesFinancials { get; internal set; }
- public bool ConfigOption_AllowFinancialsAccessControl { get; internal set; }
+ internal FinancialProfile() { }
+ public bool ViewFinancials { get; internal set; }
+ public bool UpdateFinancials { get; internal set; }
+ public bool ViewCommoditySupplyFinancials { get; internal set; }
+ public bool UpdateCommoditySupplyFinancials { get; internal set; }
+ public bool ViewCommoditySalesFinancials { get; internal set; }
+ public bool UpdateCommoditySalesFinancials { get; internal set; }
+ public bool FinancialsAccessControl { get; internal set; }
}
public FinancialProfile Financial { get; internal set; }
- private void RefreshFinancialProfile(SbmConfigConsole configConsole)
+ private void RefreshFinancialProfile(SbmSessionConsole sessionConfig)
{
- Financial.CanViewFinancials = UserHasSecurityRight(Sbm.SecurityRight.Financial_View);
- Financial.CanUpdateFinancials = UserHasSecurityRight(Sbm.SecurityRight.Financial_Update);
- Financial.CanViewCommoditySupplyFinancials = UserCanAccessFinancialViewOfType(Sbm.FinancialType.CommoditySupply);
- Financial.CanUpdateCommoditySupplyFinancials = UserCanAccessFinancialUpdateOfType(Sbm.FinancialType.CommoditySupply);
- Financial.CanViewCommoditySalesFinancials = UserCanAccessFinancialViewOfType(Sbm.FinancialType.CommoditySales);
- Financial.CanUpdateCommoditySalesFinancials = UserCanAccessFinancialUpdateOfType(Sbm.FinancialType.CommoditySales);
+ Financial.ViewFinancials = UserHasSecurityRight(Sbm.SecurityRight.Financial_View);
+ Financial.UpdateFinancials = UserHasSecurityRight(Sbm.SecurityRight.Financial_Update);
+ Financial.ViewCommoditySupplyFinancials = UserCanAccessFinancialViewOfType(Sbm.FinancialType.CommoditySupply);
+ Financial.UpdateCommoditySupplyFinancials = UserCanAccessFinancialUpdateOfType(Sbm.FinancialType.CommoditySupply);
+ Financial.ViewCommoditySalesFinancials = UserCanAccessFinancialViewOfType(Sbm.FinancialType.CommoditySales);
+ Financial.UpdateCommoditySalesFinancials = UserCanAccessFinancialUpdateOfType(Sbm.FinancialType.CommoditySales);
// Config options.
- Financial.ConfigOption_AllowFinancialsAccessControl = (configConsole != null && !configConsole.AllowOption(UserContext, Sbm.ConfigOption.AllowFinancialsAccessControl));
+ Financial.FinancialsAccessControl = (sessionConfig != null && !sessionConfig.AllowOption(Sbm.ConfigOption.AllowFinancialsAccessControl));
}
public bool UserCanViewFinancials(Sbm.FinancialType financialType = Sbm.FinancialType.Any)
{
- if (!Financial.ConfigOption_AllowFinancialsAccessControl) return true;
- if (Financial.CanUpdateFinancials || Financial.CanViewFinancials)
+ if (!Financial.FinancialsAccessControl) return true;
+ if (Financial.UpdateFinancials || Financial.ViewFinancials)
{
// If specific type of financial is requested, check that view is not denied.
if (financialType > 0 && IsSecurityRightDenied(Sbm.SecurityRight.Financial_ViewByType, new SysId((int)financialType)))
@@ -209,8 +199,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
public bool UserCanUpdateFinancials(Sbm.FinancialType financialType = Sbm.FinancialType.Any)
{
- if (!Financial.ConfigOption_AllowFinancialsAccessControl) return true;
- if (Financial.CanUpdateFinancials)
+ if (!Financial.FinancialsAccessControl) return true;
+ if (Financial.UpdateFinancials)
{
// If specific type of financial is requested, check that update is not denied.
if (financialType > 0 && IsSecurityRightDenied(Sbm.SecurityRight.Financial_UpdateByType, new SysId((int)financialType)))
@@ -242,35 +232,27 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// Security rights - Contacts.
public class ContactsProfile
{
- private readonly SbmSecurityProfile securityProfile;
- internal ContactsProfile(SbmSecurityProfile securityProfile)
- {
- this.securityProfile = securityProfile;
- }
- public bool CanCreate { get; internal set; } = false;
- public bool CanUpdate { get; internal set; } = false;
+ internal ContactsProfile() { }
+ public bool Create { get; internal set; } = false;
+ public bool Update { get; internal set; } = false;
}
public ContactsProfile Contacts { get; internal set; }
- public bool UserCanCreateContacts { get { return Contacts.CanCreate; } }
- public bool UserCanUpdateContacts { get { return Contacts.CanUpdate; } }
- private void RefreshContactsProfile(SbmConfigConsole configConsole)
+ public bool UserCanCreateContacts() { return Contacts.Create; }
+ public bool UserCanUpdateContacts() { return Contacts.Update; }
+ private void RefreshContactsProfile(SbmSessionConsole sessionConfig)
{
- Contacts.CanUpdate = (UserHasSecurityRight(Sbm.SecurityRight.Affiliate_Update));
- Contacts.CanCreate = (Contacts.CanUpdate || UserHasSecurityRight(Sbm.SecurityRight.Affiliate_Create));
+ Contacts.Update = (UserHasSecurityRight(Sbm.SecurityRight.Affiliate_Update));
+ Contacts.Create = (Contacts.Update || UserHasSecurityRight(Sbm.SecurityRight.Affiliate_Create));
}
//-------------------------------------------------------------------
// Security rights - Transactions.
public class TransactionsProfile
{
- private readonly SbmSecurityProfile securityProfile;
- internal TransactionsProfile(SbmSecurityProfile securityProfile)
- {
- this.securityProfile = securityProfile;
- }
- public bool CanCreate { get; internal set; } = false;
- public bool CanUpdate { get; internal set; } = false;
- public bool CanUpdateTransactionTypeStatusCat(Sbm.TransactionType transactionType, SbmTransaction.StatusCat transactionStatusCat)
+ internal TransactionsProfile() { }
+ public bool Create { get; internal set; } = false;
+ public bool Update { get; internal set; } = false;
+ public bool CanUpdateTransactionTypeStatusCat(SbmSecurityProfile securityProfile, Sbm.TransactionType transactionType, SbmTransaction.StatusCat transactionStatusCat)
{
SysId transactionTypeStatusCatId = SbmTransaction.GetTransactionTypeStatusId(transactionType, transactionStatusCat);
@@ -297,10 +279,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
}
}
public TransactionsProfile Transaction { get; internal set; }
- private void RefreshTransactionProfile(SbmConfigConsole configConsole)
+ private void RefreshTransactionProfile(SbmSessionConsole sessionConfig)
{
- Transaction.CanUpdate = (UserHasSecurityRight(Sbm.SecurityRight.Transaction_Update));
- Transaction.CanCreate = (Transaction.CanUpdate || UserHasSecurityRight(Sbm.SecurityRight.Transaction_View));
+ Transaction.Update = (UserHasSecurityRight(Sbm.SecurityRight.Transaction_Update));
+ Transaction.Create = (Transaction.Update || UserHasSecurityRight(Sbm.SecurityRight.Transaction_View));
}
public bool UserCanAccessTransactionsOfType(Sbm.TransactionType transactionType)
@@ -317,40 +299,40 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
public class ItemTypesProfile
{
internal ItemTypesProfile() { }
- public bool CanCreate { get; internal set; }
- public bool CanUpdate { get; internal set; }
- public bool CanRemove { get; internal set; }
+ public bool Create { get; internal set; }
+ public bool Update { get; internal set; }
+ public bool Remove { get; internal set; }
// Config options.
- public bool ConfigOption_AllowProcesses { get; internal set; }
- public bool ConfigOption_AllowContacts { get; internal set; }
- public bool ConfigOption_AllowCommodities { get; internal set; }
- public bool ConfigOption_AllowPortfolios { get; internal set; }
- public bool ConfigOption_AllowPriceSets { get; internal set; }
- public bool ConfigOption_CommodityCustomers { get; internal set; }
- public bool ConfigOption_CommoditySuppliers { get; internal set; }
- public bool ConfigOption_AllowTransactions { get; internal set; }
- public bool ConfigOption_AllowAssets { get; internal set; }
- public bool ConfigOption_AllowVehicles { get; internal set; }
- public bool ConfigOption_AllowStockLocations { get; internal set; }
- public bool ConfigOption_AllowStockContainers { get; internal set; }
- public bool ConfigOption_AllowStockControl { get; internal set; }
+ public bool Processes { get; internal set; }
+ public bool Contacts { get; internal set; }
+ public bool Commodities { get; internal set; }
+ public bool Portfolios { get; internal set; }
+ public bool PriceSets { get; internal set; }
+ public bool CommodityCustomers { get; internal set; }
+ public bool CommoditySuppliers { get; internal set; }
+ public bool Transactions { get; internal set; }
+ public bool Assets { get; internal set; }
+ public bool Vehicles { get; internal set; }
+ public bool StockLocations { get; internal set; }
+ public bool StockContainers { get; internal set; }
+ public bool StockControl { get; internal set; }
}
public ItemTypesProfile ItemType { get; } = new ItemTypesProfile();
- private void RefreshItemTypeProfile(SbmConfigConsole configConsole)
+ private void RefreshItemTypeProfile(SbmSessionConsole sessionConfig)
{
- ItemType.ConfigOption_AllowProcesses = configConsole.AllowOption(UserContext, Sbm.ConfigOption.AllowProcesses);
- ItemType.ConfigOption_AllowContacts = configConsole.AllowOption(UserContext, Sbm.ConfigOption.AllowContacts);
- ItemType.ConfigOption_AllowCommodities = configConsole.AllowOption(UserContext, Sbm.ConfigOption.AllowCommodities);
- ItemType.ConfigOption_AllowPortfolios = configConsole.AllowOption(UserContext, Sbm.ConfigOption.AllowPortfolios);
- ItemType.ConfigOption_AllowPriceSets = configConsole.AllowOption(UserContext, Sbm.ConfigOption.AllowPriceSets);
- ItemType.ConfigOption_CommodityCustomers = configConsole.AllowOption(UserContext, Sbm.ConfigOption.CommodityCustomers);
- ItemType.ConfigOption_CommoditySuppliers = configConsole.AllowOption(UserContext, Sbm.ConfigOption.CommoditySuppliers);
- ItemType.ConfigOption_AllowTransactions = configConsole.AllowOption(UserContext, Sbm.ConfigOption.AllowTransactions);
- ItemType.ConfigOption_AllowAssets = configConsole.AllowOption(UserContext, Sbm.ConfigOption.AllowAssets);
- ItemType.ConfigOption_AllowVehicles = configConsole.AllowOption(UserContext, Sbm.ConfigOption.AllowVehicles);
- ItemType.ConfigOption_AllowStockLocations = configConsole.GetStockControlConfig(UserContext).AllowStockLocations();
- ItemType.ConfigOption_AllowStockContainers = configConsole.GetStockControlConfig(UserContext).AllowStockContainers();
- ItemType.ConfigOption_AllowStockControl = configConsole.GetStockControlConfig(UserContext).AllowStockControl();
+ ItemType.Processes = sessionConfig.AllowOption(Sbm.ConfigOption.AllowProcesses);
+ ItemType.Contacts = sessionConfig.AllowOption(Sbm.ConfigOption.AllowContacts);
+ ItemType.Commodities = sessionConfig.AllowOption(Sbm.ConfigOption.AllowCommodities);
+ ItemType.Portfolios = sessionConfig.AllowOption(Sbm.ConfigOption.AllowPortfolios);
+ ItemType.PriceSets = sessionConfig.AllowOption(Sbm.ConfigOption.AllowPriceSets);
+ ItemType.CommodityCustomers = sessionConfig.AllowOption(Sbm.ConfigOption.CommodityCustomers);
+ ItemType.CommoditySuppliers = sessionConfig.AllowOption(Sbm.ConfigOption.CommoditySuppliers);
+ ItemType.Transactions = sessionConfig.AllowOption(Sbm.ConfigOption.AllowTransactions);
+ ItemType.Assets = sessionConfig.AllowOption(Sbm.ConfigOption.AllowAssets);
+ ItemType.Vehicles = sessionConfig.AllowOption(Sbm.ConfigOption.AllowVehicles);
+ ItemType.StockLocations = sessionConfig.GetStockControlConfig().AllowStockLocations();
+ ItemType.StockContainers = sessionConfig.GetStockControlConfig().AllowStockContainers();
+ ItemType.StockControl = sessionConfig.GetStockControlConfig().AllowStockControl();
}
public bool ItemTypeIsAllowed(Sbm.ItemType itemType)
@@ -363,37 +345,37 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
//case Sbm.ItemType.Language:
//case Sbm.ItemType.TaxCode:
//case Sbm.ItemType.UnitMeasure:
- case Sbm.ItemType.Process: return ItemType.ConfigOption_AllowProcesses;
+ case Sbm.ItemType.Process: return ItemType.Processes;
case Sbm.ItemType.Affiliate:
- case Sbm.ItemType.Address: return ItemType.ConfigOption_AllowContacts;
- case Sbm.ItemType.Commodity: return ItemType.ConfigOption_AllowCommodities;
- case Sbm.ItemType.PortfolioItem: return ItemType.ConfigOption_AllowPortfolios;
- case Sbm.ItemType.Location: return ItemType.ConfigOption_AllowStockLocations;
+ case Sbm.ItemType.Address: return ItemType.Contacts;
+ case Sbm.ItemType.Commodity: return ItemType.Commodities;
+ case Sbm.ItemType.PortfolioItem: return ItemType.Portfolios;
+ case Sbm.ItemType.Location: return ItemType.StockLocations;
case Sbm.ItemType.Container:
- case Sbm.ItemType.ContainerItem: return ItemType.ConfigOption_AllowStockContainers;
+ case Sbm.ItemType.ContainerItem: return ItemType.StockContainers;
case Sbm.ItemType.Movement:
- case Sbm.ItemType.StockLevel: return ItemType.ConfigOption_AllowStockControl;
+ case Sbm.ItemType.StockLevel: return ItemType.StockControl;
case Sbm.ItemType.PriceSet:
- case Sbm.ItemType.Price: return ItemType.ConfigOption_AllowPriceSets;
- case Sbm.ItemType.CommodityCustomer: return ItemType.ConfigOption_CommodityCustomers;
- case Sbm.ItemType.CommoditySupplier: return ItemType.ConfigOption_CommoditySuppliers;
+ case Sbm.ItemType.Price: return ItemType.PriceSets;
+ case Sbm.ItemType.CommodityCustomer: return ItemType.CommodityCustomers;
+ case Sbm.ItemType.CommoditySupplier: return ItemType.CommoditySuppliers;
//case Sbm.ItemType.Association:
case Sbm.ItemType.Transaction:
case Sbm.ItemType.Requirement:
- case Sbm.ItemType.Constituent: return ItemType.ConfigOption_AllowTransactions;
+ case Sbm.ItemType.Constituent: return ItemType.Transactions;
//case Sbm.ItemType.SystemAccount:
//case Sbm.ItemType.SystemUser:
//case Sbm.ItemType.SystemAccountUser:
case Sbm.ItemType.AssetCategory:
case Sbm.ItemType.AssetCategoryProcess:
case Sbm.ItemType.Asset:
- case Sbm.ItemType.AssetProcess: return ItemType.ConfigOption_AllowAssets;
+ case Sbm.ItemType.AssetProcess: return ItemType.Assets;
case Sbm.ItemType.VehicleClass:
case Sbm.ItemType.Vehicle:
case Sbm.ItemType.VehicleEvent:
- case Sbm.ItemType.VehicleFeature: return ItemType.ConfigOption_AllowVehicles;
- case Sbm.ItemType.CommodityProcess: return ItemType.ConfigOption_AllowProcesses;
- case Sbm.ItemType.RequirementProcess: return ItemType.ConfigOption_AllowProcesses;
+ case Sbm.ItemType.VehicleFeature: return ItemType.Vehicles;
+ case Sbm.ItemType.CommodityProcess: return ItemType.Processes;
+ case Sbm.ItemType.RequirementProcess: return ItemType.Processes;
//case Sbm.ItemType.Interface:
}
return true;
diff --git a/SaBusMgrStandardBase/Base/App/SbmSessionProfile.cs b/SaBusMgrStandardBase/Base/App/SbmSessionProfile.cs
deleted file mode 100644
index b1e1454..0000000
--- a/SaBusMgrStandardBase/Base/App/SbmSessionProfile.cs
+++ /dev/null
@@ -1,172 +0,0 @@
-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.Core;
-using Sarand.Net.Standard.Base.Dbas;
-using Sarand.Net.Standard.Base.ItemOptions;
-using Sarand.Net.Standard.Base.Security;
-using Sarand.Net.Standard.Base.Utils;
-using System.Collections.Generic;
-
-namespace Sarand.BusinessMgr.Net.Standard.Base.App
-{
- //=======================================================================
- public abstract class SbmSessionProfile
- {
- //-------------------------------------------------------------------
- // Definitions.
- internal class SbmUserContext_Internal : SbmUserContext
- {
- // Construction.
- public SbmUserContext_Internal(SbmSessionContext sessionContext) :
- base(sessionContext)
- {
- }
- // Refresh context.
- public void RefreshUser(SaSecurityItem securityItemUser, SbmAffiliate affiliateUser, List supervisedOwners)
- {
- SetUserData(securityItemUser, affiliateUser, supervisedOwners);
- }
- public void ClearUser()
- {
- ClearUserData();
- }
- public void RefreshSecurityProfile(SbmSecurityProfile securityProfile)
- {
- SetSecurityProfile(securityProfile);
- }
- public void RefreshOrganisation(SysId affiliateIdOrganisation)
- {
- SetOrganisationData(affiliateIdOrganisation);
- }
- public void ClearOrganisation()
- {
- ClearOrganisationData();
- }
- }
-
- //-------------------------------------------------------------------
- // Data members.
- private readonly SbmUserContext_Internal userContext;
-
- //-------------------------------------------------------------------
- // Protected Construction - use derived objects.
- protected SbmSessionProfile(SbmSessionContext sessionContext, SysId affiliateIdUser)
- {
- userContext = new SbmUserContext_Internal(sessionContext);
- SysParamCache = new SbmSysParamCache(userContext, affiliateIdUser);
- }
-
- //-------------------------------------------------------------------
- // Properties.
- public SbmUserContext UserContext { get { return userContext; } }
- public SbmSessionContext SessionContext { get { return userContext.SessionContext; } }
- public ISbmSecurityProfile_Core SecurityProfile { get { return UserContext.SecurityProfile_Core; } }
- protected SaItemOption.Cache OrganisationConfigOptionsCache { get { return UserContext.OrganisationConfigOptionsCache; } }
- // User parameters.
- protected SbmSysParamCache SysParamCache { get; }
-
- //-------------------------------------------------------------------
- // O w n e r O r g a n i s a t i o n
- //-------------------------------------------------------------------
- public abstract bool SetSelectedOwner(SysId affiliateId);
- protected void RefreshOwnerOrganisation(SysId affiliateIdOrganisation)
- {
- if (SysId.IsValid(affiliateIdOrganisation))
- userContext.RefreshOrganisation(affiliateIdOrganisation);
- else userContext.ClearOrganisation();
- }
-
- //-------------------------------------------------------------------
- // U s e r S e s s i o n
- //-------------------------------------------------------------------
- public bool StartUserSession(SysId userId, List securityRights)
- {
- // Clear existing User details.
- ClearUserSession();
-
- using (SbmConfigConsole configConsole = SbmGlobals.Application.CreateConfigConsole(UserContext.SessionContext))
- using (SaSecurityConsole securityConsole = SbmGlobals.Application.CreateSecurityConsole(UserContext))
- using (SbmAccountMgr accountMgr = CreateAccountMgr())
- {
- // Security item.
- SaSecurityItem securityItemUser = securityConsole.GetSecurityItemById(SaSecurity.ItemType.User, userId);
-
- SbmAffiliate affiliateUser = accountMgr.GetAffiliateByUserId(userId);
- if (affiliateUser == null)
- {
- SaLogger.Warn($"{SysUtil.Fn} Unable to retrieve affiliate for UserId: {SysId.ToString(userId)}");
- return false;
- }
- List userSupervisedOwners = accountMgr.GetAffiliatesSupervisedBy(affiliateUser.Id);
- userContext.RefreshUser(securityItemUser, affiliateUser, userSupervisedOwners);
-
- // Populate security rights.
- SecurityProfile.RefreshProfile(configConsole, securityConsole, userId, securityRights);
-
- // Reinstate previous owner if defined and verify that it is in the supervised list.
- SysId affiliateIdOwner = UserContext.Organisation.AffiliateId;
- if (!userSupervisedOwners.Exists(item => item.Id.Equals(affiliateIdOwner)))
- affiliateIdOwner = new SysId();
- // If not otherwise defined, select first owner in supervised list.
- if (!SysId.IsValid(affiliateIdOwner) && userSupervisedOwners.Count > 0)
- affiliateIdOwner = userSupervisedOwners[0].Id;
- SetSelectedOwner(affiliateIdOwner);
- }
-
- // ToDo StartUserSession Reinstate previous default view.
-
- return true;
- }
- public void ClearUserSession()
- {
- // Save user parameters.
- SysParamCache.Store();
-
- // Reset user details.
- userContext.ClearUser();
- SysParamCache.Clear();
- }
-
- //-------------------------------------------------------------------
- // Save the user's session parameters.
- public bool SaveSessionProfile()
- {
- bool success = false;
-
- // Update the list of parameters that we know about to the database.
- success = SysParamCache.Store();
-
- // Clear down the list of parameters for this user.
- SysParamCache.Clear();
-
- return success;
- }
-
- //-------------------------------------------------------------------
- // D a t a b a s e
- //-------------------------------------------------------------------
- // Database Update
- public DbUpdateInfo DbUpdateInfo
- {
- get
- {
- return new DbUpdateInfo(SecurityProfile.UserId, SecurityProfile.UserDisplayName, SacsSystem.ComputerName);
- }
- }
-
- public SaSecurityConsole SaSecurityConsole { get; private set; }
-
- // Data managers.
- protected SbmAccountMgr CreateAccountMgr()
- {
- return SbmGlobals.System.CreateAccountMgr(UserContext);
- }
-
- //-------------------------------------------------------------------
- }
- //=======================================================================
-}
diff --git a/SaBusMgrStandardBase/Base/App/SbmSystem-CodeTypes.cs b/SaBusMgrStandardBase/Base/App/SbmSystem-CodeTypes.cs
index ee9f93d..fd1e5cd 100644
--- a/SaBusMgrStandardBase/Base/App/SbmSystem-CodeTypes.cs
+++ b/SaBusMgrStandardBase/Base/App/SbmSystem-CodeTypes.cs
@@ -25,17 +25,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
//-------------------------------------------------------------------
// R e g i s t e r C o d e T y p e s
//-------------------------------------------------------------------
- public static void RegisterCodeTypes(SbmConfigConsole configConsole, SaCodeTypeConsole codeTypeConsole, ISbmUserContext_Core userContext)
+ public static void RegisterCodeTypes(SbmSessionConsole sessionConfig, SaCodeTypeConsole codeTypeConsole)
{
//---------------------------------------------------------------
// C o m m o d i t i e s
//---------------------------------------------------------------
- if (configConsole != null && configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowCommodities))
+ if (sessionConfig != null && sessionConfig.AllowOption(Sbm.ConfigOption.AllowCommodities))
{
// Commodity category.
SaCodeTypeDfn codeTypeCommodityCategory = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.CommodityCategory), codeTypes.GetDescForType(Sbm.ApplCodeType.CommodityCategory), 12);
codeTypeConsole.RegisterCodeType(codeTypeCommodityCategory);
- codeTypeConsole.RegisterCodesOfType(codeTypeCommodityCategory.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.CommodityCategory));
+ codeTypeConsole.RegisterCodesOfType(codeTypeCommodityCategory.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.CommodityCategory));
// Commodity range.
SaCodeTypeDfn codeTypeCommodityRange = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.CommodityRange), codeTypes.GetDescForType(Sbm.ApplCodeType.CommodityRange), 12);
@@ -62,184 +62,184 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
//codeTypeConsole.RegisterCodeType(codeTypeCommodityDelivery);
// Commodity material.
- String commodityMaterialLabel = configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Commodity_MaterialCode, "Material");
+ String commodityMaterialLabel = sessionConfig.GetAttributeCaption(SbmDbDfn.ColumnIdx.Commodity_MaterialCode, "Material");
if (!commodityMaterialLabel.ContainsCI("Commodity")) commodityMaterialLabel = "Commodity " + commodityMaterialLabel;
SaCodeTypeDfn codeTypeCommodityMaterial = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.CommodityMaterial), commodityMaterialLabel, 12);
codeTypeConsole.RegisterCodeType(codeTypeCommodityMaterial);
- codeTypeConsole.RegisterCodesOfType(codeTypeCommodityMaterial.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.CommodityMaterial));
+ codeTypeConsole.RegisterCodesOfType(codeTypeCommodityMaterial.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.CommodityMaterial));
// Commodity finish.
- String commodityFinishLabel = configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Commodity_FinishCode, "Finish");
+ String commodityFinishLabel = sessionConfig.GetAttributeCaption(SbmDbDfn.ColumnIdx.Commodity_FinishCode, "Finish");
if (!commodityFinishLabel.ContainsCI("Commodity")) commodityFinishLabel = "Commodity " + commodityFinishLabel;
SaCodeTypeDfn codeTypeCommodityFinish = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.CommodityFinish), commodityFinishLabel, 12);
codeTypeConsole.RegisterCodeType(codeTypeCommodityFinish);
- codeTypeConsole.RegisterCodesOfType(codeTypeCommodityFinish.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.CommodityFinish));
+ codeTypeConsole.RegisterCodesOfType(codeTypeCommodityFinish.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.CommodityFinish));
// Commodity promotion.
- String commodityPromotionLabel = configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Commodity_PromotionCode, "Promotion");
+ String commodityPromotionLabel = sessionConfig.GetAttributeCaption(SbmDbDfn.ColumnIdx.Commodity_PromotionCode, "Promotion");
if (!commodityPromotionLabel.ContainsCI("Commodity")) commodityPromotionLabel = "Commodity " + commodityPromotionLabel;
SaCodeTypeDfn codeTypeCommodityPromotion = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.CommodityPromotion), commodityPromotionLabel, 12);
codeTypeConsole.RegisterCodeType(codeTypeCommodityPromotion);
- codeTypeConsole.RegisterCodesOfType(codeTypeCommodityPromotion.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.CommodityPromotion));
+ codeTypeConsole.RegisterCodesOfType(codeTypeCommodityPromotion.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.CommodityPromotion));
}
//---------------------------------------------------------------
// P r o c e s s e s
//---------------------------------------------------------------
- if (configConsole != null && configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowProcesses))
+ if (sessionConfig != null && sessionConfig.AllowOption(Sbm.ConfigOption.AllowProcesses))
{
// Process type.
SaCodeTypeDfn codeTypeProcessType = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.ProcessType), codeTypes.GetDescForType(Sbm.ApplCodeType.ProcessType), 12);
codeTypeConsole.RegisterCodeType(codeTypeProcessType);
- codeTypeConsole.RegisterCodesOfType(codeTypeProcessType.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.ProcessType));
+ codeTypeConsole.RegisterCodesOfType(codeTypeProcessType.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.ProcessType));
}
//---------------------------------------------------------------
// R e f e r r a l
//---------------------------------------------------------------
- if (configConsole != null)
+ if (sessionConfig != null)
{
// Refer type.
SaCodeTypeDfn codeTypeReferType = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.ReferType), codeTypes.GetDescForType(Sbm.ApplCodeType.ReferType), 12);
codeTypeReferType.AllowSequence = true;
codeTypeConsole.RegisterCodeType(codeTypeReferType);
- codeTypeConsole.RegisterCodesOfType(codeTypeReferType.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.ReferType));
+ codeTypeConsole.RegisterCodesOfType(codeTypeReferType.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.ReferType));
}
//---------------------------------------------------------------
// T a s k s
//---------------------------------------------------------------
- if (configConsole != null && configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowTasks))
+ if (sessionConfig != null && sessionConfig.AllowOption(Sbm.ConfigOption.AllowTasks))
{
// Task category.
SaCodeTypeDfn codeTypeTaskCategory = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.TaskCategory), codeTypes.GetDescForType(Sbm.ApplCodeType.TaskCategory), 12);
codeTypeTaskCategory.AllowSequence = true;
codeTypeConsole.RegisterCodeType(codeTypeTaskCategory);
- codeTypeConsole.RegisterCodesOfType(codeTypeTaskCategory.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.TaskCategory));
+ codeTypeConsole.RegisterCodesOfType(codeTypeTaskCategory.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.TaskCategory));
}
//---------------------------------------------------------------
// A s s e t s
//---------------------------------------------------------------
- if (configConsole != null && configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowAssets))
+ if (sessionConfig != null && sessionConfig.AllowOption(Sbm.ConfigOption.AllowAssets))
{
// Asset sell category.
SaCodeTypeDfn codeTypeAssetSellCategory = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.AssetSellCategory), codeTypes.GetDescForType(Sbm.ApplCodeType.AssetSellCategory), 8);
codeTypeConsole.RegisterCodeType(codeTypeAssetSellCategory);
- codeTypeConsole.RegisterCodesOfType(codeTypeAssetSellCategory.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.AssetSellCategory));
+ codeTypeConsole.RegisterCodesOfType(codeTypeAssetSellCategory.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.AssetSellCategory));
}
//---------------------------------------------------------------
// V e h i c l e s
//---------------------------------------------------------------
- if (configConsole != null && configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowVehicles))
+ if (sessionConfig != null && sessionConfig.AllowOption(Sbm.ConfigOption.AllowVehicles))
{
// Vehicle category.
SaCodeTypeDfn codeTypeVehicleCategory = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.VehicleCategory), codeTypes.GetDescForType(Sbm.ApplCodeType.VehicleCategory), 8);
codeTypeConsole.RegisterCodeType(codeTypeVehicleCategory);
- codeTypeConsole.RegisterCodesOfType(codeTypeVehicleCategory.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.VehicleCategory));
+ codeTypeConsole.RegisterCodesOfType(codeTypeVehicleCategory.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.VehicleCategory));
// Vehicle make.
SaCodeTypeDfn codeTypeVehicleMake = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.VehicleMake), codeTypes.GetDescForType(Sbm.ApplCodeType.VehicleMake), 8);
codeTypeConsole.RegisterCodeType(codeTypeVehicleMake);
- codeTypeConsole.RegisterCodesOfType(codeTypeVehicleMake.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.VehicleMake));
+ codeTypeConsole.RegisterCodesOfType(codeTypeVehicleMake.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.VehicleMake));
// Vehicle service history.
SaCodeTypeDfn codeTypeVehicleServiceHistory = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.VehicleServiceHistory), codeTypes.GetDescForType(Sbm.ApplCodeType.VehicleServiceHistory), 12);
codeTypeConsole.RegisterCodeType(codeTypeVehicleServiceHistory);
- codeTypeConsole.RegisterCodesOfType(codeTypeVehicleServiceHistory.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.VehicleServiceHistory));
+ codeTypeConsole.RegisterCodesOfType(codeTypeVehicleServiceHistory.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.VehicleServiceHistory));
// Vehicle insurance.
SaCodeTypeDfn codeTypeVehicleInsurance = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.VehicleInsurance), codeTypes.GetDescForType(Sbm.ApplCodeType.VehicleInsurance), 3);
codeTypeConsole.RegisterCodeType(codeTypeVehicleInsurance);
- codeTypeConsole.RegisterCodesOfType(codeTypeVehicleInsurance.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.VehicleInsurance));
+ codeTypeConsole.RegisterCodesOfType(codeTypeVehicleInsurance.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.VehicleInsurance));
// Vehicle tacho.
SaCodeTypeDfn codeTypeVehicleTacho = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.VehicleTacho), codeTypes.GetDescForType(Sbm.ApplCodeType.VehicleTacho), 8);
//codeTypeConsole.RegisterCodeType(codeTypeVehicleTacho);
- //codeTypeConsole.RegisterCodesOfType(codeTypeVehicleTacho.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.VehicleTacho));
+ //codeTypeConsole.RegisterCodesOfType(codeTypeVehicleTacho.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.VehicleTacho));
}
//---------------------------------------------------------------
// H P I V e h i c l e s
//---------------------------------------------------------------
- if (configConsole != null && configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (int)Sbm.InterfaceType_System.Hpi))
+ if (sessionConfig != null && sessionConfig.AllowInterface(SaInterfaceCategory.System, (int)Sbm.InterfaceType_System.Hpi))
{
// HPI vehicle make.
SaCodeTypeDfn codeTypeHpiVehicleMake = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.HpiVehicleMake), codeTypes.GetDescForType(Sbm.ApplCodeType.HpiVehicleMake), 12);
codeTypeConsole.RegisterCodeType(codeTypeHpiVehicleMake);
- codeTypeConsole.RegisterCodesOfType(codeTypeHpiVehicleMake.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.HpiVehicleMake));
+ codeTypeConsole.RegisterCodesOfType(codeTypeHpiVehicleMake.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.HpiVehicleMake));
// HPI vehicle model.
SaCodeTypeDfn codeTypeHpiVehicleModel = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.HpiVehicleModel), codeTypes.GetDescForType(Sbm.ApplCodeType.HpiVehicleModel), 12);
codeTypeConsole.RegisterCodeType(codeTypeHpiVehicleModel);
- codeTypeConsole.RegisterCodesOfType(codeTypeHpiVehicleModel.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.HpiVehicleModel));
+ codeTypeConsole.RegisterCodesOfType(codeTypeHpiVehicleModel.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.HpiVehicleModel));
// HPI vehicle colour.
SaCodeTypeDfn codeTypeHpiVehicleColour = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.HpiVehicleColour), codeTypes.GetDescForType(Sbm.ApplCodeType.HpiVehicleColour), 12);
codeTypeConsole.RegisterCodeType(codeTypeHpiVehicleColour);
- codeTypeConsole.RegisterCodesOfType(codeTypeHpiVehicleColour.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.HpiVehicleColour));
+ codeTypeConsole.RegisterCodesOfType(codeTypeHpiVehicleColour.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.HpiVehicleColour));
// HPI vehicle fuel.
SaCodeTypeDfn codeTypeHpiVehicleFuel = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.HpiVehicleFuel), codeTypes.GetDescForType(Sbm.ApplCodeType.HpiVehicleFuel), 12);
codeTypeConsole.RegisterCodeType(codeTypeHpiVehicleFuel);
- codeTypeConsole.RegisterCodesOfType(codeTypeHpiVehicleFuel.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.HpiVehicleFuel));
+ codeTypeConsole.RegisterCodesOfType(codeTypeHpiVehicleFuel.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.HpiVehicleFuel));
// HPI vehicle transmission.
SaCodeTypeDfn codeTypeHpiVehicleTrans = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.HpiVehicleTrans), codeTypes.GetDescForType(Sbm.ApplCodeType.HpiVehicleTrans), 12);
codeTypeConsole.RegisterCodeType(codeTypeHpiVehicleTrans);
- codeTypeConsole.RegisterCodesOfType(codeTypeHpiVehicleTrans.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.HpiVehicleTrans));
+ codeTypeConsole.RegisterCodesOfType(codeTypeHpiVehicleTrans.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.HpiVehicleTrans));
}
//---------------------------------------------------------------
// C o n t a c t M a n a g e m e n t
//---------------------------------------------------------------
- if (configConsole != null)
+ if (sessionConfig != null)
{
// Account manager.
- String accountManagerLabel = configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Association_AccountManagerCode, "Account manager");
+ String accountManagerLabel = sessionConfig.GetAttributeCaption(SbmDbDfn.ColumnIdx.Association_AccountManagerCode, "Account manager");
SaCodeTypeDfn codeTypeAccountManager = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.AccountManager), accountManagerLabel, 12, "Account management group");
codeTypeConsole.RegisterCodeType(codeTypeAccountManager);
// Account handler.
- String accountHandlerLabel = configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Association_AccountHandlerCode, "Account handler");
+ String accountHandlerLabel = sessionConfig.GetAttributeCaption(SbmDbDfn.ColumnIdx.Association_AccountHandlerCode, "Account handler");
SaCodeTypeDfn codeTypeAccountHandler = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.AccountHandler), accountHandlerLabel, 12, "Account handling group");
codeTypeConsole.RegisterCodeType(codeTypeAccountHandler);
// Account type.
- String accountTypeLabel = configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Association_AccountTypeCode, "Account type");
+ String accountTypeLabel = sessionConfig.GetAttributeCaption(SbmDbDfn.ColumnIdx.Association_AccountTypeCode, "Account type");
SaCodeTypeDfn codeTypeAccountType = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.AccountType), accountTypeLabel, 12, "Grouping by nature of business");
codeTypeConsole.RegisterCodeType(codeTypeAccountType);
// Account rating.
- String accountRatingLabel = configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Association_AccountRatingCode, "Account rating");
+ String accountRatingLabel = sessionConfig.GetAttributeCaption(SbmDbDfn.ColumnIdx.Association_AccountRatingCode, "Account rating");
SaCodeTypeDfn codeTypeAccountRating = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.AccountRating), accountRatingLabel, 12);
codeTypeConsole.RegisterCodeType(codeTypeAccountRating);
// Contact title.
- String contactTitleLabel = configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Affiliate_Title, "Contact title");
+ String contactTitleLabel = sessionConfig.GetAttributeCaption(SbmDbDfn.ColumnIdx.Affiliate_Title, "Contact title");
SaCodeTypeDfn codeTypeContactTitle = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.ContactTitle), contactTitleLabel, 12);
codeTypeContactTitle.AllowSequence = true;
codeTypeConsole.RegisterCodeType(codeTypeContactTitle);
- codeTypeConsole.RegisterCodesOfType(codeTypeContactTitle.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.ContactTitle));
+ codeTypeConsole.RegisterCodesOfType(codeTypeContactTitle.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.ContactTitle));
// Contact area.
- String contactAreaLabel = configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Association_ContactAreaCode, "Contact area");
+ String contactAreaLabel = sessionConfig.GetAttributeCaption(SbmDbDfn.ColumnIdx.Association_ContactAreaCode, "Contact area");
SaCodeTypeDfn codeTypeContactArea = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.ContactArea), contactAreaLabel, 12, "Geographic region");
codeTypeConsole.RegisterCodeType(codeTypeContactArea);
// Contact handler.
- String contactHandlerLabel = configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Association_ContactHandlerCode, "Contact handler");
+ String contactHandlerLabel = sessionConfig.GetAttributeCaption(SbmDbDfn.ColumnIdx.Association_ContactHandlerCode, "Contact handler");
SaCodeTypeDfn codeTypeContactHandler = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.ContactHandler), contactHandlerLabel, 12);
codeTypeConsole.RegisterCodeType(codeTypeContactHandler);
// Contact method.
- String contactMethodLabel = configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Association_ContactMethodCode, "Contact method");
+ String contactMethodLabel = sessionConfig.GetAttributeCaption(SbmDbDfn.ColumnIdx.Association_ContactMethodCode, "Contact method");
SaCodeTypeDfn codeTypeContactMethod = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.ContactMethod), contactMethodLabel, 12);
codeTypeConsole.RegisterCodeType(codeTypeContactMethod);
// Contact call cycle.
- String contactCallCycleLabel = configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Association_ContactCallCycleCode, "Contact call cycle");
+ String contactCallCycleLabel = sessionConfig.GetAttributeCaption(SbmDbDfn.ColumnIdx.Association_ContactCallCycleCode, "Contact call cycle");
SaCodeTypeDfn codeTypeContactCallCycle = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.ContactCallCycle), contactCallCycleLabel, 12);
codeTypeConsole.RegisterCodeType(codeTypeContactCallCycle);
@@ -252,7 +252,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
// C o s t E s t i m a t e s
//---------------------------------------------------------------
FlagDfn estimateDefaultFlag = new FlagDfn((Byte)Sbm.ApplCodeFlag.EstimateType_QuoteDefault, "Default to quote", "Default");
- if (configConsole != null && configConsole.AllowOption(userContext, Sbm.ConfigOption.EstimateSalesQuotesByCosts))
+ if (sessionConfig != null && sessionConfig.AllowOption(Sbm.ConfigOption.EstimateSalesQuotesByCosts))
{
// Cost per unit.
SaCodeTypeDfn codeTypeCostPerUnit = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.CostPerUnit), codeTypes.GetDescForType(Sbm.ApplCodeType.CostPerUnit), 12);
@@ -264,85 +264,85 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
codeTypeCostPerUnit.FlagDefinitions.Add(new FlagDfn(4, "Flag 4", "#4"));
#endif
codeTypeConsole.RegisterCodeType(codeTypeCostPerUnit);
- codeTypeConsole.RegisterCodesOfType(codeTypeCostPerUnit.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.CostPerUnit));
+ codeTypeConsole.RegisterCodesOfType(codeTypeCostPerUnit.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.CostPerUnit));
// Cost per job.
SaCodeTypeDfn codeTypeCostPerJob = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.CostPerJob), codeTypes.GetDescForType(Sbm.ApplCodeType.CostPerJob), 12);
codeTypeCostPerJob.AllowSequence = true;
codeTypeCostPerJob.FlagDefinitions.Add(estimateDefaultFlag);
codeTypeConsole.RegisterCodeType(codeTypeCostPerJob);
- codeTypeConsole.RegisterCodesOfType(codeTypeCostPerJob.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.CostPerJob));
+ codeTypeConsole.RegisterCodesOfType(codeTypeCostPerJob.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.CostPerJob));
}
- if (configConsole != null && configConsole.AllowOption(userContext, Sbm.ConfigOption.EstimateLabourByMinutes))
+ if (sessionConfig != null && sessionConfig.AllowOption(Sbm.ConfigOption.EstimateLabourByMinutes))
{
// Labour cost per unit.
SaCodeTypeDfn codeTypeLabourPerUnit = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.LabourPerUnit), codeTypes.GetDescForType(Sbm.ApplCodeType.LabourPerUnit), 12);
codeTypeLabourPerUnit.AllowSequence = true;
codeTypeLabourPerUnit.FlagDefinitions.Add(estimateDefaultFlag);
codeTypeConsole.RegisterCodeType(codeTypeLabourPerUnit);
- codeTypeConsole.RegisterCodesOfType(codeTypeLabourPerUnit.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.LabourPerUnit));
+ codeTypeConsole.RegisterCodesOfType(codeTypeLabourPerUnit.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.LabourPerUnit));
// Labour cost per job.
SaCodeTypeDfn codeTypeLabourPerJob = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.LabourPerJob), codeTypes.GetDescForType(Sbm.ApplCodeType.LabourPerJob), 12);
codeTypeLabourPerJob.AllowSequence = true;
codeTypeLabourPerJob.FlagDefinitions.Add(estimateDefaultFlag);
codeTypeConsole.RegisterCodeType(codeTypeLabourPerJob);
- codeTypeConsole.RegisterCodesOfType(codeTypeLabourPerJob.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.LabourPerJob));
+ codeTypeConsole.RegisterCodesOfType(codeTypeLabourPerJob.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.LabourPerJob));
}
//---------------------------------------------------------------
// D e l i v e r y
//---------------------------------------------------------------
- if (configConsole != null && userContext.GetOwnerOption_AllowOption(Sbm.OrgOption_AllowOption.SalesOrder_DispatchDetails))
+ if (sessionConfig != null && sessionConfig.UserContext.GetOwnerOption_AllowOption(Sbm.OrgOption_AllowOption.SalesOrder_DispatchDetails))
{
// Delivery status.
SaCodeTypeDfn codeTypeDeliveryStatus = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.DeliveryStatus), codeTypes.GetDescForType(Sbm.ApplCodeType.DeliveryStatus), 3);
codeTypeDeliveryStatus.AllowSequence = true;
codeTypeConsole.RegisterCodeType(codeTypeDeliveryStatus);
- codeTypeConsole.RegisterCodesOfType(codeTypeDeliveryStatus.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.DeliveryStatus));
+ codeTypeConsole.RegisterCodesOfType(codeTypeDeliveryStatus.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.DeliveryStatus));
// Delivery type.
SaCodeTypeDfn codeTypeDeliveryType = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.DeliveryType), codeTypes.GetDescForType(Sbm.ApplCodeType.DeliveryType), 12);
codeTypeDeliveryType.AllowSequence = true;
codeTypeConsole.RegisterCodeType(codeTypeDeliveryType);
- codeTypeConsole.RegisterCodesOfType(codeTypeDeliveryType.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.DeliveryType));
+ codeTypeConsole.RegisterCodesOfType(codeTypeDeliveryType.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.DeliveryType));
// Delivery method.
SaCodeTypeDfn codeTypeDeliveryMethod = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.DeliveryMethod), codeTypes.GetDescForType(Sbm.ApplCodeType.DeliveryMethod), 12);
codeTypeDeliveryMethod.AllowSequence = true;
codeTypeConsole.RegisterCodeType(codeTypeDeliveryMethod);
- codeTypeConsole.RegisterCodesOfType(codeTypeDeliveryMethod.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.DeliveryMethod));
+ codeTypeConsole.RegisterCodesOfType(codeTypeDeliveryMethod.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.DeliveryMethod));
// Delivery courier.
SaCodeTypeDfn codeTypeDeliveryCourier = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.DeliveryCourier), codeTypes.GetDescForType(Sbm.ApplCodeType.DeliveryCourier), 12);
codeTypeDeliveryCourier.AllowSequence = true;
codeTypeConsole.RegisterCodeType(codeTypeDeliveryCourier);
- codeTypeConsole.RegisterCodesOfType(codeTypeDeliveryCourier.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.DeliveryCourier));
+ codeTypeConsole.RegisterCodesOfType(codeTypeDeliveryCourier.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.DeliveryCourier));
// Delivery book-in.
SaCodeTypeDfn codeTypeDeliveryBookIn = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.DeliveryBookIn), codeTypes.GetDescForType(Sbm.ApplCodeType.DeliveryBookIn), 12);
codeTypeDeliveryBookIn.AllowSequence = true;
//codeTypeConsole.RegisterCodeType(codeTypeDeliveryBookIn);
- //codeTypeConsole.RegisterCodesOfType(codeTypeDeliveryBookIn.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.DeliveryBookIn));
+ //codeTypeConsole.RegisterCodesOfType(codeTypeDeliveryBookIn.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.DeliveryBookIn));
// Order lead time.
SaCodeTypeDfn codeTypeOrderLeadTime = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.OrderLeadTime), codeTypes.GetDescForType(Sbm.ApplCodeType.OrderLeadTime), 12);
codeTypeOrderLeadTime.AllowSequence = true;
//codeTypeConsole.RegisterCodeType(codeTypeOrderLeadTime);
- //codeTypeConsole.RegisterCodesOfType(codeTypeOrderLeadTime.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.OrderLeadTime));
+ //codeTypeConsole.RegisterCodesOfType(codeTypeOrderLeadTime.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.OrderLeadTime));
// Delivery picker.
SaCodeTypeDfn codeTypeStockPicker = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.StockPicker), codeTypes.GetDescForType(Sbm.ApplCodeType.StockPicker), 12);
codeTypeStockPicker.AllowSequence = true;
codeTypeConsole.RegisterCodeType(codeTypeStockPicker);
- codeTypeConsole.RegisterCodesOfType(codeTypeStockPicker.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.StockPicker));
+ codeTypeConsole.RegisterCodesOfType(codeTypeStockPicker.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.StockPicker));
}
//---------------------------------------------------------------
// I t e m D o c u m e n t s
//---------------------------------------------------------------
- if (configConsole != null && configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowItemDocuments))
+ if (sessionConfig != null && sessionConfig.AllowOption(Sbm.ConfigOption.AllowItemDocuments))
{
// PDF document types.
SaCodeTypeDfn codeTypeDocType_Pdf = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.DocType_Pdf), codeTypes.GetDescForType(Sbm.ApplCodeType.DocType_Pdf), 12);
@@ -350,7 +350,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
codeTypeDocType_Pdf.AllowMixedCode = true;
codeTypeDocType_Pdf.FlagDefinitions.Add(new FlagDfn((Byte)Sbm.ApplCodeFlag.DocType_Pdf_WebPublish, "WebPublish", "Publish to Web"));
codeTypeConsole.RegisterCodeType(codeTypeDocType_Pdf);
- codeTypeConsole.RegisterCodesOfType(codeTypeDocType_Pdf.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.DocType_Pdf));
+ codeTypeConsole.RegisterCodesOfType(codeTypeDocType_Pdf.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.DocType_Pdf));
// Image document types.
SaCodeTypeDfn codeTypeDocType_Image = new SaCodeTypeDfn(codeTypes.GetCodeForType(Sbm.ApplCodeType.DocType_Image), codeTypes.GetDescForType(Sbm.ApplCodeType.DocType_Image), 12);
@@ -358,7 +358,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
codeTypeDocType_Image.AllowMixedCode = true;
codeTypeDocType_Image.FlagDefinitions.Add(new FlagDfn((Byte)Sbm.ApplCodeFlag.DocType_Image_WebPublish, "WebPublish", "Publish to Web"));
codeTypeConsole.RegisterCodeType(codeTypeDocType_Image);
- codeTypeConsole.RegisterCodesOfType(codeTypeDocType_Image.Code, configConsole.GetDefaultCodesOfType(Sbm.ApplCodeType.DocType_Image));
+ codeTypeConsole.RegisterCodesOfType(codeTypeDocType_Image.Code, sessionConfig.GetDefaultCodesOfType(Sbm.ApplCodeType.DocType_Image));
}
//---------------------------------------------------------------
diff --git a/SaBusMgrStandardBase/Base/App/SbmSystem.cs b/SaBusMgrStandardBase/Base/App/SbmSystem.cs
index aff7ffb..803a121 100644
--- a/SaBusMgrStandardBase/Base/App/SbmSystem.cs
+++ b/SaBusMgrStandardBase/Base/App/SbmSystem.cs
@@ -42,17 +42,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
//-------------------------------------------------------------------
// Application definitions.
- public static Sbm.ConfigConsole GetConfigConsoleType(String consoleProperty)
+ public static Sbm.SessionConfig GetSessionConfigType(String consoleProperty)
{
if (consoleProperty.ContainsCI("Sarand"))
- return Sbm.ConfigConsole.Sarand;
+ return Sbm.SessionConfig.Sarand;
if (consoleProperty.ContainsCI("MPE"))
- return Sbm.ConfigConsole.MPE;
+ return Sbm.SessionConfig.MPE;
if (consoleProperty.ContainsCI("BPE"))
- return Sbm.ConfigConsole.BPE;
+ return Sbm.SessionConfig.BPE;
if (consoleProperty.ContainsCI("Cadix") || consoleProperty.ContainsCI("CUL"))
- return Sbm.ConfigConsole.Cadix;
- return Sbm.ConfigConsole.Generic;
+ return Sbm.SessionConfig.Cadix;
+ return Sbm.SessionConfig.Generic;
}
public static String GetCopyrightNotice(bool html = false)
{
@@ -86,18 +86,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
}
public static List GetCodesOfType(ISbmUserContext_Core userContext, Sbm.SystemCode systemCode)
{
- SbmConfigConsole configConsole = null; // SbmGlobals.GetConfigConsole(userContext.SessionContext);
- switch (systemCode)
+ using (SbmInternals internals = new SbmInternals(userContext))
{
- case Sbm.SystemCode.ItemType:
- return new List(itemTypes);
- case Sbm.SystemCode.AffiliateType:
- return new List(affiliateTypes);
- case Sbm.SystemCode.AssociationType:
- return new List(associationTypes);
- case Sbm.SystemCode.TransactionType:
- // Transaction types.
- return new List()
+ SbmSessionConsole sessionConsole = internals.SessionConsole;
+ switch (systemCode)
+ {
+ case Sbm.SystemCode.ItemType:
+ return new List(itemTypes);
+ case Sbm.SystemCode.AffiliateType:
+ return new List(affiliateTypes);
+ case Sbm.SystemCode.AssociationType:
+ return new List(associationTypes);
+ case Sbm.SystemCode.TransactionType:
+ // Transaction types.
+ return new List()
{
new TypeCodeDesc((int) Sbm.TransactionType.Project, "PRO", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_Project, "Project")),
new TypeCodeDesc((int)Sbm.TransactionType.SalesLead, "SLD", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_SalesLead, "Sales Lead")),
@@ -116,366 +118,367 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
new TypeCodeDesc((int)Sbm.TransactionType.ProformaPurchaseInvoice, "PPI", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_ProformaPurchaseInvoice, "Proforma Purchase Invoice")),
new TypeCodeDesc((int)Sbm.TransactionType.PurchaseInvoice, "PUI", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_PurchaseInvoice, "Purchase Invoice")),
};
- case Sbm.SystemCode.TransactionStatusCat:
- return new List(transactionStatusCats);
- case Sbm.SystemCode.RequirementType:
- return new List(requirementTypes);
- case Sbm.SystemCode.TaskCodeType:
- return new List(taskCodeTypes);
- case Sbm.SystemCode.RequirementStatusCat:
- return new List(requirementStatusCats);
- case Sbm.SystemCode.ConstituentType:
- return new List(constituentTypes);
- case Sbm.SystemCode.ConstituentStatusCat:
- return new List(constituentStatusCats);
- case Sbm.SystemCode.ItemLinkData:
- return new List(itemLinkDatas);
- case Sbm.SystemCode.PortfolioItemType:
- return new List(portfolioItemTypes);
- case Sbm.SystemCode.LocationCategory:
- return new List(locationCategories);
- case Sbm.SystemCode.LocationFilter:
- return new List(locationFilters);
- case Sbm.SystemCode.ContainerCategory:
- return new List(containerCategories);
- case Sbm.SystemCode.ContainerType:
- return new List(containerTypes);
- case Sbm.SystemCode.CommodityType:
- {
- // CommodityType.
- List CommodityType = new List();
- CommodityType.Add(Sbm.CommodityType.Stock, "STK", "Stock");
- CommodityType.Add(Sbm.CommodityType.NonStock, "NST", "Non-stock");
- CommodityType.Add(Sbm.CommodityType.Service, "SRV", "Service");
- if (assetCommodityTypeAllowed < 0)
+ case Sbm.SystemCode.TransactionStatusCat:
+ return new List(transactionStatusCats);
+ case Sbm.SystemCode.RequirementType:
+ return new List(requirementTypes);
+ case Sbm.SystemCode.TaskCodeType:
+ return new List(taskCodeTypes);
+ case Sbm.SystemCode.RequirementStatusCat:
+ return new List(requirementStatusCats);
+ case Sbm.SystemCode.ConstituentType:
+ return new List(constituentTypes);
+ case Sbm.SystemCode.ConstituentStatusCat:
+ return new List(constituentStatusCats);
+ case Sbm.SystemCode.ItemLinkData:
+ return new List(itemLinkDatas);
+ case Sbm.SystemCode.PortfolioItemType:
+ return new List(portfolioItemTypes);
+ case Sbm.SystemCode.LocationCategory:
+ return new List(locationCategories);
+ case Sbm.SystemCode.LocationFilter:
+ return new List(locationFilters);
+ case Sbm.SystemCode.ContainerCategory:
+ return new List(containerCategories);
+ case Sbm.SystemCode.ContainerType:
+ return new List(containerTypes);
+ case Sbm.SystemCode.CommodityType:
{
- // ToDo SbmSystem assetCommodityTypeAllowed
-
- using (SbmAssetMgr assetMgr = SbmGlobals.System.CreateAssetMgr(userContext))
+ // CommodityType.
+ List CommodityType = new List();
+ CommodityType.Add(Sbm.CommodityType.Stock, "STK", "Stock");
+ CommodityType.Add(Sbm.CommodityType.NonStock, "NST", "Non-stock");
+ CommodityType.Add(Sbm.CommodityType.Service, "SRV", "Service");
+ if (assetCommodityTypeAllowed < 0)
{
- //assetCommodityTypeAllowed = assetMgr != null && assetMgr.DatabaseIsValid();
- }
- }
- if (assetCommodityTypeAllowed > 0)
- CommodityType.Add(Sbm.CommodityType.Asset, "AST", "Asset");
- return CommodityType;
- }
- case Sbm.SystemCode.CommodityStatusCat:
- return new List(commodityStatusCats);
- case Sbm.SystemCode.MovementType:
- return new List(movementTypes);
- case Sbm.SystemCode.StockLevelType:
- return new List(stockLevelTypes);
- case Sbm.SystemCode.StockLevelSource:
- return new List(stockLevelSources);
- case Sbm.SystemCode.AddressType:
- return new List(addressTypes);
- case Sbm.SystemCode.SysParamCategory:
- return new List(sysParamCategories);
- case Sbm.SystemCode.ProcessCategory:
- {
- List ProcessCategory = new List();
- if (configConsole != null)
- {
- if (configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowCommodities))
- ProcessCategory.Add(Sbm.ProcessCategory.Commodity, "CMD", "Commodity");
- if (configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowAssets))
- ProcessCategory.Add(Sbm.ProcessCategory.Asset, "ASSET", "Asset");
- }
- return ProcessCategory;
- }
- case Sbm.SystemCode.ProcessType:
- return new List(processTypes);
- case Sbm.SystemCode.PaymentType:
- return new List(paymentTypes);
- case Sbm.SystemCode.AssetIncomeType:
- return new List(assetIncomeTypes);
- case Sbm.SystemCode.AssetType:
- return new List(assetTypes);
- case Sbm.SystemCode.VehicleType:
- return new List(vehicleTypes);
- case Sbm.SystemCode.VehicleEventType:
- return new List(vehicleEventTypes);
- case Sbm.SystemCode.VehicleFeatureSource:
- return new List(vVehicleFeatureSources);
- case Sbm.SystemCode.VehicleFeatureType:
- return new List(vehicleFeatureTypes);
- case Sbm.SystemCode.VehicleOptionType:
- return new List(vehicleOptionTypes);
- case Sbm.SystemCode.VehicleTransType:
- return new List(vehicleTransTypes);
- case Sbm.SystemCode.FuelType:
- return new List(fuelTypes);
- case Sbm.SystemCode.OdometerUnits:
- return new List(odometerUnits);
- case Sbm.SystemCode.DiscountType:
- return new List(discountTypes);
- case Sbm.SystemCode.DiscountMarkup:
- return new List(discountMarkups);
- case Sbm.SystemCode.RegionType:
- return new List(regionTypes);
- case Sbm.SystemCode.UnitMeasureCategory:
- return new List(unitMeasureCategories);
- case Sbm.SystemCode.UnitMeasureType:
- return new List(unitMeasureTypes);
- case Sbm.SystemCode.FinancialType:
- {
- List FinancialType = new List();
- if (configConsole != null)
- {
- if (configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowCommodities))
- FinancialType.Add(Sbm.FinancialType.CommoditySupply, "CmdSup", "Commodity supply");
- }
- FinancialType.Add(Sbm.FinancialType.CommoditySales, "CmdSal", "Commodity sales");
- return FinancialType;
- }
- case Sbm.SystemCode.PriceType:
- return new List(priceTypes);
- case Sbm.SystemCode.PriceCalcMethod:
- return new List(priceCalcMethods);
- case Sbm.SystemCode.PriceRounderMethod:
- return new List(priceRounderMethods);
- case Sbm.SystemCode.PriceRounderDirection:
- return new List(priceRounderDirections);
- case Sbm.SystemCode.SystemAccountType:
- return new List(systemAccountTypes);
- case Sbm.SystemCode.ItemStatus:
- return new List(itemStatuses);
- case Sbm.SystemCode.EventStatus:
- return new List(eventStatuses);
- case Sbm.SystemCode.AssociationTab:
- return new List(associationTabs);
- case Sbm.SystemCode.InterfaceType_Website:
- {
- // Interface types - Website.
- // Duplicate static list and remove unsupported options.
- List codes = new List(interfaceTypes_Website);
- if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.Website, (short)(Sbm.InterfaceType_Website.WebStore)))
- interfaceTypes_Website.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_Website.WebStore);
- if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.Website, (short)(Sbm.InterfaceType_Website.JoomlaVirtueMart)))
- interfaceTypes_Website.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_Website.JoomlaVirtueMart);
- if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.Website, (short)(Sbm.InterfaceType_Website.MiMoWeb)))
- interfaceTypes_Website.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_Website.MiMoWeb);
- return new List(codes);
- }
- case Sbm.SystemCode.InterfaceType_Accounts:
- {
- // Interface Type - Accounts.
- // Duplicate static list and remove unsupported options.
- List codes = new List(interfaceTypes_Accounts);
- return new List(codes);
- }
- case Sbm.SystemCode.InterfaceType_System:
- {
- // Interface Type - System.
- // Duplicate static list and remove unsupported options.
- List codes = new List(interfaceTypes_System);
- if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.MSOutlook))
- interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.MSOutlook);
- if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.PostcodeAnywhere))
- interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.PostcodeAnywhere);
- if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Bac))
- interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Bac);
- if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Pvh))
- interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Pvh);
- if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Cap))
- interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Cap);
- if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Hpi))
- interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Hpi);
- if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Anchor_OrderFulfilment))
- interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Anchor_OrderFulfilment);
- if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Argos))
- interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Argos);
- if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Homebase))
- interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Homebase);
- return new List(codes);
- }
- case Sbm.SystemCode.InterfaceType_File:
- {
- // Interface Type - File.
- // Duplicate static list and remove unsupported options.
- List codes = new List(interfaceTypes_File);
- if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_File.LeasewayInvoice))
- codes.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_File.LeasewayInvoice);
- return new List(codes);
- }
- case Sbm.SystemCode.InterfaceDataType:
- return new List(interfaceDataTypes);
- case Sbm.SystemCode.ItemDataType:
- return new List(itemDataTypes);
- case Sbm.SystemCode.OrgOption_Value:
- return new List(orgOption_Values);
- case Sbm.SystemCode.OrgOption_Folder:
- return new List(orgOption_Folders);
- case Sbm.SystemCode.OrgOption_Minutes:
- return new List(OrgOption_Minutes);
- case Sbm.SystemCode.OrgOption_PeriodDays:
- {
- List OrgOption_PeriodDays = new List();
+ // ToDo SbmSystem assetCommodityTypeAllowed
- OrgOption_PeriodDays.Add(Sbm.OrgOption_PeriodDays.TransactionDatesInFuture, "TransDatesInFut", "Days in future that transaction dates can be set", "");
- OrgOption_PeriodDays.Add(Sbm.OrgOption_PeriodDays.UpdateClosedTransaction, "UpdClosedTrans", "Grace period (days) for updating closed transactions", "Period after transaction closure during which updates are allowed (0-30 days)");
- if (configConsole != null && configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowDeliveryPlanning))
- OrgOption_PeriodDays.Add(Sbm.OrgOption_PeriodDays.UpdateClosedTransaction_DispatchDetails, "UpdDisDetCloTrans", "Grace period (days) for updating dispatch details on closed order", "Period after transaction closure during which dispatch updates are allowed (0-30 days)");
- if (configConsole != null && configConsole.GetStockControlConfig(userContext).AllowStockControl())
- OrgOption_PeriodDays.Add(Sbm.OrgOption_PeriodDays.UpdateStockLevelsInPast, "UpdStkLvlInPast", "Update stock levels in past");
- return OrgOption_PeriodDays;
- }
- case Sbm.SystemCode.OrgOption_PeriodWeeks:
- {
- List OrgOption_PeriodWeeks = new List();
- if (configConsole != null && configConsole.AllowOption(userContext, Sbm.ConfigOption.TimeRecording))
- {
- OrgOption_PeriodWeeks.Add(Sbm.OrgOption_PeriodWeeks.Timesheets, "Timesheets", "Weeks of timesheets to list (default 8)");
- OrgOption_PeriodWeeks.Add(Sbm.OrgOption_PeriodWeeks.UpdateTimeRecords_Control, "UpdTimeRecsCtrl", "Weeks in past for admin user to update time records (default 2)");
+ using (SbmAssetMgr assetMgr = SbmGlobals.System.CreateAssetMgr(userContext))
+ {
+ //assetCommodityTypeAllowed = assetMgr != null && assetMgr.DatabaseIsValid();
+ }
+ }
+ if (assetCommodityTypeAllowed > 0)
+ CommodityType.Add(Sbm.CommodityType.Asset, "AST", "Asset");
+ return CommodityType;
}
- OrgOption_PeriodWeeks.Add(Sbm.OrgOption_PeriodWeeks.ImminentStockDue, "ImminStkDue", "Weeks of due stock to treat as imminent", "Weeks for which stock due is treated as imminent (0-12 weeks, default: 0)");
- return OrgOption_PeriodWeeks;
- }
- case Sbm.SystemCode.OrgOption_AllowOption:
- return new List(orgOption_AllowOptions);
- case Sbm.SystemCode.OrgOption_Caption:
- {
- List OrgOption_Caption = new List();
- if (configConsole != null)
+ case Sbm.SystemCode.CommodityStatusCat:
+ return new List(commodityStatusCats);
+ case Sbm.SystemCode.MovementType:
+ return new List(movementTypes);
+ case Sbm.SystemCode.StockLevelType:
+ return new List(stockLevelTypes);
+ case Sbm.SystemCode.StockLevelSource:
+ return new List(stockLevelSources);
+ case Sbm.SystemCode.AddressType:
+ return new List(addressTypes);
+ case Sbm.SystemCode.SysParamCategory:
+ return new List(sysParamCategories);
+ case Sbm.SystemCode.ProcessCategory:
{
- // Transaction type captions.
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.Project))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_Project, "Project", "Transaction type - Project");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesLead))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_SalesLead, "SalLead", "Transaction type - Sales Lead");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesQuote))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_SalesQuote, "SalQuote", "Transaction type - Sales quote");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesPO))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_SalesPO, "SalPO", "Transaction type - Sales PO");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaSalesOrder))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_ProformaSalesOrder, "SalPfOrder", "Transaction type - sales proforma order");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesOrder))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_SalesOrder, "SalOrder", "Transaction type - sales order");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesDispatch))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_SalesDispatch, "SalDispatch", "Transaction type - Sales dispatch");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaSalesInvoice))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_ProformaSalesInvoice, "SalPfInvoice", "Transaction type - Proforma sales invoice");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesInvoice))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_SalesInvoice, "SalInvoice", "Transaction type - Sales invoice");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseQuote))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_PurchaseQuote, "PurQuote", "Transaction type - Purchase quote");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseSO))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_PurchaseSO, "PurSO", "Transaction type - Purchase SO");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaPurchaseOrder))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_ProformaPurchaseOrder, "PurPfOrder", "Transaction type - Purchase proforma order");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseOrder))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_PurchaseOrder, "PurOrder", "Transaction type - Purchase order");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseDelivery))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_PurchaseDelivery, "PurDelivery", "Transaction type - Purchase Delivery");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaPurchaseInvoice))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_ProformaPurchaseInvoice, "PurPfInvoice", "Transaction type - Proforma Purchase invoice");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseInvoice))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_PurchaseInvoice, "PurInvoice", "Transaction type - Purchase invoice");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.Project))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_Projects, "MnuOptProject", "Caption - Projects menu option");
- // Menu option captions:
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesLead))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_SalesLeads, "MnuOptSalLead", "Caption - Sales leads menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesPO))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_SalesPOs, "MnuOptSalPO", "Caption - Sales POs menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesQuote))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_SalesQuotes, "MnuOptSalQuote", "Caption - Sales quotes menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaSalesOrder))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_ProformaSalesOrders, "MnuOptSalPfOrder", "Caption - Proforma sales orders menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesOrder))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_SalesOrders, "MnuOptSalOrder", "Caption - Sales orders menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesDispatch))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_SalesDispatches, "MnuOptSalDispatch", "Caption - Sales dispatches menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaSalesInvoice))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_ProformaSalesInvoices, "MnuOptSalPfInvoice", "Caption - Proforma sales invoices menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesInvoice))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_SalesInvoices, "MnuOptSalInvoice", "Caption - Sales invoices menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseQuote))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_PurchaseQuotes, "MnuOptPurQuote", "Caption - Purchase quotes menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseSO))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_PurchaseSOs, "MnuOptPurSO", "Caption - Purchase SOs menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaPurchaseOrder))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_ProformaPurchaseOrders, "MnuOptPurPfOrder", "Caption - Proforma purchase orders menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseOrder))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_PurchaseOrders, "MnuOptPurOrder", "Caption - Purchase orders menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseDelivery))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_PurchaseDeliveries, "MnuOptPurDelivery", "Caption - Purchase Deliveries menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaPurchaseInvoice))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_ProformaPurchaseInvoices, "MnuOptPurPfInvoice", "Caption - Proforma purchase invoices menu option");
- if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseInvoice))
- OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_PurchaseInvoices, "MnuOptPurInvoice", "Caption - Purchase invoices menu option");
+ List ProcessCategory = new List();
+ if (sessionConsole != null)
+ {
+ if (sessionConsole.AllowOption(Sbm.ConfigOption.AllowCommodities))
+ ProcessCategory.Add(Sbm.ProcessCategory.Commodity, "CMD", "Commodity");
+ if (sessionConsole.AllowOption(Sbm.ConfigOption.AllowAssets))
+ ProcessCategory.Add(Sbm.ProcessCategory.Asset, "ASSET", "Asset");
+ }
+ return ProcessCategory;
}
- return OrgOption_Caption;
- }
- case Sbm.SystemCode.OrgOption_ShowColumn:
- {
- List OrgOption_ShowColumn = new List();
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Association_AnnualSalesTarget, "Association:AnnualSalesTarget", "Association: Annual sales target");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Association_Trans_LastSaleRaised, "Association:Trans:LastSaleRaised", "Association: Last SO raised");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Association_Trans_SalesValue_Open, "Association:Trans:SalesValue:Open", "Association: SO value: Open");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Association_Trans_SalesValue_Cytd, "Association:Trans:SalesValue:Cytd", "Association: SO value: YTD");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Association_Trans_SalesValue_Lcy, "Association:Trans:SalesValue:Lcy", "Association: SO value: LCY");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Association_Group, "Association:Group", "Association: Group");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Commodity_CatalogRef, "Commodity:CatalogRef", "Commodity: Catalog reference");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Commodity_Weight, "Commodity:Weight", "Commodity: Weight");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Commodity_PackQtySale, "Commodity:PackQtySale", "Commodity: Pack qty - sale");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Commodity_StockAllocated, "Commodity:StockAllocated", "Commodity: Allocated stock");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Commodity_StockLevelSales, "Commodity:StockLevelSales", "Commodity: Stock level (Sales)");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Commodity_StockAvailable, "Commodity:StockAvailable", "Commodity: Available stock");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Order_AllocationInd, "Order:AllocationInd", "Order: Allocation indicator");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.SalesOrder_DeliveryCourier, "SalesOrder:DeliveryCourier", "Order: Delivery courier");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.SalesOrder_HasInvoice, "SalesOrder:HasInvoice", "Order: Has invoice flag");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Transaction_ContactArea, "Transaction:ContactArea", "Transaction: " + configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Association_ContactAreaCode, "Contact area"));
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Accounts_InvoiceRef, "Accounts:InvoiceRef", "Accounts: Invoice reference");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.OrderItem_AllocationInd, "OrderItem:AllocationInd", "Order item: Allocation indicator");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.OrderItem_Stock_Current, "OrderItem:StockCurrent", "Order item: Stock current");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.OrderItem_Stock_Available, "OrderItem:StockAvailable", "Order item: Stock available");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.OrderItem_Stock_BySalesLocation, "OrderItem:StockBySalesLocation", "Order item: Stock by sales location");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.SalesOrderItem_QtyDispatched, "SalesOrderItem:QuantityDispatched", "Sales order item: qty dispatched");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.SalesOrderItem_QtyInvoiced, "SalesOrderItem:QuantityInvoiced", "Sales order item: qty invoiced");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.SalesOrderItem_NextProcess, "SalesOrderItem:NextProcess", "Sales order item: Next process");
- OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Vehicle_KeyLocation, "Vehicle:KeyLocation", "Vehicle: Key location");
- return OrgOption_ShowColumn;
- }
- case Sbm.SystemCode.OrgOption_ShowField:
- return new List(orgOption_ShowFields);
- case Sbm.SystemCode.OrgOption_FieldLabel:
- return new List(orgOption_FieldLabels);
- case Sbm.SystemCode.OrgOption_TransactionCreationStatus:
- return new List(orgOption_TransactionCreationStatuses);
- case Sbm.SystemCode.OrgOption_ContainerStatusCaption:
- return new List(orgOption_ContainerStatusCaptions);
- case Sbm.SystemCode.OrgOption_NumericDecimals:
- return new List(orgOption_NumericDecimals);
- case Sbm.SystemCode.OrgOption_CommodityType:
- return new List(orgOption_CommodityTypes);
- case Sbm.SystemCode.OrgOption_StockLocation:
- return new List(orgOption_StockLocations);
- case Sbm.SystemCode.OrgOption_TaxCodeColumn:
- return new List(orgOption_TaxCodeColumns);
- case Sbm.SystemCode.OrgOption_SystemUserRight:
- return new List(orgOption_SystemUserRights);
- case Sbm.SystemCode.SystemUserOption:
- return new List(systemUserOptions);
- case Sbm.SystemCode.AssociationOption:
- return new List(associationOptions);
- case Sbm.SystemCode.InterfaceOption:
- return new List(interfaceOptions);
- case Sbm.SystemCode.InterfaceOption_WebFlag:
- return new List(interfaceOption_WebFlags);
- case Sbm.SystemCode.InterfaceOption_WebUploadData:
- return new List(interfaceOption_WebUploadDatas);
- case Sbm.SystemCode.InterfaceOption_WebUploadMethod:
- return new List(interfaceOption_WebUploadMethods);
- case Sbm.SystemCode.InterfaceOption_WebDownloadData:
- return new List(interfaceOption_WebDownloadDatas);
- case Sbm.SystemCode.InterfaceOption_WebDownloadMethod:
- return new List(interfaceOption_WebDownloadMethods);
- case Sbm.SystemCode.FileInterface_RowColValue:
- return new List(fileInterface_RowColValues);
- case Sbm.SystemCode.FileInterface_Mode:
- return new List(fileInterface_Modes);
+ case Sbm.SystemCode.ProcessType:
+ return new List(processTypes);
+ case Sbm.SystemCode.PaymentType:
+ return new List(paymentTypes);
+ case Sbm.SystemCode.AssetIncomeType:
+ return new List(assetIncomeTypes);
+ case Sbm.SystemCode.AssetType:
+ return new List(assetTypes);
+ case Sbm.SystemCode.VehicleType:
+ return new List(vehicleTypes);
+ case Sbm.SystemCode.VehicleEventType:
+ return new List(vehicleEventTypes);
+ case Sbm.SystemCode.VehicleFeatureSource:
+ return new List(vVehicleFeatureSources);
+ case Sbm.SystemCode.VehicleFeatureType:
+ return new List(vehicleFeatureTypes);
+ case Sbm.SystemCode.VehicleOptionType:
+ return new List(vehicleOptionTypes);
+ case Sbm.SystemCode.VehicleTransType:
+ return new List(vehicleTransTypes);
+ case Sbm.SystemCode.FuelType:
+ return new List(fuelTypes);
+ case Sbm.SystemCode.OdometerUnits:
+ return new List(odometerUnits);
+ case Sbm.SystemCode.DiscountType:
+ return new List(discountTypes);
+ case Sbm.SystemCode.DiscountMarkup:
+ return new List(discountMarkups);
+ case Sbm.SystemCode.RegionType:
+ return new List(regionTypes);
+ case Sbm.SystemCode.UnitMeasureCategory:
+ return new List(unitMeasureCategories);
+ case Sbm.SystemCode.UnitMeasureType:
+ return new List(unitMeasureTypes);
+ case Sbm.SystemCode.FinancialType:
+ {
+ List FinancialType = new List();
+ if (sessionConsole != null)
+ {
+ if (sessionConsole.AllowOption(Sbm.ConfigOption.AllowCommodities))
+ FinancialType.Add(Sbm.FinancialType.CommoditySupply, "CmdSup", "Commodity supply");
+ }
+ FinancialType.Add(Sbm.FinancialType.CommoditySales, "CmdSal", "Commodity sales");
+ return FinancialType;
+ }
+ case Sbm.SystemCode.PriceType:
+ return new List(priceTypes);
+ case Sbm.SystemCode.PriceCalcMethod:
+ return new List(priceCalcMethods);
+ case Sbm.SystemCode.PriceRounderMethod:
+ return new List(priceRounderMethods);
+ case Sbm.SystemCode.PriceRounderDirection:
+ return new List(priceRounderDirections);
+ case Sbm.SystemCode.SystemAccountType:
+ return new List(systemAccountTypes);
+ case Sbm.SystemCode.ItemStatus:
+ return new List(itemStatuses);
+ case Sbm.SystemCode.EventStatus:
+ return new List(eventStatuses);
+ case Sbm.SystemCode.AssociationTab:
+ return new List(associationTabs);
+ case Sbm.SystemCode.InterfaceType_Website:
+ {
+ // Interface types - Website.
+ // Duplicate static list and remove unsupported options.
+ List codes = new List(interfaceTypes_Website);
+ if (sessionConsole == null || !sessionConsole.AllowInterface(SaInterfaceCategory.Website, (short)(Sbm.InterfaceType_Website.WebStore)))
+ interfaceTypes_Website.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_Website.WebStore);
+ if (sessionConsole == null || !sessionConsole.AllowInterface(SaInterfaceCategory.Website, (short)(Sbm.InterfaceType_Website.JoomlaVirtueMart)))
+ interfaceTypes_Website.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_Website.JoomlaVirtueMart);
+ if (sessionConsole == null || !sessionConsole.AllowInterface(SaInterfaceCategory.Website, (short)(Sbm.InterfaceType_Website.MiMoWeb)))
+ interfaceTypes_Website.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_Website.MiMoWeb);
+ return new List(codes);
+ }
+ case Sbm.SystemCode.InterfaceType_Accounts:
+ {
+ // Interface Type - Accounts.
+ // Duplicate static list and remove unsupported options.
+ List codes = new List(interfaceTypes_Accounts);
+ return new List(codes);
+ }
+ case Sbm.SystemCode.InterfaceType_System:
+ {
+ // Interface Type - System.
+ // Duplicate static list and remove unsupported options.
+ List codes = new List(interfaceTypes_System);
+ if (sessionConsole == null || !sessionConsole.AllowInterface(SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.MSOutlook))
+ interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.MSOutlook);
+ if (sessionConsole == null || !sessionConsole.AllowInterface(SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.PostcodeAnywhere))
+ interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.PostcodeAnywhere);
+ if (sessionConsole == null || !sessionConsole.AllowInterface(SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Bac))
+ interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Bac);
+ if (sessionConsole == null || !sessionConsole.AllowInterface(SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Pvh))
+ interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Pvh);
+ if (sessionConsole == null || !sessionConsole.AllowInterface(SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Cap))
+ interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Cap);
+ if (sessionConsole == null || !sessionConsole.AllowInterface(SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Hpi))
+ interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Hpi);
+ if (sessionConsole == null || !sessionConsole.AllowInterface(SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Anchor_OrderFulfilment))
+ interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Anchor_OrderFulfilment);
+ if (sessionConsole == null || !sessionConsole.AllowInterface(SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Argos))
+ interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Argos);
+ if (sessionConsole == null || !sessionConsole.AllowInterface(SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Homebase))
+ interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Homebase);
+ return new List(codes);
+ }
+ case Sbm.SystemCode.InterfaceType_File:
+ {
+ // Interface Type - File.
+ // Duplicate static list and remove unsupported options.
+ List codes = new List(interfaceTypes_File);
+ if (sessionConsole == null || !sessionConsole.AllowInterface(SaInterfaceCategory.System, (short)Sbm.InterfaceType_File.LeasewayInvoice))
+ codes.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_File.LeasewayInvoice);
+ return new List(codes);
+ }
+ case Sbm.SystemCode.InterfaceDataType:
+ return new List(interfaceDataTypes);
+ case Sbm.SystemCode.ItemDataType:
+ return new List(itemDataTypes);
+ case Sbm.SystemCode.OrgOption_Value:
+ return new List(orgOption_Values);
+ case Sbm.SystemCode.OrgOption_Folder:
+ return new List(orgOption_Folders);
+ case Sbm.SystemCode.OrgOption_Minutes:
+ return new List(OrgOption_Minutes);
+ case Sbm.SystemCode.OrgOption_PeriodDays:
+ {
+ List OrgOption_PeriodDays = new List();
+
+ OrgOption_PeriodDays.Add(Sbm.OrgOption_PeriodDays.TransactionDatesInFuture, "TransDatesInFut", "Days in future that transaction dates can be set", "");
+ OrgOption_PeriodDays.Add(Sbm.OrgOption_PeriodDays.UpdateClosedTransaction, "UpdClosedTrans", "Grace period (days) for updating closed transactions", "Period after transaction closure during which updates are allowed (0-30 days)");
+ if (sessionConsole != null && sessionConsole.AllowOption(Sbm.ConfigOption.AllowDeliveryPlanning))
+ OrgOption_PeriodDays.Add(Sbm.OrgOption_PeriodDays.UpdateClosedTransaction_DispatchDetails, "UpdDisDetCloTrans", "Grace period (days) for updating dispatch details on closed order", "Period after transaction closure during which dispatch updates are allowed (0-30 days)");
+ if (sessionConsole != null && sessionConsole.GetStockControlConfig().AllowStockControl())
+ OrgOption_PeriodDays.Add(Sbm.OrgOption_PeriodDays.UpdateStockLevelsInPast, "UpdStkLvlInPast", "Update stock levels in past");
+ return OrgOption_PeriodDays;
+ }
+ case Sbm.SystemCode.OrgOption_PeriodWeeks:
+ {
+ List OrgOption_PeriodWeeks = new List