using Sarand.BusinessMgr.Net.Standard.Base.Mgr; using Sarand.Net.Standard.Base.App; using Sarand.Net.Standard.Base.Core; using Sarand.Net.Standard.Base.Utils; using System; using System.Collections.Generic; namespace Sarand.BusinessMgr.Net.Standard.Base.App { //======================================================================= public abstract partial class SbmSystem : SacsSystem { //------------------------------------------------------------------- // Data members. private static short assetCommodityTypeAllowed = -1; //------------------------------------------------------------------- // Extended logging options. public enum ExtendedLogginOption { SecurityProfile, DbQueryExecution, Printing, } public static readonly String ExtendedLogging_SecurityProfile = "SecurityProfile"; public static readonly String ExtendedLogging_DbQueryExecution = "DbQueryExecution"; public static readonly String ExtendedLogging_Printing = "Printing"; private List extendedLoggingOptions; public object StringList { get; } //------------------------------------------------------------------- // Construction - use derived objects. protected SbmSystem(PropertySet properties) { // Configure extended logging. extendedLoggingOptions = StringListUtil.Split(properties.GetPropertyValue("Logging", "ExtendedLogging")); } //------------------------------------------------------------------- // Application definitions. public static Sbm.ConfigConsole GetConfigConsoleType(String consoleProperty) { if (consoleProperty.ContainsCI("Sarand")) return Sbm.ConfigConsole.Sarand; if (consoleProperty.ContainsCI("MPE")) return Sbm.ConfigConsole.MPE; if (consoleProperty.ContainsCI("BPE")) return Sbm.ConfigConsole.BPE; if (consoleProperty.ContainsCI("Cadix") || consoleProperty.ContainsCI("CUL")) return Sbm.ConfigConsole.Cadix; return Sbm.ConfigConsole.Generic; } public static String GetCopyrightNotice(bool html = false) { return (html ? "©" : "(c)") + "2002- " + DateTime.Today.Year + "Sarand Ltd"; } public static bool IsSysAdminSession() { // Dev mode. if (IsDevHost()) return true; // Production servers. if (UserName.ContainsCI("Sarand")) { if (ComputerName.EqualsCI("SS-APP-S1")) return true; if (ComputerName.EqualsCI("SS-APP-S2")) return true; if (ComputerName.EqualsCI("SS-APP-LG1")) return true; } // Development. if (ComputerName.ContainsCI("Sarand")) return true; return false; } //------------------------------------------------------------------- // S y s t e m C o d e s //------------------------------------------------------------------- private static String GetOwnerOption_Caption(SbmUserContext userContext, Sbm.OrgOption_Caption orgOption_Caption, String defaultValue) { // In case user context not specified, eg. Security Console initialising list of transaction types before user logged in. if (userContext != null) return userContext.GetOwnerOption_Caption(orgOption_Caption, defaultValue); return defaultValue; } public static List GetCodesOfType(SbmUserContext userContext, Sbm.SystemCode systemCode) { SbmConfigConsole configConsole = null; // SbmGlobals.GetConfigConsole(userContext.SessionContext); 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")), new TypeCodeDesc((int)Sbm.TransactionType.SalesQuote, "SQT", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_SalesQuote, "Sales Quote")), new TypeCodeDesc((int)Sbm.TransactionType.SalesPO, "SPO", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_SalesPO, "Sales Purchase Order")), new TypeCodeDesc((int)Sbm.TransactionType.ProformaSalesOrder, "SAP", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_ProformaSalesOrder, "Proforma Sales Order")), new TypeCodeDesc((int)Sbm.TransactionType.SalesOrder, "SAL", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_SalesOrder, "Sales Order")), new TypeCodeDesc((int)Sbm.TransactionType.SalesDispatch, "SDP", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_SalesDispatch, "Sales Dispatch")), new TypeCodeDesc((int)Sbm.TransactionType.ProformaSalesInvoice, "PSI", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_ProformaSalesInvoice, "Proforma Sales Invoice")), new TypeCodeDesc((int)Sbm.TransactionType.SalesInvoice, "SAI", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_SalesInvoice, "Sales Invoice")), new TypeCodeDesc((int)Sbm.TransactionType.PurchaseQuote, "PQT", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_PurchaseQuote, "Purchase Quote")), new TypeCodeDesc((int)Sbm.TransactionType.PurchaseSO, "PSO", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_PurchaseSO, "Purchase Sales Order")), new TypeCodeDesc((int)Sbm.TransactionType.ProformaPurchaseOrder, "PUP", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_ProformaPurchaseOrder, "Proforma Purchase Order")), new TypeCodeDesc((int)Sbm.TransactionType.PurchaseOrder, "PUR", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_PurchaseOrder, "Purchase Order")), new TypeCodeDesc((int)Sbm.TransactionType.PurchaseDelivery, "PDL", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_PurchaseDelivery, "Purchase Delivery")), 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) { // ToDo SbmSystem assetCommodityTypeAllowed using (SbmAssetMgr assetMgr = SbmGlobals.System.CreateAssetMgr(userContext)) { //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(); 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)"); } 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) { // 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"); } 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); } return null; } //------------------------------------------------------------------- // D a t a M a n a g e r s //------------------------------------------------------------------- public abstract SbmAccountMgr CreateAccountMgr(SbmUserContext userContext); public abstract SbmAssetMgr CreateAssetMgr(SbmUserContext userContext); public abstract SbmCommodityMgr CreateCommodityMgr(SbmUserContext userContext); public abstract SbmPriceMgr CreatePriceMgr(SbmUserContext userContext); public abstract SbmDataItemMgr CreateDataItemMgr(SbmUserContext userContext); public abstract SbmProcessMgr CreateProcessMgr(SbmUserContext userContext); public abstract SbmStockMgr CreateStockMgr(SbmUserContext userContext); public abstract SbmTransactionMgr CreateTransactionMgr(SbmUserContext userContext); //------------------------------------------------------------------- // A p p l i c a t i o n P r o p e r t i e s //------------------------------------------------------------------- public bool IsExtendedLogging(ExtendedLogginOption extendedLoggingOption) { if (extendedLoggingOptions == null) return false; if (extendedLoggingOption == ExtendedLogginOption.SecurityProfile) return extendedLoggingOptions.ContainsCI(ExtendedLogging_SecurityProfile); if (extendedLoggingOption == ExtendedLogginOption.DbQueryExecution) return extendedLoggingOptions.ContainsCI(ExtendedLogging_DbQueryExecution); if (extendedLoggingOption == ExtendedLogginOption.Printing) return extendedLoggingOptions.ContainsCI(ExtendedLogging_Printing); return false; } //------------------------------------------------------------------- } //======================================================================= }