From 1075e9eef59c30d099e370b1b15551b9df5e482f Mon Sep 17 00:00:00 2001 From: Andy Howard Date: Thu, 30 Oct 2025 12:59:27 +0000 Subject: [PATCH] 3.0.1.9 Portal styling. Interfaces controller/model. --- .../SbmInterfaceProcess_Commodity_Export.cs | 4 +- SaBusMgrCoreWeb/Web/App/SbmLocaliser.cs | 12 +- .../Web/Components/SbmModel_Base.cs | 33 +- SaBusMgrStandardBase/Base/App/Sbm-Version.cs | 3 +- SaBusMgrStandardBase/Base/App/Sbm.cs | 2 +- SaBusMgrStandardBase/Base/App/SbmDbDfn.cs | 183 +++++---- .../Base/App/SbmDbDfn_Control.cs | 161 ++++---- SaBusMgrStandardBase/Base/App/SbmInternals.cs | 67 ++-- .../Base/App/SbmOrganisationConfig.cs | 30 +- .../Base/App/SbmSystem-Statics.cs | 160 ++++---- SaBusMgrStandardBase/Base/App/SbmSystem.cs | 25 +- .../Base/Bus/SbmAssociation.cs | 8 +- SaBusMgrStandardBase/Base/Bus/SbmCommodity.cs | 2 +- .../Base/Bus/SbmRequirementCosts.cs | 2 +- .../Base/Bus/SbmTransaction.cs | 11 +- .../Consoles/SbmAccountsConsole-QuickBooks.cs | 2 +- .../Base/Consoles/SbmAccountsConsole-Sage.cs | 2 +- .../Base/Consoles/SbmAccountsConsole.cs | 2 +- .../Base/Consoles/SbmInstanceSchemaConsole.cs | 34 +- .../SbmSessionConsole-Transactions.cs | 4 +- .../Base/Mgr/SbmAccountMgr.cs | 14 +- .../Base/Mgr/SbmAccountMgr_Association.cs | 22 +- .../Base/Mgr/SbmAccountMgr_Organisation.cs | 34 +- SaBusMgrStandardBase/Base/Mgr/SbmAssetMgr.cs | 2 +- .../Base/Mgr/SbmCommodityMgr.cs | 16 +- SaBusMgrStandardBase/Base/Mgr/SbmCoreMgr.cs | 14 +- SaBusMgrStandardBase/Base/Mgr/SbmPriceMgr.cs | 8 +- .../Base/Mgr/SbmProcessMgr.cs | 4 +- .../Base/Mgr/SbmProcessMgr_Process.cs | 2 +- SaBusMgrStandardBase/Base/Mgr/SbmStockMgr.cs | 2 +- .../Base/Mgr/SbmStockMgr_StockLevel.cs | 4 +- .../Base/Mgr/SbmTransactionMgr.cs | 12 +- .../Base/Mgr/SbmTransactionMgr_Transaction.cs | 4 +- .../Dbas/Consoles/SbmInterfaceConsole_Dbas.cs | 12 +- .../Dbas/Consoles/SbmSecurityConsole_Dbas.cs | 6 +- .../Dbas/Internal/Address_Db.cs | 2 +- .../Dbas/Internal/Affiliate_Db.cs | 2 +- .../Dbas/Internal/Association_Db.cs | 2 +- .../Dbas/Internal/CommodityCustomer_Db.cs | 2 +- .../Dbas/Internal/CommoditySupplier_Db.cs | 2 +- .../Dbas/Internal/Commodity_Db.cs | 2 +- .../Dbas/Internal/Constituent_Db.cs | 2 +- .../Dbas/Internal/ContainerItem_Db.cs | 2 +- .../Dbas/Internal/Container_Db.cs | 2 +- .../Control/AccountRegistration_Db.cs | 2 +- .../Dbas/Internal/Control/ItemParam_Db.cs | 2 +- .../Dbas/Internal/Control/Owner_Db.cs | 2 +- .../Dbas/Internal/Control/Repository_Db.cs | 2 +- .../Dbas/Internal/Control/UserAccount_Db.cs | 2 +- .../Dbas/Internal/ItemBatch_Db.cs | 2 +- .../Dbas/Internal/ItemLink_Db.cs | 2 +- .../Dbas/Internal/Location_Db.cs | 2 +- .../Dbas/Internal/Movement_Db.cs | 2 +- .../Dbas/Internal/PortfolioItem_Db.cs | 2 +- .../Dbas/Internal/Process_Db.cs | 2 +- .../Dbas/Internal/Requirement_Db.cs | 2 +- .../Dbas/Internal/SaAssetCategory_Db.cs | 2 +- .../Dbas/Internal/SaAssetProcess_Db.cs | 2 +- .../Dbas/Internal/SaAsset_Db.cs | 2 +- .../Dbas/Internal/SaDiaryEntry_Db.cs | 2 +- .../Dbas/Internal/SaDiaryLink_Db.cs | 2 +- .../Dbas/Internal/SaPriceSet_Db.cs | 2 +- .../Dbas/Internal/SaPrice_Db.cs | 2 +- .../Dbas/Internal/SaVehicleClass_Db.cs | 2 +- .../Dbas/Internal/SaVehicleEvent_Db.cs | 2 +- .../Dbas/Internal/SaVehicleFeature_Db.cs | 2 +- .../Dbas/Internal/SaVehicle_Db.cs | 2 +- .../Dbas/Internal/StockLevel_Db.cs | 2 +- .../Dbas/Internal/SysParam_Db.cs | 2 +- .../Dbas/Internal/SystemAccountUser_Db.cs | 2 +- .../Dbas/Internal/SystemAccount_Db.cs | 2 +- .../Dbas/Internal/SystemUser_Db.cs | 2 +- .../Dbas/Internal/Transaction_Db.cs | 2 +- .../Dbas/Mgr/SbmAccountMgr_Dbas-Affiliate.cs | 14 +- .../Mgr/SbmAccountMgr_Dbas-Association.cs | 10 +- .../Dbas/Mgr/SbmAccountMgr_Dbas-SysParam.cs | 10 +- .../Mgr/SbmAccountMgr_Dbas-SystemAccount.cs | 4 +- .../SbmAccountMgr_Dbas-SystemAccountUser.cs | 4 +- .../Dbas/Mgr/SbmAccountMgr_Dbas-SystemUser.cs | 10 +- .../Dbas/Mgr/SbmAssetMgr_Dbas-Asset.cs | 31 +- .../Mgr/SbmAssetMgr_Dbas-AssetCategory.cs | 23 +- .../Dbas/Mgr/SbmAssetMgr_Dbas-AssetProcess.cs | 10 +- .../Dbas/Mgr/SbmAssetMgr_Dbas-Vehicle.cs | 7 +- .../Dbas/Mgr/SbmAssetMgr_Dbas-VehicleClass.cs | 9 +- .../Dbas/Mgr/SbmAssetMgr_Dbas-VehicleEvent.cs | 10 +- .../Mgr/SbmAssetMgr_Dbas-VehicleFeature.cs | 4 +- .../Mgr/SbmCommodityMgr_Dbas-Commodity.cs | 33 +- .../SbmCommodityMgr_Dbas-CommodityCustomer.cs | 4 +- .../SbmCommodityMgr_Dbas-CommoditySupplier.cs | 6 +- .../Mgr/SbmCommodityMgr_Dbas-PortfolioItem.cs | 6 +- .../Dbas/Mgr/SbmDataItemMgr_Dbas-ItemLink.cs | 4 +- .../Dbas/Mgr/SbmPriceMgr_Dbas-Price.cs | 4 +- .../Dbas/Mgr/SbmPriceMgr_Dbas-PriceSet.cs | 6 +- .../Dbas/Mgr/SbmProcessMgr_Dbas-Process.cs | 6 +- .../Mgr/SbmTransactionMgr_Dbas-Constituent.cs | 26 +- .../Mgr/SbmTransactionMgr_Dbas-Requirement.cs | 28 +- .../Mgr/SbmTransactionMgr_Dbas-Transaction.cs | 36 +- .../SbmUpdateLogItemMonitor_Address.cs | 4 +- .../SbmUpdateLogItemMonitor_Affiliate.cs | 2 +- .../SbmUpdateLogItemMonitor_AssetCategory.cs | 4 +- .../SbmUpdateLogItemMonitor_Association.cs | 4 +- .../SbmUpdateLogItemMonitor_Commodity.cs | 2 +- .../SbmUpdateLogItemMonitor_Constituent.cs | 2 +- .../SbmUpdateLogItemMonitor_Container.cs | 4 +- .../SbmUpdateLogItemMonitor_ContainerItem.cs | 2 +- .../SbmUpdateLogItemMonitor_ItemBatch.cs | 2 +- .../SbmUpdateLogItemMonitor_ItemLink.cs | 2 +- .../SbmUpdateLogItemMonitor_Location.cs | 2 +- .../SbmUpdateLogItemMonitor_Movement.cs | 4 +- .../SbmUpdateLogItemMonitor_PortfolioItem.cs | 2 +- .../SbmUpdateLogItemMonitor_Process.cs | 4 +- .../SbmUpdateLogItemMonitor_Requirement.cs | 2 +- .../SbmUpdateLogItemMonitor_StockLevel.cs | 4 +- .../SbmUpdateLogItemMonitor_SysParam.cs | 2 +- .../SbmUpdateLogItemMonitor_Transaction.cs | 2 +- .../SbmUpdateLogItemMonitor_VehicleClass.cs | 6 +- .../SbmUpdateLogItemMonitor_VehicleEvent.cs | 2 +- .../SbmUpdateLogItemMonitor_VehicleFeature.cs | 4 +- .../Resources/Database/SbmDbDfn.xml | 138 ++----- .../Resources/Database/SbmDbDfn_Control.xml | 6 +- .../Control/App/SbmApplication_Control.cs | 8 +- .../wwwroot/css/sbc-form.css | 5 +- .../Localisation/SbmPortalProperties.resx | 6 + .../Portal/App/SbmApplication_Portal.cs | 4 +- .../SbmController_Portal-Security.cs | 19 +- .../Portal/Components/SbmController_Portal.cs | 8 +- .../Portal/Components/SbmModel_Portal.cs | 25 +- .../Addresses/AddressController-Ajax.cs | 2 +- .../Assets/AssetCategoryController-Ajax.cs | 4 +- .../Commodities/CommodityController-Ajax.cs | 8 +- .../Contacts/ContactController-Ajax.cs | 2 +- .../Interfaces/InterfaceController-Ajax.cs | 365 ++++++++++++++++++ .../Interfaces/InterfaceController.cs | 44 +++ .../RequirementController-Ajax.cs | 8 +- .../Security/SecurityController-Ajax.cs | 12 +- .../TransactionController-Ajax.cs | 2 +- .../Transactions/TransactionController.cs | 4 +- .../Models/Commodities/Model_Commodity.cs | 2 +- .../Portal/Models/Contacts/Model_Contact.cs | 4 +- .../Portal/Models/Home/Model_Home.cs | 1 - .../Interfaces/Model_Interface-Config.cs | 224 +++++++++++ .../Models/Interfaces/Model_Interface.cs | 157 ++++++++ .../Models/Requirements/Model_Requirement.cs | 4 +- .../Models/Transactions/Model_Transaction.cs | 4 +- .../SaBusinessMgrCoreWebPortal.csproj | 4 + .../Panel-AssociationMaintain.cshtml | 5 +- .../Panel-AssociationSelect.cshtml | 4 +- .../Commodity/Panel-CommodityMaintain.cshtml | 7 +- .../Commodity/Panel-CommoditySelect.cshtml | 7 +- .../Contact/Panel-ContactMaintain.cshtml | 5 +- .../Views/Contact/Panel-ContactSelect.cshtml | 5 +- .../Requirement/Panel-RequirementList.cshtml | 18 +- .../Panel-RequirementMaintain.cshtml | 6 +- .../Panel-RequirementSelect.cshtml | 6 +- .../Transaction/Panel-TransactionList.cshtml | 8 +- .../Panel-TransactionMaintain.cshtml | 12 +- .../Panel-TransactionSelect.cshtml | 5 +- .../wwwroot/css/sbm-data.css | 4 +- .../wwwroot/css/sbm-form.css | 3 +- 159 files changed, 1642 insertions(+), 869 deletions(-) create mode 100644 SaBusinessMgrCoreWebPortal/Portal/Controllers/Interfaces/InterfaceController-Ajax.cs create mode 100644 SaBusinessMgrCoreWebPortal/Portal/Controllers/Interfaces/InterfaceController.cs create mode 100644 SaBusinessMgrCoreWebPortal/Portal/Models/Interfaces/Model_Interface-Config.cs create mode 100644 SaBusinessMgrCoreWebPortal/Portal/Models/Interfaces/Model_Interface.cs diff --git a/SaBusMgrCoreProcs/Procs/Interfaces/SbmInterfaceProcess_Commodity_Export.cs b/SaBusMgrCoreProcs/Procs/Interfaces/SbmInterfaceProcess_Commodity_Export.cs index 20b460b..8204864 100644 --- a/SaBusMgrCoreProcs/Procs/Interfaces/SbmInterfaceProcess_Commodity_Export.cs +++ b/SaBusMgrCoreProcs/Procs/Interfaces/SbmInterfaceProcess_Commodity_Export.cs @@ -120,7 +120,7 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces public SbmInterfaceProcess_Commodity_Export(Config config) : base(config) { this.config = config; - interfaceOptions = Internals.GetSystemCodes(Sbm.SystemCode.InterfaceOption); + interfaceOptions = Internals.GetApplicationCodes(Sbm.ApplicationCode.InterfaceOption); } protected override void Dispose(bool disposing) { @@ -677,7 +677,7 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces for (int i = 1; i <= kiMaxDataColumn; i++) optionContexts_Column.Add(i, StringUtil.PadLeft(i.ToString(), 3, '0'), "Column " + StringUtil.PadLeft(i.ToString(), 2, '0')); } - optionValues_Mode = Internals.GetSystemCodes(Sbm.SystemCode.FileInterface_Mode); + optionValues_Mode = Internals.GetApplicationCodes(Sbm.ApplicationCode.FileInterface_Mode); if (optionValues_Column == null) { optionValues_Column = new List(); diff --git a/SaBusMgrCoreWeb/Web/App/SbmLocaliser.cs b/SaBusMgrCoreWeb/Web/App/SbmLocaliser.cs index dca2efc..be35226 100644 --- a/SaBusMgrCoreWeb/Web/App/SbmLocaliser.cs +++ b/SaBusMgrCoreWeb/Web/App/SbmLocaliser.cs @@ -148,8 +148,8 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App //------------------------------------------------------------------- private class CodeCache { - public Dictionary> codes { get; } = new Dictionary>(); - public List GetSystemCodes(Sbm.SystemCode codeType) + public Dictionary> codes { get; } = new Dictionary>(); + public List GetSystemCodes(Sbm.ApplicationCode codeType) { if (!codes.ContainsKey(codeType)) codes.Add(codeType, SbmSystem.GetSystemCodes(codeType)); @@ -170,7 +170,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App { if ((int)affiliateType < 1) return ""; // ToDo Affiliate Type localisation. - List affiliateTypeCodes = systemCodes.GetSystemCodes(Sbm.SystemCode.AffiliateType); + List affiliateTypeCodes = systemCodes.GetSystemCodes(Sbm.ApplicationCode.AffiliateType); return affiliateTypeCodes.GetDescForType(affiliateType, affiliateTypeCodes.GetCodeForType(affiliateType)); } @@ -179,7 +179,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App { if ((int)associationType < 1) return ""; // ToDo Association Type localisation. - List associationTypeCodes = systemCodes.GetSystemCodes(Sbm.SystemCode.AssociationType); + List associationTypeCodes = systemCodes.GetSystemCodes(Sbm.ApplicationCode.AssociationType); return associationTypeCodes.GetDescForType(associationType, associationTypeCodes.GetCodeForType(associationType)); } @@ -188,7 +188,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App { if ((int)assetType < 1) return ""; // ToDo Asset Type localisation. - List assetTypeCodes = systemCodes.GetSystemCodes(Sbm.SystemCode.AssetType); + List assetTypeCodes = systemCodes.GetSystemCodes(Sbm.ApplicationCode.AssetType); return assetTypeCodes.GetDescForType(assetType, assetTypeCodes.GetCodeForType(assetType)); } @@ -197,7 +197,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App { if ((int)transactionType < 1) return ""; // ToDo Transaction Type localisation. - List transactionTypeCodes = systemCodes.GetSystemCodes(Sbm.SystemCode.TransactionType); + List transactionTypeCodes = systemCodes.GetSystemCodes(Sbm.ApplicationCode.TransactionType); return transactionTypeCodes.GetDescForType(transactionType, transactionTypeCodes.GetCodeForType(transactionType)); } diff --git a/SaBusMgrCoreWeb/Web/Components/SbmModel_Base.cs b/SaBusMgrCoreWeb/Web/Components/SbmModel_Base.cs index 207c735..a201832 100644 --- a/SaBusMgrCoreWeb/Web/Components/SbmModel_Base.cs +++ b/SaBusMgrCoreWeb/Web/Components/SbmModel_Base.cs @@ -1,30 +1,17 @@ -using DocumentFormat.OpenXml.Drawing; -using Microsoft.AspNetCore.Html; -using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.AspNetCore.Html; using Sacs.Web.Components; using Sarand.BusinessMgr.Net.Core.Web.App; using Sarand.BusinessMgr.Net.Standard.Base.App; -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.BusinessMgr.Net.Standard.Base.Mgr.Control; using Sarand.Net.Standard.Base.CodeTypes; -using Sarand.Net.Standard.Base.Core; using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Diary; using Sarand.Net.Standard.Base.Interfaces; -using Sarand.Net.Standard.Base.ItemData; -using Sarand.Net.Standard.Base.ItemDocs; using Sarand.Net.Standard.Base.ItemOptions; -using Sarand.Net.Standard.Base.ReferenceData; using Sarand.Net.Standard.Base.Security; -using Sarand.Net.Standard.Base.UpdateLog; using Sarand.Net.Standard.Base.Utils; using System; -using System.Collections.Generic; using System.Globalization; -using System.Text; namespace Sarand.BusinessMgr.Net.Core.Web.Components { @@ -100,7 +87,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Components public int PasswordMaxLength { get; } = 32; //------------------------------------------------------------------- - // Control max lengths - based on database tabke column length. + // Control max lengths - based on database table column length. /// /// Form control value max length - Security tables. @@ -152,6 +139,22 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Components return maxLength; } + /// + /// Form control value max length - Code Type tables. + /// In many cases the database columns allow plenty of extra space for the value, in case they need to be encrypted. + /// Hence, several cases where the value entered in the control isn't allowed the full database length. + /// + public virtual int GetControlMaxLength(SaInterfaceDbDfn.ColumnIdx column) + { + int maxLength = (int)(InstanceSchemaConsole?.GetColTextLen(column) ?? SaInterfaceDbDfn.GetColTextLen(column)); + switch (column) + { + case SaInterfaceDbDfn.ColumnIdx.SaInterface_Code: + break; + } + return maxLength; + } + /// /// Form control value max length - BusinessMgr tables. /// In many cases the database columns allow plenty of extra space for the value, in case they need to be encrypted. diff --git a/SaBusMgrStandardBase/Base/App/Sbm-Version.cs b/SaBusMgrStandardBase/Base/App/Sbm-Version.cs index 2d4b948..19e40b8 100644 --- a/SaBusMgrStandardBase/Base/App/Sbm-Version.cs +++ b/SaBusMgrStandardBase/Base/App/Sbm-Version.cs @@ -13,7 +13,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- public static class Version { - private static String version { get; } = "3.0.1.8"; + private static String version { get; } = "3.0.1.9"; // Retrieve version. public static String GetFullVersion() { return version; } public static String GetAppVersion() @@ -44,6 +44,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // 3.0.1.6 05-May-25 Addresses. // 3.0.1.7 21-Oct-25 Business object disposability. // 3.0.1.8 26-Oct-25 Control repository status check on update. + // 3.0.1.9 30-Oct-25 Portal styling. //------------------------------------------------------------------- // 3.0.0 Jul-2021 Initial demo test version. // 02-Feb-25 Initial live deployment. diff --git a/SaBusMgrStandardBase/Base/App/Sbm.cs b/SaBusMgrStandardBase/Base/App/Sbm.cs index 80bc04c..284303f 100644 --- a/SaBusMgrStandardBase/Base/App/Sbm.cs +++ b/SaBusMgrStandardBase/Base/App/Sbm.cs @@ -762,7 +762,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App /// /// CodeType fixed enumerated values. /// - public enum SystemCode + public enum ApplicationCode { ItemType, ItemDataType, diff --git a/SaBusMgrStandardBase/Base/App/SbmDbDfn.cs b/SaBusMgrStandardBase/Base/App/SbmDbDfn.cs index 1129bdb..fe29809 100644 --- a/SaBusMgrStandardBase/Base/App/SbmDbDfn.cs +++ b/SaBusMgrStandardBase/Base/App/SbmDbDfn.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Base.App { @@ -74,7 +74,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Column identifiers. public enum ColumnIdx { - Unknown = 0, + Unknown = 0, Address_Id, Address_ItemType, Address_ItemId, @@ -446,10 +446,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App InterfaceDataItem_ItemId, InterfaceDataItem_ProcessStatus, InterfaceDataItem_ProcessStatusBy, - InterfaceDataItem_ProcessStatusOn, + InterfaceDataItem_ProcessStatusAt, InterfaceDataItem_ItemStatus, InterfaceDataItem_ItemStatusBy, - InterfaceDataItem_ItemStatusOn, + InterfaceDataItem_ItemStatusAt, InterfaceDataItem_Notes, InterfaceDataItem_Flags, InterfaceDataItem_CreateOn, @@ -463,10 +463,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App InterfaceProcess_Direction, InterfaceProcess_ProcRef, InterfaceProcess_ProcSeq, - InterfaceProcess_ProcDate, - InterfaceProcess_ProcTime, - InterfaceProcess_BatchDate, - InterfaceProcess_BatchTime, + InterfaceProcess_ProcessAt, + InterfaceProcess_BatchAt, InterfaceProcess_ElapseSecs, InterfaceProcess_ItemCount, InterfaceProcess_Flags, @@ -1272,11 +1270,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- // Data members. private static readonly int tableCount = 51; - private static readonly int columnCount = 1192; + private static readonly int columnCount = 1190; public static ulong MaxTextLen { get; private set; } //------------------------------------------------------------------- - // Retrieve Table details (eg. name: 'Company'). + // Retrieve Table details. public static int GetTableCount () { return tableCount; @@ -1334,8 +1332,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App String tableName = StringUtil.EmptyOnNull(tableAlias); if (tableName.IsEmpty()) tableName = GetTableName(GetTableForColumn(column)); columnName = tableName + (tableName.Length > 0 ? "." : "") + columnName; - if (braces) - columnName = "(" + columnName + ")"; + if (braces) columnName = $"({columnName})"; } return columnName; } @@ -1368,11 +1365,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App case DbReservedWordDelim.None: break; case DbReservedWordDelim.DoubleQuotes: - word = "\"" + word + "\""; + word = $"\"{word}\""; break; case DbReservedWordDelim.SquareBrackets: default: - word = "[" + word + "]"; + word = $"[{word}]"; break; } return word; @@ -1898,10 +1895,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App new ColumnDfn(12,"ItemId",4,4,false,10), new ColumnDfn(12,"ProcessStatus",0,-9,false,3), new ColumnDfn(12,"ProcessStatusBy",4,4,false,10), - new ColumnDfn(12,"ProcessStatusOn",4,4,false,10), + new ColumnDfn(12,"ProcessStatusAt",9,93,false,23), new ColumnDfn(12,"ItemStatus",0,-9,false,3), new ColumnDfn(12,"ItemStatusBy",4,4,false,10), - new ColumnDfn(12,"ItemStatusOn",4,4,false,10), + new ColumnDfn(12,"ItemStatusAt",9,93,false,23), new ColumnDfn(12,"Notes",0,-9,false,255), new ColumnDfn(12,"Flags",3,5,false,5), new ColumnDfn(12,"CreateOn",9,93,false,23), @@ -1915,10 +1912,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App new ColumnDfn(13,"Direction",3,5,false,5), new ColumnDfn(13,"ProcRef",0,-9,false,32), new ColumnDfn(13,"ProcSeq",4,4,false,10), - new ColumnDfn(13,"ProcDate",4,4,false,10), - new ColumnDfn(13,"ProcTime",4,4,false,10), - new ColumnDfn(13,"BatchDate",4,4,false,10), - new ColumnDfn(13,"BatchTime",4,4,false,10), + new ColumnDfn(13,"ProcessAt",9,93,false,23), + new ColumnDfn(13,"BatchAt",9,93,false,23), new ColumnDfn(13,"ElapseSecs",4,4,false,10), new ColumnDfn(13,"ItemCount",4,4,false,10), new ColumnDfn(13,"Flags",3,5,false,5), @@ -2725,80 +2720,80 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Reserved words. private static readonly HashSet reservedWords = new HashSet() { - "ADD", - "ALL", - "ALTER", - "AND", - "ANY", - "AS", - "ASC", - "AVG", - "BEGIN", - "BETWEEN", - "BY", - "CASE", - "CAST", - "COLUMN", - "COMMIT", - "CONSTRAINT", - "CONVERT", - "COUNT", - "CREATE", - "CURRENCY", - "DEFAULT", - "DELETE", - "DESC", - "DISTINCT", - "DROP", - "ELSE", - "END", - "EXECUTE", - "EXISTS", - "FALSE", - "FROM", - "GRANT", - "GROUP", - "HAVING", - "IN", - "INDEX", - "INNER", - "INSERT", - "INTO", - "IS", - "JOIN", - "KEY", - "LEFT", - "LIKE", - "MAX", - "MIN", - "NOT", - "NULL", - "ON", - "OR", - "ORDER", - "OUTER", - "OUTPUT", - "PRIMARY", - "PROCEDURE", - "REVOKE", - "ROLLBACK", - "ROWCOUNT", - "SELECT", - "SET", - "SQL", - "SUM", - "TABLE", - "THEN", - "TRANSACTION", - "TRUE", - "UNION", - "UNIQUE", - "UPDATE", - "USER", - "VALUES", - "VIEW", - "WHEN", - "WHERE", + "ADD", + "ALL", + "ALTER", + "AND", + "ANY", + "AS", + "ASC", + "AVG", + "BEGIN", + "BETWEEN", + "BY", + "CASE", + "CAST", + "COLUMN", + "COMMIT", + "CONSTRAINT", + "CONVERT", + "COUNT", + "CREATE", + "CURRENCY", + "DEFAULT", + "DELETE", + "DESC", + "DISTINCT", + "DROP", + "ELSE", + "END", + "EXECUTE", + "EXISTS", + "FALSE", + "FROM", + "GRANT", + "GROUP", + "HAVING", + "IN", + "INDEX", + "INNER", + "INSERT", + "INTO", + "IS", + "JOIN", + "KEY", + "LEFT", + "LIKE", + "MAX", + "MIN", + "NOT", + "NULL", + "ON", + "OR", + "ORDER", + "OUTER", + "OUTPUT", + "PRIMARY", + "PROCEDURE", + "REVOKE", + "ROLLBACK", + "ROWCOUNT", + "SELECT", + "SET", + "SQL", + "SUM", + "TABLE", + "THEN", + "TRANSACTION", + "TRUE", + "UNION", + "UNIQUE", + "UPDATE", + "USER", + "VALUES", + "VIEW", + "WHEN", + "WHERE" }; //------------------------------------------------------------------- diff --git a/SaBusMgrStandardBase/Base/App/SbmDbDfn_Control.cs b/SaBusMgrStandardBase/Base/App/SbmDbDfn_Control.cs index 9679353..4f89d78 100644 --- a/SaBusMgrStandardBase/Base/App/SbmDbDfn_Control.cs +++ b/SaBusMgrStandardBase/Base/App/SbmDbDfn_Control.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Thu 13-Feb-2025 11:12:01 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:25:21 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Base.App { @@ -28,7 +28,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Column identifiers. public enum ColumnIdx { - Unknown = 0, + Unknown = 0, AccountRegistration_Id, AccountRegistration_EmailAddress, AccountRegistration_FirstName, @@ -131,7 +131,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App public static ulong MaxTextLen { get; private set; } //------------------------------------------------------------------- - // Retrieve Table details (eg. name: 'Company'). + // Retrieve Table details. public static int GetTableCount () { return tableCount; @@ -189,8 +189,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App String tableName = StringUtil.EmptyOnNull(tableAlias); if (tableName.IsEmpty()) tableName = GetTableName(GetTableForColumn(column)); columnName = tableName + (tableName.Length > 0 ? "." : "") + columnName; - if (braces) - columnName = "(" + columnName + ")"; + if (braces) columnName = $"({columnName})"; } return columnName; } @@ -223,11 +222,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App case DbReservedWordDelim.None: break; case DbReservedWordDelim.DoubleQuotes: - word = "\"" + word + "\""; + word = $"\"{word}\""; break; case DbReservedWordDelim.SquareBrackets: default: - word = "[" + word + "]"; + word = $"[{word}]"; break; } return word; @@ -435,80 +434,80 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Reserved words. private static readonly HashSet reservedWords = new HashSet() { - "ADD", - "ALL", - "ALTER", - "AND", - "ANY", - "AS", - "ASC", - "AVG", - "BEGIN", - "BETWEEN", - "BY", - "CASE", - "CAST", - "COLUMN", - "COMMIT", - "CONSTRAINT", - "CONVERT", - "COUNT", - "CREATE", - "CURRENCY", - "DEFAULT", - "DELETE", - "DESC", - "DISTINCT", - "DROP", - "ELSE", - "END", - "EXECUTE", - "EXISTS", - "FALSE", - "FROM", - "GRANT", - "GROUP", - "HAVING", - "IN", - "INDEX", - "INNER", - "INSERT", - "INTO", - "IS", - "JOIN", - "KEY", - "LEFT", - "LIKE", - "MAX", - "MIN", - "NOT", - "NULL", - "ON", - "OR", - "ORDER", - "OUTER", - "OUTPUT", - "PRIMARY", - "PROCEDURE", - "REVOKE", - "ROLLBACK", - "ROWCOUNT", - "SELECT", - "SET", - "SQL", - "SUM", - "TABLE", - "THEN", - "TRANSACTION", - "TRUE", - "UNION", - "UNIQUE", - "UPDATE", - "USER", - "VALUES", - "VIEW", - "WHEN", - "WHERE", + "ADD", + "ALL", + "ALTER", + "AND", + "ANY", + "AS", + "ASC", + "AVG", + "BEGIN", + "BETWEEN", + "BY", + "CASE", + "CAST", + "COLUMN", + "COMMIT", + "CONSTRAINT", + "CONVERT", + "COUNT", + "CREATE", + "CURRENCY", + "DEFAULT", + "DELETE", + "DESC", + "DISTINCT", + "DROP", + "ELSE", + "END", + "EXECUTE", + "EXISTS", + "FALSE", + "FROM", + "GRANT", + "GROUP", + "HAVING", + "IN", + "INDEX", + "INNER", + "INSERT", + "INTO", + "IS", + "JOIN", + "KEY", + "LEFT", + "LIKE", + "MAX", + "MIN", + "NOT", + "NULL", + "ON", + "OR", + "ORDER", + "OUTER", + "OUTPUT", + "PRIMARY", + "PROCEDURE", + "REVOKE", + "ROLLBACK", + "ROWCOUNT", + "SELECT", + "SET", + "SQL", + "SUM", + "TABLE", + "THEN", + "TRANSACTION", + "TRUE", + "UNION", + "UNIQUE", + "UPDATE", + "USER", + "VALUES", + "VIEW", + "WHEN", + "WHERE" }; //------------------------------------------------------------------- diff --git a/SaBusMgrStandardBase/Base/App/SbmInternals.cs b/SaBusMgrStandardBase/Base/App/SbmInternals.cs index d45ccc7..1f62884 100644 --- a/SaBusMgrStandardBase/Base/App/SbmInternals.cs +++ b/SaBusMgrStandardBase/Base/App/SbmInternals.cs @@ -93,6 +93,9 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App public SbmEmailConsole emailConsole; } public Consoles con { get; } = new Consoles(); + // System and Application codes. + public Dictionary> systemCodeCache { get; } = new Dictionary>(); + public Dictionary> applicationCodeCache = new Dictionary>(); // Configurations. public SbmStockControlConfig stockControlConfig { get; set; } public SbmRequirementCostingConfig requirementCostingConfig { get; set; } @@ -203,41 +206,51 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- // System codes. - private Dictionary> systemCodeCache = new Dictionary>(); - public List GetSystemCodes(Sbm.SystemCode systemCode) + public List GetSystemCodes(SaSysCodeType systemCode) { - if (!systemCodeCache.ContainsKey(systemCode)) + if (!mbr.systemCodeCache.ContainsKey(systemCode)) + mbr.systemCodeCache[systemCode] = SacsSystem.GetCodesOfType(systemCode); + return new List(mbr.systemCodeCache.GetValueOrDefault(systemCode, new List())); + } + public List MessageLevelCodes { get { return GetSystemCodes(SaSysCodeType.MessageLevel); } } + public List InterfaceCategoryCodes { get { return GetSystemCodes(SaSysCodeType.InterfaceCategory); } } + public List InterfaceProcessDirectionCodes { get { return GetSystemCodes(SaSysCodeType.InterfaceProcessDirection); } } + + // Application codes. + public List GetApplicationCodes(Sbm.ApplicationCode applicationCode) + { + if (!mbr.applicationCodeCache.ContainsKey(applicationCode)) { List codes = new List(); - foreach (TypeCodeDesc code in SbmSystem.GetSystemCodes(systemCode)) + foreach (TypeCodeDesc code in SbmSystem.GetSystemCodes(applicationCode)) { - switch (systemCode) + switch (applicationCode) { - case Sbm.SystemCode.AffiliateType: + case Sbm.ApplicationCode.AffiliateType: if (!SessionConsole.AllowAffiliateType((Sbm.AffiliateType)code.Type)) continue; break; - case Sbm.SystemCode.AssociationType: + case Sbm.ApplicationCode.AssociationType: if (!SessionConsole.AllowAssociationType((Sbm.AssociationType)code.Type)) continue; break; - case Sbm.SystemCode.TransactionType: + case Sbm.ApplicationCode.TransactionType: if (!SessionConsole.AllowTransactionType((Sbm.TransactionType)code.Type)) continue; break; - case Sbm.SystemCode.CommodityType: + case Sbm.ApplicationCode.CommodityType: if (code.Type == (int)Sbm.CommodityType.Asset && (!SessionConsole.AllowOption(Sbm.ConfigOption.Assets) || !AssetMgr.AssetDatabaseIsValid())) continue; break; - case Sbm.SystemCode.ProcessCategory: + case Sbm.ApplicationCode.ProcessCategory: if (code.Type == (int)Sbm.ProcessCategory.Commodity && !SessionConsole.AllowOption(Sbm.ConfigOption.Commodities)) continue; if (code.Type == (int)Sbm.ProcessCategory.Asset && (!SessionConsole.AllowOption(Sbm.ConfigOption.Assets) || !AssetMgr.AssetDatabaseIsValid())) continue; break; - case Sbm.SystemCode.FinancialType: + case Sbm.ApplicationCode.FinancialType: if ((code.Type == (int)Sbm.FinancialType.CommoditySupply || code.Type == (int)Sbm.FinancialType.CommoditySales) && !SessionConsole.AllowOption(Sbm.ConfigOption.Commodities)) continue; break; - case Sbm.SystemCode.InterfaceType_Website: + case Sbm.ApplicationCode.InterfaceType_Website: if (code.Type == (int)Sbm.InterfaceType_Website.WebStore && !SessionConsole.AllowInterface(SaInterfaceCategory.Website, (short)code.Type)) continue; if (code.Type == (int)Sbm.InterfaceType_Website.JoomlaVirtueMart && !SessionConsole.AllowInterface(SaInterfaceCategory.Website, (short)code.Type)) continue; if (code.Type == (int)Sbm.InterfaceType_Website.MiMoWeb && !SessionConsole.AllowInterface(SaInterfaceCategory.Website, (short)code.Type)) continue; break; - case Sbm.SystemCode.InterfaceType_System: + case Sbm.ApplicationCode.InterfaceType_System: if (code.Type == (int)Sbm.InterfaceType_System.MSOutlook && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue; if (code.Type == (int)Sbm.InterfaceType_System.PostcodeAnywhere && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue; if (code.Type == (int)Sbm.InterfaceType_System.Bac && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue; @@ -248,35 +261,35 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App if (code.Type == (int)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Argos && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue; if (code.Type == (int)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Homebase && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue; break; - case Sbm.SystemCode.OrgOption_PeriodDays: + case Sbm.ApplicationCode.OrgOption_PeriodDays: if (code.Type == (int)Sbm.OrgOption_PeriodDays.UpdateClosedTransaction_DispatchDetails && !SessionConsole.AllowOption(Sbm.ConfigOption.DeliveryPlanning)) continue; if (code.Type == (int)Sbm.OrgOption_PeriodDays.UpdateStockLevelsInPast && !SessionConsole.AllowInterface(SaInterfaceCategory.System, (short)code.Type)) continue; break; - case Sbm.SystemCode.OrgOption_PeriodWeeks: + case Sbm.ApplicationCode.OrgOption_PeriodWeeks: if (code.Type == (int)Sbm.OrgOption_PeriodWeeks.Timesheets && !SessionConsole.AllowOption(Sbm.ConfigOption.TimeRecording)) continue; if (code.Type == (int)Sbm.OrgOption_PeriodWeeks.UpdateTimeRecords_Control && !SessionConsole.AllowOption(Sbm.ConfigOption.TimeRecording)) continue; if (code.Type == (int)Sbm.OrgOption_PeriodWeeks.ImminentStockDue && !SessionConsole.GetOwnerOption_AllowOption(Sbm.OrgOption_AllowOption.ImminentStock)) continue; break; - case Sbm.SystemCode.OrgOption_Caption: + case Sbm.ApplicationCode.OrgOption_Caption: if (!SessionConsole.AllowTransactionType(Sbm.OrgOptionToTransType((Sbm.OrgOption_Caption)code.Type))) continue; break; } codes.Add(code); } - systemCodeCache.Add(systemCode, codes); + mbr.applicationCodeCache.Add(applicationCode, codes); } - return new List(systemCodeCache.GetValueOrDefault(systemCode, new List())); + return new List(mbr.applicationCodeCache.GetValueOrDefault(applicationCode, new List())); } // Selection of specific system code types. - public List ItemTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.ItemType); } } - public List AffiliateTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.AffiliateType); } } - public List AddressTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.AddressType); } } - public List AssociationTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.AssociationType); } } - public List CommodityTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.CommodityType); } } - public List AssetTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.AssetType); } } - public List VehicleTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.VehicleType); } } - public List TransactionTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.TransactionType); } } - public List RequirementTypeCodes { get { return GetSystemCodes(Sbm.SystemCode.RequirementType); } } + public List ItemTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.ItemType); } } + public List AffiliateTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.AffiliateType); } } + public List AddressTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.AddressType); } } + public List AssociationTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.AssociationType); } } + public List CommodityTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.CommodityType); } } + public List AssetTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.AssetType); } } + public List VehicleTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.VehicleType); } } + public List TransactionTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.TransactionType); } } + public List RequirementTypeCodes { get { return GetApplicationCodes(Sbm.ApplicationCode.RequirementType); } } //------------------------------------------------------------------- // Code types. diff --git a/SaBusMgrStandardBase/Base/App/SbmOrganisationConfig.cs b/SaBusMgrStandardBase/Base/App/SbmOrganisationConfig.cs index 2a92b78..25b44cc 100644 --- a/SaBusMgrStandardBase/Base/App/SbmOrganisationConfig.cs +++ b/SaBusMgrStandardBase/Base/App/SbmOrganisationConfig.cs @@ -48,7 +48,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Organisation configuration. public String GetOrganisationOption(Sbm.OrganisationOption option, String context) { - if (assocOptions == null) assocOptions = SbmSystem.GetSystemCodes(Sbm.SystemCode.AssociationOption); + if (assocOptions == null) assocOptions = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.AssociationOption); String optionName = assocOptions.GetCodeForType(option); return GetOrganisationOption(optionName, context); } @@ -59,33 +59,33 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App } public String GetOwnerOption_Value(Sbm.OrgOption_Value value) { - if (contextValues == null) contextValues = SbmSystem.GetSystemCodes(Sbm.SystemCode.OrgOption_Value); + if (contextValues == null) contextValues = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OrgOption_Value); String context = contextValues.GetCodeForType(value); return GetOrganisationOption(Sbm.OrganisationOption.Value, context).Trim(); } public String GetOwnerOption_Folder(Sbm.OrgOption_Folder folder) { - if (contextFolders == null) contextFolders = SbmSystem.GetSystemCodes(Sbm.SystemCode.OrgOption_Folder); + if (contextFolders == null) contextFolders = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OrgOption_Folder); String context = contextFolders.GetCodeForType(folder); return GetOrganisationOption(Sbm.OrganisationOption.Folder, context).Trim(); } public bool GetOwnerOption_AllowOption(Sbm.OrgOption_AllowOption option) { - if (contextAllowOptions == null) contextAllowOptions = SbmSystem.GetSystemCodes(Sbm.SystemCode.OrgOption_AllowOption); + if (contextAllowOptions == null) contextAllowOptions = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OrgOption_AllowOption); String context = contextAllowOptions.GetCodeForType(option); String value = GetOrganisationOption(Sbm.OrganisationOption.AllowOption, context).Trim(); return StringUtil.ToBool(value); } public String GetOwnerOption_Caption(Sbm.OrgOption_Caption caption, String defaultValue) { - if (contextCaptions == null) contextCaptions = SbmSystem.GetSystemCodes(Sbm.SystemCode.OrgOption_Caption); + if (contextCaptions == null) contextCaptions = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OrgOption_Caption); String context = contextCaptions.GetCodeForType(caption); String value = GetOrganisationOption(Sbm.OrganisationOption.Caption, context).Trim(); return (!value.IsEmpty() ? value : defaultValue); } public bool GetOwnerOption_ShowField(SbmDbDfn.ColumnIdx column) { - if (contextShowFields == null) contextShowFields = SbmSystem.GetSystemCodes(Sbm.SystemCode.OrgOption_ShowField); + if (contextShowFields == null) contextShowFields = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OrgOption_ShowField); String context = contextShowFields.GetCodeForType(column); if (context.IsEmpty()) return true; // Automatically show fields that are not in the 'Show Field' list. String value = GetOrganisationOption(Sbm.OrganisationOption.ShowField, context).Trim(); @@ -93,21 +93,21 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App } public bool GetOwnerOption_ShowColumn(Sbm.OrgOption_ShowColumn column) { - if (contextShowColumns == null) contextShowColumns = SbmSystem.GetSystemCodes(Sbm.SystemCode.OrgOption_ShowColumn); + if (contextShowColumns == null) contextShowColumns = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OrgOption_ShowColumn); String context = contextShowColumns.GetCodeForType(column); String value = GetOrganisationOption(Sbm.OrganisationOption.ShowColumn, context).Trim(); return StringUtil.ToBool(value); } public String GetOwnerOption_FieldLabel(SbmDbDfn.ColumnIdx column, String defautValue) { - if (contextFieldLabels == null) contextFieldLabels = SbmSystem.GetSystemCodes(Sbm.SystemCode.OrgOption_FieldLabel); + if (contextFieldLabels == null) contextFieldLabels = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OrgOption_FieldLabel); String context = contextFieldLabels.GetCodeForType(column); String value = GetOrganisationOption(Sbm.OrganisationOption.FieldLabel, context).Trim(); return (!value.IsEmpty() ? value : defautValue); // Return default if no label defined. } public int GetOwnerOption_Minutes(Sbm.OrgOption_Minutes limit, int defautValue) { - if (contextMinutes == null) contextMinutes = SbmSystem.GetSystemCodes(Sbm.SystemCode.OrgOption_Minutes); + if (contextMinutes == null) contextMinutes = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OrgOption_Minutes); String context = contextMinutes.GetCodeForType(limit); String value = GetOrganisationOption(Sbm.OrganisationOption.Minutes, context).Trim(); if (!value.IsEmpty()) @@ -120,7 +120,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App } public int GetOwnerOption_UpdateLimit(Sbm.OrgOption_PeriodDays limit, int defautValue) { - if (contextPeriodDays == null) contextPeriodDays = SbmSystem.GetSystemCodes(Sbm.SystemCode.OrgOption_PeriodDays); + if (contextPeriodDays == null) contextPeriodDays = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OrgOption_PeriodDays); String context = contextPeriodDays.GetCodeForType(limit); String value = GetOrganisationOption(Sbm.OrganisationOption.PeriodDays, context).Trim(); if (!value.IsEmpty()) @@ -133,7 +133,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App } public int GetOwnerOption_UpdateLimit(Sbm.OrgOption_PeriodWeeks limit, int defautValue) { - if (contextPeriodWeeks == null) contextPeriodWeeks = SbmSystem.GetSystemCodes(Sbm.SystemCode.OrgOption_PeriodWeeks); + if (contextPeriodWeeks == null) contextPeriodWeeks = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OrgOption_PeriodWeeks); String context = contextPeriodWeeks.GetCodeForType(limit); String value = GetOrganisationOption(Sbm.OrganisationOption.PeriodWeeks, context).Trim(); if (!value.IsEmpty()) @@ -146,7 +146,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App } public int GetOwnerOption_NumericDecimals(Sbm.OrgOption_NumericDecimals decimals, int defautValue = 2) { - if (contextNumericDecimals == null) contextNumericDecimals = SbmSystem.GetSystemCodes(Sbm.SystemCode.OrgOption_NumericDecimals); + if (contextNumericDecimals == null) contextNumericDecimals = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OrgOption_NumericDecimals); String context = contextNumericDecimals.GetCodeForType(decimals); String value = GetOrganisationOption(Sbm.OrganisationOption.NumericDecimals, context).Trim(); int iNumDecimals = defautValue; @@ -157,8 +157,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App } public Sbm.CommodityType GetOwnerOption_CommodityType(Sbm.OrgOption_CommodityType commodityType) { - if (contextCommodityTypes == null) contextCommodityTypes = SbmSystem.GetSystemCodes(Sbm.SystemCode.OrgOption_CommodityType); - if (commodityTypes == null) commodityTypes = SbmSystem.GetSystemCodes(Sbm.SystemCode.CommodityType); + if (contextCommodityTypes == null) contextCommodityTypes = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OrgOption_CommodityType); + if (commodityTypes == null) commodityTypes = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.CommodityType); String context = contextCommodityTypes.GetCodeForType(commodityType); String value = GetOrganisationOption(Sbm.OrganisationOption.CommodityType, context).Trim(); Sbm.CommodityType eCmdType = (Sbm.CommodityType)commodityTypes.GetTypeForCode(value); @@ -166,7 +166,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App } public SysId GetOwnerOption_StockLocation(Sbm.OrgOption_StockLocation stockLocation) { - if (contextSalesLocations == null) contextSalesLocations = SbmSystem.GetSystemCodes(Sbm.SystemCode.OrgOption_StockLocation); + if (contextSalesLocations == null) contextSalesLocations = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OrgOption_StockLocation); String context = contextSalesLocations.GetCodeForType(stockLocation); String value = GetOrganisationOption(Sbm.OrganisationOption.SalesLocation, context).Trim(); SysId idLoc = new SysId(); diff --git a/SaBusMgrStandardBase/Base/App/SbmSystem-Statics.cs b/SaBusMgrStandardBase/Base/App/SbmSystem-Statics.cs index 9c4b87e..88deb18 100644 --- a/SaBusMgrStandardBase/Base/App/SbmSystem-Statics.cs +++ b/SaBusMgrStandardBase/Base/App/SbmSystem-Statics.cs @@ -17,7 +17,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- // System code types. - private static Dictionary> systemCodes = new Dictionary>(); + private static Dictionary> systemCodes = new Dictionary>(); // Code types. private static List codeTypes = new List(); @@ -97,7 +97,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //--------------------------------------------------------------- // I t e m T y p e //--------------------------------------------------------------- - systemCodes[Sbm.SystemCode.ItemType] = new List() + systemCodes[Sbm.ApplicationCode.ItemType] = new List() { new TypeCodeDesc((int)Sbm.ItemType.SecItem, "SecItm", "Securty Item"), new TypeCodeDesc((int)Sbm.ItemType.Currency, "Currency", "Currency"), @@ -139,7 +139,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Contacts. // Affiliate Type. - systemCodes[Sbm.SystemCode.AffiliateType] = new List() + systemCodes[Sbm.ApplicationCode.AffiliateType] = new List() { new TypeCodeDesc((int)Sbm.AffiliateType.Individual, "IND", "Individual"), new TypeCodeDesc((int)Sbm.AffiliateType.Commercial, "COM", "Commercial"), @@ -151,7 +151,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Address Type. - systemCodes[Sbm.SystemCode.AddressType] = new List() + systemCodes[Sbm.ApplicationCode.AddressType] = new List() { new TypeCodeDesc((int)Sbm.AddressType.Office, "OFF", "Office"), new TypeCodeDesc((int)Sbm.AddressType.Registered, "REG", "Registered"), @@ -161,7 +161,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Association Type. - systemCodes[Sbm.SystemCode.AssociationType] = new List() + systemCodes[Sbm.ApplicationCode.AssociationType] = new List() { new TypeCodeDesc((int)Sbm.AssociationType.Internal, "INT", "Internal"), new TypeCodeDesc((int)Sbm.AssociationType.Customer, "CUS", "Customer"), @@ -174,7 +174,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // System Account Type. - systemCodes[Sbm.SystemCode.SystemAccountType] = new List() + systemCodes[Sbm.ApplicationCode.SystemAccountType] = new List() { new TypeCodeDesc((int)Sbm.SystemAccountType.Customer, "CUST", "Customer") }; @@ -183,7 +183,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Transactions. // Transaction types. - systemCodes[Sbm.SystemCode.TransactionType] = new List() + systemCodes[Sbm.ApplicationCode.TransactionType] = new List() { new TypeCodeDesc((int) Sbm.TransactionType.Project, "PRO", "Project"), new TypeCodeDesc((int)Sbm.TransactionType.SalesLead, "SLD", "Sales Lead"), @@ -204,7 +204,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Transaction StatusCat. - systemCodes[Sbm.SystemCode.TransactionStatusCat] = new List() + systemCodes[Sbm.ApplicationCode.TransactionStatusCat] = new List() { new TypeCodeDesc((int)SbmTransaction.StatusCat.Pending, "PEN", "Pending"), new TypeCodeDesc((int)SbmTransaction.StatusCat.Open, "OPE", "Open"), @@ -212,28 +212,28 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Requirement Type. - systemCodes[Sbm.SystemCode.RequirementType] = new List() + systemCodes[Sbm.ApplicationCode.RequirementType] = new List() { new TypeCodeDesc((int)Sbm.RequirementType.Detail, "DET", "Detail"), new TypeCodeDesc((int)Sbm.RequirementType.Job, "JOB", "Job"), }; // TaskCodeType. - systemCodes[Sbm.SystemCode.TaskCodeType] = new List() + systemCodes[Sbm.ApplicationCode.TaskCodeType] = new List() { new TypeCodeDesc((int)Sbm.TaskCodeType.Project, "PRO", "Project code"), new TypeCodeDesc((int)Sbm.TaskCodeType.Job, "JOB", "Job number"), }; // Requirement StatusCat. - systemCodes[Sbm.SystemCode.RequirementStatusCat] = new List() + systemCodes[Sbm.ApplicationCode.RequirementStatusCat] = new List() { new TypeCodeDesc((int)SbmRequirement.StatusCat.Open, "OPE", "Open"), new TypeCodeDesc((int)SbmRequirement.StatusCat.Closed, "CLO", "Closed"), }; // ConstituentType. - systemCodes[Sbm.SystemCode.ConstituentType] = new List() + systemCodes[Sbm.ApplicationCode.ConstituentType] = new List() { new TypeCodeDesc((int)Sbm.ConstituentType.TimeRecord, "TIM", "Time record"), new TypeCodeDesc((int)Sbm.ConstituentType.Event, "EVT", "Event"), @@ -244,7 +244,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Constituent StatusCat. - systemCodes[Sbm.SystemCode.ConstituentStatusCat] = new List() + systemCodes[Sbm.ApplicationCode.ConstituentStatusCat] = new List() { new TypeCodeDesc((int)SbmConstituent.StatusCat.Open, "OPE", "Open"), new TypeCodeDesc((int)SbmConstituent.StatusCat.Closed, "CLO", "Closed"), @@ -254,13 +254,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Miscellaneous. // ItemLinkData. - systemCodes[Sbm.SystemCode.ItemLinkData] = new List() + systemCodes[Sbm.ApplicationCode.ItemLinkData] = new List() { new TypeCodeDesc((int)Sbm.ItemLinkData.Requirement_AssocItem_PurchaseCostProportion, "PurchaseCostProportion", "Purchase cost proportion") }; // Sys Param Category. - systemCodes[Sbm.SystemCode.SysParamCategory] = new List() + systemCodes[Sbm.ApplicationCode.SysParamCategory] = new List() { new TypeCodeDesc((int)Sbm.StockLevelSource.Manual, "MAN", "Manual"), new TypeCodeDesc((int)Sbm.SysParamCategory.Security, "SEC", "Security parameter"), @@ -271,7 +271,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Commodities. // Commodity Type. - systemCodes[Sbm.SystemCode.CommodityType] = new List() + systemCodes[Sbm.ApplicationCode.CommodityType] = new List() { new TypeCodeDesc((int)Sbm.CommodityType.Stock, "STK", "Stock"), new TypeCodeDesc((int)Sbm.CommodityType.NonStock, "NST", "Non-stock"), @@ -280,14 +280,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Commodity Status Cat. - Any' value is included in list to support organisation item options and commodity panel filter. - systemCodes[Sbm.SystemCode.CommodityStatusCat] = new List() + systemCodes[Sbm.ApplicationCode.CommodityStatusCat] = new List() { new TypeCodeDesc((int)SbmCommodity.StatusCat.Any, "ANY", ""), new TypeCodeDesc((int)SbmCommodity.StatusCat.Current, "CUR", "Current") }; // Portfolio Item Type. - systemCodes[Sbm.SystemCode.PortfolioItemType] = new List() + systemCodes[Sbm.ApplicationCode.PortfolioItemType] = new List() { new TypeCodeDesc((int)Sbm.PortfolioItemType.Portfolio, "PORT", "Portfolio"), new TypeCodeDesc((int)Sbm.PortfolioItemType.Category, "CAT", "Category"), @@ -295,13 +295,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Container Category. - systemCodes[Sbm.SystemCode.ContainerCategory] = new List() + systemCodes[Sbm.ApplicationCode.ContainerCategory] = new List() { new TypeCodeDesc((int)Sbm.ContainerCategory.Stock, "STOCK", "Stock") }; // Container Type. - systemCodes[Sbm.SystemCode.ContainerType] = new List() + systemCodes[Sbm.ApplicationCode.ContainerType] = new List() { new TypeCodeDesc((int)Sbm.ContainerType.Vehicle, "VEHICLE", "Vehicle"), new TypeCodeDesc((int)Sbm.ContainerType.Truck, "TRUCK", "Truck"), @@ -316,13 +316,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Stock. // Location Category. - systemCodes[Sbm.SystemCode.LocationCategory] = new List() + systemCodes[Sbm.ApplicationCode.LocationCategory] = new List() { new TypeCodeDesc((int)Sbm.LocationCategory.Stock, "STOCK", "Stock") }; // Location Filter. - systemCodes[Sbm.SystemCode.LocationFilter] = new List() + systemCodes[Sbm.ApplicationCode.LocationFilter] = new List() { new TypeCodeDesc((int)Sbm.LocationFilter.Sales, "SALESLOC", "Sales locations"), new TypeCodeDesc((int)Sbm.LocationFilter.Calc, "CALCLOC", "Calculated locations"), @@ -330,7 +330,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Movement Type. - systemCodes[Sbm.SystemCode.MovementType] = new List() + systemCodes[Sbm.ApplicationCode.MovementType] = new List() { new TypeCodeDesc((int)Sbm.MovementType.StockTransfer, "STKTRA", "Stock transfer"), new TypeCodeDesc((int)Sbm.MovementType.SalesAllocation, "SALALL", "Sales allocation"), @@ -338,7 +338,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Stock Level Type. - systemCodes[Sbm.SystemCode.StockLevelType] = new List() + systemCodes[Sbm.ApplicationCode.StockLevelType] = new List() { new TypeCodeDesc((int)Sbm.StockLevelType.CurrentLevel, "CUR", "Current level"), new TypeCodeDesc((int)Sbm.StockLevelType.StockTake, "STK", "Stock take"), @@ -346,7 +346,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Stock Level Source. - systemCodes[Sbm.SystemCode.StockLevelSource] = new List() + systemCodes[Sbm.ApplicationCode.StockLevelSource] = new List() { new TypeCodeDesc((int)Sbm.StockLevelSource.Manual, "MAN", "Manual"), new TypeCodeDesc((int)Sbm.StockLevelSource.System, "SYS", "System"), @@ -357,14 +357,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Processes. // Process Category. - systemCodes[Sbm.SystemCode.ProcessCategory] = new List() + systemCodes[Sbm.ApplicationCode.ProcessCategory] = new List() { new TypeCodeDesc((int)Sbm.ProcessCategory.Commodity, "CMD", "Commodity"), new TypeCodeDesc((int)Sbm.ProcessCategory.Asset, "ASSET", "Asset") }; // Process Type. - systemCodes[Sbm.SystemCode.ProcessType] = new List() + systemCodes[Sbm.ApplicationCode.ProcessType] = new List() { new TypeCodeDesc((int)Sbm.ProcessType.Preparation, "PREP", "Preparation"), new TypeCodeDesc((int)Sbm.ProcessType.Production, "PROD", "Production"), @@ -373,7 +373,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Payment Type. - systemCodes[Sbm.SystemCode.PaymentType] = new List() + systemCodes[Sbm.ApplicationCode.PaymentType] = new List() { new TypeCodeDesc((int)Sbm.PaymentType.Finance, "FINANCE", "Finance"), new TypeCodeDesc((int)Sbm.PaymentType.Cash, "CASH", "Cash"), @@ -386,7 +386,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Assets. // Asset Type. - systemCodes[Sbm.SystemCode.AssetType] = new List() + systemCodes[Sbm.ApplicationCode.AssetType] = new List() { new TypeCodeDesc((int)Sbm.AssetType.General, "GEN", "General"), new TypeCodeDesc((int)Sbm.AssetType.Furniture, "FUR", "Furniture"), @@ -395,7 +395,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Asset Income Type. - systemCodes[Sbm.SystemCode.AssetIncomeType] = new List() + systemCodes[Sbm.ApplicationCode.AssetIncomeType] = new List() { new TypeCodeDesc((int)Sbm.AssetIncomeType.Sale, "SALE", "Sale"), new TypeCodeDesc((int)Sbm.AssetIncomeType.Rental, "RENTAL", "Rental") @@ -405,7 +405,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Vehicles. // Vehicle Type. - systemCodes[Sbm.SystemCode.VehicleType] = new List() + systemCodes[Sbm.ApplicationCode.VehicleType] = new List() { new TypeCodeDesc((int)Sbm.VehicleType.Car, "CAR", "Car"), new TypeCodeDesc((int)Sbm.VehicleType.Minibus, "MINIBUS", "Minibus"), @@ -415,7 +415,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Vehicle Event Type. - systemCodes[Sbm.SystemCode.VehicleEventType] = new List() + systemCodes[Sbm.ApplicationCode.VehicleEventType] = new List() { new TypeCodeDesc((int)Sbm.VehicleEventType.Odometer, "ODO", "Odometer"), new TypeCodeDesc((int)Sbm.VehicleEventType.Service, "SRV", "Service"), @@ -425,7 +425,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Vehicle Feature Source. - systemCodes[Sbm.SystemCode.VehicleFeatureSource] = new List() + systemCodes[Sbm.ApplicationCode.VehicleFeatureSource] = new List() { new TypeCodeDesc((int)Sbm.VehicleFeatureSource.Manual, "MAN", "Manual"), new TypeCodeDesc((int)Sbm.VehicleFeatureSource.HPI, "HPI", "HPI"), @@ -435,7 +435,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Vehicle Feature Type. - systemCodes[Sbm.SystemCode.VehicleFeatureType] = new List() + systemCodes[Sbm.ApplicationCode.VehicleFeatureType] = new List() { new TypeCodeDesc((int)Sbm.VehicleFeatureType.Make, "MAKE", "Make"), new TypeCodeDesc((int)Sbm.VehicleFeatureType.Model, "MODEL", "Model"), @@ -458,7 +458,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Vehicle Option Type. - systemCodes[Sbm.SystemCode.VehicleOptionType] = new List() + systemCodes[Sbm.ApplicationCode.VehicleOptionType] = new List() { new TypeCodeDesc((int)Sbm.VehicleOptionType.Trim, "TRIM", "Trim"), new TypeCodeDesc((int)Sbm.VehicleOptionType.Ventilation, "VENTILATION", "Ventilation"), @@ -468,14 +468,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Vehicle Trans Type. - systemCodes[Sbm.SystemCode.VehicleTransType] = new List() + systemCodes[Sbm.ApplicationCode.VehicleTransType] = new List() { new TypeCodeDesc((int)Sbm.VehicleTransType.Manual, "MANUAL", "Manual"), new TypeCodeDesc((int)Sbm.VehicleTransType.Automatic, "AUTO", "Automatic") }; // Fuel Type. - systemCodes[Sbm.SystemCode.FuelType] = new List() + systemCodes[Sbm.ApplicationCode.FuelType] = new List() { new TypeCodeDesc((int)Sbm.VehicleFuelType.Petrol, "PETROL", "Petrol"), new TypeCodeDesc((int)Sbm.VehicleFuelType.Diesel, "DIESEL", "Diesel"), @@ -485,14 +485,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Odometer Units. - systemCodes[Sbm.SystemCode.OdometerUnits] = new List() + systemCodes[Sbm.ApplicationCode.OdometerUnits] = new List() { new TypeCodeDesc((int)Sbm.VehicleOdometerUnits.Mile, "MILE", "Miles"), new TypeCodeDesc((int)Sbm.VehicleOdometerUnits.Kilometre, "KM", "Kilometres") }; // Discount Type. - systemCodes[Sbm.SystemCode.DiscountType] = new List() + systemCodes[Sbm.ApplicationCode.DiscountType] = new List() { new TypeCodeDesc((int)Sbm.DiscountType.NoDiscount, "NoDisc", "No Discount"), new TypeCodeDesc((int)Sbm.DiscountType.ValueDiscount, "ValDisc", "Value discount"), @@ -504,7 +504,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Discount Markup. - systemCodes[Sbm.SystemCode.DiscountMarkup] = new List() + systemCodes[Sbm.ApplicationCode.DiscountMarkup] = new List() { new TypeCodeDesc((int)Sbm.DiscountMarkup.Discount, "DISC", "Discount"), new TypeCodeDesc((int)Sbm.DiscountMarkup.Markup, "MARK", "Markup") @@ -514,16 +514,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Reference. // Region Type. - systemCodes[Sbm.SystemCode.RegionType] = new List(SaReferenceDataConsole.GetReferenceDataCodes(ReferenceDataSystemCode.RegionType)); + systemCodes[Sbm.ApplicationCode.RegionType] = new List(SaReferenceDataConsole.GetReferenceDataCodes(ReferenceDataSystemCode.RegionType)); // Unit Measure Category. - systemCodes[Sbm.SystemCode.UnitMeasureCategory] = new List(SaReferenceDataConsole.GetReferenceDataCodes(ReferenceDataSystemCode.UnitMeasureCategory)); + systemCodes[Sbm.ApplicationCode.UnitMeasureCategory] = new List(SaReferenceDataConsole.GetReferenceDataCodes(ReferenceDataSystemCode.UnitMeasureCategory)); // Unit Measure Type. - systemCodes[Sbm.SystemCode.UnitMeasureType] = new List(SaReferenceDataConsole.GetReferenceDataCodes(ReferenceDataSystemCode.UnitMeasureType)); + systemCodes[Sbm.ApplicationCode.UnitMeasureType] = new List(SaReferenceDataConsole.GetReferenceDataCodes(ReferenceDataSystemCode.UnitMeasureType)); // Financial Type. - systemCodes[Sbm.SystemCode.FinancialType] = new List() + systemCodes[Sbm.ApplicationCode.FinancialType] = new List() { new TypeCodeDesc((int)Sbm.FinancialType.CommoditySupply, "CmdSup", "Commodity supply"), new TypeCodeDesc((int)Sbm.FinancialType.CommoditySales, "CmdSal", "Commodity sales") @@ -533,7 +533,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Pricing. // Price Type. - systemCodes[Sbm.SystemCode.PriceType] = new List() + systemCodes[Sbm.ApplicationCode.PriceType] = new List() { new TypeCodeDesc((int)Sbm.PriceType.Customer, "P", "Customer"), new TypeCodeDesc((int)Sbm.PriceType.Supplier, "U", "Supplier"), @@ -541,7 +541,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Price Calc Method. - systemCodes[Sbm.SystemCode.PriceCalcMethod] = new List() + systemCodes[Sbm.ApplicationCode.PriceCalcMethod] = new List() { new TypeCodeDesc((int)Sbm.PriceCalcMethod.Fixed, "Fixed", "Fixed"), new TypeCodeDesc((int)Sbm.PriceCalcMethod.Standard, "Standard", "Standard"), @@ -564,7 +564,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Application configuration. // Association Tab. - systemCodes[Sbm.SystemCode.AssociationTab] = new List() + systemCodes[Sbm.ApplicationCode.AssociationTab] = new List() { new TypeCodeDesc((int)Sbm.AssociationTab.Details, "Details", "Details"), new TypeCodeDesc((int)Sbm.AssociationTab.Order, "Order", "Order"), @@ -579,7 +579,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Interfaces. // Interface types - Website. - systemCodes[Sbm.SystemCode.InterfaceType_Website] = new List() + systemCodes[Sbm.ApplicationCode.InterfaceType_Website] = new List() { new TypeCodeDesc((int)Sbm.InterfaceType_Website.WebStore, "WebStore", "WebStore"), new TypeCodeDesc((int)Sbm.InterfaceType_Website.JoomlaVirtueMart, "JoomlaVM", "Joomla VirtueMart"), @@ -587,14 +587,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Interface types - Accounts. - systemCodes[Sbm.SystemCode.InterfaceType_Accounts] = new List() + systemCodes[Sbm.ApplicationCode.InterfaceType_Accounts] = new List() { new TypeCodeDesc((int)Sbm.InterfaceType_Accounts.SageLine50, "SageLine50", "Sage Line 50"), new TypeCodeDesc((int)Sbm.InterfaceType_Accounts.QuickBooks, "QBooks", "QuickBooks") }; // Interface types - System. - systemCodes[Sbm.SystemCode.InterfaceType_System] = new List() + systemCodes[Sbm.ApplicationCode.InterfaceType_System] = new List() { new TypeCodeDesc((int)Sbm.InterfaceType_System.MSOutlook, "MSOutlook", "MS Outlook"), new TypeCodeDesc((int)Sbm.InterfaceType_System.PostcodeAnywhere, "POSTCODEANYWHERE", "Postcode Anywhere"), @@ -609,7 +609,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Interface types - File. - systemCodes[Sbm.SystemCode.InterfaceType_File] = new List() + systemCodes[Sbm.ApplicationCode.InterfaceType_File] = new List() { new TypeCodeDesc((int)Sbm.InterfaceType_File.TransactionImport, "SalesOrderImport", "Transaction import"), new TypeCodeDesc((int)Sbm.InterfaceType_File.TransactionExport, "SalesOrderExport", "Transaction export"), @@ -627,7 +627,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // InterfaceDataType. - systemCodes[Sbm.SystemCode.InterfaceDataType] = new List() + systemCodes[Sbm.ApplicationCode.InterfaceDataType] = new List() { new TypeCodeDesc((int)Sbm.InterfaceDataType.Contact, "CONTACT", "Contact"), new TypeCodeDesc((int)Sbm.InterfaceDataType.Association, "ASSOCIATION", "Association"), @@ -665,7 +665,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Associated data. // Item Data Type. - systemCodes[Sbm.SystemCode.ItemDataType] = new List() + systemCodes[Sbm.ApplicationCode.ItemDataType] = new List() { new TypeCodeDesc((int)Sbm.ItemDataType.Vehicle_HpiResponse, "HPI", "HPI response"), new TypeCodeDesc((int)Sbm.ItemDataType.Transaction_VehicleFilter, "VehicleFilter", "Vehicle filter"), @@ -682,7 +682,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Organisation configuration. // Organisation Option - Value. - systemCodes[Sbm.SystemCode.OrgOption_Value] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_Value] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_Value.MaxTransactionsQueriedForEmptyFilter, "MaxTransEmptyFilter", "Maximum transactions queried for empty filter"), new TypeCodeDesc((int)Sbm.OrgOption_Value.AlternativePromotionText, "AltPromotionText", "To be used when no promotion specified"), @@ -697,14 +697,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Organisation Option - Folder. - systemCodes[Sbm.SystemCode.OrgOption_Folder] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_Folder] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_Folder.CommodityImage, "CmdImage", "Commodity image"), new TypeCodeDesc((int)Sbm.OrgOption_Folder.CommodityBarcodeImage, "CmdBarcodeImage", "Commodity barcode image") }; // Organisation Option - Allow Option. - systemCodes[Sbm.SystemCode.OrgOption_AllowOption] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_AllowOption] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_AllowOption.UpdateAssociationCode, "UpdAssocCode", "Update association code"), new TypeCodeDesc((int)Sbm.OrgOption_AllowOption.CustomerAccountDetails, "CustAccntDet", "Customer account details"), @@ -738,7 +738,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Organisation Option - Caption - systemCodes[Sbm.SystemCode.OrgOption_Caption] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_Caption] = new List() { // Transaction type captions. new TypeCodeDesc((int)Sbm.OrgOption_Caption.TransType_Project, "Project", "Transaction type - Project"), @@ -777,7 +777,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Organisation Option - Show Column. - systemCodes[Sbm.SystemCode.OrgOption_ShowColumn] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_ShowColumn] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_ShowColumn.Association_AnnualSalesTarget, "Association:AnnualSalesTarget", "Association: Annual sales target"), new TypeCodeDesc((int)Sbm.OrgOption_ShowColumn.Association_Trans_LastSaleRaised, "Association:Trans:LastSaleRaised", "Association: Last SO raised"), @@ -807,7 +807,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Organisation Option - Show Field. - systemCodes[Sbm.SystemCode.OrgOption_ShowField] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_ShowField] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_ShowField.Association_AnnualSalesTarget, SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Association_AnnualSalesTarget, null, false), "Association: Annual sales target"), new TypeCodeDesc((int)Sbm.OrgOption_ShowField.Address_LastVisitOn, SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Address_LastVisitOn, null, false), "Address: Last visit date"), @@ -830,7 +830,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Organisation Option - Field Label. - systemCodes[Sbm.SystemCode.OrgOption_FieldLabel] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_FieldLabel] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_FieldLabel.Commodity_CatalogRef, SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Commodity_CatalogRef, null, false), "Commodity: Catalog reference"), new TypeCodeDesc((int)Sbm.OrgOption_FieldLabel.Commodity_Dimensions, SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Commodity_Dimensions, null, false), "Commodity: Dimensions"), @@ -865,14 +865,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Organisation Option - Transaction Creation Status. - systemCodes[Sbm.SystemCode.OrgOption_TransactionCreationStatus] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_TransactionCreationStatus] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_TransCreateStatus.ProformaSalesOrder, "ProFromaSalOrd", "Proforma SO creation status", "Default: 'Preparation'"), new TypeCodeDesc((int)Sbm.OrgOption_TransCreateStatus.SalesOrder, "SalesOrder", "SO creation status", "Default. 'In progress'") }; // Organisation Option - Container Status Caption. - systemCodes[Sbm.SystemCode.OrgOption_ContainerStatusCaption] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_ContainerStatusCaption] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_StatusContainer.Provisional, SacsSystem.GetStatusCode(SaStatus.Provisional), "Provisional"), new TypeCodeDesc((int)Sbm.OrgOption_StatusContainer.Awaiting, SacsSystem.GetStatusCode(SaStatus.Awaiting), "Awaiting"), @@ -882,13 +882,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Organisation Option - Minutes. - systemCodes[Sbm.SystemCode.OrgOption_Minutes] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_Minutes] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_Minutes.AutoSaveTransaction, "MinsAutoSaveTrans", "Auto save transactions (minutes)", "") }; // Organisation Option - Period Days. - systemCodes[Sbm.SystemCode.OrgOption_PeriodDays] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_PeriodDays] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_PeriodDays.TransactionDatesInFuture, "TransDatesInFut", "Days in future that transaction dates can be set", ""), new TypeCodeDesc((int)Sbm.OrgOption_PeriodDays.UpdateClosedTransaction, "UpdClosedTrans", "Grace period (days) for updating closed transactions", "Period after transaction closure during which updates are allowed (0-30 days)"), @@ -897,7 +897,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Organisation Option - Period Weeks. - systemCodes[Sbm.SystemCode.OrgOption_PeriodWeeks] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_PeriodWeeks] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_PeriodWeeks.Timesheets, "Timesheets", "Weeks of timesheets to list (default 8)"), new TypeCodeDesc((int)Sbm.OrgOption_PeriodWeeks.UpdateTimeRecords_Control, "UpdTimeRecsCtrl", "Weeks in past for admin user to update time records (default 2)"), @@ -905,7 +905,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Organisation Option - Numeric Decimals. - systemCodes[Sbm.SystemCode.OrgOption_NumericDecimals] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_NumericDecimals] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_NumericDecimals.OrderQuantity, "OrdQty", "Order quantity"), new TypeCodeDesc((int)Sbm.OrgOption_NumericDecimals.CommodityWeight, "CmdWeight", "Commodity weight"), @@ -915,13 +915,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // Organisation Option - Commodity Type. - systemCodes[Sbm.SystemCode.OrgOption_CommodityType] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_CommodityType] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_CommodityType.CommodityCreationDefault, "CmdCreateDflt", "Commodity creation default") }; // Organisation Option - Stock Location. - systemCodes[Sbm.SystemCode.OrgOption_StockLocation] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_StockLocation] = new List() { new TypeCodeDesc((int)Sbm.OrgOption_StockLocation.SalesOrderDefault, "SalOrdDflt", "Sales order default"), new TypeCodeDesc((int)Sbm.OrgOption_StockLocation.PurchaseOrderDefault, "PurOrdDflt", "Purchase order default"), @@ -932,7 +932,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Association organisation options. // AssociationOrgOption. - systemCodes[Sbm.SystemCode.AssociationOption] = new List() + systemCodes[Sbm.ApplicationCode.AssociationOption] = new List() { new TypeCodeDesc((int)Sbm.OrganisationOption.Value, "Value", "Value"), new TypeCodeDesc((int)Sbm.OrganisationOption.Folder, "Folder", "Folder"), @@ -956,7 +956,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // System User options. // SystemUserOption. - systemCodes[Sbm.SystemCode.SystemUserOption] = new List() + systemCodes[Sbm.ApplicationCode.SystemUserOption] = new List() { new TypeCodeDesc((int)Sbm.SystemUserOption.Right, "SecRight", "Security Right") }; @@ -965,7 +965,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Interface options. // InterfaceOption. - systemCodes[Sbm.SystemCode.InterfaceOption] = new List() + systemCodes[Sbm.ApplicationCode.InterfaceOption] = new List() { new TypeCodeDesc((int)Sbm.InterfaceOption.Value, "Value", "Value"), new TypeCodeDesc((int)Sbm.InterfaceOption.Flag, "Flag", "Flag"), @@ -1006,7 +1006,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Generic item options. // OrgOption_TaxCodeColumn. // eg. for Sage and other system interfaces. - systemCodes[Sbm.SystemCode.OrgOption_TaxCodeColumn] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_TaxCodeColumn] = new List() { new TypeCodeDesc((int)SaTaxCodeColumn.Code, SbmDbDfn.GetColumnName(SbmDbDfn.ColumnIdx.TaxCode_Code), "Code"), new TypeCodeDesc((int)SaTaxCodeColumn.CodeAlt1, SbmDbDfn.GetColumnName(SbmDbDfn.ColumnIdx.TaxCode_CodeAlt1), "Alternative code 1"), @@ -1017,14 +1017,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Website interface configuration. // InterfaceOption_WebFlag. - systemCodes[Sbm.SystemCode.InterfaceOption_WebFlag] = new List() + systemCodes[Sbm.ApplicationCode.InterfaceOption_WebFlag] = new List() { new TypeCodeDesc((int)Sbm.SystemInterface_Website_Flag.IncludeImminentStock, "IncImminStock", "Include imminent stock in current level"), new TypeCodeDesc((int)Sbm.SystemInterface_Website_Flag.AllowZeroOrderItemAmount, "AllowZeroOrdItmAmt", "Allow zero order item amount") }; // InterfaceOption_WebUploadData. - systemCodes[Sbm.SystemCode.InterfaceOption_WebUploadData] = new List() + systemCodes[Sbm.ApplicationCode.InterfaceOption_WebUploadData] = new List() { new TypeCodeDesc((int)Sbm.WebUploadData.Portfolio, "Portfolio", "Portfolio"), new TypeCodeDesc((int)Sbm.WebUploadData.StockLevels, "StockLevels", "Stock Levels"), @@ -1033,7 +1033,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; //InterfaceOption_WebUploadMethod. - systemCodes[Sbm.SystemCode.InterfaceOption_WebUploadMethod] = new List() + systemCodes[Sbm.ApplicationCode.InterfaceOption_WebUploadMethod] = new List() { new TypeCodeDesc((int)Sbm.WebUploadMethod.None, "None", "None"), new TypeCodeDesc((int)Sbm.WebUploadMethod.Ftp, "FTP", "FTP"), @@ -1041,13 +1041,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // InterfaceOption_WebDownloadData. - systemCodes[Sbm.SystemCode.InterfaceOption_WebDownloadData] = new List() + systemCodes[Sbm.ApplicationCode.InterfaceOption_WebDownloadData] = new List() { new TypeCodeDesc((int)Sbm.WebDownloadData.Orders, "Orders", "Orders") }; //InterfaceOption_WebDownloadMethod. - systemCodes[Sbm.SystemCode.InterfaceOption_WebDownloadMethod] = new List() + systemCodes[Sbm.ApplicationCode.InterfaceOption_WebDownloadMethod] = new List() { new TypeCodeDesc((int)Sbm.WebDownloadMethod.None, "None", "None"), new TypeCodeDesc((int)Sbm.WebDownloadMethod.Ftp, "FTP", "FTP"), @@ -1058,7 +1058,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Generic File Interface options. // File Interface - Row Column values. - systemCodes[Sbm.SystemCode.FileInterface_RowColValue] = new List() + systemCodes[Sbm.ApplicationCode.FileInterface_RowColValue] = new List() { new TypeCodeDesc((int)Sbm.FileInterface_RowColValue.Row, "Row", "Row"), new TypeCodeDesc((int)Sbm.FileInterface_RowColValue.Col, "Col", "Column"), @@ -1066,7 +1066,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App }; // File Interface - Mode. - systemCodes[Sbm.SystemCode.FileInterface_Mode] = new List() + systemCodes[Sbm.ApplicationCode.FileInterface_Mode] = new List() { new TypeCodeDesc((int)Sbm.FileInterface_Mode.Csv, "CSV", "Comma separated file (csv)", ""), new TypeCodeDesc((int)Sbm.FileInterface_Mode.MsExcel, "MSExcel", "MS Excel workbook", "") @@ -1074,7 +1074,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //--------------------------------------------------------------- // System User configuration. - systemCodes[Sbm.SystemCode.OrgOption_SystemUserRight] = new List() + systemCodes[Sbm.ApplicationCode.OrgOption_SystemUserRight] = new List() { new TypeCodeDesc((int)Sbm.SystemUserRight.AllAccounts, "AllAccounts", "All accounts"), new TypeCodeDesc((int)Sbm.SystemUserRight.Admin, "Admin", "Admin"), diff --git a/SaBusMgrStandardBase/Base/App/SbmSystem.cs b/SaBusMgrStandardBase/Base/App/SbmSystem.cs index 3a4ac2a..3b5f2e8 100644 --- a/SaBusMgrStandardBase/Base/App/SbmSystem.cs +++ b/SaBusMgrStandardBase/Base/App/SbmSystem.cs @@ -1,5 +1,4 @@ using Sarand.BusinessMgr.Net.Standard.Base.Consoles; -using Sarand.BusinessMgr.Net.Standard.Base.Core; using Sarand.BusinessMgr.Net.Standard.Base.Mgr; using Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control; using Sarand.Net.Standard.Base.App; @@ -16,7 +15,6 @@ using Sarand.Net.Standard.Base.UpdateLog; using Sarand.Net.Standard.Base.Utils; using System; using System.Collections.Generic; -using System.Linq; namespace Sarand.BusinessMgr.Net.Standard.Base.App { @@ -25,10 +23,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App { //------------------------------------------------------------------- // Data members. + private static short assetCommodityTypeAllowed = -1; //------------------------------------------------------------------- // Extended logging options. + public enum ExtendedLogginOption { SecurityProfile, @@ -44,6 +44,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- // Construction - use derived objects. + protected SbmSystem(PropertySet properties) { // Configure extended logging. @@ -52,6 +53,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- // Application definitions. + public static Sbm.SessionConfig GetSessionConfigType(String consoleProperty) { if (consoleProperty.ContainsCI("Sarand")) @@ -85,19 +87,19 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App } //------------------------------------------------------------------- - // S y s t e m C o d e s - //------------------------------------------------------------------- - public static List GetSystemCodes(Sbm.SystemCode systemCode) + // Application codes. + + public static List GetSystemCodes(Sbm.ApplicationCode applicationCode) { - List codes = systemCodes.GetValueOrDefault(systemCode); + List codes = systemCodes.GetValueOrDefault(applicationCode); if (codes == null) - SaLogger.Warn($"{SysUtil.Fn} Unrecognised system code type: {systemCode}."); + SaLogger.Warn($"{SysUtil.Fn} Unrecognised system code type: {applicationCode}."); return codes; } //------------------------------------------------------------------- - // D a t a M a n a g e r s - //------------------------------------------------------------------- + // Data Managers. + public abstract SbmAccountMgr CreateAccountMgr(SbmInternals internals); public abstract SbmAssetMgr CreateAssetMgr(SbmInternals internals); public abstract SbmCommodityMgr CreateCommodityMgr(SbmInternals internals); @@ -113,6 +115,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- // Consoles. + public abstract SbmSessionConsole CreateSessionConsole(SbmInternals internals); public abstract SaDiaryConsole CreateDiaryConsole(SbmInternals internals); public abstract SaSecurityConsole CreateSecurityConsole(SbmInternals internals); @@ -126,8 +129,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App public abstract SbmEmailConsole CreateEmailConsole(SbmEmailConfig emailConfig); //------------------------------------------------------------------- - // A p p l i c a t i o n P r o p e r t i e s - //------------------------------------------------------------------- + // Application Properties. + public bool IsExtendedLogging(ExtendedLogginOption extendedLoggingOption) { if (extendedLoggingOptions == null) return false; diff --git a/SaBusMgrStandardBase/Base/Bus/SbmAssociation.cs b/SaBusMgrStandardBase/Base/Bus/SbmAssociation.cs index 52f48e7..0752d08 100644 --- a/SaBusMgrStandardBase/Base/Bus/SbmAssociation.cs +++ b/SaBusMgrStandardBase/Base/Bus/SbmAssociation.cs @@ -1,5 +1,4 @@ using Sarand.BusinessMgr.Net.Standard.Base.App; -using Sarand.BusinessMgr.Net.Standard.Base.Core; using Sarand.Net.Standard.Base.Bus; using Sarand.Net.Standard.Base.Core; using Sarand.Net.Standard.Base.Utils; @@ -550,10 +549,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus } // Association type. + public static bool TypeIsValid(Sbm.AssociationType associationType) + { + return (associationType > 0); + } public bool TypeIsValid() { - if (AssociationType > 0) return true; - return false; + return TypeIsValid(AssociationType); } public bool IsOfType(Sbm.AssociationType associationType) { diff --git a/SaBusMgrStandardBase/Base/Bus/SbmCommodity.cs b/SaBusMgrStandardBase/Base/Bus/SbmCommodity.cs index 2add377..ba994b6 100644 --- a/SaBusMgrStandardBase/Base/Bus/SbmCommodity.cs +++ b/SaBusMgrStandardBase/Base/Bus/SbmCommodity.cs @@ -1870,7 +1870,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus if (IdsIncluded.Count > 0) values.Add("Included commodities", IdsIncluded.Count.ToString()); if (IdsExcluded.Count > 0) values.Add("Excluded commodities", IdsExcluded.Count.ToString()); // Commodity type. - if (CommodityType > 0) values.Add("Type", SbmSystem.GetSystemCodes(Sbm.SystemCode.CommodityType).GetDescForType(CommodityType, CommodityType.ToString())); + if (CommodityType > 0) values.Add("Type", SbmSystem.GetSystemCodes(Sbm.ApplicationCode.CommodityType).GetDescForType(CommodityType, CommodityType.ToString())); else if (CommodityType == Sbm.CommodityType.AnyProduct) values.Add("Type", "Any product"); if (StockItemsOnly) values.Add("Stock items only", "True"); // Commodity code. diff --git a/SaBusMgrStandardBase/Base/Bus/SbmRequirementCosts.cs b/SaBusMgrStandardBase/Base/Bus/SbmRequirementCosts.cs index 03cd26f..9be10fd 100644 --- a/SaBusMgrStandardBase/Base/Bus/SbmRequirementCosts.cs +++ b/SaBusMgrStandardBase/Base/Bus/SbmRequirementCosts.cs @@ -284,7 +284,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus PurchaseCostsPopulated = true; int decimalsPercent = 2; - List ItemLinkDataTypes = SbmSystem.GetSystemCodes(Sbm.SystemCode.ItemLinkData); + List ItemLinkDataTypes = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.ItemLinkData); String dataTypeCostProportion = ItemLinkDataTypes.GetCodeForType(Sbm.ItemLinkData.Requirement_AssocItem_PurchaseCostProportion); if (itemLinks == null) { diff --git a/SaBusMgrStandardBase/Base/Bus/SbmTransaction.cs b/SaBusMgrStandardBase/Base/Bus/SbmTransaction.cs index cf1ee5f..26e0c4d 100644 --- a/SaBusMgrStandardBase/Base/Bus/SbmTransaction.cs +++ b/SaBusMgrStandardBase/Base/Bus/SbmTransaction.cs @@ -1,15 +1,11 @@ using Sarand.BusinessMgr.Net.Standard.Base.App; -using Sarand.BusinessMgr.Net.Standard.Base.Consoles; -using Sarand.BusinessMgr.Net.Standard.Base.Core; using Sarand.Net.Standard.Base.Bus; using Sarand.Net.Standard.Base.Core; -using Sarand.Net.Standard.Base.Dbas; using Sarand.Net.Standard.Base.Utils; using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; -using System.Transactions; namespace Sarand.BusinessMgr.Net.Standard.Base.Bus { @@ -801,7 +797,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus public static List GetTransactionStatusCats(Sbm.TransactionType transactionType) { List statusCats = new List(); - List statusCatsFull = SbmSystem.GetSystemCodes(Sbm.SystemCode.TransactionStatusCat); + List statusCatsFull = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.TransactionStatusCat); switch (transactionType) { // NB Changes here may also need to be made in GetTaxEffectiveDate() @@ -1023,7 +1019,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus bool updateRequired = true; if (messageConsole != null) { - String transactionType = SbmSystem.GetSystemCodes(Sbm.SystemCode.TransactionStatusCat).GetDescForType(TransactionType); + String transactionType = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.TransactionStatusCat).GetDescForType(TransactionType); if (StringUtil.IsEmpty(transactionType)) transactionType = "Transaction"; String message = "The earliest 'Required' date against unclosed\nrequirements for this " + transactionType + " is " + @@ -1060,7 +1056,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus bool completeTransaction = true; if (messageConsole != null) { - String transactionType = SbmSystem.GetSystemCodes(Sbm.SystemCode.TransactionStatusCat).GetDescForType(TransactionType); + String transactionType = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.TransactionStatusCat).GetDescForType(TransactionType); if (StringUtil.IsEmpty(transactionType)) transactionType = "Transaction"; String message = "All of the requirements against this " + transactionType + "\nhave been completed.\n\nSet the status to 'Completed'?"; @@ -1651,6 +1647,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus // Test each 'significant' element of the filter and return 'false' if any of the values are set. // NB Elements without a test in the list below are not regarded as 'significant'. if (ForceFullResults) return false; + if (ResultsPaging.Paged) return false; if (IdsIncluded.Count > 0) return false; if (SysId.IsValid(TransIdSource)) return false; if (StatusCat == StatusCat.Pending || StatusCat == StatusCat.Open) return false; diff --git a/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole-QuickBooks.cs b/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole-QuickBooks.cs index 664e557..abeb14a 100644 --- a/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole-QuickBooks.cs +++ b/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole-QuickBooks.cs @@ -327,7 +327,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles itemOption.DisplayOptions.Group = OptionGroup_Data; itemOption.Name = sageStatics.InterfaceOptions.GetCodeForType(QuickBooksInterfaceOption.TaxCodeColumn); itemOption.DisplayOptions.Caption = sageStatics.InterfaceOptions.GetDescForType(QuickBooksInterfaceOption.TaxCodeColumn); - itemOption.DisplayOptions.Values.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_TaxCodeColumn)); + itemOption.DisplayOptions.Values.AddRange(Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_TaxCodeColumn)); //itemOption.DefaultValue = SbmDbDfn.GetColumnName(SbmDbDfn.ColumnIdx.TaxCode_CodeAlt1); interfaceItemOptionDfns.Add(itemOption); diff --git a/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole-Sage.cs b/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole-Sage.cs index c58d3b1..7955393 100644 --- a/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole-Sage.cs +++ b/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole-Sage.cs @@ -556,7 +556,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles itemOption.DisplayOptions.Group = OptionGroup_Stock; itemOption.Name = sageStatics.InterfaceOptions.GetCodeForType(SageInterfaceOption.TaxCodeColumn); itemOption.DisplayOptions.Caption = sageStatics.InterfaceOptions.GetDescForType(SageInterfaceOption.TaxCodeColumn); - itemOption.DisplayOptions.Values.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_TaxCodeColumn)); + itemOption.DisplayOptions.Values.AddRange(Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_TaxCodeColumn)); //itemOption.DefaultValue = SbmDbDfn.GetColumnName(SbmDbDfn.ColumnIdx.TaxCode_CodeAlt1); interfaceItemOptionDfns.Add(itemOption); diff --git a/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole.cs b/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole.cs index ea475d6..bb2007a 100644 --- a/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole.cs +++ b/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole.cs @@ -75,7 +75,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles mbr = new DataMembers(internalsSupplied); sageParams = new SageParams(Internals); qbkParams = new QBooksParams(Internals); - mbr.InterfaceOptions.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.InterfaceOption)); + mbr.InterfaceOptions.AddRange(Internals.GetApplicationCodes(Sbm.ApplicationCode.InterfaceOption)); Reset(); } diff --git a/SaBusMgrStandardBase/Base/Consoles/SbmInstanceSchemaConsole.cs b/SaBusMgrStandardBase/Base/Consoles/SbmInstanceSchemaConsole.cs index 044edcb..6c97209 100644 --- a/SaBusMgrStandardBase/Base/Consoles/SbmInstanceSchemaConsole.cs +++ b/SaBusMgrStandardBase/Base/Consoles/SbmInstanceSchemaConsole.cs @@ -1,14 +1,12 @@ using Sarand.BusinessMgr.Net.Standard.Base.App; using Sarand.Net.Standard.Base.CodeTypes; using Sarand.Net.Standard.Base.Dbas; +using Sarand.Net.Standard.Base.Interfaces; using Sarand.Net.Standard.Base.ItemOptions; using Sarand.Net.Standard.Base.Security; using Sarand.Net.Standard.Base.Utils; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles { @@ -165,6 +163,36 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles return (SaItemOptionDbDfn.MaxTextLen > 1 ? Math.Min(SaItemOptionDbDfn.MaxTextLen, columnLength) : columnLength); } + //------------------------------------------------------------------- + // Interface Column lengths - taking into account current database schema for selected columns. + public ulong GetColTextLen(SaInterfaceDbDfn.ColumnIdx column) + { + // Intercept columns that may have different lengths on the database. + if (db != null && InterfaceColumnLengths.ContainsKey(column)) + { + if (InterfaceColumnLengths[column] == 0) + InterfaceColumnLengths[column] = GetDbColTextLen(column); + if (InterfaceColumnLengths[column] > 0) + return InterfaceColumnLengths[column]; + } + return SaInterfaceDbDfn.GetColTextLen(column); + } + // Interface columns that may differ in length on the db. + private readonly Dictionary InterfaceColumnLengths = new Dictionary() + { + { SaInterfaceDbDfn.ColumnIdx.SaInterface_Code, 0}, + { SaInterfaceDbDfn.ColumnIdx.SaInterface_Caption, 0}, + }; + public ulong GetDbColTextLen(SaInterfaceDbDfn.ColumnIdx column) + { + // Get the column's length from the currently open database: + if (SaInterfaceDbDfn.GetColDataType(column) != DbColumnDataType.VarChar) return 0; + DbDfnTable dfnTable = db.GetTableDfn(SaInterfaceDbDfn.GetTableName(SaInterfaceDbDfn.GetTableForColumn(column), false)); + String columnName = SaInterfaceDbDfn.GetColumnName(column, false); + ulong columnLength = (ulong)(dfnTable.Columns.Find(col => col.Name.EqualsCI(columnName))?.Size ?? 0); + return (SaInterfaceDbDfn.MaxTextLen > 1 ? Math.Min(SaInterfaceDbDfn.MaxTextLen, columnLength) : columnLength); + } + //------------------------------------------------------------------- } //======================================================================= diff --git a/SaBusMgrStandardBase/Base/Consoles/SbmSessionConsole-Transactions.cs b/SaBusMgrStandardBase/Base/Consoles/SbmSessionConsole-Transactions.cs index 634cc2b..677a213 100644 --- a/SaBusMgrStandardBase/Base/Consoles/SbmSessionConsole-Transactions.cs +++ b/SaBusMgrStandardBase/Base/Consoles/SbmSessionConsole-Transactions.cs @@ -337,7 +337,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles { // Build the list of transaction types that are allowed to be raised from the specified type. List transTypes = new List(); - if (mbr.TransactionTypes_Full == null) mbr.TransactionTypes_Full = Internals.GetSystemCodes(Sbm.SystemCode.TransactionType); + if (mbr.TransactionTypes_Full == null) mbr.TransactionTypes_Full = Internals.GetApplicationCodes(Sbm.ApplicationCode.TransactionType); foreach (TypeCodeDesc transTypeTo in mbr.TransactionTypes_Full) { //if ((Sbm.TransactionType)typeTo.iType == typeFrom) continue; @@ -352,7 +352,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles { // Build the list of transaction types that are allowed to be raised to the specified type. List transTypes = new List(); - if (mbr.TransactionTypes_Full.Count == 0) mbr.TransactionTypes_Full = Internals.GetSystemCodes(Sbm.SystemCode.TransactionType); + if (mbr.TransactionTypes_Full.Count == 0) mbr.TransactionTypes_Full = Internals.GetApplicationCodes(Sbm.ApplicationCode.TransactionType); //transTypes_Full.GotoStart(); foreach (TypeCodeDesc transTypeTo in mbr.TransactionTypes_Full) { diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr.cs b/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr.cs index 971386d..d437a85 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr.cs @@ -55,13 +55,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr // Properties. public abstract bool SystemAccountDatabaseIsValid { get; } // System codes. - protected List AffiliateTypes { get { return GetSystemCodes(Sbm.SystemCode.AffiliateType); } } - protected List AssociationTypes { get { return GetSystemCodes(Sbm.SystemCode.AssociationType); } } - protected List AddressTypes { get { return GetSystemCodes(Sbm.SystemCode.AddressType); } } - protected List SysParamCategories { get { return GetSystemCodes(Sbm.SystemCode.SysParamCategory); } } - protected List TransactionStatusCats { get { return GetSystemCodes(Sbm.SystemCode.TransactionStatusCat); } } - protected List DiscountTypes { get { return GetSystemCodes(Sbm.SystemCode.DiscountType); } } - protected List SystemAccountTypes { get { return GetSystemCodes(Sbm.SystemCode.SystemAccountType); } } + protected List AffiliateTypes { get { return GetSystemCodes(Sbm.ApplicationCode.AffiliateType); } } + protected List AssociationTypes { get { return GetSystemCodes(Sbm.ApplicationCode.AssociationType); } } + protected List AddressTypes { get { return GetSystemCodes(Sbm.ApplicationCode.AddressType); } } + protected List SysParamCategories { get { return GetSystemCodes(Sbm.ApplicationCode.SysParamCategory); } } + protected List TransactionStatusCats { get { return GetSystemCodes(Sbm.ApplicationCode.TransactionStatusCat); } } + protected List DiscountTypes { get { return GetSystemCodes(Sbm.ApplicationCode.DiscountType); } } + protected List SystemAccountTypes { get { return GetSystemCodes(Sbm.ApplicationCode.SystemAccountType); } } // Code types. public override List SupportedCodeTypes { get { return new List(supportedCodeTypes); } } diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Association.cs b/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Association.cs index 80f8cea..4a86f20 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Association.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Association.cs @@ -115,7 +115,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr public virtual bool IsValidAssociationData(SbmAssociation.Data data, SbmAssociation.ErrField errField) { ClearErrorState(); - // Association properties. + + // Association must have valid Owner and Target. if (errField.AffiliateIdOwner != SacsHierarchyItem.ValidValue.Ignore && !SysId.IsValid(data.AffiliateIdOwner)) { errField.AffiliateIdOwner = SacsHierarchyItem.ValidValue.Invalid; @@ -126,14 +127,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr errField.AffiliateIdTarget = SacsHierarchyItem.ValidValue.Invalid; return SetErrorState("Target must be supplied"); } - if (errField.AssociationType != SacsHierarchyItem.ValidValue.Ignore && (short)data.AssociationType < 1) + + // Association must have valid type. + if (errField.AssociationType != SacsHierarchyItem.ValidValue.Ignore && !SbmAssociation.TypeIsValid(data.AssociationType)) { - if ((int)data.AssociationType < 1) - { - errField.AssociationType = SacsHierarchyItem.ValidValue.Invalid; - return SetErrorState("Association type must be supplied"); - } + errField.AssociationType = SacsHierarchyItem.ValidValue.Invalid; + return SetErrorState("Association type must be supplied"); } + + // Validate text fields. if (errField.Code != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Code, "code", (long)Internals.GetColTextLen(SbmDbDfn.ColumnIdx.Association_Code))) { errField.Code = SacsHierarchyItem.ValidValue.Invalid; @@ -184,6 +186,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr errField.InvoiceDesc = SacsHierarchyItem.ValidValue.Invalid; return false; } + // Association codes. if (errField.AccountManagerCode != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.AccountManagerCode, " account manager code", (long)Internals.GetColTextLen(SbmDbDfn.ColumnIdx.Association_AccountManagerCode))) { @@ -225,6 +228,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr errField.ContactCallCycleCode = SacsHierarchyItem.ValidValue.Invalid; return false; } + if (errField.CommodityIdSalesDefault != SacsHierarchyItem.ValidValue.Ignore && SysId.IsValid(data.CommodityIdSalesDefault)) { if (data.AssociationType != Sbm.AssociationType.Customer) @@ -233,6 +237,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr return SetErrorState("Default sales Commodity can only be assigned to customers"); } } + if (errField.OrderLeadTimeCode != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.OrderLeadTimeCode, "order lead time code", (long)Internals.GetColTextLen(SbmDbDfn.ColumnIdx.Association_OrderLeadTimeCode))) { errField.OrderLeadTimeCode = SacsHierarchyItem.ValidValue.Invalid; @@ -258,6 +263,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr errField.DeliveryBookInCode = SacsHierarchyItem.ValidValue.Invalid; return false; } + // Numeric values. if (errField.AmountTransMax != SacsHierarchyItem.ValidValue.Ignore && data.AmountTransMax < 0.0m) { @@ -281,11 +287,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr errField.DiscountRate = SacsHierarchyItem.ValidValue.Invalid; return SetErrorState("Discount Rate must not be negative"); } + /* Not applied in desktop application. if (data.DiscountRate > 0.0m && (short)data.DiscountType < 1) { errField.DiscountRate = SacsHierarchyItem.ValidValue.Invalid; return SetErrorState("Discount Type must be specified if a Rate is supplied"); } + */ } if (errField.PaymentTerms != SacsHierarchyItem.ValidValue.Ignore && data.PaymentTerms < 0) { diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Organisation.cs b/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Organisation.cs index 685df03..4f78318 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Organisation.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Organisation.cs @@ -220,7 +220,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr OrganisationOptionData orgOptData = new OrganisationOptionData(); // Option types. - orgOptData.associationOptionTypes.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.AssociationOption)); + orgOptData.associationOptionTypes.AddRange(Internals.GetApplicationCodes(Sbm.ApplicationCode.AssociationOption)); // Yes/No. orgOptData.Values_YesNo.Add(orgOptData.Value_Yes, "Yes"); @@ -243,7 +243,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr bool bAllowInterfaces_File = (bAllowInterfaces && SessionConsole.AllowInterfaceCategory(SaInterfaceCategory.File)); // Values: - List orgOptionValues = Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_Value); + List orgOptionValues = Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_Value); if (bAllowTransactions) { orgOptData.Contexts_Value.Add(orgOptionValues.GetCodeDescForType(Sbm.OrgOption_Value.MaxTransactionsQueriedForEmptyFilter)); @@ -268,7 +268,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr } // Folders: - List lOrgOptionFolder = Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_Folder); + List lOrgOptionFolder = Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_Folder); if (bAllowCommodities) { orgOptData.Contexts_Folder.Add(lOrgOptionFolder.GetCodeDescForType(Sbm.OrgOption_Folder.CommodityImage)); @@ -276,7 +276,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr } // Allow option contexts: - List lAllowOption = Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_AllowOption); + List lAllowOption = Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_AllowOption); if (bAllowContacts) { orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.UpdateAssociationCode)); @@ -341,11 +341,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr } // Caption contexts: - orgOptData.Contexts_Caption.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_Caption)); + orgOptData.Contexts_Caption.AddRange(Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_Caption)); // Show field contexts. // NB This list must be kept up to date with equivalent in 'SapphireConsole::DisplayAttribute': - List lShowField = Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_ShowField); + List lShowField = Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_ShowField); if (ColumnExists(SbmDbDfn.ColumnIdx.Association_AnnualSalesTarget)) orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Association_AnnualSalesTarget)); if (ColumnExists(SbmDbDfn.ColumnIdx.Address_LastVisitOn)) @@ -376,7 +376,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr } // Show column contexts: - List lShowColumn = Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_ShowColumn); + List lShowColumn = Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_ShowColumn); if (bAllowSalesOrders) { if (ColumnExists(SbmDbDfn.ColumnIdx.Association_AnnualSalesTarget)) @@ -426,7 +426,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Vehicle_KeyLocation)); // Field label contexts: - List lFieldLabel = Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_FieldLabel); + List lFieldLabel = Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_FieldLabel); orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_CatalogRef)); orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_Dimensions)); orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_ICNTariffCode)); @@ -466,7 +466,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr } // Commodity status filter. - List lCmdStatusCat = Internals.GetSystemCodes(Sbm.SystemCode.CommodityStatusCat); + List lCmdStatusCat = Internals.GetApplicationCodes(Sbm.ApplicationCode.CommodityStatusCat); orgOptData.Values_CommodityStatusCat.Add(lCmdStatusCat.GetCodeDescForType(SbmCommodity.StatusCat.Any)); orgOptData.Values_CommodityStatusCat.Add(lCmdStatusCat.GetCodeDescForType(SbmCommodity.StatusCat.Current)); @@ -476,12 +476,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr // Container status caption. if (CommodityMgr.ContainerDatabaseIsValid && StockControlConfig.AllowStockContainers()) - orgOptData.Contexts_ContainerStatus.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_ContainerStatusCaption)); + orgOptData.Contexts_ContainerStatus.AddRange(Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_ContainerStatusCaption)); // Generic options: - orgOptData.Contexts_Minutes.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_Minutes)); - orgOptData.Contexts_PeriodDays.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_PeriodDays)); - orgOptData.Contexts_PeriodWeeks.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_PeriodWeeks)); + orgOptData.Contexts_Minutes.AddRange(Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_Minutes)); + orgOptData.Contexts_PeriodDays.AddRange(Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_PeriodDays)); + orgOptData.Contexts_PeriodWeeks.AddRange(Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_PeriodWeeks)); // Minutes. for (int iMins = 0; iMins <= 30; iMins++) @@ -535,7 +535,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr orgOptData.Values_PeriodWeeks.Add("30", "30 weeks"); // Numeric Decimals: - orgOptData.Contexts_NumericDecimals.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_NumericDecimals)); + orgOptData.Contexts_NumericDecimals.AddRange(Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_NumericDecimals)); orgOptData.Values_Decimals_0To2.Add("0", "None"); orgOptData.Values_Decimals_0To2.Add("1", "1 places"); orgOptData.Values_Decimals_0To2.Add("2", "2 places"); @@ -546,11 +546,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr orgOptData.Values_Decimals_0To4.Add("4", "4 places"); // Commodity types. - orgOptData.Contexts_CommodityType.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.CommodityType)); - orgOptData.Values_CommodityTypes.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.CommodityType)); + orgOptData.Contexts_CommodityType.AddRange(Internals.GetApplicationCodes(Sbm.ApplicationCode.CommodityType)); + orgOptData.Values_CommodityTypes.AddRange(Internals.GetApplicationCodes(Sbm.ApplicationCode.CommodityType)); // Sales locations. - orgOptData.Contexts_SalesLocation.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.OrgOption_StockLocation)); + orgOptData.Contexts_SalesLocation.AddRange(Internals.GetApplicationCodes(Sbm.ApplicationCode.OrgOption_StockLocation)); SbmLocation.Params prmLocation = new SbmLocation.Params(); prmLocation.RestrictToSalesStock = true; prmLocation.StatusCat = SbmLocation.StatusCat.ActiveOnly; diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmAssetMgr.cs b/SaBusMgrStandardBase/Base/Mgr/SbmAssetMgr.cs index f7abdea..11df245 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmAssetMgr.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmAssetMgr.cs @@ -31,7 +31,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr //------------------------------------------------------------------- // Properties. - public List AssetTypes { get { return GetSystemCodes(Sbm.SystemCode.AssetType); } } + public List AssetTypes { get { return GetSystemCodes(Sbm.ApplicationCode.AssetType); } } //------------------------------------------------------------------- // Utilities. diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmCommodityMgr.cs b/SaBusMgrStandardBase/Base/Mgr/SbmCommodityMgr.cs index 37d1d76..67a6e5a 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmCommodityMgr.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmCommodityMgr.cs @@ -53,14 +53,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr public abstract bool ContainerDatabaseIsValid { get; } public abstract bool PortfolioDatabaseIsValid { get; } // Code lists. - public List CommodityTypes { get { return GetSystemCodes(Sbm.SystemCode.CommodityType); } } - public List ContainerCategories { get { return GetSystemCodes(Sbm.SystemCode.ContainerCategory); } } - public List ContainerTypes { get { return GetSystemCodes(Sbm.SystemCode.ContainerType); } } - public List PortfolioItemTypes { get { return GetSystemCodes(Sbm.SystemCode.PortfolioItemType); } } - public List CommodityStatusCats { get { return GetSystemCodes(Sbm.SystemCode.CommodityStatusCat); } } - public List TransactionTypes { get { return GetSystemCodes(Sbm.SystemCode.TransactionType); } } - public List TransactionStatusCats { get { return GetSystemCodes(Sbm.SystemCode.TransactionStatusCat); } } - public List RequirementStatusCats { get { return GetSystemCodes(Sbm.SystemCode.RequirementStatusCat); } } + public List CommodityTypes { get { return GetSystemCodes(Sbm.ApplicationCode.CommodityType); } } + public List ContainerCategories { get { return GetSystemCodes(Sbm.ApplicationCode.ContainerCategory); } } + public List ContainerTypes { get { return GetSystemCodes(Sbm.ApplicationCode.ContainerType); } } + public List PortfolioItemTypes { get { return GetSystemCodes(Sbm.ApplicationCode.PortfolioItemType); } } + public List CommodityStatusCats { get { return GetSystemCodes(Sbm.ApplicationCode.CommodityStatusCat); } } + public List TransactionTypes { get { return GetSystemCodes(Sbm.ApplicationCode.TransactionType); } } + public List TransactionStatusCats { get { return GetSystemCodes(Sbm.ApplicationCode.TransactionStatusCat); } } + public List RequirementStatusCats { get { return GetSystemCodes(Sbm.ApplicationCode.RequirementStatusCat); } } // Code types. public override List SupportedCodeTypes { get { return new List(supportedCodeTypes); } } diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmCoreMgr.cs b/SaBusMgrStandardBase/Base/Mgr/SbmCoreMgr.cs index 46a2141..aabec92 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmCoreMgr.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmCoreMgr.cs @@ -166,8 +166,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr //------------------------------------------------------------------- // Properties. // System codes. - protected List ItemTypes { get { return GetSystemCodes(Sbm.SystemCode.ItemType); } } - protected List InterfaceOptionCodes { get { return GetSystemCodes(Sbm.SystemCode.InterfaceOption); } } + protected List ItemTypes { get { return GetSystemCodes(Sbm.ApplicationCode.ItemType); } } + protected List InterfaceOptionCodes { get { return GetSystemCodes(Sbm.ApplicationCode.InterfaceOption); } } // Numeric control values. protected int WeightDecimals { get { InitialiseNumericControlValues(); return mbr.weightDecimals; } } protected int LengthDecimals { get { InitialiseNumericControlValues(); return mbr.lengthDecimals; } } @@ -247,9 +247,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr //------------------------------------------------------------------- // Utilities. - public List GetSystemCodes(Sbm.SystemCode systemCode) + + public List GetSystemCodes(Sbm.ApplicationCode applicationCode) { - return Internals.GetSystemCodes(systemCode); + return Internals.GetApplicationCodes(applicationCode); } // Database utilities. @@ -274,6 +275,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr //------------------------------------------------------------------- // Session console utilities. + public bool AllowConfigOption(Sbm.ConfigOption configOption) { return SessionConsole.AllowOption(configOption); @@ -296,8 +298,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr } //------------------------------------------------------------------- - // C o d e T y p e s - //------------------------------------------------------------------- + // Code Types. + public virtual List SupportedCodeTypes { get; } = new List(); private CodeTypeCache codeTypeCache; public bool CodeTypeHasCodes(Sbm.ApplCodeType codeType) diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmPriceMgr.cs b/SaBusMgrStandardBase/Base/Mgr/SbmPriceMgr.cs index 7da57d8..8e56878 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmPriceMgr.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmPriceMgr.cs @@ -40,10 +40,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr // Properties. public abstract bool PriceDatabaseIsValid { get; } // System codes. - public List PriceTypes { get { return GetSystemCodes(Sbm.SystemCode.PriceType); } } - public List PriceCalculationMethods { get { return GetSystemCodes(Sbm.SystemCode.PriceCalcMethod); } } - public List PriceRounderMethods { get { return GetSystemCodes(Sbm.SystemCode.PriceRounderMethod); } } - public List PriceRounderDirections { get { return GetSystemCodes(Sbm.SystemCode.PriceRounderDirection); } } + public List PriceTypes { get { return GetSystemCodes(Sbm.ApplicationCode.PriceType); } } + public List PriceCalculationMethods { get { return GetSystemCodes(Sbm.ApplicationCode.PriceCalcMethod); } } + public List PriceRounderMethods { get { return GetSystemCodes(Sbm.ApplicationCode.PriceRounderMethod); } } + public List PriceRounderDirections { get { return GetSystemCodes(Sbm.ApplicationCode.PriceRounderDirection); } } // Code types. public override List SupportedCodeTypes { get { return new List(supportedCodeTypes); } } diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmProcessMgr.cs b/SaBusMgrStandardBase/Base/Mgr/SbmProcessMgr.cs index ae51d8c..dfc1f51 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmProcessMgr.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmProcessMgr.cs @@ -39,8 +39,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr // Properties. public abstract bool ProcessDatabaseIsValid { get; } // System codes. - public List ProcessTypes { get { return GetSystemCodes(Sbm.SystemCode.ProcessType); } } - public List processCategories { get { return GetSystemCodes(Sbm.SystemCode.ProcessCategory); } } + public List ProcessTypes { get { return GetSystemCodes(Sbm.ApplicationCode.ProcessType); } } + public List processCategories { get { return GetSystemCodes(Sbm.ApplicationCode.ProcessCategory); } } //------------------------------------------------------------------- } diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmProcessMgr_Process.cs b/SaBusMgrStandardBase/Base/Mgr/SbmProcessMgr_Process.cs index c56db51..b828ba2 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmProcessMgr_Process.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmProcessMgr_Process.cs @@ -24,7 +24,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr // Associated codes. public String GetItemDataCodeForProcessCostCode(SbmProcess.SbmProcessCostCode processCostCode) { - List itemDataTypes = Internals.GetSystemCodes(Sbm.SystemCode.ItemDataType); + List itemDataTypes = Internals.GetApplicationCodes(Sbm.ApplicationCode.ItemDataType); switch (processCostCode) { case SbmProcess.SbmProcessCostCode.Fixed_Unit: return itemDataTypes.GetCodeForType(Sbm.ItemDataType.Process_FixedCost_Unit); diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmStockMgr.cs b/SaBusMgrStandardBase/Base/Mgr/SbmStockMgr.cs index 7327e3e..598d7c5 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmStockMgr.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmStockMgr.cs @@ -41,7 +41,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr //------------------------------------------------------------------- // Properties. // Code lists. - public List LocationCategories { get { return GetSystemCodes(Sbm.SystemCode.LocationCategory); } } + public List LocationCategories { get { return GetSystemCodes(Sbm.ApplicationCode.LocationCategory); } } //------------------------------------------------------------------- // Utilities. diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmStockMgr_StockLevel.cs b/SaBusMgrStandardBase/Base/Mgr/SbmStockMgr_StockLevel.cs index 2d4b829..79bc708 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmStockMgr_StockLevel.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmStockMgr_StockLevel.cs @@ -159,7 +159,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr case SbmStockLevel.Column.Type_Desc: { Sbm.StockLevelType type = (Sbm.StockLevelType)values.GetLong(column.DataName); - value = new DataValue(Internals.GetSystemCodes(Sbm.SystemCode.StockLevelType).GetDescForType(type, $"{type}")); + value = new DataValue(Internals.GetApplicationCodes(Sbm.ApplicationCode.StockLevelType).GetDescForType(type, $"{type}")); break; } @@ -168,7 +168,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr case SbmStockLevel.Column.Source_Desc: { Sbm.StockLevelSource source = (Sbm.StockLevelSource)values.GetLong(column.DataName); - value = new DataValue(Internals.GetSystemCodes(Sbm.SystemCode.StockLevelSource).GetDescForType(source, $"{source}")); + value = new DataValue(Internals.GetApplicationCodes(Sbm.ApplicationCode.StockLevelSource).GetDescForType(source, $"{source}")); break; } diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmTransactionMgr.cs b/SaBusMgrStandardBase/Base/Mgr/SbmTransactionMgr.cs index 3fbe90a..77f1303 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmTransactionMgr.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmTransactionMgr.cs @@ -50,12 +50,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr //------------------------------------------------------------------- // Properties. - public List TransactionTypes { get { return GetSystemCodes(Sbm.SystemCode.TransactionType); } } - public List TransactionStatusCats { get { return GetSystemCodes(Sbm.SystemCode.TransactionStatusCat); } } - public List AssociationTypes { get { return GetSystemCodes(Sbm.SystemCode.AssociationType); } } - public List RequirementStatusCats { get { return GetSystemCodes(Sbm.SystemCode.RequirementStatusCat); } } - public List ConstituentTypes { get { return GetSystemCodes(Sbm.SystemCode.ConstituentType); } } - public List ConstituentStatusCats { get { return GetSystemCodes(Sbm.SystemCode.ConstituentStatusCat); } } + public List TransactionTypes { get { return GetSystemCodes(Sbm.ApplicationCode.TransactionType); } } + public List TransactionStatusCats { get { return GetSystemCodes(Sbm.ApplicationCode.TransactionStatusCat); } } + public List AssociationTypes { get { return GetSystemCodes(Sbm.ApplicationCode.AssociationType); } } + public List RequirementStatusCats { get { return GetSystemCodes(Sbm.ApplicationCode.RequirementStatusCat); } } + public List ConstituentTypes { get { return GetSystemCodes(Sbm.ApplicationCode.ConstituentType); } } + public List ConstituentStatusCats { get { return GetSystemCodes(Sbm.ApplicationCode.ConstituentStatusCat); } } // Code types. public override List SupportedCodeTypes { get { return new List(supportedCodeTypes); } } diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmTransactionMgr_Transaction.cs b/SaBusMgrStandardBase/Base/Mgr/SbmTransactionMgr_Transaction.cs index 7b084c9..f7ca75b 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmTransactionMgr_Transaction.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmTransactionMgr_Transaction.cs @@ -1,6 +1,5 @@ using Sarand.BusinessMgr.Net.Standard.Base.App; using Sarand.BusinessMgr.Net.Standard.Base.Bus; -using Sarand.BusinessMgr.Net.Standard.Base.Consoles; using Sarand.Net.Standard.Base.App; using Sarand.Net.Standard.Base.Bus; using Sarand.Net.Standard.Base.Core; @@ -9,7 +8,6 @@ using Sarand.Net.Standard.Base.ReferenceData; using Sarand.Net.Standard.Base.Utils; using System; using System.Collections.Generic; -using static Sarand.BusinessMgr.Net.Standard.Base.App.Sbm; namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr { @@ -404,7 +402,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr //------------------------------------------------------------------- // Transaction list. public abstract ColumnDfn GetTransactionColumnDfn(SbmTransaction.Column columnId, String caption = "", int width = 0); - public abstract List GetTransactionQueryFilter(SbmTransaction.Params prm); + public abstract List GetTransactionQueryFilter(SbmTransaction.Params prm, bool forceFullResults = false); public abstract long GetTransactionCount(SbmTransaction.Params prm); public abstract List GetTransactionList(SbmTransaction.Params prm); public abstract DbResultSet ExecuteTransactionQuery(List columns, SbmTransaction.Params prm); diff --git a/SaBusMgrStandardDbas/Dbas/Consoles/SbmInterfaceConsole_Dbas.cs b/SaBusMgrStandardDbas/Dbas/Consoles/SbmInterfaceConsole_Dbas.cs index 9673468..5016f37 100644 --- a/SaBusMgrStandardDbas/Dbas/Consoles/SbmInterfaceConsole_Dbas.cs +++ b/SaBusMgrStandardDbas/Dbas/Consoles/SbmInterfaceConsole_Dbas.cs @@ -36,8 +36,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles protected SbmInterfaceConsole_Dbas(SbmInternals internals) : base(internals.BusMgrDatabase) { mbr = new DataMembers(internals); - dataItemTypes = Internals.GetSystemCodes(Sbm.SystemCode.ItemType); - interfaceDataTypes = internals.GetSystemCodes(Sbm.SystemCode.InterfaceDataType); + dataItemTypes = Internals.GetApplicationCodes(Sbm.ApplicationCode.ItemType); + interfaceDataTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.InterfaceDataType); } protected override void Dispose(bool disposing) { @@ -75,13 +75,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles private List GetInterfaceTypesForCategory(SaInterfaceCategory interfaceCategory) { if (interfaceCategory == SaInterfaceCategory.Website) - return Internals.GetSystemCodes(Sbm.SystemCode.InterfaceType_Website); + return Internals.GetApplicationCodes(Sbm.ApplicationCode.InterfaceType_Website); if (interfaceCategory == SaInterfaceCategory.Accounts) - return Internals.GetSystemCodes(Sbm.SystemCode.InterfaceType_Accounts); + return Internals.GetApplicationCodes(Sbm.ApplicationCode.InterfaceType_Accounts); if (interfaceCategory == SaInterfaceCategory.System) - return Internals.GetSystemCodes(Sbm.SystemCode.InterfaceType_System); + return Internals.GetApplicationCodes(Sbm.ApplicationCode.InterfaceType_System); if (interfaceCategory == SaInterfaceCategory.File) - return Internals.GetSystemCodes(Sbm.SystemCode.InterfaceType_File); + return Internals.GetApplicationCodes(Sbm.ApplicationCode.InterfaceType_File); return new List(); } public void RegisterInterfaces(String context) diff --git a/SaBusMgrStandardDbas/Dbas/Consoles/SbmSecurityConsole_Dbas.cs b/SaBusMgrStandardDbas/Dbas/Consoles/SbmSecurityConsole_Dbas.cs index 0427948..1968f04 100644 --- a/SaBusMgrStandardDbas/Dbas/Consoles/SbmSecurityConsole_Dbas.cs +++ b/SaBusMgrStandardDbas/Dbas/Consoles/SbmSecurityConsole_Dbas.cs @@ -129,7 +129,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles { // Construct list of transaction types and statuses to use in security rights. List transactionTypesStatus = new List(); - foreach (TypeCodeDesc transactionType in Internals.GetSystemCodes(Sbm.SystemCode.TransactionType)) + foreach (TypeCodeDesc transactionType in Internals.GetApplicationCodes(Sbm.ApplicationCode.TransactionType)) { Sbm.TransactionType transType = (Sbm.TransactionType)transactionType.Type; // Only interested in sales quotes and orders for now. @@ -208,7 +208,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles // Transaction types: List transactionTypesDesc = new List(); List transactionTypesDescAllowed = new List(); - foreach (TypeCodeDesc transactionType in Internals.GetSystemCodes(Sbm.SystemCode.TransactionType)) + foreach (TypeCodeDesc transactionType in Internals.GetApplicationCodes(Sbm.ApplicationCode.TransactionType)) { if (SessionConsole.AllowTransactionType((Sbm.TransactionType)transactionType.Type)) transactionTypesDescAllowed.Add(new SysId(transactionType.Type), transactionType.Desc); @@ -235,7 +235,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles // Financial types: List financialTypesDesc = new List(); List financialTypesDescAllowed = new List(); - foreach (TypeCodeDesc financialType in Internals.GetSystemCodes(Sbm.SystemCode.FinancialType)) + foreach (TypeCodeDesc financialType in Internals.GetApplicationCodes(Sbm.ApplicationCode.FinancialType)) { financialTypesDescAllowed.Add(new SysId(financialType.Type), financialType.Desc); financialTypesDesc.Add(new SysId(financialType.Type), financialType.Desc); diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Address_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Address_Db.cs index 84c1ef1..a7b935c 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Address_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Address_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Affiliate_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Affiliate_Db.cs index e19bc13..e250757 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Affiliate_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Affiliate_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Association_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Association_Db.cs index 0ef8d62..1f4a2ec 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Association_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Association_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/CommodityCustomer_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/CommodityCustomer_Db.cs index f1772a3..cd702ab 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/CommodityCustomer_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/CommodityCustomer_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/CommoditySupplier_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/CommoditySupplier_Db.cs index f2e390a..629200f 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/CommoditySupplier_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/CommoditySupplier_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Commodity_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Commodity_Db.cs index 5aca6df..5f73397 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Commodity_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Commodity_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Constituent_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Constituent_Db.cs index 303a895..04d3a1d 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Constituent_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Constituent_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/ContainerItem_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/ContainerItem_Db.cs index 3d7fefa..d0c4469 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/ContainerItem_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/ContainerItem_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Container_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Container_Db.cs index e87cef6..27db835 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Container_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Container_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Control/AccountRegistration_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Control/AccountRegistration_Db.cs index 90d6501..304cbb3 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Control/AccountRegistration_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Control/AccountRegistration_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Thu 13-Feb-2025 11:12:01 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:25:21 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal.Control { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Control/ItemParam_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Control/ItemParam_Db.cs index 0aa9ab4..2ce5986 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Control/ItemParam_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Control/ItemParam_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Thu 13-Feb-2025 11:12:01 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:25:21 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal.Control { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Control/Owner_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Control/Owner_Db.cs index 8c33604..1f643a6 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Control/Owner_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Control/Owner_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Thu 13-Feb-2025 11:12:01 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:25:21 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal.Control { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Control/Repository_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Control/Repository_Db.cs index 7af18ef..f593698 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Control/Repository_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Control/Repository_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Thu 13-Feb-2025 11:12:01 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:25:21 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal.Control { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Control/UserAccount_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Control/UserAccount_Db.cs index 009d56f..5b46e17 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Control/UserAccount_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Control/UserAccount_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Thu 13-Feb-2025 11:12:01 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:25:21 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal.Control { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/ItemBatch_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/ItemBatch_Db.cs index afe794a..1fa2615 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/ItemBatch_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/ItemBatch_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/ItemLink_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/ItemLink_Db.cs index d68633b..66200f7 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/ItemLink_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/ItemLink_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Location_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Location_Db.cs index aba37e3..58ba9d6 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Location_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Location_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Movement_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Movement_Db.cs index 54877dc..7612d3e 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Movement_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Movement_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/PortfolioItem_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/PortfolioItem_Db.cs index 29dc07c..1069af0 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/PortfolioItem_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/PortfolioItem_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Process_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Process_Db.cs index 05fd04a..629e8c0 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Process_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Process_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Requirement_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Requirement_Db.cs index 9f65561..f2b177e 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Requirement_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Requirement_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaAssetCategory_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaAssetCategory_Db.cs index eb2a5b7..422d7d4 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaAssetCategory_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaAssetCategory_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaAssetProcess_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaAssetProcess_Db.cs index 3cc2e62..6d5c31c 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaAssetProcess_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaAssetProcess_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaAsset_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaAsset_Db.cs index cb984c9..0c67b49 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaAsset_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaAsset_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryEntry_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryEntry_Db.cs index b11b1cd..f841cc9 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryEntry_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryEntry_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryLink_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryLink_Db.cs index 3b6973e..3f6a2b8 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryLink_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryLink_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaPriceSet_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaPriceSet_Db.cs index 4d6f55b..2bb7534 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaPriceSet_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaPriceSet_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaPrice_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaPrice_Db.cs index b00f143..72bdf1b 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaPrice_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaPrice_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleClass_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleClass_Db.cs index 72dd704..5552593 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleClass_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleClass_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleEvent_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleEvent_Db.cs index 6e48896..c432c07 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleEvent_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleEvent_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleFeature_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleFeature_Db.cs index e0b9963..fa5cf9b 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleFeature_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleFeature_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicle_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicle_Db.cs index f9707e8..d99a27a 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicle_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicle_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/StockLevel_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/StockLevel_Db.cs index fcb8cd0..a99867e 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/StockLevel_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/StockLevel_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SysParam_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SysParam_Db.cs index bbd6b68..a8ddfd2 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SysParam_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SysParam_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SystemAccountUser_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SystemAccountUser_Db.cs index c6f148f..b6f7410 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SystemAccountUser_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SystemAccountUser_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SystemAccount_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SystemAccount_Db.cs index b0bf7d6..8316a2d 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SystemAccount_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SystemAccount_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SystemUser_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SystemUser_Db.cs index 43fa5ef..a2b1acc 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SystemUser_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SystemUser_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Transaction_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Transaction_Db.cs index 7baa391..7a97917 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Transaction_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Transaction_Db.cs @@ -10,7 +10,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Tue 11-Feb-2025 12:43:45 +// Code generated by Sarand Database Utilities Thu 30-Oct-2025 11:27:05 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-Affiliate.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-Affiliate.cs index 0891cf1..22d99a0 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-Affiliate.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-Affiliate.cs @@ -1,8 +1,5 @@ -using Org.BouncyCastle.Asn1.Cmp; -using Sarand.BusinessMgr.Net.Standard.Base.App; +using Sarand.BusinessMgr.Net.Standard.Base.App; using Sarand.BusinessMgr.Net.Standard.Base.Bus; -using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control; -using Sarand.BusinessMgr.Net.Standard.Base.Mgr; using Sarand.BusinessMgr.Net.Standard.Dbas.Bus; using Sarand.BusinessMgr.Net.Standard.Dbas.Internal; using Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog; @@ -10,7 +7,6 @@ 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.Interfaces; using Sarand.Net.Standard.Base.Utils; using Sarand.Net.Standard.Dbas.Data; using System; @@ -451,7 +447,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr affiliate.Email = dbAffiliate._Email; affiliate.Website = dbAffiliate._Website; // Ogranisation. - affiliate.AffiliateIdParent = new SysId(dbAffiliate._AffIdParent ?? 0); + affiliate.AffiliateIdParent = new SysId(dbAffiliate._AffIdParent); affiliate.Name = dbAffiliate._Name; affiliate.Abbr = dbAffiliate._Abbrev; affiliate.Nature = dbAffiliate._Nature; @@ -473,12 +469,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr affiliate.Spouse = dbAffiliate._Spouse; affiliate.Children = dbAffiliate._Children; affiliate.Hometown = dbAffiliate._Hometown; - affiliate.UserId = new SysId(dbAffiliate._UserId ?? 0); + affiliate.UserId = new SysId(dbAffiliate._UserId); // Common properties. affiliate.Notes = dbAffiliate._Notes; affiliate.Status = SacsSystem.GetStatusForCode(dbAffiliate._Status); - affiliate.SetCreateStamp(dbAffiliate._CreateOn, new SysId(dbAffiliate._CreateBy ?? 0), dbAffiliate._CreateHost); - affiliate.SetUpdateStamp(dbAffiliate._UpdateOn ?? default(DateTime), new SysId(dbAffiliate._UpdateBy ?? 0), dbAffiliate._UpdateHost); + affiliate.SetCreateStamp(dbAffiliate._CreateOn, new SysId(dbAffiliate._CreateBy), dbAffiliate._CreateHost); + affiliate.SetUpdateStamp(dbAffiliate._UpdateOn, new SysId(dbAffiliate._UpdateBy), dbAffiliate._UpdateHost); affiliate.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-Association.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-Association.cs index 8b88505..a5cbc2e 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-Association.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-Association.cs @@ -332,7 +332,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr association.ContactCallCycleCode = dbAssociation._ContactCallCycleCode; association.CallsPerYear = dbAssociation._CallsPerYear ?? 0; association.LastCall = dbAssociation._LastCall ?? default(DateTime); - association.CommodityIdSalesDefault = new SysId(dbAssociation._CommodityIdSalesDefault ?? 0); + association.CommodityIdSalesDefault = new SysId(dbAssociation._CommodityIdSalesDefault); association.OrderLeadTimeCode = dbAssociation._OrderLeadTimeCode; association.DeliveryTypeCode = dbAssociation._DeliveryTypeCode; association.DeliveryCourierCode = dbAssociation._DeliveryCourierCode; @@ -345,8 +345,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr association.AccountBalance = dbAssociation._AccountBalance ?? 0; association.DiscountType = (Sbm.DiscountType)(dbAssociation._DiscountType ?? 0); association.DiscountRate = dbAssociation._DiscountRate ?? 0; - association.PriceSetId = new SysId(dbAssociation._PriceSetId ?? 0); - association.TaxCodeId = new SysId(dbAssociation._TaxCodeId ?? 0); + association.PriceSetId = new SysId(dbAssociation._PriceSetId); + association.TaxCodeId = new SysId(dbAssociation._TaxCodeId); association.PaymentTerms = dbAssociation._PaymentTerms ?? 0; association.InvoiceDesc = dbAssociation._InvoiceDesc; if (dbAssociation._Terminated > 0) @@ -355,8 +355,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr // Common properties. association.Notes = dbAssociation._Notes; association.Status = SacsSystem.GetStatusForCode(dbAssociation._Status); - association.SetCreateStamp(dbAssociation._CreateOn, new SysId(dbAssociation._CreateBy ?? 0), dbAssociation._CreateHost); - association.SetUpdateStamp(dbAssociation._UpdateOn ?? default(DateTime), new SysId(dbAssociation._UpdateBy ?? 0), dbAssociation._UpdateHost); + association.SetCreateStamp(dbAssociation._CreateOn, new SysId(dbAssociation._CreateBy), dbAssociation._CreateHost); + association.SetUpdateStamp(dbAssociation._UpdateOn, new SysId(dbAssociation._UpdateBy), dbAssociation._UpdateHost); association.AcceptChanges(); } //------------------------------------------------------------------- diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SysParam.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SysParam.cs index 010aec8..90d65c1 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SysParam.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SysParam.cs @@ -225,14 +225,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr sysparam.Category = (Sbm.SysParamCategory)dbSysParam._Cat; sysparam.Name = dbSysParam._Name; sysparam.Value = dbSysParam._Value; - sysparam.AffiliateIdOwner = new SysId(dbSysParam._AffIdOwner ?? 0); - sysparam.AffiliateIdTarget = new SysId(dbSysParam._AffIdTarget ?? 0); - sysparam.AssociationId = new SysId(dbSysParam._AssocId ?? 0); + sysparam.AffiliateIdOwner = new SysId(dbSysParam._AffIdOwner); + sysparam.AffiliateIdTarget = new SysId(dbSysParam._AffIdTarget); + sysparam.AssociationId = new SysId(dbSysParam._AssocId); // Common properties. //sysparam.Notes = dbSysParam._Notes; sysparam.Status = SacsSystem.GetStatusForCode(dbSysParam._Status); - sysparam.SetCreateStamp(dbSysParam._CreateOn ?? default(DateTime), new SysId(dbSysParam._CreateBy ?? 0), dbSysParam._CreateHost); - sysparam.SetUpdateStamp(dbSysParam._UpdateOn ?? default(DateTime), new SysId(dbSysParam._UpdateBy ?? 0), dbSysParam._UpdateHost); + sysparam.SetCreateStamp(dbSysParam._CreateOn, new SysId(dbSysParam._CreateBy), dbSysParam._CreateHost); + sysparam.SetUpdateStamp(dbSysParam._UpdateOn, new SysId(dbSysParam._UpdateBy), dbSysParam._UpdateHost); sysparam.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SystemAccount.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SystemAccount.cs index 63e7579..2ad57db 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SystemAccount.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SystemAccount.cs @@ -256,8 +256,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr // Common properties. systemAccount.Notes = dbSystemAccount._Notes; systemAccount.Status = SacsSystem.GetStatusForCode(dbSystemAccount._Status); - systemAccount.SetCreateStamp(dbSystemAccount._CreateOn ?? default(DateTime), new SysId(dbSystemAccount._CreateBy ?? 0), dbSystemAccount._CreateHost); - systemAccount.SetUpdateStamp(dbSystemAccount._UpdateOn ?? default(DateTime), new SysId(dbSystemAccount._UpdateBy ?? 0), dbSystemAccount._UpdateHost); + systemAccount.SetCreateStamp(dbSystemAccount._CreateOn, new SysId(dbSystemAccount._CreateBy), dbSystemAccount._CreateHost); + systemAccount.SetUpdateStamp(dbSystemAccount._UpdateOn, new SysId(dbSystemAccount._UpdateBy), dbSystemAccount._UpdateHost); systemAccount.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SystemAccountUser.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SystemAccountUser.cs index 547409b..4e19957 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SystemAccountUser.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SystemAccountUser.cs @@ -217,8 +217,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr // Common properties. systemAccountUser.Notes = dbSystemAccountUser._Notes; systemAccountUser.Status = SacsSystem.GetStatusForCode(dbSystemAccountUser._Status); - systemAccountUser.SetCreateStamp(dbSystemAccountUser._CreateOn ?? default(DateTime), new SysId(dbSystemAccountUser._CreateBy ?? 0), dbSystemAccountUser._CreateHost); - systemAccountUser.SetUpdateStamp(dbSystemAccountUser._UpdateOn ?? default(DateTime), new SysId(dbSystemAccountUser._UpdateBy ?? 0), dbSystemAccountUser._UpdateHost); + systemAccountUser.SetCreateStamp(dbSystemAccountUser._CreateOn, new SysId(dbSystemAccountUser._CreateBy), dbSystemAccountUser._CreateHost); + systemAccountUser.SetUpdateStamp(dbSystemAccountUser._UpdateOn, new SysId(dbSystemAccountUser._UpdateBy), dbSystemAccountUser._UpdateHost); systemAccountUser.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SystemUser.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SystemUser.cs index aa4788a..b972691 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SystemUser.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAccountMgr_Dbas-SystemUser.cs @@ -45,7 +45,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr private SbmSystemUser_Dbas CreateSystemUser(SystemUser_Db dbSystemUser) { ClearErrorState(); - SbmSystemUser_Dbas systemUser = new SbmSystemUser_Dbas(new SysId(dbSystemUser._Id), new SysId(dbSystemUser._AffIdOwner), new SysId(dbSystemUser._InterfaceId ?? 0), new SysId(dbSystemUser._AffiliateId ?? 0), (ushort)dbSystemUser._Flags); + SbmSystemUser_Dbas systemUser = new SbmSystemUser_Dbas(new SysId(dbSystemUser._Id), new SysId(dbSystemUser._AffIdOwner), new SysId(dbSystemUser._InterfaceId), new SysId(dbSystemUser._AffiliateId), (ushort)dbSystemUser._Flags); PopulateFrom(dbSystemUser, systemUser); return systemUser; } @@ -225,15 +225,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr { systemUser.Id = new SysId(dbSystemUser._Id); systemUser.AffiliateIdOwner = new SysId(dbSystemUser._AffIdOwner); - systemUser.InterfaceId = new SysId(dbSystemUser._InterfaceId ?? 0); - systemUser.AffiliateId = new SysId(dbSystemUser._AffiliateId ?? 0); + systemUser.InterfaceId = new SysId(dbSystemUser._InterfaceId); + systemUser.AffiliateId = new SysId(dbSystemUser._AffiliateId); systemUser.Code = dbSystemUser._Code; systemUser.AuthCodeEnc = dbSystemUser._AuthCodeEnc; // Common properties. systemUser.Notes = dbSystemUser._Notes; systemUser.Status = SacsSystem.GetStatusForCode(dbSystemUser._Status); - systemUser.SetCreateStamp(dbSystemUser._CreateOn ?? default(DateTime), new SysId(dbSystemUser._CreateBy ?? 0), dbSystemUser._CreateHost); - systemUser.SetUpdateStamp(dbSystemUser._UpdateOn ?? default(DateTime), new SysId(dbSystemUser._UpdateBy ?? 0), dbSystemUser._UpdateHost); + systemUser.SetCreateStamp(dbSystemUser._CreateOn, new SysId(dbSystemUser._CreateBy), dbSystemUser._CreateHost); + systemUser.SetUpdateStamp(dbSystemUser._UpdateOn, new SysId(dbSystemUser._UpdateBy), dbSystemUser._UpdateHost); systemUser.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-Asset.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-Asset.cs index 2d615fc..06d440e 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-Asset.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-Asset.cs @@ -7,7 +7,6 @@ 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.Interfaces; using Sarand.Net.Standard.Base.Utils; using Sarand.Net.Standard.Dbas.Data; using System; @@ -264,7 +263,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr private SbmAsset_Dbas CreateAsset(SaAsset_Db dbAsset) { ClearErrorState(); - SbmAsset_Dbas asset = new SbmAsset_Dbas(new SysId(dbAsset._Id), new SysId(dbAsset._AssetCategoryId ?? 0), (ushort)dbAsset._Flags); + SbmAsset_Dbas asset = new SbmAsset_Dbas(new SysId(dbAsset._Id), new SysId(dbAsset._AssetCategoryId), (ushort)dbAsset._Flags); PopulateFrom(dbAsset, asset); return asset; } @@ -434,26 +433,26 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr } private void PopulateFrom(SaAsset_Db dbAsset, SbmAsset asset) { - asset.AssetCategoryId = new SysId(dbAsset._AssetCategoryId ?? 0); + asset.AssetCategoryId = new SysId(dbAsset._AssetCategoryId); asset.SerialNumber = dbAsset._SerialNumber; asset.RefExt = dbAsset._RefExt; asset.DescBrief = dbAsset._DescBrief; - asset.ItemId = new ItemId(dbAsset._ItemType ?? 0, new SysId(dbAsset._ItemId ?? 0)); + asset.ItemId = new ItemId(dbAsset._ItemType, new SysId(dbAsset._ItemId)); asset.PurchaseOn = dbAsset._PurchaseOn ?? default(DateTime); - asset.AssocIdSupplier = new SysId(dbAsset._AssocIdSupplier ?? 0); + asset.AssocIdSupplier = new SysId(dbAsset._AssocIdSupplier); asset.PurchaseInvoiceRef = dbAsset._PurchaseInvoiceRef; asset.PaymentTerms = dbAsset._PaymentTerms ?? 0; asset.AmountPurchase = dbAsset._AmountPurchase ?? 0.0m; - asset.TaxCodeIdPurchase = new SysId(dbAsset._TaxCodeIdPurchase ?? 0); + asset.TaxCodeIdPurchase = new SysId(dbAsset._TaxCodeIdPurchase); asset.AmountPurchaseGross = dbAsset._AmountPurchaseGross ?? 0.0m; asset.AmountSettlementGross = dbAsset._AmountSettlementGross ?? 0.0m; asset.AmountEnhancementGross = dbAsset._AmountEnhancementGross ?? 0.0m; - asset.AssocIdCustomer = new SysId(dbAsset._AssocIdCustomer ?? 0); + asset.AssocIdCustomer = new SysId(dbAsset._AssocIdCustomer); asset.SellCategoryCode = dbAsset._SellCategoryCode; asset.AmountSell = dbAsset._AmountSell ?? 0.0m; - asset.TaxCodeIdSell = new SysId(dbAsset._TaxCodeIdSell ?? 0); + asset.TaxCodeIdSell = new SysId(dbAsset._TaxCodeIdSell); asset.AmountSellGross = dbAsset._AmountSellGross ?? 0.0m; - asset.TaxCodeIdProfit = new SysId(dbAsset._TaxCodeIdProfit ?? 0); + asset.TaxCodeIdProfit = new SysId(dbAsset._TaxCodeIdProfit); asset.SoldOn = dbAsset._SoldOn ?? default(DateTime); asset.AmountSold = dbAsset._AmountSold ?? 0.0m; asset.AmountSoldGross = dbAsset._AmountSoldGross ?? 0.0m; @@ -461,17 +460,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr asset.DisposeOn = dbAsset._DisposeOn ?? default(DateTime); asset.DueBackOn = dbAsset._DueBackOn ?? default(DateTime); asset.AmountRentalCost = dbAsset._AmountRentalCost ?? 0.0m; - asset.UomIdRentalCost = new SysId(dbAsset._UomIdRentalCost ?? 0); - asset.TaxCodeIdRentalCost = new SysId(dbAsset._TaxCodeIdRentalCost ?? 0); + asset.UomIdRentalCost = new SysId(dbAsset._UomIdRentalCost); + asset.TaxCodeIdRentalCost = new SysId(dbAsset._TaxCodeIdRentalCost); asset.AmountRentalPrice = dbAsset._AmountRentalPrice ?? 0.0m; - asset.UomIdRentalPrice = new SysId(dbAsset._UomIdRentalPrice ?? 0); - asset.TaxCodeIdRentalPrice = new SysId(dbAsset._TaxCodeIdRentalPrice ?? 0); - asset.ProcessIdNext = new SysId(dbAsset._ProcessIdNext ?? 0); + asset.UomIdRentalPrice = new SysId(dbAsset._UomIdRentalPrice); + asset.TaxCodeIdRentalPrice = new SysId(dbAsset._TaxCodeIdRentalPrice); + asset.ProcessIdNext = new SysId(dbAsset._ProcessIdNext); // Common properties. asset.Notes = dbAsset._Notes; asset.Status = SacsSystem.GetStatusForCode(dbAsset._Status); - asset.SetCreateStamp(dbAsset._CreateOn ?? default(DateTime), new SysId(dbAsset._CreateBy ?? 0), dbAsset._CreateHost); - asset.SetUpdateStamp(dbAsset._UpdateOn ?? default(DateTime), new SysId(dbAsset._UpdateBy ?? 0), dbAsset._UpdateHost); + asset.SetCreateStamp(dbAsset._CreateOn, new SysId(dbAsset._CreateBy), dbAsset._CreateHost); + asset.SetUpdateStamp(dbAsset._UpdateOn, new SysId(dbAsset._UpdateBy), dbAsset._UpdateHost); asset.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-AssetCategory.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-AssetCategory.cs index 1034a4c..59adfa7 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-AssetCategory.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-AssetCategory.cs @@ -7,7 +7,6 @@ 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.Interfaces; using Sarand.Net.Standard.Base.Utils; using Sarand.Net.Standard.Dbas.Data; using System; @@ -349,22 +348,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr assetCategory.Code = dbAssetCategory._Code; assetCategory.DescBrief = dbAssetCategory._DescBrief; assetCategory.IncomeType = (Sbm.AssetIncomeType)(dbAssetCategory._IncomeType ?? 0); - assetCategory.AssocIdSupplier = new SysId(dbAssetCategory._AssocIdSupplier ?? 0); + assetCategory.AssocIdSupplier = new SysId(dbAssetCategory._AssocIdSupplier); assetCategory.PaymentTerms = dbAssetCategory._PaymentTerms ?? 0; - assetCategory.TaxCodeIdPurchase = new SysId(dbAssetCategory._TaxCodeIdPurchase ?? 0); - assetCategory.AssocIdCustomer = new SysId(dbAssetCategory._AssocIdCustomer ?? 0); - assetCategory.TaxCodeIdSell = new SysId(dbAssetCategory._TaxCodeIdSell ?? 0); - assetCategory.TaxCodeIdProfit = new SysId(dbAssetCategory._TaxCodeIdProfit ?? 0); + assetCategory.TaxCodeIdPurchase = new SysId(dbAssetCategory._TaxCodeIdPurchase); + assetCategory.AssocIdCustomer = new SysId(dbAssetCategory._AssocIdCustomer); + assetCategory.TaxCodeIdSell = new SysId(dbAssetCategory._TaxCodeIdSell); + assetCategory.TaxCodeIdProfit = new SysId(dbAssetCategory._TaxCodeIdProfit); assetCategory.DisposeCode = dbAssetCategory._DisposeCode; - assetCategory.UomIdRentalCost = new SysId(dbAssetCategory._UomIdRentalCost ?? 0); - assetCategory.TaxCodeIdRentalCost = new SysId(dbAssetCategory._TaxCodeIdRentalCost ?? 0); - assetCategory.UomIdRentalPrice = new SysId(dbAssetCategory._UomIdRentalPrice ?? 0); - assetCategory.TaxCodeIdRentalPrice = new SysId(dbAssetCategory._TaxCodeIdRentalPrice ?? 0); + assetCategory.UomIdRentalCost = new SysId(dbAssetCategory._UomIdRentalCost); + assetCategory.TaxCodeIdRentalCost = new SysId(dbAssetCategory._TaxCodeIdRentalCost); + assetCategory.UomIdRentalPrice = new SysId(dbAssetCategory._UomIdRentalPrice); + assetCategory.TaxCodeIdRentalPrice = new SysId(dbAssetCategory._TaxCodeIdRentalPrice); // Common properties. assetCategory.Notes = dbAssetCategory._Notes; assetCategory.Status = SacsSystem.GetStatusForCode(dbAssetCategory._Status); - assetCategory.SetCreateStamp(dbAssetCategory._CreateOn ?? default(DateTime), new SysId(dbAssetCategory._CreateBy ?? 0), dbAssetCategory._CreateHost); - assetCategory.SetUpdateStamp(dbAssetCategory._UpdateOn ?? default(DateTime), new SysId(dbAssetCategory._UpdateBy ?? 0), dbAssetCategory._UpdateHost); + assetCategory.SetCreateStamp(dbAssetCategory._CreateOn, new SysId(dbAssetCategory._CreateBy), dbAssetCategory._CreateHost); + assetCategory.SetUpdateStamp(dbAssetCategory._UpdateOn, new SysId(dbAssetCategory._UpdateBy), dbAssetCategory._UpdateHost); assetCategory.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-AssetProcess.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-AssetProcess.cs index fbacf1b..9c32005 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-AssetProcess.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-AssetProcess.cs @@ -87,7 +87,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr private SbmAssetProcess_Dbas CreateAssetProcess(SaAssetProcess_Db dbAssetProcess) { ClearErrorState(); - SbmAssetProcess_Dbas assetProcess = new SbmAssetProcess_Dbas(new SysId(dbAssetProcess._Id), new SysId(dbAssetProcess._AssetId ?? 0), new SysId(dbAssetProcess._ProcessId ?? 0), (ushort)dbAssetProcess._Flags); + SbmAssetProcess_Dbas assetProcess = new SbmAssetProcess_Dbas(new SysId(dbAssetProcess._Id), new SysId(dbAssetProcess._AssetId), new SysId(dbAssetProcess._ProcessId), (ushort)dbAssetProcess._Flags); PopulateFrom(dbAssetProcess, assetProcess); return assetProcess; } @@ -230,17 +230,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr private void PopulateFrom(SaAssetProcess_Db dbAssetProcess, SbmAssetProcess assetProcess) { //assetProcess.Id = new SysId(dbAssetProcess._Id); - assetProcess.AssetId = new SysId(dbAssetProcess._AssetId ?? 0); + assetProcess.AssetId = new SysId(dbAssetProcess._AssetId); assetProcess.Seq = dbAssetProcess._Seq.ToString(); - assetProcess.ProcessId = new SysId(dbAssetProcess._ProcessId ?? 0); + assetProcess.ProcessId = new SysId(dbAssetProcess._ProcessId); assetProcess.RequiredOn = dbAssetProcess._RequiredOn ?? default(DateTime); assetProcess.ExpectedOn = dbAssetProcess._ExpectedOn ?? default(DateTime); assetProcess.ProcessedOn = dbAssetProcess._ProcessedOn ?? default(DateTime); // Common properties. assetProcess.Notes = dbAssetProcess._Notes; assetProcess.Status = SacsSystem.GetStatusForCode(dbAssetProcess._Status); - assetProcess.SetCreateStamp(dbAssetProcess._CreateOn ?? default(DateTime), new SysId(dbAssetProcess._CreateBy ?? 0), dbAssetProcess._CreateHost); - assetProcess.SetUpdateStamp(dbAssetProcess._UpdateOn ?? default(DateTime), new SysId(dbAssetProcess._UpdateBy ?? 0), dbAssetProcess._UpdateHost); + assetProcess.SetCreateStamp(dbAssetProcess._CreateOn, new SysId(dbAssetProcess._CreateBy), dbAssetProcess._CreateHost); + assetProcess.SetUpdateStamp(dbAssetProcess._UpdateOn, new SysId(dbAssetProcess._UpdateBy), dbAssetProcess._UpdateHost); assetProcess.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-Vehicle.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-Vehicle.cs index 77507b8..8066794 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-Vehicle.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-Vehicle.cs @@ -7,7 +7,6 @@ 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.Interfaces; using Sarand.Net.Standard.Base.ItemData; using Sarand.Net.Standard.Base.Utils; using Sarand.Net.Standard.Dbas.Data; @@ -429,7 +428,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr private void PopulateFrom(SaVehicle_Db dbVehicle, SbmVehicle vehicle) { //vehicle.Id = new SysId(dbVehicle._Id); - vehicle.VehicleClassId = new SysId(dbVehicle._VehicleClassId ?? 0); + vehicle.VehicleClassId = new SysId(dbVehicle._VehicleClassId); vehicle.RegNumber = dbVehicle._RegNumber; vehicle.Vin = dbVehicle._VIN; vehicle.CapCode = dbVehicle._CapCode; @@ -459,8 +458,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr // Common properties. vehicle.Notes = dbVehicle._Notes; vehicle.Status = SacsSystem.GetStatusForCode(dbVehicle._Status); - vehicle.SetCreateStamp(dbVehicle._CreateOn ?? default(DateTime), new SysId(dbVehicle._CreateBy ?? 0), dbVehicle._CreateHost); - vehicle.SetUpdateStamp(dbVehicle._UpdateOn ?? default(DateTime), new SysId(dbVehicle._UpdateBy ?? 0), dbVehicle._UpdateHost); + vehicle.SetCreateStamp(dbVehicle._CreateOn, new SysId(dbVehicle._CreateBy), dbVehicle._CreateHost); + vehicle.SetUpdateStamp(dbVehicle._UpdateOn, new SysId(dbVehicle._UpdateBy), dbVehicle._UpdateHost); vehicle.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-VehicleClass.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-VehicleClass.cs index a389517..c14c908 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-VehicleClass.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-VehicleClass.cs @@ -8,7 +8,6 @@ using Sarand.Net.Standard.Base.Bus; using Sarand.Net.Standard.Base.CodeTypes; using Sarand.Net.Standard.Base.Core; using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Interfaces; using Sarand.Net.Standard.Base.Utils; using Sarand.Net.Standard.Dbas.Data; using System; @@ -409,14 +408,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr vehicleClass.ServiceOdo = dbVehicleClass._ServiceOdo ?? 0; vehicleClass.ServiceWeeks = dbVehicleClass._ServiceWeeks ?? 0; vehicleClass.AmountRentalCost = dbVehicleClass._AmountRentalCost ?? 0; - vehicleClass.UomIdRentalCost = new SysId(dbVehicleClass._UomIdRentalCost ?? 0); + vehicleClass.UomIdRentalCost = new SysId(dbVehicleClass._UomIdRentalCost); vehicleClass.AmountRentalPrice = dbVehicleClass._AmountRentalPrice ?? 0; - vehicleClass.UomIdRentalPrice = new SysId(dbVehicleClass._UomIdRentalPrice ?? 0); + vehicleClass.UomIdRentalPrice = new SysId(dbVehicleClass._UomIdRentalPrice); // Common properties. vehicleClass.Notes = dbVehicleClass._Notes; vehicleClass.Status = SacsSystem.GetStatusForCode(dbVehicleClass._Status); - vehicleClass.SetCreateStamp(dbVehicleClass._CreateOn ?? default(DateTime), new SysId(dbVehicleClass._CreateBy ?? 0), dbVehicleClass._CreateHost); - vehicleClass.SetUpdateStamp(dbVehicleClass._UpdateOn ?? default(DateTime), new SysId(dbVehicleClass._UpdateBy ?? 0), dbVehicleClass._UpdateHost); + vehicleClass.SetCreateStamp(dbVehicleClass._CreateOn, new SysId(dbVehicleClass._CreateBy), dbVehicleClass._CreateHost); + vehicleClass.SetUpdateStamp(dbVehicleClass._UpdateOn, new SysId(dbVehicleClass._UpdateBy), dbVehicleClass._UpdateHost); vehicleClass.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-VehicleEvent.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-VehicleEvent.cs index 02da0fd..d2ba998 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-VehicleEvent.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-VehicleEvent.cs @@ -87,7 +87,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr private SbmVehicleEvent_Dbas CreateVehicleEvent(SaVehicleEvent_Db dbVehicleEvent) { ClearErrorState(); - SbmVehicleEvent_Dbas vehicleEvent = new SbmVehicleEvent_Dbas(new SysId(dbVehicleEvent._VehicleId ?? 0), (Sbm.VehicleEventType)dbVehicleEvent._EventType, (ushort)dbVehicleEvent._Flags); + SbmVehicleEvent_Dbas vehicleEvent = new SbmVehicleEvent_Dbas(new SysId(dbVehicleEvent._VehicleId), (Sbm.VehicleEventType)dbVehicleEvent._EventType, (ushort)dbVehicleEvent._Flags); PopulateFrom(dbVehicleEvent, vehicleEvent); return vehicleEvent; } @@ -236,7 +236,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr private void PopulateFrom(SaVehicleEvent_Db dbVehicleEvent, SbmVehicleEvent vehicleEvent) { //vehicleEvent.Id = new SysId(dbVehicleEvent._Id); - vehicleEvent.VehicleId = new SysId(dbVehicleEvent._VehicleId ?? 0); + vehicleEvent.VehicleId = new SysId(dbVehicleEvent._VehicleId); vehicleEvent.VehicleEventType = (Sbm.VehicleEventType)(dbVehicleEvent._EventType ?? 0); vehicleEvent.StartOn = dbVehicleEvent._StartOn ?? default(DateTime); vehicleEvent.FinishOn = dbVehicleEvent._FinishOn ?? default(DateTime); @@ -244,15 +244,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr vehicleEvent.DescBrief = dbVehicleEvent._DescBrief; vehicleEvent.DescDetail = dbVehicleEvent._DescDetail; vehicleEvent.AmountNet = dbVehicleEvent._AmountNet ?? 0.0m; - vehicleEvent.TaxCodeId = new SysId(dbVehicleEvent._TaxCodeId ?? 0); + vehicleEvent.TaxCodeId = new SysId(dbVehicleEvent._TaxCodeId); vehicleEvent.TaxRate = dbVehicleEvent._TaxRate ?? 0.0m; vehicleEvent.AmountTax = dbVehicleEvent._AmountTax ?? 0.0m; vehicleEvent.AmountTot = dbVehicleEvent._AmountTot ?? 0.0m; // Common properties. vehicleEvent.Notes = dbVehicleEvent._Notes; vehicleEvent.Status = SacsSystem.GetStatusForCode(dbVehicleEvent._Status); - vehicleEvent.SetCreateStamp(dbVehicleEvent._CreateOn ?? default(DateTime), new SysId(dbVehicleEvent._CreateBy ?? 0), dbVehicleEvent._CreateHost); - vehicleEvent.SetUpdateStamp(dbVehicleEvent._UpdateOn ?? default(DateTime), new SysId(dbVehicleEvent._UpdateBy ?? 0), dbVehicleEvent._UpdateHost); + vehicleEvent.SetCreateStamp(dbVehicleEvent._CreateOn, new SysId(dbVehicleEvent._CreateBy), dbVehicleEvent._CreateHost); + vehicleEvent.SetUpdateStamp(dbVehicleEvent._UpdateOn, new SysId(dbVehicleEvent._UpdateBy), dbVehicleEvent._UpdateHost); vehicleEvent.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-VehicleFeature.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-VehicleFeature.cs index d4edc6b..6ca0e15 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-VehicleFeature.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmAssetMgr_Dbas-VehicleFeature.cs @@ -327,8 +327,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr // Common properties. vehicleFeature.Notes = dbVehicleFeature._Notes; vehicleFeature.Status = SacsSystem.GetStatusForCode(dbVehicleFeature._Status); - vehicleFeature.SetCreateStamp(dbVehicleFeature._CreateOn ?? default(DateTime), new SysId(dbVehicleFeature._CreateBy ?? 0), dbVehicleFeature._CreateHost); - vehicleFeature.SetUpdateStamp(dbVehicleFeature._UpdateOn ?? default(DateTime), new SysId(dbVehicleFeature._UpdateBy ?? 0), dbVehicleFeature._UpdateHost); + vehicleFeature.SetCreateStamp(dbVehicleFeature._CreateOn, new SysId(dbVehicleFeature._CreateBy), dbVehicleFeature._CreateHost); + vehicleFeature.SetUpdateStamp(dbVehicleFeature._UpdateOn, new SysId(dbVehicleFeature._UpdateBy), dbVehicleFeature._UpdateHost); vehicleFeature.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-Commodity.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-Commodity.cs index d3cc919..27b2682 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-Commodity.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-Commodity.cs @@ -1,6 +1,5 @@ using Sarand.BusinessMgr.Net.Standard.Base.App; using Sarand.BusinessMgr.Net.Standard.Base.Bus; -using Sarand.BusinessMgr.Net.Standard.Base.Mgr; using Sarand.BusinessMgr.Net.Standard.Dbas.Bus; using Sarand.BusinessMgr.Net.Standard.Dbas.Internal; using Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog; @@ -836,7 +835,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr commodity.DescDetail = dbCommodity._DescDetail; commodity.DrawingNumber = dbCommodity._DrawingNo; commodity.DrawingIssue = dbCommodity._DrawingIssue; - commodity.AssetCatId = new SysId(dbCommodity._AssetCatId ?? 0); + commodity.AssetCatId = new SysId(dbCommodity._AssetCatId); commodity.ImagePath = dbCommodity._ImagePath; commodity.Category1 = dbCommodity._Category; commodity.Category2 = dbCommodity._Category2; @@ -845,15 +844,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr commodity.Department = dbCommodity._Department; commodity.CatalogRef = dbCommodity._CatalogRef; commodity.Weight = dbCommodity._Weight ?? 0.0m; - commodity.UomIdWeight = new SysId(dbCommodity._UomIdWeight ?? 0); + commodity.UomIdWeight = new SysId(dbCommodity._UomIdWeight); commodity.Length = dbCommodity._Length ?? 0.0m; - commodity.UomIdLength = new SysId(dbCommodity._UomIdLength ?? 0); + commodity.UomIdLength = new SysId(dbCommodity._UomIdLength); commodity.Volume = dbCommodity._Volume ?? 0.0m; - commodity.UomIdVolume = new SysId(dbCommodity._UomIdVolume ?? 0); + commodity.UomIdVolume = new SysId(dbCommodity._UomIdVolume); commodity.Density = dbCommodity._Density ?? 0; - commodity.UomIdDensity = new SysId(dbCommodity._UomIdDensity ?? 0); + commodity.UomIdDensity = new SysId(dbCommodity._UomIdDensity); commodity.BoxQuantity = dbCommodity._BoxQuantity ?? 0; - commodity.UomIdBox = new SysId(dbCommodity._UomIdBox ?? 0); + commodity.UomIdBox = new SysId(dbCommodity._UomIdBox); commodity.Dimensions = dbCommodity._Dimensions; commodity.SpecSummary = dbCommodity._SpecSummary; commodity.RangeCode = dbCommodity._RangeCode; @@ -869,27 +868,27 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr commodity.NominalCodePurchase = dbCommodity._NominalCodePurchase; commodity.ICNTariffCode = dbCommodity._ICNTariffCode; commodity.TimeProd = dbCommodity._TimeProd ?? 0.0m; - commodity.UomIdTimeProd = new SysId(dbCommodity._UomIdTimeProd ?? 0); - commodity.AssociationIdSupplier = new SysId(dbCommodity._AssIdSupplier ?? 0); + commodity.UomIdTimeProd = new SysId(dbCommodity._UomIdTimeProd); + commodity.AssociationIdSupplier = new SysId(dbCommodity._AssIdSupplier); commodity.SupplierRef = dbCommodity._SupplierRef; commodity.CostPrice = dbCommodity._CostPrice ?? 0.0m; commodity.PlaceOfOrigin = dbCommodity._PlaceOfOrigin; commodity.MaterialCost = dbCommodity._MaterialCost ?? 0.0m; - commodity.CurrencyIdMaterial = new SysId(dbCommodity._CurrencyIdMaterial ?? 0); + commodity.CurrencyIdMaterial = new SysId(dbCommodity._CurrencyIdMaterial); commodity.ExWorksCost = dbCommodity._ExWorksCost ?? 0.0m; - commodity.CurrencyIdExWorks = new SysId(dbCommodity._CurrencyIdExWorks ?? 0); + commodity.CurrencyIdExWorks = new SysId(dbCommodity._CurrencyIdExWorks); commodity.ReorderLevel = dbCommodity._ReorderLevel ?? 0.0m; commodity.ReorderQty = dbCommodity._ReorderQty ?? 0.0m; commodity.QtyOnOrder = dbCommodity._QtyOnOrder ?? 0.0m; - commodity.AssociationIdCustomer = new SysId(dbCommodity._AssIdCustomer ?? 0); + commodity.AssociationIdCustomer = new SysId(dbCommodity._AssIdCustomer); commodity.SalesPrice = dbCommodity._SalesPrice ?? 0.0m; commodity.RetailPrice = dbCommodity._RetailPrice ?? 0.0m; commodity.RetailPricePlanned = dbCommodity._RetailPricePlanned ?? 0.0m; - commodity.UomIdSale = new SysId(dbCommodity._UomIdSale ?? 0); + commodity.UomIdSale = new SysId(dbCommodity._UomIdSale); commodity.CarriageCostIndicative = dbCommodity._CarriageCostIndicative ?? 0.0m; commodity.MinOrderQty = dbCommodity._MinOrderQty ?? 0.0m; commodity.PackQtySale = dbCommodity._PackQty ?? 0.0m; - commodity.TaxCodeId = new SysId(dbCommodity._TaxCodeId ?? 0); + commodity.TaxCodeId = new SysId(dbCommodity._TaxCodeId); commodity.LastOrderDate = dbCommodity._LastOrderDate ?? default(DateTime); commodity.LastOrderQty = dbCommodity._LastOrderQty ?? 0.0m; commodity.QtyInStock = dbCommodity._QtyInStock ?? 0.0m; @@ -897,7 +896,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr commodity.FreeStock = dbCommodity._FreeStock ?? 0.0m; commodity.StockTakeDate = dbCommodity._StockTakeDate ?? default(DateTime); commodity.StockTakeQty = dbCommodity._StockTakeQty ?? 0.0m; - commodity.CommodityIdSalesProj = new SysId(dbCommodity._CommodityIdSalesProj ?? 0); + commodity.CommodityIdSalesProj = new SysId(dbCommodity._CommodityIdSalesProj); commodity.SalesProjAnnual = dbCommodity._SalesProjAnnual ?? 0.0m; commodity.SalesProjMonth01 = dbCommodity._SalesProjMonth01 ?? 0.0m; commodity.SalesProjMonth02 = dbCommodity._SalesProjMonth02 ?? 0.0m; @@ -914,8 +913,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr // Common properties. commodity.Notes = dbCommodity._Notes; commodity.Status = SacsSystem.GetStatusForCode(dbCommodity._Status); - commodity.SetCreateStamp(dbCommodity._CreateOn, new SysId(dbCommodity._CreateBy ?? 0), dbCommodity._CreateHost); - commodity.SetUpdateStamp(dbCommodity._UpdateOn ?? default(DateTime), new SysId(dbCommodity._UpdateBy ?? 0), dbCommodity._UpdateHost); + commodity.SetCreateStamp(dbCommodity._CreateOn, new SysId(dbCommodity._CreateBy), dbCommodity._CreateHost); + commodity.SetUpdateStamp(dbCommodity._UpdateOn, new SysId(dbCommodity._UpdateBy), dbCommodity._UpdateHost); commodity.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-CommodityCustomer.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-CommodityCustomer.cs index a380e39..a2f9372 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-CommodityCustomer.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-CommodityCustomer.cs @@ -338,8 +338,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr // Common properties. commodityCustomer.Notes = dbCommodityCustomer._Notes; commodityCustomer.Status = SacsSystem.GetStatusForCode(dbCommodityCustomer._Status); - commodityCustomer.SetCreateStamp(dbCommodityCustomer._CreateOn, new SysId(dbCommodityCustomer._CreateBy ?? 0), dbCommodityCustomer._CreateHost); - commodityCustomer.SetUpdateStamp(dbCommodityCustomer._UpdateOn ?? default(DateTime), new SysId(dbCommodityCustomer._UpdateBy ?? 0), dbCommodityCustomer._UpdateHost); + commodityCustomer.SetCreateStamp(dbCommodityCustomer._CreateOn, new SysId(dbCommodityCustomer._CreateBy), dbCommodityCustomer._CreateHost); + commodityCustomer.SetUpdateStamp(dbCommodityCustomer._UpdateOn, new SysId(dbCommodityCustomer._UpdateBy), dbCommodityCustomer._UpdateHost); commodityCustomer.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-CommoditySupplier.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-CommoditySupplier.cs index e2c0149..101a031 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-CommoditySupplier.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-CommoditySupplier.cs @@ -245,12 +245,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr commoditySupplier.AssocIdSupplier = new SysId(dbCommoditySupplier._AssocIdSupplier); commoditySupplier.ProductCode = dbCommoditySupplier._ProductCode; commoditySupplier.AmountCost = dbCommoditySupplier._AmountCost ?? 0.0m; - commoditySupplier.CurrencyIdCost = new SysId(dbCommoditySupplier._CurrencyIdCost ?? 0); + commoditySupplier.CurrencyIdCost = new SysId(dbCommoditySupplier._CurrencyIdCost); // Common properties. commoditySupplier.Notes = dbCommoditySupplier._Notes; commoditySupplier.Status = SacsSystem.GetStatusForCode(dbCommoditySupplier._Status); - commoditySupplier.SetCreateStamp(dbCommoditySupplier._CreateOn, new SysId(dbCommoditySupplier._CreateBy ?? 0), dbCommoditySupplier._CreateHost); - commoditySupplier.SetUpdateStamp(dbCommoditySupplier._UpdateOn ?? default(DateTime), new SysId(dbCommoditySupplier._UpdateBy ?? 0), dbCommoditySupplier._UpdateHost); + commoditySupplier.SetCreateStamp(dbCommoditySupplier._CreateOn, new SysId(dbCommoditySupplier._CreateBy), dbCommoditySupplier._CreateHost); + commoditySupplier.SetUpdateStamp(dbCommoditySupplier._UpdateOn, new SysId(dbCommoditySupplier._UpdateBy), dbCommoditySupplier._UpdateHost); commoditySupplier.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-PortfolioItem.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-PortfolioItem.cs index 4e48256..7621578 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-PortfolioItem.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-PortfolioItem.cs @@ -642,12 +642,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr portfolioItem.Caption = dbPortfolioItem._Caption; portfolioItem.DescBrief = dbPortfolioItem._DescBrief; portfolioItem.DescDetail = dbPortfolioItem._DescDetail; - portfolioItem.CommodityId = new SysId(dbPortfolioItem._CommodityId ?? 0); + portfolioItem.CommodityId = new SysId(dbPortfolioItem._CommodityId); // Common properties. portfolioItem.Notes = dbPortfolioItem._Notes; portfolioItem.Status = SacsSystem.GetStatusForCode(dbPortfolioItem._Status); - portfolioItem.SetCreateStamp(dbPortfolioItem._CreateOn ?? default(DateTime), new SysId(dbPortfolioItem._CreateBy ?? 0), dbPortfolioItem._CreateHost); - portfolioItem.SetUpdateStamp(dbPortfolioItem._UpdateOn ?? default(DateTime), new SysId(dbPortfolioItem._UpdateBy ?? 0), dbPortfolioItem._UpdateHost); + portfolioItem.SetCreateStamp(dbPortfolioItem._CreateOn, new SysId(dbPortfolioItem._CreateBy), dbPortfolioItem._CreateHost); + portfolioItem.SetUpdateStamp(dbPortfolioItem._UpdateOn, new SysId(dbPortfolioItem._UpdateBy), dbPortfolioItem._UpdateHost); portfolioItem.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmDataItemMgr_Dbas-ItemLink.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmDataItemMgr_Dbas-ItemLink.cs index 398535c..80b3c5b 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmDataItemMgr_Dbas-ItemLink.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmDataItemMgr_Dbas-ItemLink.cs @@ -351,8 +351,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr // Common properties. itemLink.Notes = dbItemLink._Notes; itemLink.Status = SacsSystem.GetStatusForCode(dbItemLink._Status); - itemLink.SetCreateStamp(dbItemLink._CreateOn ?? default(DateTime), new SysId(dbItemLink._CreateBy ?? 0), dbItemLink._CreateHost); - itemLink.SetUpdateStamp(dbItemLink._UpdateOn ?? default(DateTime), new SysId(dbItemLink._UpdateBy ?? 0), dbItemLink._UpdateHost); + itemLink.SetCreateStamp(dbItemLink._CreateOn, new SysId(dbItemLink._CreateBy), dbItemLink._CreateHost); + itemLink.SetUpdateStamp(dbItemLink._UpdateOn, new SysId(dbItemLink._UpdateBy), dbItemLink._UpdateHost); itemLink.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmPriceMgr_Dbas-Price.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmPriceMgr_Dbas-Price.cs index 949138e..8f41363 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmPriceMgr_Dbas-Price.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmPriceMgr_Dbas-Price.cs @@ -232,8 +232,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr // Common properties. price.Notes = dbPrice._Notes; price.Status = SacsSystem.GetStatusForCode(dbPrice._Status); - price.SetCreateStamp(dbPrice._CreateOn ?? default(DateTime), new SysId(dbPrice._CreateBy ?? 0), dbPrice._CreateHost); - price.SetUpdateStamp(dbPrice._UpdateOn ?? default(DateTime), new SysId(dbPrice._UpdateBy ?? 0), dbPrice._UpdateHost); + price.SetCreateStamp(dbPrice._CreateOn, new SysId(dbPrice._CreateBy), dbPrice._CreateHost); + price.SetUpdateStamp(dbPrice._UpdateOn, new SysId(dbPrice._UpdateBy), dbPrice._UpdateHost); price.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmPriceMgr_Dbas-PriceSet.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmPriceMgr_Dbas-PriceSet.cs index 09cbaa1..d1653bc 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmPriceMgr_Dbas-PriceSet.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmPriceMgr_Dbas-PriceSet.cs @@ -243,12 +243,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr //priceSet.Reference = dbPriceSet._Ref; priceSet.PriceType = (Sbm.PriceType)(dbPriceSet._Type ?? 0); priceSet.Name = dbPriceSet._Name; - priceSet.CurrencyId = new SysId(dbPriceSet._CurrencyId ?? 0); + priceSet.CurrencyId = new SysId(dbPriceSet._CurrencyId); // Common properties. priceSet.Notes = dbPriceSet._Notes; priceSet.Status = SacsSystem.GetStatusForCode(dbPriceSet._Status); - priceSet.SetCreateStamp(dbPriceSet._CreateOn ?? default(DateTime), new SysId(dbPriceSet._CreateBy ?? 0), dbPriceSet._CreateHost); - priceSet.SetUpdateStamp(dbPriceSet._UpdateOn ?? default(DateTime), new SysId(dbPriceSet._UpdateBy ?? 0), dbPriceSet._UpdateHost); + priceSet.SetCreateStamp(dbPriceSet._CreateOn, new SysId(dbPriceSet._CreateBy), dbPriceSet._CreateHost); + priceSet.SetUpdateStamp(dbPriceSet._UpdateOn, new SysId(dbPriceSet._UpdateBy), dbPriceSet._UpdateHost); priceSet.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmProcessMgr_Dbas-Process.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmProcessMgr_Dbas-Process.cs index b8562ed..6895274 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmProcessMgr_Dbas-Process.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmProcessMgr_Dbas-Process.cs @@ -267,7 +267,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr private SbmProcess_Dbas CreateProcess(Process_Db dbProcess) { ClearErrorState(); - SbmProcess_Dbas process = new SbmProcess_Dbas(new SysId(dbProcess._Id), new SysId(dbProcess._AffIdOwner ?? 0), (Sbm.ProcessCategory)dbProcess._Category, (ushort)dbProcess._Flags); + SbmProcess_Dbas process = new SbmProcess_Dbas(new SysId(dbProcess._Id), new SysId(dbProcess._AffIdOwner), (Sbm.ProcessCategory)dbProcess._Category, (ushort)dbProcess._Flags); PopulateFrom(dbProcess, process); return process; } @@ -417,8 +417,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr // Common properties. process.Notes = dbProcess._Notes; process.Status = SacsSystem.GetStatusForCode(dbProcess._Status); - process.SetCreateStamp(dbProcess._CreateOn ?? default(DateTime), new SysId(dbProcess._CreateBy ?? 0), dbProcess._CreateHost); - process.SetUpdateStamp(dbProcess._UpdateOn ?? default(DateTime), new SysId(dbProcess._UpdateBy ?? 0), dbProcess._UpdateHost); + process.SetCreateStamp(dbProcess._CreateOn, new SysId(dbProcess._CreateBy), dbProcess._CreateHost); + process.SetUpdateStamp(dbProcess._UpdateOn, new SysId(dbProcess._UpdateBy), dbProcess._UpdateHost); process.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmTransactionMgr_Dbas-Constituent.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmTransactionMgr_Dbas-Constituent.cs index dbe845b..abe0945 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmTransactionMgr_Dbas-Constituent.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmTransactionMgr_Dbas-Constituent.cs @@ -360,7 +360,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr private SbmConstituent_Dbas CreateConstituent(Constituent_Db dbConstituent) { ClearErrorState(); - SbmConstituent_Dbas constituent = new SbmConstituent_Dbas(new SysId(dbConstituent._Id), new SysId(dbConstituent._AffIdOwner), new SysId(dbConstituent._AssocId ?? 0), (Sbm.ConstituentType)dbConstituent._Type, (ushort)dbConstituent._Flags); + SbmConstituent_Dbas constituent = new SbmConstituent_Dbas(new SysId(dbConstituent._Id), new SysId(dbConstituent._AffIdOwner), new SysId(dbConstituent._AssocId), (Sbm.ConstituentType)dbConstituent._Type, (ushort)dbConstituent._Flags); PopulateFrom(dbConstituent, constituent); return constituent; } @@ -531,14 +531,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr { //constituent.Id = new SysId(dbConstituent._Id); constituent.AffiliateIdOwner = new SysId(dbConstituent._AffIdOwner); - constituent.AffiliateIdTarget = new SysId(dbConstituent._AffIdTarget ?? 0); - constituent.AssociationId = new SysId(dbConstituent._AssocId ?? 0); - constituent.TransactionId = new SysId(dbConstituent._TransId ?? 0); - constituent.RequirementId = new SysId(dbConstituent._ReqntId ?? 0); - constituent.ConstituentId = new SysId(dbConstituent._ConstId ?? 0); - constituent.AssetId = new SysId(dbConstituent._AssetId ?? 0); - constituent.ProcessId = new SysId(dbConstituent._ProcessId ?? 0); - constituent.AssociationIdContractor = new SysId(dbConstituent._AssocIdContractor ?? 0); + constituent.AffiliateIdTarget = new SysId(dbConstituent._AffIdTarget); + constituent.AssociationId = new SysId(dbConstituent._AssocId); + constituent.TransactionId = new SysId(dbConstituent._TransId); + constituent.RequirementId = new SysId(dbConstituent._ReqntId); + constituent.ConstituentId = new SysId(dbConstituent._ConstId); + constituent.AssetId = new SysId(dbConstituent._AssetId); + constituent.ProcessId = new SysId(dbConstituent._ProcessId); + constituent.AssociationIdContractor = new SysId(dbConstituent._AssocIdContractor); constituent.ConstituentType = (Sbm.ConstituentType)(dbConstituent._Type ?? 0); constituent.Seq = dbConstituent._Seq ?? 0; constituent.Effective = dbConstituent._Effective ?? default(DateTime); @@ -553,11 +553,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr constituent.Category = dbConstituent._Category; constituent.Reference = dbConstituent._Reference; constituent.Quantity = dbConstituent._Quantity ?? 0.0m; - constituent.UomId = new SysId(dbConstituent._UomId ?? 0); + constituent.UomId = new SysId(dbConstituent._UomId); constituent.UnitCost = dbConstituent._UnitCost ?? 0.0m; constituent.AmountEst = dbConstituent._AmountEst ?? 0.0m; constituent.AmountNet = dbConstituent._AmountNet ?? 0.0m; - constituent.TaxCodeId = new SysId(dbConstituent._TaxCodeId ?? 0); + constituent.TaxCodeId = new SysId(dbConstituent._TaxCodeId); constituent.TaxRate = dbConstituent._TaxRate ?? 0.0m; constituent.AmountTax = dbConstituent._AmountTax ?? 0.0m; constituent.AmountTot = dbConstituent._AmountTot ?? 0.0m; @@ -566,8 +566,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr // Common properties. constituent.Notes = dbConstituent._Notes; constituent.Status = SacsSystem.GetStatusForCode(dbConstituent._Status); - constituent.SetCreateStamp(dbConstituent._CreateOn ?? default(DateTime), new SysId(dbConstituent._CreateBy ?? 0), dbConstituent._CreateHost); - constituent.SetUpdateStamp(dbConstituent._UpdateOn ?? default(DateTime), new SysId(dbConstituent._UpdateBy ?? 0), dbConstituent._UpdateHost); + constituent.SetCreateStamp(dbConstituent._CreateOn, new SysId(dbConstituent._CreateBy), dbConstituent._CreateHost); + constituent.SetUpdateStamp(dbConstituent._UpdateOn, new SysId(dbConstituent._UpdateBy), dbConstituent._UpdateHost); constituent.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmTransactionMgr_Dbas-Requirement.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmTransactionMgr_Dbas-Requirement.cs index 557f40a..0d47cfb 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmTransactionMgr_Dbas-Requirement.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmTransactionMgr_Dbas-Requirement.cs @@ -1,5 +1,4 @@ -using Org.BouncyCastle.Bcpg; -using Sarand.BusinessMgr.Net.Standard.Base.App; +using Sarand.BusinessMgr.Net.Standard.Base.App; using Sarand.BusinessMgr.Net.Standard.Base.Bus; using Sarand.BusinessMgr.Net.Standard.Dbas.Bus; using Sarand.BusinessMgr.Net.Standard.Dbas.Internal; @@ -17,7 +16,6 @@ using System.Collections.Generic; using System.Data.Common; using System.Linq; using System.Text.RegularExpressions; -using System.Transactions; namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr { @@ -571,7 +569,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr private SbmRequirement_Dbas CreateRequirement(Requirement_Db dbRequirement) { ClearErrorState(); - SbmRequirement_Dbas requirement = new SbmRequirement_Dbas(new SysId(dbRequirement._Id), new SysId(dbRequirement._AffIdOwner), new SysId(dbRequirement._AssocId ?? 0), new SysId(dbRequirement._TransId ?? 0), (Sbm.RequirementType)dbRequirement._Type, (ushort)dbRequirement._Flags); + SbmRequirement_Dbas requirement = new SbmRequirement_Dbas(new SysId(dbRequirement._Id), new SysId(dbRequirement._AffIdOwner), new SysId(dbRequirement._AssocId), new SysId(dbRequirement._TransId), (Sbm.RequirementType)dbRequirement._Type, (ushort)dbRequirement._Flags); PopulateFrom(dbRequirement, requirement); return requirement; } @@ -753,19 +751,19 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr { //requirement.Id = new SysId(dbRequirement._Id); requirement.AffiliateIdOwner = new SysId(dbRequirement._AffIdOwner); - requirement.AssociationId = new SysId(dbRequirement._AssocId ?? 0); - requirement.TransactionId = new SysId(dbRequirement._TransId ?? 0); + requirement.AssociationId = new SysId(dbRequirement._AssocId); + requirement.TransactionId = new SysId(dbRequirement._TransId); requirement.RequirementType = (Sbm.RequirementType)(dbRequirement._Type ?? 0); requirement.Seq = dbRequirement._Seq ?? 0; - requirement.RequirementIdSource = new SysId(dbRequirement._ReqntIdSource ?? 0); + requirement.RequirementIdSource = new SysId(dbRequirement._ReqntIdSource); requirement.Required = dbRequirement._Required ?? default(DateTime); requirement.Started = dbRequirement._Started ?? default(DateTime); requirement.Completed = dbRequirement._Completed ?? default(DateTime); requirement.JobNumber = dbRequirement._JobNumber; - requirement.AssociationIdSubContract = new SysId(dbRequirement._AssIdSubcontract ?? 0); - requirement.CommodityId = new SysId(dbRequirement._CommodityId ?? 0); + requirement.AssociationIdSubContract = new SysId(dbRequirement._AssIdSubcontract); + requirement.CommodityId = new SysId(dbRequirement._CommodityId); requirement.ProductCode = dbRequirement._ProductCode; - requirement.AssetId = new SysId(dbRequirement._AssetId ?? 0); + requirement.AssetId = new SysId(dbRequirement._AssetId); requirement.DescBrief = dbRequirement._DescBrief; requirement.DescIntro = dbRequirement._DescIntro; requirement.DescOutline = dbRequirement._DescOutline; @@ -774,20 +772,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr requirement.NominalCode = dbRequirement._NominalCode; requirement.Quantity = (decimal)dbRequirement._Quantity; requirement.QuantityProd = (decimal)dbRequirement._QuantityProd; - requirement.UomId = new SysId(dbRequirement._UomId ?? 0); + requirement.UomId = new SysId(dbRequirement._UomId); requirement.MaterialSourceCode = dbRequirement._MaterialSourceCode; requirement.AmountUnit = (decimal)dbRequirement._AmountUnit; requirement.AmountAct = (decimal)dbRequirement._AmountAct; requirement.AmountDisc = (decimal)dbRequirement._AmountDisc; requirement.AmountNet = (decimal)dbRequirement._AmountNet; - requirement.TaxCodeId = new SysId(dbRequirement._TaxCodeId ?? 0); + requirement.TaxCodeId = new SysId(dbRequirement._TaxCodeId); requirement.TaxRate = (decimal)dbRequirement._TaxRate; requirement.AmountTax = (decimal)dbRequirement._AmountTax; requirement.AmountTot = (decimal)dbRequirement._AmountTot; requirement.TimeEst = (decimal)dbRequirement._TimeEst; requirement.TimeAct = (decimal)dbRequirement._TimeAct; requirement.TimeTot = (decimal)dbRequirement._TimeTot; - requirement.LocationIdStock = new SysId(dbRequirement._LocationIdStock ?? 0); + requirement.LocationIdStock = new SysId(dbRequirement._LocationIdStock); requirement.CostLabourHours = dbRequirement._CostLabourHours ?? 0.0m; requirement.CostLabourRateHour = dbRequirement._CostLabourRateHour ?? 0.0m; requirement.CostLabour = dbRequirement._CostLabour ?? 0.0m; @@ -800,8 +798,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr // Common properties. requirement.Notes = dbRequirement._Notes; requirement.Status = SacsSystem.GetStatusForCode(dbRequirement._Status); - requirement.SetCreateStamp(dbRequirement._CreateOn ?? default(DateTime), new SysId(dbRequirement._CreateBy ?? 0), dbRequirement._CreateHost); - requirement.SetUpdateStamp(dbRequirement._UpdateOn ?? default(DateTime), new SysId(dbRequirement._UpdateBy ?? 0), dbRequirement._UpdateHost); + requirement.SetCreateStamp(dbRequirement._CreateOn, new SysId(dbRequirement._CreateBy), dbRequirement._CreateHost); + requirement.SetUpdateStamp(dbRequirement._UpdateOn, new SysId(dbRequirement._UpdateBy), dbRequirement._UpdateHost); requirement.AcceptChanges(); } diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmTransactionMgr_Dbas-Transaction.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmTransactionMgr_Dbas-Transaction.cs index f75ab9e..59dc09c 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmTransactionMgr_Dbas-Transaction.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmTransactionMgr_Dbas-Transaction.cs @@ -566,7 +566,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr private SbmTransaction_Dbas CreateTransaction(Transaction_Db dbTransaction) { ClearErrorState(); - SbmTransaction_Dbas transaction = new SbmTransaction_Dbas(new SysId(dbTransaction._Id), new SysId(dbTransaction._AffIdOwner ?? 0), new SysId(dbTransaction._AssocId), (Sbm.TransactionType)dbTransaction._Type, (ushort)dbTransaction._Flags); + SbmTransaction_Dbas transaction = new SbmTransaction_Dbas(new SysId(dbTransaction._Id), new SysId(dbTransaction._AffIdOwner), new SysId(dbTransaction._AssocId), (Sbm.TransactionType)dbTransaction._Type, (ushort)dbTransaction._Flags); PopulateFrom(dbTransaction, transaction); return transaction; } @@ -821,22 +821,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr private void PopulateFrom(Transaction_Db dbTransaction, SbmTransaction transaction) { //transaction.Id = new SysId(dbTransaction._Id); - transaction.AffiliateIdOwner = new SysId(dbTransaction._AffIdOwner ?? 0); + transaction.AffiliateIdOwner = new SysId(dbTransaction._AffIdOwner); transaction.AssociationId = new SysId(dbTransaction._AssocId); transaction.TransactionType = (Sbm.TransactionType)(dbTransaction._Type ?? 0); transaction.Ref = dbTransaction._Ref; transaction.RefExt = dbTransaction._RefExt; transaction.RaisedBy = dbTransaction._RaisedBy; - transaction.AffiliateIdRaise = new SysId(dbTransaction._AffIdRaise ?? 0); - transaction.AssociationIdOffice = new SysId(dbTransaction._AssocIdOffice ?? 0); + transaction.AffiliateIdRaise = new SysId(dbTransaction._AffIdRaise); + transaction.AssociationIdOffice = new SysId(dbTransaction._AssocIdOffice); transaction.ContactName = dbTransaction._ContactName; transaction.Likelihood = dbTransaction._Likelihood; - transaction.TransactionIdSource = new SysId(dbTransaction._TransIdSource ?? 0); + transaction.TransactionIdSource = new SysId(dbTransaction._TransIdSource); transaction.ReferCode = dbTransaction._ReferCode; transaction.ReferSource = dbTransaction._ReferSource; - transaction.AffiliateIdRefer = new SysId(dbTransaction._AffIdRefer ?? 0); - transaction.AssociationIdContract = new SysId(dbTransaction._AssocIdContract ?? 0); - transaction.AssociationIdDelivery = new SysId(dbTransaction._AssIdDeliver ?? 0); + transaction.AffiliateIdRefer = new SysId(dbTransaction._AffIdRefer); + transaction.AssociationIdContract = new SysId(dbTransaction._AssocIdContract); + transaction.AssociationIdDelivery = new SysId(dbTransaction._AssIdDeliver); transaction.Raised = dbTransaction._Raised ?? default(DateTime); transaction.Required = dbTransaction._Required ?? default(DateTime); transaction.InProgress = dbTransaction._InProgress ?? default(DateTime); @@ -851,8 +851,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr transaction.ResponseCode = dbTransaction._ResponseCode; transaction.ContactAreaCode = dbTransaction._ContactAreaCode; transaction.Postcode = dbTransaction._Postcode; - transaction.CurrencyId = new SysId(dbTransaction._CurrencyId ?? 0); - transaction.TaxCodeId = new SysId(dbTransaction._TaxCodeId ?? 0); + transaction.CurrencyId = new SysId(dbTransaction._CurrencyId); + transaction.TaxCodeId = new SysId(dbTransaction._TaxCodeId); transaction.AmountEst = dbTransaction._AmountEst ?? 0.0m; transaction.AmountMax = dbTransaction._AmountMax ?? 0.0m; transaction.AmountNet = dbTransaction._AmountNet ?? 0.0m; @@ -861,9 +861,9 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr transaction.TimeEst = dbTransaction._TimeEst ?? 0.0m; transaction.TimeAct = dbTransaction._TimeAct ?? 0.0m; transaction.TimeTot = dbTransaction._TimeTot ?? 0.0m; - transaction.LocationIdStock = new SysId(dbTransaction._LocationIdStock ?? 0); + transaction.LocationIdStock = new SysId(dbTransaction._LocationIdStock); transaction.Weight = dbTransaction._Weight ?? 0.0m; - transaction.UomIdWeight = new SysId(dbTransaction._UomIdWeight ?? 0); + transaction.UomIdWeight = new SysId(dbTransaction._UomIdWeight); transaction.BoxCount = dbTransaction._BoxCount; transaction.DeliveryStatusCode = dbTransaction._DeliveryStatusCode; transaction.DeliveryTypeCode = dbTransaction._DeliveryTypeCode; @@ -874,7 +874,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr transaction.DeliveryRef = dbTransaction._DeliveryRef; transaction.DeliveryComment = dbTransaction._DeliveryComment; transaction.DeliveryAmountNet = dbTransaction._DeliveryAmountNet ?? 0.0m; - transaction.TaxCodeIdDelivery = new SysId(dbTransaction._TaxCodeIdDelivery ?? 0); + transaction.TaxCodeIdDelivery = new SysId(dbTransaction._TaxCodeIdDelivery); transaction.DeliveryAmountTax = dbTransaction._DeliveryAmountTax ?? 0.0m; transaction.DeliveryAmountTot = dbTransaction._DeliveryAmountTot ?? 0.0m; transaction.DeliveryDepartment = dbTransaction._DeliveryDepartment; @@ -882,8 +882,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr // Common properties. transaction.Notes = dbTransaction._Notes; transaction.Status = SacsSystem.GetStatusForCode(dbTransaction._Status); - transaction.SetCreateStamp(dbTransaction._CreateOn ?? default(DateTime), new SysId(dbTransaction._CreateBy ?? 0), dbTransaction._CreateHost); - transaction.SetUpdateStamp(dbTransaction._UpdateOn ?? default(DateTime), new SysId(dbTransaction._UpdateBy ?? 0), dbTransaction._UpdateHost); + transaction.SetCreateStamp(dbTransaction._CreateOn, new SysId(dbTransaction._CreateBy), dbTransaction._CreateHost); + transaction.SetUpdateStamp(dbTransaction._UpdateOn, new SysId(dbTransaction._UpdateBy), dbTransaction._UpdateHost); transaction.AcceptChanges(); } @@ -1379,7 +1379,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr //------------------------------------------------------------------- // Transaction query filter. - public override List GetTransactionQueryFilter(SbmTransaction.Params prm) + public override List GetTransactionQueryFilter(SbmTransaction.Params prm, bool forceFullResults = false) { List filter = new List(); String tableAlias = StringUtil.OnEmpty(prm.TableAlias, aliasTransaction); @@ -1779,7 +1779,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr //--------------------------------------------------------------- // 'Archive' filter - restrict transaction dates if no other 'significant' filter in place. - if (prm.RequiresVolumeThrottle()) + if (prm.RequiresVolumeThrottle() && !forceFullResults) { DateTime today = DateTime.Today; DateTime earliestTransaction = new DateTime(today.Year - 1, 1, 1); @@ -1860,7 +1860,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr public override long GetTransactionCount(SbmTransaction.Params prm) { ClearErrorState(); - return GetTransactionCount(GetTransactionQueryFilter(prm).Concat(" AND ", "(", ")")); + return GetTransactionCount(GetTransactionQueryFilter(prm, true).Concat(" AND ", "(", ")")); } //------------------------------------------------------------------- diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Address.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Address.cs index 9355ba5..ff5544f 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Address.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Address.cs @@ -32,8 +32,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_Address(SbmInternals internals, SbmAddress address) : base(new Config(internals, address.Id)) { - itemTypes = internals.GetSystemCodes(Sbm.SystemCode.ItemType); - addressTypes = internals.GetSystemCodes(Sbm.SystemCode.AddressType); + itemTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.ItemType); + addressTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.AddressType); RecordAttrValues(address, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Affiliate.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Affiliate.cs index 415ebda..dfe622a 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Affiliate.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Affiliate.cs @@ -31,7 +31,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_Affiliate(SbmInternals internals, SbmAffiliate affiliate) : base(new Config(internals, affiliate.Id)) { - affiliateTypes = internals.GetSystemCodes(Sbm.SystemCode.AffiliateType); + affiliateTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.AffiliateType); RecordAttrValues(affiliate, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_AssetCategory.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_AssetCategory.cs index 853e3cf..d0c2118 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_AssetCategory.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_AssetCategory.cs @@ -32,8 +32,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_AssetCategory(SbmInternals internals, SbmAssetCategory assetCategory) : base(new Config(internals, assetCategory.Id)) { - assetTypes = internals.GetSystemCodes(Sbm.SystemCode.AssetType); - incomeTypes = internals.GetSystemCodes(Sbm.SystemCode.AssetIncomeType); + assetTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.AssetType); + incomeTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.AssetIncomeType); RecordAttrValues(assetCategory, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Association.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Association.cs index 41b0b26..ca2db15 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Association.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Association.cs @@ -32,8 +32,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_Association(SbmInternals internals, SbmAssociation association) : base(new Config(internals, association.Id)) { - associationTypes = internals.GetSystemCodes(Sbm.SystemCode.AssociationType); - discountTypes = internals.GetSystemCodes(Sbm.SystemCode.DiscountType); + associationTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.AssociationType); + discountTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.DiscountType); RecordAttrValues(association, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Commodity.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Commodity.cs index 15c4cb7..33b1982 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Commodity.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Commodity.cs @@ -32,7 +32,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_Commodity(SbmInternals internals, SbmCommodity commodity) : base(new Config(internals, commodity.Id)) { - commodityTypes = internals.GetSystemCodes(Sbm.SystemCode.CommodityType); + commodityTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.CommodityType); RecordAttrValues(commodity, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Constituent.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Constituent.cs index 6efa5ea..4fbfd15 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Constituent.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Constituent.cs @@ -32,7 +32,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_Constituent(SbmInternals internals, SbmConstituent constituent) : base(new Config(internals, constituent.Id)) { - constituentTypes = internals.GetSystemCodes(Sbm.SystemCode.ConstituentType); + constituentTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.ConstituentType); RecordAttrValues(constituent, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Container.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Container.cs index 7f7ba39..b8f3c71 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Container.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Container.cs @@ -32,8 +32,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_Container(SbmInternals internals, SbmContainer container) : base(new Config(internals, container.Id)) { - containerCategories = internals.GetSystemCodes(Sbm.SystemCode.ContainerCategory); - containerTypes = internals.GetSystemCodes(Sbm.SystemCode.ContainerType); + containerCategories = internals.GetApplicationCodes(Sbm.ApplicationCode.ContainerCategory); + containerTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.ContainerType); RecordAttrValues(container, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_ContainerItem.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_ContainerItem.cs index 79e85c5..828e57a 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_ContainerItem.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_ContainerItem.cs @@ -32,7 +32,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_ContainerItem(SbmInternals internals, SbmContainerItem containerItem) : base(new Config(internals, containerItem.Id)) { - itemTypes = internals.GetSystemCodes(Sbm.SystemCode.ItemType); + itemTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.ItemType); RecordAttrValues(containerItem, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_ItemBatch.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_ItemBatch.cs index 0ac363f..9bb0ee0 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_ItemBatch.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_ItemBatch.cs @@ -32,7 +32,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_ItemBatch(SbmInternals internals, SbmItemBatch itemBatch) : base(new Config(internals, itemBatch.Id)) { - itemTypes = internals.GetSystemCodes(Sbm.SystemCode.ItemType); + itemTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.ItemType); RecordAttrValues(itemBatch, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_ItemLink.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_ItemLink.cs index ab78ca0..55bcea8 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_ItemLink.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_ItemLink.cs @@ -32,7 +32,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_ItemLink(SbmInternals internals, SbmItemLink itemLink) : base(new Config(internals, itemLink.Id)) { - itemTypes = internals.GetSystemCodes(Sbm.SystemCode.ItemType); + itemTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.ItemType); RecordAttrValues(itemLink, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Location.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Location.cs index e2c59e6..537574e 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Location.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Location.cs @@ -32,7 +32,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_Location(SbmInternals internals, SbmLocation location) : base(new Config(internals, location.Id)) { - locationCategories = internals.GetSystemCodes(Sbm.SystemCode.LocationCategory); + locationCategories = internals.GetApplicationCodes(Sbm.ApplicationCode.LocationCategory); RecordAttrValues(location, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Movement.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Movement.cs index 6ecd7e3..8cc7258 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Movement.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Movement.cs @@ -32,8 +32,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_Movement(SbmInternals internals, SbmMovement movement) : base(new Config(internals, movement.Id)) { - itemTypes = internals.GetSystemCodes(Sbm.SystemCode.ItemType); - movementTypes = internals.GetSystemCodes(Sbm.SystemCode.MovementType); + itemTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.ItemType); + movementTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.MovementType); RecordAttrValues(movement, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_PortfolioItem.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_PortfolioItem.cs index e66a3f9..96a693d 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_PortfolioItem.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_PortfolioItem.cs @@ -32,7 +32,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_PortfolioItem(SbmInternals internals, SbmPortfolioItem portfolioItem) : base(new Config(internals, portfolioItem.Id)) { - portfolioItemTypes = internals.GetSystemCodes(Sbm.SystemCode.PortfolioItemType); + portfolioItemTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.PortfolioItemType); RecordAttrValues(portfolioItem, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Process.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Process.cs index 095b084..e66d84b 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Process.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Process.cs @@ -32,8 +32,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_Process(SbmInternals internals, SbmProcess process) : base(new Config(internals, process.Id)) { - processCategories = internals.GetSystemCodes(Sbm.SystemCode.ProcessCategory); - processTypes = internals.GetSystemCodes(Sbm.SystemCode.ProcessType); + processCategories = internals.GetApplicationCodes(Sbm.ApplicationCode.ProcessCategory); + processTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.ProcessType); RecordAttrValues(process, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Requirement.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Requirement.cs index f98a262..7541b92 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Requirement.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Requirement.cs @@ -32,7 +32,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_Requirement(SbmInternals internals, SbmRequirement requirement) : base(new Config(internals, requirement.Id)) { - requirementTypes = internals.GetSystemCodes(Sbm.SystemCode.RequirementType); + requirementTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.RequirementType); RecordAttrValues(requirement, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_StockLevel.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_StockLevel.cs index f8f6ed3..b05de5c 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_StockLevel.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_StockLevel.cs @@ -32,8 +32,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_StockLevel(SbmInternals internals, SbmStockLevel stockLevel) : base(new Config(internals, stockLevel.Id)) { - stockLevelTypes = internals.GetSystemCodes(Sbm.SystemCode.StockLevelType); - stockLevelSources = internals.GetSystemCodes(Sbm.SystemCode.StockLevelSource); + stockLevelTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.StockLevelType); + stockLevelSources = internals.GetApplicationCodes(Sbm.ApplicationCode.StockLevelSource); RecordAttrValues(stockLevel, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_SysParam.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_SysParam.cs index 25e6d0f..075f948 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_SysParam.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_SysParam.cs @@ -31,7 +31,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_SysParam(SbmInternals internals, SbmSysParam sysParam) : base(new Config(internals, sysParam.Id)) { - sysParamCategories = internals.GetSystemCodes(Sbm.SystemCode.SysParamCategory); + sysParamCategories = internals.GetApplicationCodes(Sbm.ApplicationCode.SysParamCategory); RecordAttrValues(sysParam, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Transaction.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Transaction.cs index 7c51e0e..72bf197 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Transaction.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_Transaction.cs @@ -32,7 +32,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_Transaction(SbmInternals internals, SbmTransaction transaction) : base(new Config(internals, transaction.Id)) { - transactionTypes = internals.GetSystemCodes(Sbm.SystemCode.TransactionType); + transactionTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.TransactionType); RecordAttrValues(transaction, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_VehicleClass.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_VehicleClass.cs index db8b243..0ff7c03 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_VehicleClass.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_VehicleClass.cs @@ -32,9 +32,9 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_VehicleClass(SbmInternals internals, SbmVehicleClass vehicleClass) : base(new Config(internals, vehicleClass.Id)) { - vehicleTypes = internals.GetSystemCodes(Sbm.SystemCode.VehicleType); - fuelTypes = internals.GetSystemCodes(Sbm.SystemCode.FuelType); - odometerUnits = SbmSystem.GetSystemCodes(Sbm.SystemCode.OdometerUnits); + vehicleTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.VehicleType); + fuelTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.FuelType); + odometerUnits = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.OdometerUnits); RecordAttrValues(vehicleClass, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_VehicleEvent.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_VehicleEvent.cs index ef9236e..14568f4 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_VehicleEvent.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_VehicleEvent.cs @@ -32,7 +32,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_VehicleEvent(SbmInternals internals, SbmVehicleEvent vehicleEvent) : base(new Config(internals, vehicleEvent.Id)) { - vehicleEventTypes = internals.GetSystemCodes(Sbm.SystemCode.VehicleEventType); + vehicleEventTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.VehicleEventType); RecordAttrValues(vehicleEvent, false); } diff --git a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_VehicleFeature.cs b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_VehicleFeature.cs index 1cbc5fe..5313757 100644 --- a/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_VehicleFeature.cs +++ b/SaBusMgrStandardDbas/Dbas/UpdateLog/SbmUpdateLogItemMonitor_VehicleFeature.cs @@ -32,8 +32,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog public SbmUpdateLogItemMonitor_VehicleFeature(SbmInternals internals, SbmVehicleFeature vehicleFeature) : base(new Config(internals, vehicleFeature.Id)) { - vehicleFeatureSources = internals.GetSystemCodes(Sbm.SystemCode.VehicleFeatureSource); - vehicleFeatureTypes = internals.GetSystemCodes(Sbm.SystemCode.VehicleFeatureType); + vehicleFeatureSources = internals.GetApplicationCodes(Sbm.ApplicationCode.VehicleFeatureSource); + vehicleFeatureTypes = internals.GetApplicationCodes(Sbm.ApplicationCode.VehicleFeatureType); RecordAttrValues(vehicleFeature, false); } diff --git a/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn.xml b/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn.xml index 4e35672..5209bdd 100644 --- a/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn.xml +++ b/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn.xml @@ -8484,15 +8484,15 @@ dbo InterfaceDataItem
9 - ProcessStatusOn - Int + ProcessStatusAt + DateTime - 4 - int + 93 + datetime false - 10 - 4 - 0 + 23 + 16 + 3 Nullable true @@ -8535,15 +8535,15 @@ dbo InterfaceDataItem
12 - ItemStatusOn - Int + ItemStatusAt + DateTime - 4 - int + 93 + datetime false - 10 - 4 - 0 + 23 + 16 + 3 Nullable true @@ -8972,15 +8972,15 @@ dbo InterfaceProcess
6 - ProcDate - Int + ProcessAt + DateTime - 4 - int + 93 + datetime false - 10 - 4 - 0 + 23 + 16 + 3 Nullable true @@ -8989,15 +8989,15 @@ dbo InterfaceProcess
7 - ProcTime - Int + BatchAt + DateTime - 4 - int + 93 + datetime false - 10 - 4 - 0 + 23 + 16 + 3 Nullable true @@ -9006,40 +9006,6 @@ dbo InterfaceProcess
8 - BatchDate - Int - - 4 - int - false - 10 - 4 - 0 - Nullable - true - - - - dbo - InterfaceProcess
- 9 - BatchTime - Int - - 4 - int - false - 10 - 4 - 0 - Nullable - true - -
- - dbo - InterfaceProcess
- 10 ElapseSecs Int @@ -9056,7 +9022,7 @@ dbo InterfaceProcess
- 11 + 9 ItemCount Int @@ -9073,7 +9039,7 @@ dbo InterfaceProcess
- 12 + 10 Flags SmallInt @@ -9090,7 +9056,7 @@ dbo InterfaceProcess
- 13 + 11 Status VarChar @@ -9107,7 +9073,7 @@ dbo InterfaceProcess
- 14 + 12 CreateOn DateTime @@ -9124,7 +9090,7 @@ dbo InterfaceProcess
- 15 + 13 CreateBy Int @@ -9141,7 +9107,7 @@ dbo InterfaceProcess
- 16 + 14 CreateHost VarChar @@ -9158,7 +9124,7 @@ dbo InterfaceProcess
- 17 + 15 UpdateOn DateTime @@ -9175,7 +9141,7 @@ dbo InterfaceProcess
- 18 + 16 UpdateBy Int @@ -9192,7 +9158,7 @@ dbo InterfaceProcess
- 19 + 17 UpdateHost VarChar @@ -9283,36 +9249,6 @@ - - dbo - InterfaceProcess
- IDX_InterfaceProcess_IntProcDate - 3 - false - false - false - false - 0 - 0 - false - - - 1 - InterfaceId - true - - - 2 - ProcDate - true - - - 3 - ProcTime - true - - -
diff --git a/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn_Control.xml b/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn_Control.xml index 77690df..bb30c9e 100644 --- a/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn_Control.xml +++ b/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn_Control.xml @@ -375,7 +375,7 @@ false false 1 - 3 + 10 false @@ -724,7 +724,7 @@ false false 3 - 97 + 98 false @@ -1386,7 +1386,7 @@ false false 1 - 8 + 9 false diff --git a/SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Control.cs b/SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Control.cs index 331426e..d54258c 100644 --- a/SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Control.cs +++ b/SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Control.cs @@ -20,6 +20,7 @@ using Sarand.Net.Standard.Base.IO; using Sarand.Net.Standard.Base.Utils; using Sarand.Net.Standard.Dbas.Base; using Sarand.Net.Standard.Dbas.CodeType; +using Sarand.Net.Standard.Dbas.Interface; using Sarand.Net.Standard.Dbas.ItemOptions; using Sarand.Net.Standard.Dbas.Security; using System; @@ -35,11 +36,12 @@ namespace Sarand.BusinessMgr.Web.Control.App { //------------------------------------------------------------------- // Processing indicators. - private bool generateDatabaseDefinitions_Control = true; + private bool generateDatabaseDefinitions_Control = false; private bool generateDatabaseDefinitions_BusMgr = false; private bool generateDatabaseDefinitions_Security = false; private bool generateDatabaseDefinitions_CodeTypes = false; private bool generateDatabaseDefinitions_ItemOptions = false; + private bool generateDatabaseDefinitions_Interfaces = false; //------------------------------------------------------------------- // Data members. @@ -358,6 +360,10 @@ namespace Sarand.BusinessMgr.Web.Control.App { SaItemOptionsDbDfnGenerator.Generate(GetTemplateDatabase()?.ConnectionString ?? ""); } + if (generateDatabaseDefinitions_Interfaces) + { + SaInterfaceDbDfnGenerator.Generate(GetTemplateDatabase()?.ConnectionString ?? ""); + } } //------------------------------------------------------------------- diff --git a/SaBusinessMgrCoreWebControl/wwwroot/css/sbc-form.css b/SaBusinessMgrCoreWebControl/wwwroot/css/sbc-form.css index d108b3b..8ae719c 100644 --- a/SaBusinessMgrCoreWebControl/wwwroot/css/sbc-form.css +++ b/SaBusinessMgrCoreWebControl/wwwroot/css/sbc-form.css @@ -148,11 +148,10 @@ .sbc-form .sbc-form-control .sbc-label { - margin: 4px 0 4px 0; - font-size: 1rem; - line-height: 1.25; + margin: 2px 12px 8px 0; } +.sbc-form .sbc-form-control .sbc-label, .sbc-form .sbc-form-control .sbc-label-text { font-size: 1rem; diff --git a/SaBusinessMgrCoreWebPortal/Localisation/SbmPortalProperties.resx b/SaBusinessMgrCoreWebPortal/Localisation/SbmPortalProperties.resx index eb59f51..d63d358 100644 --- a/SaBusinessMgrCoreWebPortal/Localisation/SbmPortalProperties.resx +++ b/SaBusinessMgrCoreWebPortal/Localisation/SbmPortalProperties.resx @@ -942,4 +942,10 @@ Prim. + + Net + + + Select Commodity + \ No newline at end of file diff --git a/SaBusinessMgrCoreWebPortal/Portal/App/SbmApplication_Portal.cs b/SaBusinessMgrCoreWebPortal/Portal/App/SbmApplication_Portal.cs index ff138d1..c60ca73 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/App/SbmApplication_Portal.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/App/SbmApplication_Portal.cs @@ -181,7 +181,9 @@ namespace Sarand.BusinessMgr.Web.Portal.App } public override ISacsDatabase CreateBusMgrDatabase(SbmSessionContext sessionContext) { - ISacsDatabase busMgrDatabase = SacsDatabaseConsole.OpenOdbcDatabase(sessionContexts.GetValue(sessionContext?.Index ?? 0, null)?.OdbcConfig); + SacsDatabaseConsole.OdbcConfig odbcConfig = sessionContexts.GetValue(sessionContext?.Index ?? 0, null)?.OdbcConfig; + if (odbcConfig is null) return null; + ISacsDatabase busMgrDatabase = SacsDatabaseConsole.OpenOdbcDatabase(odbcConfig); if (busMgrDatabase.HasErrorState()) SaLogger.Warn($"{SysUtil.Fn} BusMgr Database: " + busMgrDatabase.DatabaseName + ". Initialisation error: " + busMgrDatabase.ErrorStateMessage); return busMgrDatabase; diff --git a/SaBusinessMgrCoreWebPortal/Portal/Components/SbmController_Portal-Security.cs b/SaBusinessMgrCoreWebPortal/Portal/Components/SbmController_Portal-Security.cs index 8f6ab4a..2e7e87b 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Components/SbmController_Portal-Security.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Components/SbmController_Portal-Security.cs @@ -1,35 +1,18 @@ -using Microsoft.AspNetCore.Mvc.Filters; -using Newtonsoft.Json; -using Sarand.BusinessMgr.Net.Core.Web.App; -using Sarand.BusinessMgr.Net.Core.Web.Components; -using Sarand.BusinessMgr.Net.Standard.Base.App; +using Sarand.BusinessMgr.Net.Standard.Base.App; 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.BusinessMgr.Web.Portal.App; using Sarand.BusinessMgr.Web.Portal.Helpers; using Sarand.Net.Standard.Base.App; using Sarand.Net.Standard.Base.Bus; -using Sarand.Net.Standard.Base.CodeTypes; using Sarand.Net.Standard.Base.Core; -using Sarand.Net.Standard.Base.Diary; -using Sarand.Net.Standard.Base.Email; using Sarand.Net.Standard.Base.Helpers; -using Sarand.Net.Standard.Base.Interfaces; -using Sarand.Net.Standard.Base.ItemData; -using Sarand.Net.Standard.Base.ItemDocs; -using Sarand.Net.Standard.Base.ItemOptions; -using Sarand.Net.Standard.Base.ReferenceData; using Sarand.Net.Standard.Base.Security; -using Sarand.Net.Standard.Base.UpdateLog; using Sarand.Net.Standard.Base.Utils; using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Diagnostics; using System.Linq; -using System.Web; namespace Sarand.BusinessMgr.Web.Portal.Components { diff --git a/SaBusinessMgrCoreWebPortal/Portal/Components/SbmController_Portal.cs b/SaBusinessMgrCoreWebPortal/Portal/Components/SbmController_Portal.cs index 84ed34a..cbdf033 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Components/SbmController_Portal.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Components/SbmController_Portal.cs @@ -1,5 +1,4 @@ -using DocumentFormat.OpenXml.EMMA; -using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.Filters; using Newtonsoft.Json; using Sarand.BusinessMgr.Net.Core.Web.App; using Sarand.BusinessMgr.Net.Core.Web.Components; @@ -9,7 +8,6 @@ using Sarand.BusinessMgr.Net.Standard.Base.Consoles; using Sarand.BusinessMgr.Net.Standard.Base.Core; using Sarand.BusinessMgr.Net.Standard.Base.Mgr; using Sarand.BusinessMgr.Web.Portal.App; -using Sarand.BusinessMgr.Web.Portal.Helpers; using Sarand.Net.Standard.Base.App; using Sarand.Net.Standard.Base.Bus; using Sarand.Net.Standard.Base.CodeTypes; @@ -25,10 +23,8 @@ using Sarand.Net.Standard.Base.ReferenceData; using Sarand.Net.Standard.Base.Security; using Sarand.Net.Standard.Base.UpdateLog; using Sarand.Net.Standard.Base.Utils; -using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Diagnostics; using System.Linq; using System.Web; @@ -96,7 +92,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Components protected SbmStockControlConfig StockControlConfig { get { return Internals.StockControlConfig; } } protected SbmRequirementCostingConfig RequirementCostingConfig { get { return Internals.RequirementCostingConfig; } } // System codes. - protected List GetSystemCodes(Sbm.SystemCode systemCode) { return Internals.GetSystemCodes(systemCode); } + protected List GetSystemCodes(Sbm.ApplicationCode applicationCode) { return Internals.GetApplicationCodes(applicationCode); } // Email. protected SaEmailConfig EmailConfig { get { return Internals.EmailConfig; } } protected SbmEmailConsole EmailConsole { get { return Internals.EmailConsole; } } diff --git a/SaBusinessMgrCoreWebPortal/Portal/Components/SbmModel_Portal.cs b/SaBusinessMgrCoreWebPortal/Portal/Components/SbmModel_Portal.cs index 1f32d7b..8c1c2d8 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Components/SbmModel_Portal.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Components/SbmModel_Portal.cs @@ -5,9 +5,7 @@ using Sarand.BusinessMgr.Net.Standard.Base.App; using Sarand.BusinessMgr.Net.Standard.Base.Bus; using Sarand.BusinessMgr.Net.Standard.Base.Consoles; using Sarand.BusinessMgr.Net.Standard.Base.Mgr; -using Sarand.BusinessMgr.Net.Standard.Dbas.Data; using Sarand.BusinessMgr.Web.Portal.App; -using Sarand.Net.Standard.Base.App; using Sarand.Net.Standard.Base.Bus; using Sarand.Net.Standard.Base.CodeTypes; using Sarand.Net.Standard.Base.Core; @@ -20,7 +18,6 @@ using Sarand.Net.Standard.Base.ReferenceData; using Sarand.Net.Standard.Base.Security; using Sarand.Net.Standard.Base.UpdateLog; using Sarand.Net.Standard.Base.Utils; -using Sarand.Net.Standard.Dbas.Base; using System.Collections.Generic; using System.Linq; @@ -131,7 +128,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Components protected SbmStockControlConfig StockControlConfig { get { return Internals.StockControlConfig; } } protected SbmRequirementCostingConfig RequirementCostingConfig { get { return Internals.RequirementCostingConfig; } } // System codes. - protected List GetSystemCodes(Sbm.SystemCode systemCode) { return Internals.GetSystemCodes(systemCode); } + protected List GetSystemCodes(Sbm.ApplicationCode applicationCode) { return Internals.GetApplicationCodes(applicationCode); } //------------------------------------------------------------------- // Page menu options. @@ -252,7 +249,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Components ///
public IEnumerable GetAffiliateTypeCodesForFilterDropdown(IEnumerable typesExcluded = null) { - List affiliateTypes = GetSystemCodes(Sbm.SystemCode.AffiliateType); + List affiliateTypes = GetSystemCodes(Sbm.ApplicationCode.AffiliateType); if (typesExcluded?.Any() ?? false) affiliateTypes.RemoveAll(item => typesExcluded.Contains((Sbm.AffiliateType)item.Type)); if (!affiliateTypes.Any(item => item.Type == (int)Sbm.AffiliateType.AnyOrganisation)) @@ -267,7 +264,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Components ///
public IEnumerable GetAddressTypeCodesForFilterDropdown() { - List affiliateTypes = GetSystemCodes(Sbm.SystemCode.AddressType); + List affiliateTypes = GetSystemCodes(Sbm.ApplicationCode.AddressType); affiliateTypes.Insert(0, Sbm.AddressType.Any, "", Localiser["label.any"]); return new SelectList(affiliateTypes, "Code", "Desc"); } @@ -278,7 +275,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Components /// public IEnumerable GetAddressTypeCodesForDropdown() { - List affiliateTypes = GetSystemCodes(Sbm.SystemCode.AddressType); + List affiliateTypes = GetSystemCodes(Sbm.ApplicationCode.AddressType); return new SelectList(affiliateTypes, "Code", "Desc"); } @@ -288,7 +285,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Components /// public IEnumerable GetAssociationTypeCodesForFilterDropdown() { - List associationTypes = GetSystemCodes(Sbm.SystemCode.AssociationType); + List associationTypes = GetSystemCodes(Sbm.ApplicationCode.AssociationType); associationTypes.Insert(0, Sbm.AssociationType.Any, "", Localiser["label.any"]); associationTypes.RemoveAll(item => item.Type == (short)Sbm.AssociationType.Internal); foreach (Sbm.AssociationType associationType in EnumUtil.GetValues()) @@ -309,7 +306,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Components { List commodityTypes = new List(); commodityTypes.Add(Sbm.CommodityType.Any, "", Localiser["label.any"]); - foreach (TypeCodeDesc commodityType in GetSystemCodes(Sbm.SystemCode.CommodityType)) + foreach (TypeCodeDesc commodityType in GetSystemCodes(Sbm.ApplicationCode.CommodityType)) { if (commodityType.Type == (int)Sbm.CommodityType.Asset && !SessionConsole.AllowOption(Sbm.ConfigOption.Assets)) continue; commodityTypes.Add(commodityType); @@ -323,7 +320,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Components public IEnumerable GetCommodityTypeCodesForDropdown() { List commodityTypes = new List(); - foreach (TypeCodeDesc commodityType in GetSystemCodes(Sbm.SystemCode.CommodityType)) + foreach (TypeCodeDesc commodityType in GetSystemCodes(Sbm.ApplicationCode.CommodityType)) { if (commodityType.Type == (int)Sbm.CommodityType.Asset && !SessionConsole.AllowOption(Sbm.ConfigOption.Assets)) continue; commodityTypes.Add(commodityType); @@ -338,7 +335,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Components { List assetTypes = new List(); assetTypes.Add(Sbm.AssetType.Any, "", Localiser["label.any"]); - foreach (TypeCodeDesc assetType in GetSystemCodes(Sbm.SystemCode.AssetType)) + foreach (TypeCodeDesc assetType in GetSystemCodes(Sbm.ApplicationCode.AssetType)) { assetTypes.Add(assetType); } @@ -351,7 +348,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Components public IEnumerable GetAssetTypeCodesForDropdown() { List assetTypes = new List(); - foreach (TypeCodeDesc assetType in GetSystemCodes(Sbm.SystemCode.AssetType)) + foreach (TypeCodeDesc assetType in GetSystemCodes(Sbm.ApplicationCode.AssetType)) { assetTypes.Add(assetType); } @@ -368,7 +365,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Components { List transactionTypes = new List(); transactionTypes.Add(Sbm.TransactionType.Any, "", Localiser["label.any"]); - foreach (TypeCodeDesc transactionType in GetSystemCodes(Sbm.SystemCode.TransactionType)) + foreach (TypeCodeDesc transactionType in GetSystemCodes(Sbm.ApplicationCode.TransactionType)) { if (!SessionConsole.AllowTransactionType((Sbm.TransactionType)transactionType.Type)) continue; string description = SessionConsole.GetOwnerOption_Caption(Sbm.TransTypeToOrgOption((Sbm.TransactionType)transactionType.Type), Localiser.GetTransactionTypeCaption((Sbm.TransactionType)transactionType.Type)); @@ -383,7 +380,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Components public IEnumerable GetTransactionTypeCodesForDropdown() { List transactionTypes = new List(); - foreach (TypeCodeDesc transactionType in GetSystemCodes(Sbm.SystemCode.TransactionType)) + foreach (TypeCodeDesc transactionType in GetSystemCodes(Sbm.ApplicationCode.TransactionType)) { if (!SessionConsole.AllowTransactionType((Sbm.TransactionType)transactionType.Type)) continue; string description = SessionConsole.GetOwnerOption_Caption(Sbm.TransTypeToOrgOption((Sbm.TransactionType)transactionType.Type), Localiser.GetTransactionTypeCaption((Sbm.TransactionType)transactionType.Type)); diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Addresses/AddressController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Addresses/AddressController-Ajax.cs index 79f35b5..2b37baf 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Addresses/AddressController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Addresses/AddressController-Ajax.cs @@ -156,7 +156,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Addresses model.PopulateItemConfig(responseData.Data.CfgItemNew, null, Sbm.AddressType.Any); // Address types. - List addressTypes = GetSystemCodes(Sbm.SystemCode.AddressType); + List addressTypes = GetSystemCodes(Sbm.ApplicationCode.AddressType); foreach (TypeCodeDesc addressType in addressTypes.Where(addr => addr.Type > 0)) responseData.Data.AddressTypes.Add(new AjaxResponse_Data.ItemCodeDesc(addressType.Code, addressType.Desc)); responseData.Data.AddressTypeDefault = addressTypes.GetCodeForType(Sbm.AddressType.Office); diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Assets/AssetCategoryController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Assets/AssetCategoryController-Ajax.cs index 202097a..d6ac99b 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Assets/AssetCategoryController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Assets/AssetCategoryController-Ajax.cs @@ -116,9 +116,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Assets model.PopulateItemConfig(responseData.Data.CfgItemNew, null, Sbm.AssetType.Unknown); // Reference data - select lists. - foreach (TypeCodeDesc assetType in GetSystemCodes(Sbm.SystemCode.AssetType)) + foreach (TypeCodeDesc assetType in GetSystemCodes(Sbm.ApplicationCode.AssetType)) responseData.Data.AssetTypes.Add(new AjaxResponse_Data.ItemCodeDesc(assetType.Code, assetType.Desc)); - foreach (TypeCodeDesc incomeType in GetSystemCodes(Sbm.SystemCode.AssetIncomeType)) + foreach (TypeCodeDesc incomeType in GetSystemCodes(Sbm.ApplicationCode.AssetIncomeType)) responseData.Data.IncomeTypes.Add(new AjaxResponse_Data.ItemCodeDesc(incomeType.Code, incomeType.Desc)); // Reference data - statuses. diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Commodities/CommodityController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Commodities/CommodityController-Ajax.cs index 3abc980..4bcf1b1 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Commodities/CommodityController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Commodities/CommodityController-Ajax.cs @@ -78,7 +78,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities data.Field.Value.Add($"{Model_Commodity.ItemField.SaleAmount}", StringUtil.NullOnBlank(StringUtil.FormatNumeric(commodity.SalesPrice, SbmInternals.CurrencyDecimalsDefault))); } data.Field.Value.Add($"{Model_Commodity.ItemField.SaleTaxCode}", Internals.GetTaxCodeById(commodity.TaxCodeId)?.Code); - data.SalesUnitType = SbmSystem.GetSystemCodes(Sbm.SystemCode.UnitMeasureType).GetCodeForType(Internals.GetUnitOfMeasureType(commodity.UomIdSale)); + data.SalesUnitType = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.UnitMeasureType).GetCodeForType(Internals.GetUnitOfMeasureType(commodity.UomIdSale)); if (commodity.PackQtySale > 0) data.Field.Value.Add($"{Model_Commodity.ItemField.SalePackQty}", $"{commodity.PackQtySale}"); data.Field.Value.Add($"{Model_Commodity.ItemField.AssocIdCustomer}", StringUtil.NullOnBlank(SysId.ToString(commodity.AssociationIdCustomer))); @@ -178,7 +178,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities model.PopulateItemConfig(responseData.Data.CfgItemNew, null, Sbm.CommodityType.Unknown); // Commodity types. - List commodityTypes = GetSystemCodes(Sbm.SystemCode.CommodityType); + List commodityTypes = GetSystemCodes(Sbm.ApplicationCode.CommodityType); foreach (TypeCodeDesc commodityType in commodityTypes) responseData.Data.CommodityTypes.Add(new AjaxResponse_Data.ItemCodeDesc(commodityType.Code, commodityType.Desc)); Sbm.CommodityType commodityTypeDefault = SessionConsole.GetOwnerOption_CommodityType(Sbm.OrgOption_CommodityType.CommodityCreationDefault); @@ -192,8 +192,8 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities responseData.Data.TaxCodeDefault = Internals.GetDefaultTaxCode(); // Units of measure. - List uomCategories = SbmSystem.GetSystemCodes(Sbm.SystemCode.UnitMeasureCategory); - List uomTypes = SbmSystem.GetSystemCodes(Sbm.SystemCode.UnitMeasureType); + List uomCategories = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.UnitMeasureCategory); + List uomTypes = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.UnitMeasureType); responseData.Data.UomCats.AddRange(uomCategories.Select(item => new AjaxResponse_Data.ItemCodeDesc(item.Code, item.Desc))); responseData.Data.UomTypes.AddRange(uomTypes.Select(item => new AjaxResponse_Data.ItemCodeDesc(item.Code, item.Desc))); foreach (SaUnitMeasure uom in Internals.GetUnitsOfMeasure()) diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Contacts/ContactController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Contacts/ContactController-Ajax.cs index 499c20f..4cc23f9 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Contacts/ContactController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Contacts/ContactController-Ajax.cs @@ -165,7 +165,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Contacts model.PopulateItemConfig(responseData.Data.CfgGrp, null, Sbm.AffiliateType.ContactGroup); // Reference data - Organisation types. - foreach (TypeCodeDesc affiliateType in GetSystemCodes(Sbm.SystemCode.AffiliateType).Where(item => item.Type != (short)Sbm.AffiliateType.Individual && item.Type != (short)Sbm.AffiliateType.ContactGroup)) + foreach (TypeCodeDesc affiliateType in GetSystemCodes(Sbm.ApplicationCode.AffiliateType).Where(item => item.Type != (short)Sbm.AffiliateType.Individual && item.Type != (short)Sbm.AffiliateType.ContactGroup)) responseData.Data.OrganisationTypes.Add(new AjaxResponse_Data.ItemCodeDesc(affiliateType.Code, affiliateType.Desc)); // Reference data - titles. diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Interfaces/InterfaceController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Interfaces/InterfaceController-Ajax.cs new file mode 100644 index 0000000..bf703eb --- /dev/null +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Interfaces/InterfaceController-Ajax.cs @@ -0,0 +1,365 @@ +using Microsoft.AspNetCore.Mvc; +using Sarand.BusinessMgr.Web.Portal.Components; +using Sarand.BusinessMgr.Web.Portal.Models.Interfaces; +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.Interfaces; +using Sarand.Net.Standard.Base.Utils; +using System; +using System.Collections.Generic; + +namespace Sarand.BusinessMgr.Web.Portal.Controllers.Interfaces +{ + //======================================================================= + // Portal Interface Controller - Ajax actions. + //======================================================================= + partial class InterfaceController + { + //------------------------------------------------------------------- + // Item data. + private class InterfaceListData : AjaxResponse_Data.ItemData_Base + { + public String CategoryDesc { get; set; } + public String TypeDesc { get; set; } + public String Code { get; set; } + public String Caption { get; set; } + // Field values. + public AjaxResponse_Data.FieldValuesData Field { get; } = new AjaxResponse_Data.FieldValuesData(); + } + private class InterfaceItemData : InterfaceListData + { + public String CategoryCode { get; set; } + public String Type { get; set; } + } + private void PopulateInterfaceResponseListData(SbmModel_Portal model, InterfaceListData data, SaInterface interfaceObj) + { + // Prominent properties for selecting and editing. + data.Id = SysId.ToString(interfaceObj.Id); + data.Field.Value.Add($"{Model_Interface.ItemField.Id}", data.Id); + data.Field.Value.Add($"{Model_Interface.ItemField.Exists}", "1"); + data.Field.Value.Add($"{Model_Interface.ItemField.Category}", $"{Internals.InterfaceCategoryCodes.GetDescForType(interfaceObj.Category)}"); + data.Code = interfaceObj.Code; + data.Field.Value.Add($"{Model_Interface.ItemField.Code}", interfaceObj.Code); + data.Caption = interfaceObj.Caption; + data.Field.Value.Add($"{Model_Interface.ItemField.Caption}", interfaceObj.Caption); + } + private void PopulateInterfaceResponseItemData(SbmModel_Portal model, InterfaceItemData data, SaInterface interfaceObj) + { + PopulateInterfaceResponseListData(model, data, interfaceObj); + data.CategoryCode = Internals.InterfaceCategoryCodes.GetCodeForType(interfaceObj.Category); + data.Field.Value.Add($"{Model_Interface.ItemField.CategoryCode}", data.CategoryCode); + // Common properties. + data.StatusCode = interfaceObj.StatusCode; + data.StatusDesc = interfaceObj.StatusDesc; + // Cleanse field values. + data.Field.Value.RemoveAll(item => StringUtil.IsBlank(item.Value)); + // Populate item list values that might be cleared during update after removing blank values to ensure that blank values are published. + data.Field.Value.Add($"{Model_Interface.ItemField.Notes}", interfaceObj.Notes); + data.Field.Value.Add($"{Model_Interface.ItemField.UpdatedOn}", Localiser.FormatDate(interfaceObj.UpdateStamp.On)); + } + + //------------------------------------------------------------------- + // Interface configuration ajax request. + //------------------------------------------------------------------- + private class AjaxResponse_InterfaceConfig : AjaxResponse_Data + { + // Construction. + public AjaxResponse_InterfaceConfig(SbmModel_Portal model) : base(model) { } + // Configuration data - object copied directly to env.datain script. + public class ConfigData + { + // Configuration. + public Model_Interface.ListConfigData CfgList { get; } = new Model_Interface.ListConfigData(); + public Model_Interface.ItemConfigData CfgItemNew { get; } = new Model_Interface.ItemConfigData(); + // Reference data. + public List Statuses { get; } = new List(); + public List StatusesCreate { get; } = new List(); + public String StatusCodeDefault { get; set; } + } + public ConfigData Data { get; set; } = new ConfigData(); + } + //------------------------------------------------------------------- + [HttpPost] + [Route("Interfaces/Interface/Ajax/Config")] + [Route("Interfaces/Interface/Ajax/GetConfig")] + public IActionResult Ajax_GetInterfaceConfig(Model_Interface model) + { + String messageTitle = Localiser["label.interfaceObjs"]; + AjaxResponse_InterfaceConfig responseData = new AjaxResponse_InterfaceConfig(model); + + // Validate session and referrer. + if (!ValidReferer) return Forbid(); + if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData); + RefreshModel(model); + + // Populate configuration data. + PopulateInterfaceConfig(model, responseData); + + // Complete response. + responseData.Success = true; + return Json(responseData); + } + private void PopulateInterfaceConfig(Model_Interface model, AjaxResponse_InterfaceConfig responseData) + { + // Configuration. + model.PopulateListConfig(responseData.Data.CfgList); + model.PopulateItemConfig(responseData.Data.CfgItemNew, null, SaInterfaceCategory.Unknown); + + // Reference data - statuses. + foreach (SaStatus status in SaInterface.ValidStatuses) + { + responseData.Data.Statuses.Add(new AjaxResponse_Data.ItemCodeDesc(SacsSystem.GetStatusCode(status), Localiser.GetStatusCaption(status))); + if (status != SaStatus.Deleted) + responseData.Data.StatusesCreate.Add(new AjaxResponse_Data.ItemCodeDesc(SacsSystem.GetStatusCode(status), Localiser.GetStatusCaption(status))); + } + responseData.Data.StatusCodeDefault = SacsSystem.GetStatusCode(SaInterface.DefaultStatus); + } + + //------------------------------------------------------------------- + // Interface list ajax request. + //------------------------------------------------------------------- + private class AjaxResponse_InterfaceList : AjaxResponse_InterfaceConfig + { + // Construction. + public AjaxResponse_InterfaceList(SbmModel_Portal model) : base(model) { } + // View mode. + public class ModeData + { + public ushort? Search { get; set; } + public ushort? Maintain { get; set; } + public ushort? InterfacesForItem { get; set; } + } + public ModeData Mode { get; set; } + // Interface list. + public List Interfaces { get; } = new List(); + } + //------------------------------------------------------------------- + [HttpPost] + [Route("Interfaces/Interface/Ajax/GetList")] + [Route("Interfaces/Interface/Ajax/GetInterfaces")] + [Route("Interfaces/Interface/Ajax/GetInterfaceList")] + public IActionResult Ajax_GetInterfaceList(Model_Interface model) + { + String messageTitle = Localiser["label.interfaceObjs"]; + AjaxResponse_InterfaceList responseData = new AjaxResponse_InterfaceList(model); + + // Validate session and referrer. + if (!ValidReferer) return Forbid(); + if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData); + RefreshModel(model); + + // Populate configuration data. + PopulateInterfaceConfig(model, responseData); + + // View mode. + responseData.Mode = new AjaxResponse_InterfaceList.ModeData(); + Model_Interface.ViewMode viewMode = model.GetFilterMode(); + if (viewMode == Model_Interface.ViewMode.Maintain) + responseData.Mode.Maintain = 1; + else if (viewMode == Model_Interface.ViewMode.InterfacesForItem) + responseData.Mode.InterfacesForItem = 1; + else + responseData.Mode.Search = 1; + + // Item filter. + SaInterface.Params prmInterface = new SaInterface.Params(); + prmInterface.InterfaceCategory = model.GetFilterInterfaceCategory(); + prmInterface.Search = model.Filter.Search; + prmInterface.StatusCat = model.GetFilterStatusCat(); + model.Paging.ItemTotal = (ulong)InterfaceConsole.GetInterfaceCount(prmInterface); + model.PopulatePagingTo(prmInterface.ResultsPaging); + + // Item columns. + ColumnDfn colId = InterfaceConsole.GetInterfaceColumnDfn(SaInterface.Column.Id); + ColumnDfn colCategoryDesc = InterfaceConsole.GetInterfaceColumnDfn(SaInterface.Column.Category_Desc); + ColumnDfn colCode = InterfaceConsole.GetInterfaceColumnDfn(SaInterface.Column.Code); + ColumnDfn colCaption = InterfaceConsole.GetInterfaceColumnDfn(SaInterface.Column.Caption); + ColumnDfn colNotes = InterfaceConsole.GetInterfaceColumnDfn(SaInterface.Column.Notes); + ColumnDfn colStatus = InterfaceConsole.GetInterfaceColumnDfn(SaInterface.Column.Status); + List columns = new List() + { + colId, colCategoryDesc, colCode, colCaption, + colNotes, colStatus + }; + + // Query items. + using (DbResultSet resultSet = InterfaceConsole.ExecuteInterfaceQuery(columns, prmInterface)) + { + while (resultSet != null && resultSet.HasRows && resultSet.NextRecord()) + { + NamedValue.Map values = resultSet.GetRecordValues(); + InterfaceListData interfaceObjData = new InterfaceListData() + { + Id = values.GetLong(colId.DataName).ToString(), + CategoryDesc = values.GetString(colCategoryDesc.DataName), + Caption = values.GetString(colCaption.DataName), + StatusCode = values.GetString(colStatus.DataName), + StatusDesc = SacsSystem.GetStatusDescForCode(values.GetString(colStatus.DataName)) + }; + interfaceObjData.Field.Value.Add($"{Model_Interface.ItemField.Category}", interfaceObjData.CategoryDesc); + interfaceObjData.Field.Value.Add($"{Model_Interface.ItemField.Code}", values.GetString(colCode.DataName)); + interfaceObjData.Field.Value.Add($"{Model_Interface.ItemField.Caption}", interfaceObjData.Caption); + interfaceObjData.Field.Value.Add($"{Model_Interface.ItemField.Notes}", InterfaceConsole.GetInterfaceDataValue(colNotes, values).ToString()); + interfaceObjData.Field.Value.Add($"{Model_Interface.ItemField.Status}", SacsSystem.GetStatusDescForCode(values.GetString(colStatus.DataName))); + // Cleanse item values. + interfaceObjData.Field.Value.RemoveAll(item => StringUtil.IsBlank(item.Value)); + responseData.Interfaces.Add(interfaceObjData); + } + } + if (model.Paging.IsPaged) + model.Paging.ItemCount = (ushort)responseData.Interfaces.Count; + + // Complete response. + responseData.SetPaging(model); + responseData.Success = true; + return Json(responseData); + } + + //------------------------------------------------------------------- + // Interface ajax request. + //------------------------------------------------------------------- + private class AjaxResponse_Interface : AjaxResponse_Data + { + // Construction. + public AjaxResponse_Interface(SbmModel_Portal model) : base(model) { } + // Configuration. + public Model_Interface.ItemConfigData Config { get; } = new Model_Interface.ItemConfigData(); + // Interface details. + public InterfaceItemData interfaceObj { get; } = new InterfaceItemData(); + } + //------------------------------------------------------------------- + [HttpPost] + [Route("Interfaces/Interface/Ajax/GetItem")] + [Route("Interfaces/Interface/Ajax/GetInterface")] + public IActionResult Ajax_GetInterface(Model_Interface model) + { + String messageTitle = Localiser["label.interfaceObj"]; + AjaxResponse_Interface responseData = new AjaxResponse_Interface(model); + + // Validate session and referrer. + if (!ValidReferer) return Forbid(); + if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData); + RefreshModel(model); + + // Record disposable items as they are created so all can be disposed when needed. + using (DisposableCollection disposables = new DisposableCollection()) + { + + // Identify item. + SysId interfaceObjId = SysId.ToSysId(model.Interface.Id); + if (!SysId.IsValid(interfaceObjId)) + return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"])); + + // Retrieve item. + SaInterface interfaceObj = InterfaceConsole.GetInterfaceById(interfaceObjId); + if (interfaceObj == null) + { + SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve interfaceObj for Id: '" + interfaceObjId + "'"); + return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"])); + } + + // Construct response. + model.PopulateItemConfig(responseData.Config, interfaceObj); + PopulateInterfaceResponseItemData(model, responseData.interfaceObj, interfaceObj); + responseData.Success = true; + } + return Json(responseData); + } + + //------------------------------------------------------------------- + // Store Interface ajax request. + //------------------------------------------------------------------- + [HttpPost] + [Route("Interfaces/Interface/Ajax/StoreItem")] + [Route("Interfaces/Interface/Ajax/StoreInterface")] + public IActionResult Ajax_StoreInterface(Model_Interface model) + { + String messageTitle = Localiser["label.interfaceObj"]; + AjaxResponse_Interface responseData = new AjaxResponse_Interface(model); + + // Validate session and referrer. + if (!ValidReferer) return Forbid(); + if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData); + RefreshModel(model); + + // Validate item Id. + SysId interfaceObjId = SysId.ToSysId(model.Interface.Id); + if (StringUtil.ToBool(model.Interface.Exists) && !SysId.IsValid(interfaceObjId)) + { + SaLogger.Warn($"{SysUtil.Fn} Interface Id not supplied for existing item."); + return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"])); + } + if (!StringUtil.ToBool(model.Interface.Exists) && SysId.IsValid(interfaceObjId)) + { + SaLogger.Warn($"{SysUtil.Fn} Interface Id supplied for new item."); + return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"])); + } + + // Validate item properties. + model.ValidateInterfaceData(responseData); + if (responseData.HasControlErrors()) + return Json(responseData); + + // Record disposable items as they are created so all can be disposed when needed. + using (DisposableCollection disposables = new DisposableCollection()) + { + + // Retrieve existing item. + SaInterface interfaceObj = InterfaceConsole.GetInterfaceById(interfaceObjId); + if (interfaceObj == null && SysId.IsValid(interfaceObjId)) + { + SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Interface for Id: '" + model.Interface.Id + "'"); + return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"])); + } + + // Create new item if required. + if (interfaceObj == null) + { + if (!InterfaceConsole.HasInterfaceDfns(SessionData_Portal.OrganisationInterfaceContext, model.GetInterfaceCategory(), model.GetInterfaceType(), true)) + { + SaLogger.Warn($"{SysUtil.Fn} No Interface definitions exist for Category: " + model.Interface.CategoryCode + ", Type: " + model.Interface.Type); + return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.definition.missing"])); + } + SysId interfaceId = InterfaceConsole.CreateInterface + (SessionData_Portal.OrganisationInterfaceContext, model.GetInterfaceCategory(), model.GetInterfaceType(), + model.Interface.Code, model.Interface.Caption, DbUpdateInfo); + interfaceObj = InterfaceConsole.GetInterfaceById(interfaceId); + if (interfaceObj is null) + { + SaLogger.Warn($"{SysUtil.Fn} Failed to create new Interface: " + InterfaceConsole.ErrorStateMessage); + return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"])); + } + } + + // Populate item properties. + if (model.Interface.Code != null) + interfaceObj.Code = model.Interface.Code; + if (model.Interface.Caption != null) + interfaceObj.Caption = model.Interface.Caption; + if (model.Interface.StatusCode != null) + interfaceObj.Status = model.GetInterfaceStatus(); + if (model.Interface.Notes != null) + interfaceObj.Notes = model.Interface.Notes; + + // Store item. + if (!InterfaceConsole.UpdateInterface(interfaceObj, DbUpdateInfo)) + { + SaLogger.Warn($"{SysUtil.Fn} Failed to update Interface [Id:" + SysId.ToString(interfaceObj.Id) + "]: " + InterfaceConsole.ErrorStateMessage); + return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"])); + } + responseData.SetNotification(messageTitle, Localiser["msg.item.updated"]); + + // Construct response. + model.PopulateItemConfig(responseData.Config, interfaceObj); + PopulateInterfaceResponseItemData(model, responseData.interfaceObj, interfaceObj); + responseData.Success = true; + } + return Json(responseData); + } + + //------------------------------------------------------------------- + } + //======================================================================= +} diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Interfaces/InterfaceController.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Interfaces/InterfaceController.cs new file mode 100644 index 0000000..b06929d --- /dev/null +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Interfaces/InterfaceController.cs @@ -0,0 +1,44 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using Sarand.BusinessMgr.Net.Core.Web.App; +using Sarand.BusinessMgr.Web.Portal.Components; +using Sarand.BusinessMgr.Web.Portal.Models.Interfaces; + +namespace Sarand.BusinessMgr.Web.Portal.Controllers.Interfaces +{ + //====================================================================== + public partial class InterfaceController : SbmController_Portal + { + //------------------------------------------------------------------- + // Data members. + + //------------------------------------------------------------------- + // Construction. + public InterfaceController(SbmLocaliser localiser, ILogger logger) : + base(localiser, logger) + { + } + + //------------------------------------------------------------------- + [Route("Interfaces/Interface")] + public IActionResult Index() + { + if (!ValidUserSession) + AutoLoginUser(); + + // Redirect to sign-in if not signed-in. + if (!ValidUserSession) + { + ClearKeepLoggedInCookie(); + return RedirectToAction("", "Security"); + } + + // Interface page. + Model_Interface model = new Model_Interface(Localiser); + return View("Views/Interfaces/Interface/Index.cshtml", model); + } + + //------------------------------------------------------------------- + } + //====================================================================== +} diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Requirements/RequirementController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Requirements/RequirementController-Ajax.cs index 5c3a33a..b4cf9ca 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Requirements/RequirementController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Requirements/RequirementController-Ajax.cs @@ -68,7 +68,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements data.Field.Value.Add($"{Model_Requirement.ItemField.ProductCode}", requirement.ProductCode); data.Field.Value.Add($"{Model_Requirement.ItemField.Quantity}", $"{requirement.Quantity}"); data.Field.Value.Add($"{Model_Requirement.ItemField.QuantityProd}", $"{requirement.QuantityProd}"); - data.UnitType = SbmSystem.GetSystemCodes(Sbm.SystemCode.UnitMeasureType).GetCodeForType(Internals.GetUnitOfMeasureType(requirement.UomId)); + data.UnitType = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.UnitMeasureType).GetCodeForType(Internals.GetUnitOfMeasureType(requirement.UomId)); data.Field.Value.Add($"{Model_Requirement.ItemField.UnitType}", SaReferenceDataConsole.GetReferenceDataCodes(ReferenceDataSystemCode.UnitMeasureType).GetCodeForType(Internals.GetUnitOfMeasureById(requirement.UomId)?.UnitType ?? Internals.GetDefaultUomType())); data.Field.Value.Add($"{Model_Requirement.ItemField.MaterialSourceCode}", requirement.MaterialSourceCode); data.Field.Value.Add($"{Model_Requirement.ItemField.PromotionCode}", requirement.PromotionCode); @@ -171,7 +171,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements model.PopulateItemConfig(responseData.Data.CfgItemNew, null, model.GetFilterTransactionType(), SbmTransaction.StatusCat.Pending, Sbm.RequirementType.Unknown); // Reference data - requirement types. - foreach (TypeCodeDesc requirementType in GetSystemCodes(Sbm.SystemCode.RequirementType)) + foreach (TypeCodeDesc requirementType in GetSystemCodes(Sbm.ApplicationCode.RequirementType)) responseData.Data.RequirementTypes.Add(new AjaxResponse_Data.ItemCodeDesc(requirementType.Code, requirementType.Desc)); // Tax codes. @@ -182,8 +182,8 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements responseData.Data.taxCodeDefault = Internals.GetDefaultTaxCode(); // Units of measure. - List uomCategories = SbmSystem.GetSystemCodes(Sbm.SystemCode.UnitMeasureCategory); - List uomTypes = SbmSystem.GetSystemCodes(Sbm.SystemCode.UnitMeasureType); + List uomCategories = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.UnitMeasureCategory); + List uomTypes = SbmSystem.GetSystemCodes(Sbm.ApplicationCode.UnitMeasureType); responseData.Data.UomCats.AddRange(uomCategories.Select(item => new AjaxResponse_Data.ItemCodeDesc(item.Code, item.Desc))); responseData.Data.UomTypes.AddRange(uomTypes.Select(item => new AjaxResponse_Data.ItemCodeDesc(item.Code, item.Desc))); foreach (SaUnitMeasure uom in Internals.GetUnitsOfMeasure()) diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Security/SecurityController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Security/SecurityController-Ajax.cs index 98fa950..0f01b8d 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Security/SecurityController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Security/SecurityController-Ajax.cs @@ -85,13 +85,13 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security if (sessionContext == null) return false; SbmSessionData_Portal sessionDataForUser = new SbmSessionData_Portal(sessionContext, model.RepositoryContext, null, null, null, null); - ISacsDatabase busMgrDatabase = Internals.BusMgrDatabase; - if (busMgrDatabase == null) return false; using (DisposableCollection disposables = new DisposableCollection()) { SbmInternals internalsForUser = new SbmInternals(sessionDataForUser); disposables.Add(internalsForUser); + ISacsDatabase busMgrDatabase = internalsForUser.BusMgrDatabase; + if (busMgrDatabase == null) return false; // User's security item. SaSecurityItem securityItemUser = GetSecurityItemForSignin(sessionDataForUser, internalsForUser.SecurityConsole, model); @@ -144,7 +144,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security } //------------------------------------------------------------------- - private SaSecurityItem GetSecurityItemForSignin(ISbmUserContext userContext, SaSecurityConsole securityConsoleForUser, Model_Security model) + private static SaSecurityItem GetSecurityItemForSignin(ISbmUserContext userContext, SaSecurityConsole securityConsoleForUser, Model_Security model) { // Retrieve security item by email address. SaSecurityItem securityItemUser = securityConsoleForUser.GetUserByEmail(model.EmailAddress); @@ -161,7 +161,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security securityItemUser.InvalidLoginCount++; securityItemUser.LastInvalidLoginAt = DateTime.Now; if (!securityConsoleForUser.UpdateSecurityItem(securityItemUser, userContext.DbUpdateInfo)) - SaLogger.Warn($"{SysUtil.Fn} Failed to store invalid sign-in attempt against User: {model.EmailAddress}. {AccountMgr.ErrorStateMessage}", true); + SaLogger.Warn($"{SysUtil.Fn} Failed to store invalid sign-in attempt against User: {model.EmailAddress}. {securityConsoleForUser.ErrorStateMessage}", true); SaLogger.Warn($"{SysUtil.Fn} Attempt to sign-in to User {model.EmailAddress} with invalid password. Attempt: {securityItemUser.InvalidLoginCount}.", true); return null; } @@ -170,7 +170,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security } //------------------------------------------------------------------- - private SbmAffiliate GetAffiliateForSignin(SbmAccountMgr accountMgrForUser, Model_Security model, SaSecurityItem securityItemUser) + private static SbmAffiliate GetAffiliateForSignin(SbmAccountMgr accountMgrForUser, Model_Security model, SaSecurityItem securityItemUser) { // Identify the contact asociated with the security item. SbmAffiliate.Params prmAffiliate = new SbmAffiliate.Params(); @@ -198,7 +198,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security /// /// Identify the organisation for the user to login to - either last selected (via SysParam) or first in list. /// - private SbmAssociation GetOrganisationAssociationForSignIn(SbmInternals internalsForUser, Model_Security model, ISbmUserOrganisationContext userContext) + private static SbmAssociation GetOrganisationAssociationForSignIn(SbmInternals internalsForUser, Model_Security model, ISbmUserOrganisationContext userContext) { // Previously selected organisation is stored in user params (SysParam table). SbmSysParamCache sysParamCache = new SbmSysParamCache(internalsForUser, userContext.UserAffiliateId); diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Transactions/TransactionController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Transactions/TransactionController-Ajax.cs index fccd82e..718427e 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Transactions/TransactionController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Transactions/TransactionController-Ajax.cs @@ -159,7 +159,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions model.PopulateItemConfig(responseData.Data.CfgItemNew, null, Sbm.TransactionType.Unknown); // Reference data - transaction types. - foreach (TypeCodeDesc transactionType in GetSystemCodes(Sbm.SystemCode.TransactionType)) + foreach (TypeCodeDesc transactionType in GetSystemCodes(Sbm.ApplicationCode.TransactionType)) responseData.Data.TransactionTypes.Add(new AjaxResponse_Data.ItemCodeDesc(transactionType.Code, transactionType.Desc)); // Reference data - statuses. diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Transactions/TransactionController.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Transactions/TransactionController.cs index 7ba6265..d050e86 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Transactions/TransactionController.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Transactions/TransactionController.cs @@ -43,7 +43,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions } // Interpret transaction type, default to 'Sales Order'. - List transactionTypes = GetSystemCodes(Sbm.SystemCode.TransactionType); + List transactionTypes = GetSystemCodes(Sbm.ApplicationCode.TransactionType); Sbm.TransactionType transactionType = EnumUtil.ParseEnum(transactionTypeName, Sbm.TransactionType.SalesOrder); // Transaction page. @@ -55,7 +55,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions SaLogger.Warn($"{SysUtil.Fn} Transaction View invoked without Transaction Type specified."); return RedirectToAction("", ""); } - model.Filter.StatusCat = Internals.GetSystemCodes(Sbm.SystemCode.TransactionStatusCat).GetCodeForType(SbmTransaction.StatusCat.Open); + model.Filter.StatusCat = Internals.GetApplicationCodes(Sbm.ApplicationCode.TransactionStatusCat).GetCodeForType(SbmTransaction.StatusCat.Open); model.Paging.PageNo = SessionData_Portal.Profile.Transaction.Filter.PageNo; model.Paging.PageLength = SessionData_Portal.Profile.Transaction.Filter.PageLength; model.PopulateListConfig(); diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Commodities/Model_Commodity.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Commodities/Model_Commodity.cs index d414ec5..351b384 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Models/Commodities/Model_Commodity.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Commodities/Model_Commodity.cs @@ -106,7 +106,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities } public SaUomType GetCommoditySalesUnitType() { - return (SaUomType)Internals.GetSystemCodes(Sbm.SystemCode.UnitMeasureType).GetTypeForCode(Commodity.SaleUnitType); + return (SaUomType)Internals.GetApplicationCodes(Sbm.ApplicationCode.UnitMeasureType).GetTypeForCode(Commodity.SaleUnitType); } public SysId GetCommoditySalesUnitId() { diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Contacts/Model_Contact.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Contacts/Model_Contact.cs index 9123a0a..20641ce 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Models/Contacts/Model_Contact.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Contacts/Model_Contact.cs @@ -50,14 +50,14 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Contacts } public Sbm.AffiliateType GetFilterContactType() { - Sbm.AffiliateType affiliateType = (Sbm.AffiliateType)SbmSystem.GetSystemCodes(Sbm.SystemCode.AffiliateType).GetTypeForCode(Filter.ContactType); + Sbm.AffiliateType affiliateType = (Sbm.AffiliateType)SbmSystem.GetSystemCodes(Sbm.ApplicationCode.AffiliateType).GetTypeForCode(Filter.ContactType); if (affiliateType == 0 && !StringUtil.IsBlank(Filter.ContactType) && StringUtil.IsNumeric(Filter.ContactType, true)) affiliateType = (Sbm.AffiliateType)StringUtil.ToInt(Filter.ContactType); return affiliateType; } public Sbm.AssociationType GetFilterAssociationTypeExclude() { - Sbm.AssociationType associationType = (Sbm.AssociationType)SbmSystem.GetSystemCodes(Sbm.SystemCode.AssociationType).GetTypeForCode(Filter.AssociationTypeExclude); + Sbm.AssociationType associationType = (Sbm.AssociationType)SbmSystem.GetSystemCodes(Sbm.ApplicationCode.AssociationType).GetTypeForCode(Filter.AssociationTypeExclude); if (associationType == 0 && !StringUtil.IsBlank(Filter.AssociationTypeExclude) && StringUtil.IsNumeric(Filter.AssociationTypeExclude, true)) associationType = (Sbm.AssociationType)StringUtil.ToInt(Filter.AssociationTypeExclude); return associationType; diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Home/Model_Home.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Home/Model_Home.cs index 55a9171..295d732 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Models/Home/Model_Home.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Home/Model_Home.cs @@ -1,7 +1,6 @@ using Sarand.BusinessMgr.Net.Core.Web.App; using Sarand.BusinessMgr.Net.Standard.Base.App; using Sarand.BusinessMgr.Net.Standard.Base.Bus; -using Sarand.BusinessMgr.Net.Standard.Base.Bus.Control; using Sarand.BusinessMgr.Web.Portal.Components; namespace Sarand.BusinessMgr.Web.Portal.Models.Home diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Interfaces/Model_Interface-Config.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Interfaces/Model_Interface-Config.cs new file mode 100644 index 0000000..63b1d91 --- /dev/null +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Interfaces/Model_Interface-Config.cs @@ -0,0 +1,224 @@ +using Sarand.BusinessMgr.Net.Standard.Base.App; +using Sarand.Net.Standard.Base.Bus; +using Sarand.Net.Standard.Base.Core; +using Sarand.Net.Standard.Base.Interfaces; +using System; +using System.Collections.Generic; + +namespace Sarand.BusinessMgr.Web.Portal.Models.Interfaces +{ + //======================================================================= + // Interface model - Configuration. + //======================================================================= + partial class Model_Interface + { + //------------------------------------------------------------------- + + /// Prefix for field names. + public const String FieldNamePrefix = "Interface"; + + /// Item fields. + public enum ItemField + { + // Interface properties. + Id, + Exists, + // Identity. + Context, + Category, + CategoryCode, + Type, + TypeValue, + Code, + // Properties. + Caption, + // Common. + Notes, + Status, + CreatedOn, + UpdatedOn, + Actions, + } + + /// + /// Identifier used by form fields to show control specific messages generated by model validation etc. + /// - Both page and model should use this method to consistently generate the field name. + /// + public static String GetFieldName(ItemField field) + { + return $"{FieldNamePrefix}{field}"; + } + + // List configuration. + public class ListConfigData + { + // Actions. + public class ActionData + { + public class AllowData + { + public bool? Create { get; set; } + public bool? Update { get; set; } + } + public AllowData Allow { get; } = new AllowData(); + } + public ActionData Action { get; } = new ActionData(); + // List columns. + public class ColumnData + { + // Column name prefix. + public String Prefix { get; } = Model_Interface.FieldNamePrefix; + // Hide column. + public HashSet Hide { get; } = new HashSet(StringComparer.InvariantCultureIgnoreCase); + // Column labels. + public Dictionary Label { get; } = new Dictionary(StringComparer.InvariantCultureIgnoreCase); + } + public ColumnData Column { get; } = new ColumnData(); + } + public ListConfigData ListConfig { get; private set; } + + //------------------------------------------------------------------- + /// + /// Populate Interface list configuration data - only required on initial page construction. + /// + public void PopulateListConfig() + { + ListConfig = new ListConfigData(); + PopulateListConfig(ListConfig); + } + public void PopulateListConfig(ListConfigData config) + { + ViewMode pageMode = GetFilterMode(); + bool modeIsSearch = pageMode == ViewMode.Search; + bool modeIsMaintain = pageMode == ViewMode.Maintain; + bool userCanCreateInterfaces = SessionData_Portal.SecurityProfile.UserCanCreateItemType(Sbm.ItemType.Interface); + bool userCanUpdateInterfaces = SessionData_Portal.SecurityProfile.UserCanUpdateItemType(Sbm.ItemType.Interface); + + //--------------------------------------------------------------- + // Actions. + + if (userCanCreateInterfaces) + config.Action.Allow.Create = true; + if (userCanUpdateInterfaces) + config.Action.Allow.Update = true; + + // List columns. + + if (GetFilterInterfaceCategory() > 0) + config.Column.Hide.Add($"{ItemField.Category}"); + + // Actions. + if (!modeIsMaintain) + config.Column.Hide.Add($"{ItemField.Actions}"); + } + + //------------------------------------------------------------------- + // Item configuration. + //------------------------------------------------------------------- + // Legacy Interface dialog tabs and panels. + // Dialog: + // - Category, SerialNumber, DescBrief, Status. + // Tab 1 'Properties': + // Item - Item info Html panel. + // Purchase - price, tax code, on, net price, invoice ref, settlement, payment terms, enhancement, supplier. + // Sale - price, tax code, category, net price, sold price, sold on. + // Rental - cost, cost unit, price, price unit. + // Disposal - method, dispose on. + // Notes. + // Tab 2 'Processes'. + //------------------------------------------------------------------- + + public class ItemConfigData + { + // Update dialog title. + public String Title { get; set; } + // Pre-select Interface type. + public class TypeData + { + public TypeData(string code, String desc) + { + Code = code; + Desc = desc; + } + public String Code { get; set; } + public String Desc { get; set; } + } + public TypeData Type { get; set; } + // Field name prefix. + public String Prefix { get; } = Model_Interface.FieldNamePrefix; + // Control flags. + public bool? ManagedByAccounts { get; set; } + public bool? LocalPricing { get; set; } + // Allowed actions. + public class AllowData + { + public bool? UpdateCode { get; set; } + } + public AllowData Allow { get; } = new AllowData(); + // Item fields. + public class FieldData + { + // Field name prefix. + public String Prefix { get; } = Model_Interface.FieldNamePrefix; + // Hide field. + public HashSet Hide { get; } = new HashSet(StringComparer.InvariantCultureIgnoreCase); + // Read-only field. + public HashSet Readonly { get; } = new HashSet(StringComparer.InvariantCultureIgnoreCase); + // Field labels. + public Dictionary Label { get; } = new Dictionary(StringComparer.InvariantCultureIgnoreCase); + } + public FieldData Field { get; } = new FieldData(); + } + /// + /// Populate item configuration for existing vehicle. + /// + public void PopulateItemConfig(ItemConfigData config, SaInterface interfaceObj) + { + PopulateItemConfig(config, interfaceObj.GetItemId(), interfaceObj.Category); + } + /// + /// Populate item configuration for new or existing vehicle. + /// + public void PopulateItemConfig(ItemConfigData config, ItemId interfaceObjId, SaInterfaceCategory interfaceCategory) + { + // Session configuration. + bool userCanCreateInterfaces = SessionData_Portal.SecurityProfile.UserCanCreateItemType(Sbm.ItemType.Interface); + bool userCanUpdateInterfaces = SessionData_Portal.SecurityProfile.UserCanUpdateItemType(Sbm.ItemType.Interface); + + // Update dialog title. + config.Title = Localiser["caption.interface.update"]; + + //--------------------------------------------------------------- + // Identity. + + // Interface category. + // ToDo - Interface type readonly if any associated items. + if (!userCanUpdateInterfaces || ItemId.IsValid(interfaceObjId)) + config.Field.Readonly.Add($"{ItemField.Category}"); + + // Code. + if (!userCanUpdateInterfaces) + config.Field.Readonly.Add($"{ItemField.Code}"); + + // Caption. + if (!userCanUpdateInterfaces) + config.Field.Readonly.Add($"{ItemField.Caption}"); + + //--------------------------------------------------------------- + // Common properties. + + // Status. + if (!userCanUpdateInterfaces) + config.Field.Readonly.Add($"{ItemField.Status}"); + + // Notes. + if (!userCanUpdateInterfaces) + config.Field.Readonly.Add($"{ItemField.Notes}"); + + //--------------------------------------------------------------- + } + + //------------------------------------------------------------------- + } + //======================================================================= +} diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Interfaces/Model_Interface.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Interfaces/Model_Interface.cs new file mode 100644 index 0000000..66e0094 --- /dev/null +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Interfaces/Model_Interface.cs @@ -0,0 +1,157 @@ +using Sarand.BusinessMgr.Net.Core.Web.App; +using Sarand.BusinessMgr.Net.Core.Web.Components; +using Sarand.BusinessMgr.Web.Portal.Components; +using Sarand.Net.Standard.Base.App; +using Sarand.Net.Standard.Base.Core; +using Sarand.Net.Standard.Base.Interfaces; +using Sarand.Net.Standard.Base.Utils; +using System; +using System.Collections.Generic; + +namespace Sarand.BusinessMgr.Web.Portal.Models.Interfaces +{ + //======================================================================= + public partial class Model_Interface : SbmModel_Portal + { + //------------------------------------------------------------------- + // Definitions. + public enum ViewMode + { + Search, Maintain, InterfacesForItem + } + + //------------------------------------------------------------------- + // Construction. + public Model_Interface(SbmLocaliser localiser) : + base(localiser) + { + } + + //------------------------------------------------------------------- + // Filter properties. + public class FilterData + { + public String Mode { get; set; } + public String CategoryCode { get; set; } + public String Type { get; set; } + public String Search { get; set; } + public String StatusCat { get; set; } + } + public FilterData Filter { get; } = new FilterData(); + public ViewMode GetFilterMode() + { + return EnumUtil.ParseEnum(Filter.Mode, ViewMode.Search); + } + public SaInterfaceCategory GetFilterInterfaceCategory() + { + return (SaInterfaceCategory)Internals.InterfaceCategoryCodes.GetTypeForCode(Filter.CategoryCode); + } + public SaInterfaceCategory GetInterfaceCategory() + { + return (SaInterfaceCategory)Internals.InterfaceCategoryCodes.GetTypeForCode(Interface.CategoryCode); + } + public short GetInterfaceType() + { + return StringUtil.ToShort(Interface.CategoryCode); + } + public SaInterface.StatusCat GetFilterStatusCat() + { + return EnumUtil.ParseEnum(Filter.StatusCat, SaInterface.StatusCat.ActiveOnly); + } + + //------------------------------------------------------------------- + // Item properties. + public class InterfaceData + { + public String Exists { get; set; } + public String Id { get; set; } + public String Context { get; set; } + public String CategoryCode { get; set; } + public String Type { get; set; } + public String Code { get; set; } + public String Caption { get; set; } + public String Notes { get; set; } + public String StatusCode { get; set; } + } + public InterfaceData Interface { get; } = new InterfaceData(); + public SaStatus GetInterfaceStatus() { return SacsSystem.GetStatusForCode(Interface.StatusCode); } + + //------------------------------------------------------------------- + // Validation. + //------------------------------------------------------------------- + // Interface. + public bool ValidateInterfaceData(SbmController_Base.AjaxResponse_Data responseData) + { + // Record disposable items as they are created so all can be disposed when needed. + using (DisposableCollection disposables = new DisposableCollection()) + { + + // Interface Category. + List interfaceCategories = Internals.InterfaceCategoryCodes; + if (Interface.CategoryCode != null) + { + String controlName = "InterfaceCategory"; + SaInterfaceCategory interfaceCategory = (SaInterfaceCategory)interfaceCategories.GetTypeForCode(Interface.CategoryCode); + if (interfaceCategory == SaInterfaceCategory.Unknown) + responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]); + } + + // Interface type. + if (Interface.Type != null) + { + String controlName = "InterfaceType"; + short interfaceType = StringUtil.ToShort(Interface.Type); + if (interfaceType <= 0) + responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]); + if (interfaceType > 100) + responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]); + } + + // Code. + if (Interface.Code != null) + { + String controlName = "InterfaceCode"; + Interface.Code = Interface.Code.ToUpper(); + responseData.SetControlValue(controlName, Interface.Code); + if (StringUtil.IsBlank(Interface.Code)) + responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]); + else if (StringUtil.GetLength(Interface.Code) > GetControlMaxLength(SaInterfaceDbDfn.ColumnIdx.SaInterface_Code)) + responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SaInterfaceDbDfn.ColumnIdx.SaInterface_Code)]); + } + + // Caption. + if (Interface.Caption != null) + { + String controlName = "InterfaceCaption"; + responseData.SetControlValue(controlName, Interface.Caption); + if (StringUtil.GetLength(Interface.Caption) > GetControlMaxLength(SaInterfaceDbDfn.ColumnIdx.SaInterface_Caption)) + responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SaInterfaceDbDfn.ColumnIdx.SaInterface_Caption)]); + } + + // Notes. + if (Interface.Notes != null) + { + String controlName = "InterfaceNotes"; + responseData.SetControlValue(controlName, Interface.Notes); + if (StringUtil.GetLength(Interface.Notes) > GetControlMaxLength(SaInterfaceDbDfn.ColumnIdx.SaInterface_Notes)) + responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SaInterfaceDbDfn.ColumnIdx.SaInterface_Notes)]); + } + + // Interface status. + if (Interface.StatusCode != null) + { + String controlName = "InterfaceStatus"; + if (StringUtil.IsBlank(Interface.StatusCode)) + responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]); + else if (!SaInterface.ValidStatuses.Contains(GetInterfaceStatus())) + responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]); + } + } + + return !responseData.HasControlErrors(); + } + + //------------------------------------------------------------------- + } + //======================================================================= +} diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Requirements/Model_Requirement.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Requirements/Model_Requirement.cs index 35d7bfb..7a651aa 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Models/Requirements/Model_Requirement.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Requirements/Model_Requirement.cs @@ -77,11 +77,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Requirements } public SbmTransaction.StatusCat GetFilterTransactionStatusCat() { - return (SbmTransaction.StatusCat)Internals.GetSystemCodes(Sbm.SystemCode.TransactionStatusCat).GetTypeForCode(Filter.TransactionStatusCat); + return (SbmTransaction.StatusCat)Internals.GetApplicationCodes(Sbm.ApplicationCode.TransactionStatusCat).GetTypeForCode(Filter.TransactionStatusCat); } public SbmRequirement.StatusCat GetFilterRequirementStatusCat() { - return (SbmRequirement.StatusCat)Internals.GetSystemCodes(Sbm.SystemCode.RequirementStatusCat).GetTypeForCode(Filter.StatusCat); + return (SbmRequirement.StatusCat)Internals.GetApplicationCodes(Sbm.ApplicationCode.RequirementStatusCat).GetTypeForCode(Filter.StatusCat); } //------------------------------------------------------------------- diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Transactions/Model_Transaction.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Transactions/Model_Transaction.cs index 6e606fd..181f777 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Models/Transactions/Model_Transaction.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Transactions/Model_Transaction.cs @@ -59,7 +59,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions } public String GetFilterAssociationTypeCode() { - List associationTypes = Internals.GetSystemCodes(Sbm.SystemCode.AssociationType); + List associationTypes = Internals.GetApplicationCodes(Sbm.ApplicationCode.AssociationType); return SbmTransaction.GetAssociationTypes(GetFilterTransactionType()) .Select(item => associationTypes.GetCodeForType(item)) .Where(item => !StringUtil.IsBlank(item)) @@ -67,7 +67,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions } public SbmTransaction.StatusCat GetFilterTransactionStatusCat() { - return (SbmTransaction.StatusCat)Internals.GetSystemCodes(Sbm.SystemCode.TransactionStatusCat).GetTypeForCode(Filter.StatusCat); + return (SbmTransaction.StatusCat)Internals.GetApplicationCodes(Sbm.ApplicationCode.TransactionStatusCat).GetTypeForCode(Filter.StatusCat); } //------------------------------------------------------------------- diff --git a/SaBusinessMgrCoreWebPortal/SaBusinessMgrCoreWebPortal.csproj b/SaBusinessMgrCoreWebPortal/SaBusinessMgrCoreWebPortal.csproj index 454d3fc..6d9d236 100644 --- a/SaBusinessMgrCoreWebPortal/SaBusinessMgrCoreWebPortal.csproj +++ b/SaBusinessMgrCoreWebPortal/SaBusinessMgrCoreWebPortal.csproj @@ -80,4 +80,8 @@ + + + + diff --git a/SaBusinessMgrCoreWebPortal/Views/Association/Panel-AssociationMaintain.cshtml b/SaBusinessMgrCoreWebPortal/Views/Association/Panel-AssociationMaintain.cshtml index 1bdac9b..bcdf9fa 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Association/Panel-AssociationMaintain.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Association/Panel-AssociationMaintain.cshtml @@ -44,14 +44,15 @@ @* Filter Panel *@
-
+
@* Association Category *@
@Localiser["label.type"]
@Html.DropDownList("Filter.AssociationType", Model.GetAssociationTypeCodesForFilterDropdown(), null, new { @id = "", @class = "FilterAssociationType sbm-select" })
-
+
+
@* Association filter - name etc. *@
@Localiser["label.search"]
diff --git a/SaBusinessMgrCoreWebPortal/Views/Association/Panel-AssociationSelect.cshtml b/SaBusinessMgrCoreWebPortal/Views/Association/Panel-AssociationSelect.cshtml index 5ddd69d..3087085 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Association/Panel-AssociationSelect.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Association/Panel-AssociationSelect.cshtml @@ -23,7 +23,7 @@ @* Filter Panel *@
-
+
@* Association type *@
@Localiser["label.type"]
@@ -31,7 +31,7 @@ @Html.DropDownList("Filter.AssociationType", Model.GetAssociationTypeCodesForFilterDropdown(), null, new { @id = "", @class = "FilterAssociationType sbm-select" })
-
+
@* Association filter - name etc. *@
@Localiser["label.search"]
diff --git a/SaBusinessMgrCoreWebPortal/Views/Commodity/Panel-CommodityMaintain.cshtml b/SaBusinessMgrCoreWebPortal/Views/Commodity/Panel-CommodityMaintain.cshtml index ac99752..bdef863 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Commodity/Panel-CommodityMaintain.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Commodity/Panel-CommodityMaintain.cshtml @@ -40,22 +40,21 @@ @* Filter Panel *@
-
+
@* Commodity Category *@
@Localiser["label.type"]
@Html.DropDownList("Filter.CommodityType", Model.GetCommodityTypeCodesForFilterDropdown(), null, new { @id = "", @class = "FilterCommodityType sbm-select" })
-
+
+
@* Commodity filter - code, description etc *@
@Localiser["label.search"]
@Html.TextBox("Filter.Search", "", new { @type = "search", @id = "", @class = "FilterSearch sbm-input", @maxlength = "32" })
-
-
} diff --git a/SaBusinessMgrCoreWebPortal/Views/Commodity/Panel-CommoditySelect.cshtml b/SaBusinessMgrCoreWebPortal/Views/Commodity/Panel-CommoditySelect.cshtml index c2d9ea7..3dca9d2 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Commodity/Panel-CommoditySelect.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Commodity/Panel-CommoditySelect.cshtml @@ -11,7 +11,7 @@ -
+
@using (@Html.BeginForm(FormMethod.Post, new { @id = "", @class = "frmCommodityFilter sbm-form", @onSubmit = "return false;" })) { @@ -20,14 +20,15 @@ @* Filter Panel *@
-
+
@* Commodity type *@
@Localiser["label.type"]
@Html.DropDownList("Filter.CommodityType", Model.GetCommodityTypeCodesForFilterDropdown(), Localiser["label.any"], new { @id = "", @class = "FilterCommodityType sbm-select" })
-
+
+
@* Commodity filter - name etc. *@
@Localiser["label.search"]
diff --git a/SaBusinessMgrCoreWebPortal/Views/Contact/Panel-ContactMaintain.cshtml b/SaBusinessMgrCoreWebPortal/Views/Contact/Panel-ContactMaintain.cshtml index c745841..251e562 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Contact/Panel-ContactMaintain.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Contact/Panel-ContactMaintain.cshtml @@ -45,14 +45,15 @@ @* Filter Panel *@
-
+
@* Contact type *@
@Localiser["label.type"]
@Html.DropDownList("Filter.ContactType", Model.GetAffiliateTypeCodesForFilterDropdown(), null, new { @id = "", @class = "FilterContactType sbm-select" })
-
+
+
@* Contact filter - name etc. *@
@Localiser["label.search"]
diff --git a/SaBusinessMgrCoreWebPortal/Views/Contact/Panel-ContactSelect.cshtml b/SaBusinessMgrCoreWebPortal/Views/Contact/Panel-ContactSelect.cshtml index ffd12f7..3225089 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Contact/Panel-ContactSelect.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Contact/Panel-ContactSelect.cshtml @@ -21,14 +21,15 @@ @* Filter Panel *@
-
+
@* Contact type *@
@Localiser["label.type"]
@Html.DropDownList("Filter.ContactType", Model.GetAffiliateTypeCodesForFilterDropdown(Sbm.AffiliateType.ContactGroup), Localiser["label.any"], new { @id = "", @class = "FilterContactType sbm-select" })
-
+
+
@* Contact filter - name etc. *@
@Localiser["label.search"]
diff --git a/SaBusinessMgrCoreWebPortal/Views/Requirement/Panel-RequirementList.cshtml b/SaBusinessMgrCoreWebPortal/Views/Requirement/Panel-RequirementList.cshtml index aa372ea..f7016ab 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Requirement/Panel-RequirementList.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Requirement/Panel-RequirementList.cshtml @@ -12,13 +12,16 @@ @Localiser["label.seq"] - @Localiser["label.code"] + @Localiser["label.code"] @Localiser["label.description"] - @Localiser["label.quantity"] @if (Model.UserCanViewFinancials()) { - @Localiser["label.amount.unit"] - @Localiser["label.amount.net"] + @Localiser["label.unit"] + } + @Localiser["label.quantity"] + @if (Model.UserCanViewFinancials()) + { + @Localiser["label.net"] } @Localiser["label.notes"] @Localiser["label.status"] @@ -44,11 +47,14 @@ - @if (Model.UserCanViewFinancials()) { - + } + + @if (Model.UserCanViewFinancials()) + { + } diff --git a/SaBusinessMgrCoreWebPortal/Views/Requirement/Panel-RequirementMaintain.cshtml b/SaBusinessMgrCoreWebPortal/Views/Requirement/Panel-RequirementMaintain.cshtml index be29ce2..a52160d 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Requirement/Panel-RequirementMaintain.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Requirement/Panel-RequirementMaintain.cshtml @@ -40,8 +40,10 @@ @* Filter Panel *@
-
- @* Requirement filter - code, description etc *@ +
+
+
+ @* Search filter - narrative, commodity code, notes etc *@
@Localiser["label.search"]
@Html.TextBox("Filter.Search", "", new { @type = "search", @id = "", @class = "FilterSearch sbm-input", @maxlength = "32" }) diff --git a/SaBusinessMgrCoreWebPortal/Views/Requirement/Panel-RequirementSelect.cshtml b/SaBusinessMgrCoreWebPortal/Views/Requirement/Panel-RequirementSelect.cshtml index 61ee3e4..afb01e5 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Requirement/Panel-RequirementSelect.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Requirement/Panel-RequirementSelect.cshtml @@ -23,8 +23,10 @@ @* Filter Panel *@
-
- @* Requirement filter - name etc. *@ +
+
+
+ @* Search filter - narrative, commodity code, notes etc *@
@Localiser["label.search"]
@Html.TextBox("Filter.Search", "", new { @type = "search", @id = "", @class = "FilterSearch sbm-input", @maxlength = "32" }) diff --git a/SaBusinessMgrCoreWebPortal/Views/Transaction/Panel-TransactionList.cshtml b/SaBusinessMgrCoreWebPortal/Views/Transaction/Panel-TransactionList.cshtml index b9031e6..1fd2dd1 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Transaction/Panel-TransactionList.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Transaction/Panel-TransactionList.cshtml @@ -24,8 +24,8 @@ @Localiser["label.items"] @if (Model.UserCanViewFinancials()) { - @Localiser["label.amount.net"] - @Localiser["label.amount.tax"] + @Localiser["label.net"] + @Localiser["label.tax"] } @Localiser["label.notes"] @Localiser["label.status"] @@ -64,7 +64,9 @@ } - + +
+
diff --git a/SaBusinessMgrCoreWebPortal/Views/Transaction/Panel-TransactionMaintain.cshtml b/SaBusinessMgrCoreWebPortal/Views/Transaction/Panel-TransactionMaintain.cshtml index c2ec039..51285d8 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Transaction/Panel-TransactionMaintain.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Transaction/Panel-TransactionMaintain.cshtml @@ -48,7 +48,7 @@ } else { -
+
@* Transaction Category *@
@Localiser["label.type"]
@@ -56,22 +56,24 @@
} -
+
@* Transaction Status *@
@Localiser["label.status"]
@Html.DropDownList("Filter.StatusCat", ModelTransaction?.GetTransactionStatusCatsForFilterDropdown() ?? Model.GetEmptyListForSelect(), null, new { @id = "", @class = "FilterStatusCat sbm-select" })
-
+ @if (ModelTransaction?.GetFilterTransactionType() <= 0) + { +
+ } +
@* Transaction filter - code, description etc *@
@Localiser["label.search"]
@Html.TextBox("Filter.Search", "", new { @type = "search", @id = "", @class = "FilterSearch sbm-input", @maxlength = "32" })
-
-
} diff --git a/SaBusinessMgrCoreWebPortal/Views/Transaction/Panel-TransactionSelect.cshtml b/SaBusinessMgrCoreWebPortal/Views/Transaction/Panel-TransactionSelect.cshtml index 0748598..a631d66 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Transaction/Panel-TransactionSelect.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Transaction/Panel-TransactionSelect.cshtml @@ -20,14 +20,15 @@ @* Filter Panel *@
-
+
@* Transaction type *@
@Localiser["label.type"]
@Html.DropDownList("Filter.Type", Model.GetTransactionTypeCodesForFilterDropdown(), Localiser["label.any"], new { @id = "", @class = "FilterType sbm-select" })
-
+
+
@* Transaction filter - name etc. *@
@Localiser["label.search"]
diff --git a/SaBusinessMgrCoreWebPortal/wwwroot/css/sbm-data.css b/SaBusinessMgrCoreWebPortal/wwwroot/css/sbm-data.css index e68bedb..71701ee 100644 --- a/SaBusinessMgrCoreWebPortal/wwwroot/css/sbm-data.css +++ b/SaBusinessMgrCoreWebPortal/wwwroot/css/sbm-data.css @@ -62,13 +62,13 @@ .sbm-panel-filter { - padding: 6px 8px 2px 8px; + padding: 4px 8px 4px 8px; border-bottom: solid 1px var(--color-panel-data); } .sbm-panel-filter .sbm-label { - padding: 2px 8px 0 0; + padding: 4px 8px 0 0; } .sbm-panel-filter input[type="text"], diff --git a/SaBusinessMgrCoreWebPortal/wwwroot/css/sbm-form.css b/SaBusinessMgrCoreWebPortal/wwwroot/css/sbm-form.css index 754991c..d494913 100644 --- a/SaBusinessMgrCoreWebPortal/wwwroot/css/sbm-form.css +++ b/SaBusinessMgrCoreWebPortal/wwwroot/css/sbm-form.css @@ -75,8 +75,7 @@ .sbm-form .sbm-form-control .sbm-label { - margin: 2px 12px 8px 0; - text-align: right; + margin: 2px 4px 8px 12px; } .sbm-form .sbm-form-control .sbm-label,