diff --git a/SaBusMgrCoreWeb/Web/App/SbmSessionConfig.cs b/SaBusMgrCoreWeb/Web/App/SbmAppConfig.cs similarity index 92% rename from SaBusMgrCoreWeb/Web/App/SbmSessionConfig.cs rename to SaBusMgrCoreWeb/Web/App/SbmAppConfig.cs index 4491af4..4bee073 100644 --- a/SaBusMgrCoreWeb/Web/App/SbmSessionConfig.cs +++ b/SaBusMgrCoreWeb/Web/App/SbmAppConfig.cs @@ -8,7 +8,9 @@ using System.Text; namespace Sarand.BusinessMgr.Net.Core.Web.App { //======================================================================= - public class SbmSessionConfig + // BusinessMgr Application Configuration. + //======================================================================= + public class SbmAppConfig { //--------------------------------------------------------------- // Data members. @@ -16,7 +18,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App //--------------------------------------------------------------- // Construction. - public SbmSessionConfig(String context, ConfigurationSection configSection, SbmSessionConfig defaultConfig) + public SbmAppConfig(String context, ConfigurationSection configSection, SbmAppConfig defaultConfig) { Context = context; populateDefaults(defaultConfig); @@ -24,7 +26,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App } //--------------------------------------------------------------- - private void populateDefaults(SbmSessionConfig defaultConfig) + private void populateDefaults(SbmAppConfig defaultConfig) { if (defaultConfig == null) return; Security.Password.MinLength = defaultConfig.Security.Password.MinLength; @@ -87,8 +89,10 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App { Logging.RootFolder = StringUtil.OnEmpty(logging["RootFolder"], Logging.RootFolder); } - // Database. - extractDatabaseConfig(BusMgrDatabase, configSection.GetSection("CoreDatabase")); + // Databases. + extractDatabaseConfig(ControlDatabase, configSection.GetSection("ControlDatabase")); + extractDatabaseConfig(BusMgrDatabase, configSection.GetSection("BusMgrDatabase")); + extractDatabaseConfig(TemplateDatabase, configSection.GetSection("TemplateDatabase")); // Variants. foreach (ConfigurationSection variantSection in configSection.GetSection("Variants").GetChildren()) { @@ -179,7 +183,9 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App public String User { get; internal set; } public String Password { get; internal set; } } + public DatabaseConfig ControlDatabase { get; } = new DatabaseConfig(); public DatabaseConfig BusMgrDatabase { get; } = new DatabaseConfig(); + public DatabaseConfig TemplateDatabase { get; } = new DatabaseConfig(); // Documents. public class DocumentsConfig { diff --git a/SaBusMgrCoreWeb/Web/App/SbmApplication_Web.cs b/SaBusMgrCoreWeb/Web/App/SbmApplication_Web.cs index c76424d..4cb2507 100644 --- a/SaBusMgrCoreWeb/Web/App/SbmApplication_Web.cs +++ b/SaBusMgrCoreWeb/Web/App/SbmApplication_Web.cs @@ -5,7 +5,6 @@ using Sarand.BusinessMgr.Net.Standard.Base.Consoles; using Sarand.Net.Standard.Base.App; 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.IO; @@ -16,7 +15,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.Data; using System; using System.Collections.Generic; using System.Linq; @@ -36,24 +34,23 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App // Protected construction. protected SbmApplication_Web() : base(new PropertySet()) { - WebApp = this; + SbmGlobals_Web.Application = this; } //------------------------------------------------------------------- // Properties. public override SbmSystem System { get { return System_Web; } } public SbmSystem_Web System_Web { get; protected set; } - public static SbmApplication_Web WebApp { get; private set; } // Application instance. public override Sbm.InstanceType InstanceType { get { return instanceType; } } public override String EnvironmentName { get { return environmentName; } } public bool Development { get; protected set; } public String LoggingRootFolder { get; protected set; } = ""; // Application components. + public abstract SbmAppConfig AppConfig { get; } public abstract String SessionCookieName { get; } - public virtual SbmSessionContext SessionContext { get; protected set; } - public abstract SbmSessionConfig SessionConfig { get; } - public override IDatabaseInfo CreateBusMgrDbInfo(SbmSessionContext sessionContext) { return new DbDataItem.DatabaseInfo(GetBusMgrDatabase(sessionContext)); } + public abstract List GetSessionContextIdxs(); + public abstract SbmSessionContext GetSessionContext(ushort index); // Configuration. public IConfiguration Configuration { get; protected set; } public IConfiguration SbmConfiguration { get; protected set; } @@ -66,14 +63,15 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App List applicationParams = new List(); applicationParams.Add("Host", SbmSystem.ComputerName); applicationParams.Add("Version", Sbm.Version.GetFullVersion()); - applicationParams.Add("Instance", InstanceType.ToString() + (!StringUtil.IsEmpty(SessionConfig.Instance) ? " [" + SessionConfig.Instance + "]" : "")); + applicationParams.Add("Instance", InstanceType.ToString() + (!StringUtil.IsEmpty(AppConfig.Instance) ? " [" + AppConfig.Instance + "]" : "")); applicationParams.Add("Configuration", SbmSystem.DebugMode ? "Debug" : "Release"); applicationParams.Add("Environment", EnvironmentName); - applicationParams.Add("Database", SessionConfig.BusMgrDatabase.Location); + applicationParams.Add("Control database", AppConfig.ControlDatabase.Location); + applicationParams.Add("BusMgr database", AppConfig.BusMgrDatabase.Location); applicationParams.Add("Application root", SbmSystem.ApplicationFolder); - if (!StringUtil.IsEmpty(SessionConfig.Documents.RootFolder)) - applicationParams.Add("Documents root", SessionConfig.Documents.RootFolder); - applicationParams.Add("Email context", SessionConfig.Email.Context + (!StringUtil.IsEmpty(EmailConfig.SMTP.Server) ? " [" + EmailConfig.SMTP.Server + "]" : "")); + if (!StringUtil.IsEmpty(AppConfig.Documents.RootFolder)) + applicationParams.Add("Documents root", AppConfig.Documents.RootFolder); + applicationParams.Add("Email context", AppConfig.Email.Context + (!StringUtil.IsEmpty(EmailConfig.SMTP.Server) ? " [" + EmailConfig.SMTP.Server + "]" : "")); SaLogger.Info(fn + " Application start." + applicationParams.Select(item => StringUtil.PadRight(item.Item1 + ":", 20, ' ') + item.Item2).Concat("", "\n\t"), true); } @@ -107,7 +105,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App } public override SaSecurityConsole CreateSecurityConsole(SbmUserContext userContext) { - return null; + return new SbmSecurityConsole_Web(userContext, GetBusMgrDatabase(userContext.SessionContext)); } public override SaCodeTypeConsole CreateCodeTypeConsole(SbmUserContext userContext) { @@ -135,7 +133,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App } public override SaUpdateLogConsole CreateUpdateLogConsole(SbmUserContext userContext) { - return null; + return new SbmUpdateLogConsole_Web(userContext, GetBusMgrDatabase(userContext.SessionContext)); } public override SbmEmailConsole CreateEmailConsole(SbmUserContext userContext) { diff --git a/SaBusMgrCoreWeb/Web/App/SbmGlobals_Web.cs b/SaBusMgrCoreWeb/Web/App/SbmGlobals_Web.cs new file mode 100644 index 0000000..f2dbaef --- /dev/null +++ b/SaBusMgrCoreWeb/Web/App/SbmGlobals_Web.cs @@ -0,0 +1,28 @@ +using Sarand.Net.Standard.Base.CodeTypes; +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; + +namespace Sarand.BusinessMgr.Net.Core.Web.App +{ + //======================================================================= + public static class SbmGlobals_Web + { + //------------------------------------------------------------------- + // System. + public static SbmSystem_Web System { get; set; } = null; + + //------------------------------------------------------------------- + // Application. + public static SbmApplication_Web Application { get; set; } = null; + + //------------------------------------------------------------------- + } + //======================================================================= +} diff --git a/SaBusMgrCoreWeb/Web/Consoles/SbmSecurityConsole_Web.cs b/SaBusMgrCoreWeb/Web/Consoles/SbmSecurityConsole_Web.cs new file mode 100644 index 0000000..3a18d46 --- /dev/null +++ b/SaBusMgrCoreWeb/Web/Consoles/SbmSecurityConsole_Web.cs @@ -0,0 +1,55 @@ +using Sarand.BusinessMgr.Net.Standard.Base.App; +using Sarand.BusinessMgr.Net.Standard.Dbas.Consoles; +using Sarand.Net.Standard.Base.Bus; +using Sarand.Net.Standard.Base.Dbas; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Sarand.BusinessMgr.Net.Core.Web.Consoles +{ + //======================================================================= + public class SbmSecurityConsole_Web : SbmSecurityConsole_Dbas + { + //------------------------------------------------------------------- + // Data members. + + //------------------------------------------------------------------- + // Construction. + public SbmSecurityConsole_Web(SbmUserContext userContext, ISacsDatabase database) : base(userContext, database) + { + } + protected override void Dispose(bool disposing) + { + if (disposing) + { + } + base.Dispose(disposing); + } + + //------------------------------------------------------------------- + // Properties. + + //------------------------------------------------------------------- + protected override ShowUserLoginFormFunction ShowUserLoginFormFn => throw new NotImplementedException(); + protected override ShowManageSecurityDialogFunction ShowManageSecurityDialogFn => throw new NotImplementedException(); + public override bool OnSecurityGroupModified(SysId userId) + { + return true; + } + public override bool OnUserModified(SysId userId) + { + return true; + } + protected override bool OnLogin(SysId userId) + { + return true; + } + protected override void OnLogout() + { + } + + //------------------------------------------------------------------- + } + //======================================================================= +} diff --git a/SaBusMgrCoreWeb/Web/Consoles/SbmUpdateLogConsole_Web.cs b/SaBusMgrCoreWeb/Web/Consoles/SbmUpdateLogConsole_Web.cs new file mode 100644 index 0000000..c32575e --- /dev/null +++ b/SaBusMgrCoreWeb/Web/Consoles/SbmUpdateLogConsole_Web.cs @@ -0,0 +1,38 @@ +using Sarand.BusinessMgr.Net.Standard.Base.App; +using Sarand.BusinessMgr.Net.Standard.Dbas.Consoles; +using Sarand.Net.Standard.Base.Dbas; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Sarand.BusinessMgr.Net.Core.Web.Consoles +{ + //======================================================================= + public class SbmUpdateLogConsole_Web : SbmUpdateLogConsole_Dbas + { + //------------------------------------------------------------------- + // Data members. + + //------------------------------------------------------------------- + // Construction. + public SbmUpdateLogConsole_Web(SbmUserContext userContext, ISacsDatabase database) : base(userContext, database) + { + } + protected override void Dispose(bool disposing) + { + if (disposing) + { + } + base.Dispose(disposing); + } + + //------------------------------------------------------------------- + // Properties. + + //------------------------------------------------------------------- + protected override ShowUpdateLogDialogFunction ShowUpdateLogDialogFn => throw new NotImplementedException(); + + //------------------------------------------------------------------- + } + //======================================================================= +} diff --git a/SaBusMgrCoreWeb/Web/Controllers/SbmController_Base.cs b/SaBusMgrCoreWeb/Web/Controllers/SbmController_Base.cs index c001577..7d4c87c 100644 --- a/SaBusMgrCoreWeb/Web/Controllers/SbmController_Base.cs +++ b/SaBusMgrCoreWeb/Web/Controllers/SbmController_Base.cs @@ -67,9 +67,9 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers //------------------------------------------------------------------- // Properties. public bool DebugMode { get; } = SacsSystem.DebugMode; - protected SbmApplication_Web App { get { return SbmApplication_Web.WebApp; } } - public SbmSessionConfig SessionConfig { get { return App.SessionConfig; } } - public SbmSessionContext SessionContext { get { return App.SessionContext; } } + protected SbmApplication_Web App { get { return SbmGlobals_Web.Application; } } + public SbmAppConfig AppConfig { get { return App.AppConfig; } } + public SbmSessionContext SessionContext { get { return UserContext?.SessionContext ?? null; } } public SbmUserContext UserContext { get { return SessionData.UserContext; } } protected SbmLocaliser Localiser { get; } /// @@ -177,10 +177,10 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers if (StoreSessionData) { String sessionDataJson = JsonConvert.SerializeObject(SessionData); - HttpContext.Session.Set(SessionStorage.SessionKey_SessionConfig, SessionStorage.sessionDataEncoding.GetBytes(sessionDataJson)); + HttpContext.Session.Set(SessionStorage.SessionKey_SessionData, SessionStorage.sessionDataEncoding.GetBytes(sessionDataJson)); } } - else HttpContext.Session.Remove(SessionStorage.SessionKey_SessionConfig); + else HttpContext.Session.Remove(SessionStorage.SessionKey_SessionData); // Response headers. if (baseModel != null && baseModel.ProhibitCache) @@ -306,7 +306,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers public class SessionStorage { public SbmSessionData_Web SessionData { get; set; } - public static String SessionKey_SessionConfig { get; } = "SbmSessionData"; + public static String SessionKey_SessionData { get; } = "SbmSessionData"; public static Encoding sessionDataEncoding { get; } = Encoding.UTF8; //JSON Serialisation. public class SbmSessionDataContractResolver : DefaultContractResolver @@ -347,7 +347,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Controllers if (sessionStorage.SessionData == null) { byte[] sessionDataBytes = null; - HttpContext.Session.TryGetValue(SessionStorage.SessionKey_SessionConfig, out sessionDataBytes); + HttpContext.Session.TryGetValue(SessionStorage.SessionKey_SessionData, out sessionDataBytes); if (sessionDataBytes != null) { String sessionDataJson = SessionStorage.sessionDataEncoding.GetString(sessionDataBytes); diff --git a/SaBusMgrCoreWeb/Web/Helpers/SbmAppConfigHelper.cs b/SaBusMgrCoreWeb/Web/Helpers/SbmAppConfigHelper.cs new file mode 100644 index 0000000..76391c8 --- /dev/null +++ b/SaBusMgrCoreWeb/Web/Helpers/SbmAppConfigHelper.cs @@ -0,0 +1,70 @@ +using Microsoft.Extensions.Configuration; +using Sarand.BusinessMgr.Net.Core.Web.App; +using Sarand.BusinessMgr.Net.Standard.Base.App; +using Sarand.Net.Standard.Base.Utils; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Sarand.BusinessMgr.Net.Core.Web.Helpers +{ + //======================================================================= + public static class SbmAppConfigHelper + { + //------------------------------------------------------------------- + public static Dictionary ExtractAppConfigs(IConfigurationSection appConfigsSection) + { + // NB The set of configurations will only allow one per context. + // Only the last configuration found for each context will be stored (NB usually only one of each apart from 'Defaults'). + Dictionary appConfigs = new Dictionary(); + + // Start the list with a default 'Defaults' configuration - values set to application defaults (defined in Sbm). + // NB This can be overridden in each level of configuration. + // Settings from the 'Defaults' configuration provide values where they are missing from other configurations. + // NB Coverage may not be 100% - just where it's proven needed. + SbmAppConfig defaultsAppConfig = new SbmAppConfig(Sbm.Config.Context_Defaults, null, null); + appConfigs.Add(defaultsAppConfig.Context, defaultsAppConfig); + + // Load session configurations. + foreach (ConfigurationSection appConfigSection in appConfigsSection.GetChildren()) + { + if (StringUtil.IsEmpty(appConfigSection.Key)) continue; + + // Extract the configuration, supplying current 'Defaults' to supply missing values, and add to the list. + SbmAppConfig appConfig = new SbmAppConfig(appConfigSection.Key, appConfigSection, defaultsAppConfig); + appConfigs.Remove(appConfigSection.Key); + appConfigs.Add(appConfigSection.Key, appConfig); + + // Replace the 'Defaults' configuration if this one matches the context. + if (appConfig.Context.EqualsCI(Sbm.Config.Context_Defaults)) + defaultsAppConfig = appConfig; + } + return appConfigs; + } + + //------------------------------------------------------------------- + } + + //======================================================================= + public static class AppConfigList + { + public static SbmAppConfig getConfigForApplication(this List appConfigs) + { + SbmAppConfig defaultsAppConfig = new SbmAppConfig("", null, null); + SbmApplication app = SbmGlobals_Web.Application; + if (app != null) + { + foreach (SbmAppConfig appConfig in appConfigs) + { + if (appConfig.Environments.ContainsCI(app.EnvironmentName)) + return appConfig; + if (appConfig.Context.EqualsCI(Sbm.Config.Context_Defaults)) + defaultsAppConfig = appConfig; + } + } + return defaultsAppConfig; + } + } + + //======================================================================= +} diff --git a/SaBusMgrCoreWeb/Web/Helpers/SbmEmailConfigHelper.cs b/SaBusMgrCoreWeb/Web/Helpers/SbmEmailConfigHelper.cs index 46b37a7..758e342 100644 --- a/SaBusMgrCoreWeb/Web/Helpers/SbmEmailConfigHelper.cs +++ b/SaBusMgrCoreWeb/Web/Helpers/SbmEmailConfigHelper.cs @@ -75,13 +75,13 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Helpers //======================================================================= public static class EmailConfigList { - public static SbmEmailConfig getConfigForSession(this List emailConfigs, SbmSessionConfig sessionConfig) + public static SbmEmailConfig getConfigForSession(this List emailConfigs, SbmAppConfig appConfig) { - if (sessionConfig != null && !StringUtil.IsEmpty(sessionConfig.Email.Context)) + if (appConfig != null && !StringUtil.IsEmpty(appConfig.Email.Context)) { foreach (SbmEmailConfig emailConfig in emailConfigs) { - if (emailConfig.Context.EqualsCI(sessionConfig.Email.Context)) + if (emailConfig.Context.EqualsCI(appConfig.Email.Context)) return emailConfig; } } diff --git a/SaBusMgrCoreWeb/Web/Helpers/SbmSessionConfigHelper.cs b/SaBusMgrCoreWeb/Web/Helpers/SbmSessionConfigHelper.cs deleted file mode 100644 index 184f251..0000000 --- a/SaBusMgrCoreWeb/Web/Helpers/SbmSessionConfigHelper.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Microsoft.Extensions.Configuration; -using Sarand.BusinessMgr.Net.Core.Web.App; -using Sarand.BusinessMgr.Net.Standard.Base.App; -using Sarand.Net.Standard.Base.Utils; -using System; -using System.Collections.Generic; -using System.Text; - -namespace Sarand.BusinessMgr.Net.Core.Web.Helpers -{ - //======================================================================= - public static class SbmSessionConfigHelper - { - //------------------------------------------------------------------- - public static Dictionary ExtractSessionConfigs(IConfigurationSection sessionConfigsSection) - { - // NB The set of configurations will only allow one per context. - // Only the last configuration found for each context will be stored (NB usually only one of each apart from 'Defaults'). - Dictionary sessionConfigs = new Dictionary(); - - // Start the list with a default 'Defaults' configuration - values set to application defaults (defined in Sbm). - // NB This can be overridden in each level of configuration. - // Settings from the 'Defaults' configuration provide values where they are missing from other configurations. - // NB Coverage may not be 100% - just where it's proven needed. - SbmSessionConfig defaultsSessionConfig = new SbmSessionConfig(Sbm.Config.Context_Defaults, null, null); - sessionConfigs.Add(defaultsSessionConfig.Context, defaultsSessionConfig); - - // Load session configurations. - foreach (ConfigurationSection sessionConfigSection in sessionConfigsSection.GetChildren()) - { - if (StringUtil.IsEmpty(sessionConfigSection.Key)) continue; - - // Extract the configuration, supplying current 'Defaults' to supply missing values, and add to the list. - SbmSessionConfig sessionConfig = new SbmSessionConfig(sessionConfigSection.Key, sessionConfigSection, defaultsSessionConfig); - sessionConfigs.Remove(sessionConfigSection.Key); - sessionConfigs.Add(sessionConfigSection.Key, sessionConfig); - - // Replace the 'Defaults' configuration if this one matches the context. - if (sessionConfig.Context.EqualsCI(Sbm.Config.Context_Defaults)) - defaultsSessionConfig = sessionConfig; - } - return sessionConfigs; - } - - //------------------------------------------------------------------- - } - - //======================================================================= - public static class SessionConfigList - { - public static SbmSessionConfig getConfigForApplication(this List sessionConfigs) - { - SbmSessionConfig defaultsSessionConfig = new SbmSessionConfig("", null, null); - SbmApplication app = SbmGlobals.Application; - if (app != null) - { - foreach (SbmSessionConfig sessionConfig in sessionConfigs) - { - if (sessionConfig.Environments.ContainsCI(app.EnvironmentName)) - return sessionConfig; - if (sessionConfig.Context.EqualsCI(Sbm.Config.Context_Defaults)) - defaultsSessionConfig = sessionConfig; - } - } - return defaultsSessionConfig; - } - } - - //======================================================================= -} diff --git a/SaBusMgrCoreWeb/Web/Helpers/SbmSessionContextHelper_Web.cs b/SaBusMgrCoreWeb/Web/Helpers/SbmSessionContextHelper_Web.cs new file mode 100644 index 0000000..8fdd440 --- /dev/null +++ b/SaBusMgrCoreWeb/Web/Helpers/SbmSessionContextHelper_Web.cs @@ -0,0 +1,92 @@ +using Sarand.BusinessMgr.Net.Core.Web.App; +using Sarand.BusinessMgr.Net.Standard.Base.App; +using Sarand.Net.Standard.Base.App; +using Sarand.Net.Standard.Base.Core; +using Sarand.Net.Standard.Base.Dbas; +using Sarand.Net.Standard.Base.Security; +using Sarand.Net.Standard.Base.Utils; +using Sarand.Net.Standard.Dbas.Data; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Sarand.BusinessMgr.Net.Core.Web.Helpers +{ + //======================================================================= + // Session Context utility functions. + //======================================================================= + public static class SbmSessionContextHelper_Web + { + //------------------------------------------------------------------- + // Data members. + private static String className = typeof(SbmSessionContextHelper_Web).Name; + + //------------------------------------------------------------------- + // Session Contexts. + //------------------------------------------------------------------- + public static SbmSessionContext GetSessionContext (ushort idx) + { + SbmApplication_Web app = SbmGlobals_Web.Application; + return app.GetSessionContext(idx); + } + + //------------------------------------------------------------------- + // Session Contexts for User Email Address + //------------------------------------------------------------------- + /// + /// Identify the session context that corresponds with the BusinessMgr + /// database for the specified user by email address. + /// + public static List GetSessionContextIdxsForUsersBusMgrDatabase(String emailAddress) + { + String fn = className + ".GetSessionContextIdxForUsersBusMgrDatabase"; + String alias_SecurityItem = "SecItm"; + String alias_Affiliate = "Affil"; + List sessionContextIdxs = new List(); + if (StringUtil.IsEmpty(emailAddress)) return sessionContextIdxs; + + // Get the session context indices defined by the application. + SbmApplication_Web app = SbmGlobals_Web.Application; + foreach (ushort sessionContextIdx in app.GetSessionContextIdxs()) + { + // Retrieve the session context. + SbmSessionContext sessionContext = app.GetSessionContext(sessionContextIdx); + if (sessionContext == null) + { + SaLogger.Warn(fn + " Failed to retrieve SessionContext for idx: " + sessionContextIdx); + continue; + } + // Retrieve the BusinessMgr database. + ISacsDatabase db = app.GetBusMgrDatabase(sessionContext); + if (db == null) + { + SaLogger.Warn(fn + " Failed to retrieve SessionContext for idx: " + sessionContextIdx); + continue; + } + + // Query to check for Security Item matching the email with associated Affiliate. + // NB This is done independently for each database in case there are different + // DBMSs involved with different value formatting or syntax rules. + DbQuery qry = new DbQuery(db.DbmsType); + qry.Tables.Add(SaSecurityDbDfn.GetTableName(SaSecurityDbDfn.TableIdx.SaSecItem), alias_SecurityItem); + qry.Columns.Add(SaSecurityDbDfn.GetColumnNameQual(SaSecurityDbDfn.ColumnIdx.SaSecItem_Id, alias_SecurityItem)); + qry.Filters.Add(SaSecurityDbDfn.GetColumnNameQual(SaSecurityDbDfn.ColumnIdx.SaSecItem_EmailAddress, alias_SecurityItem) + "='" + DbQuery.FormatForCondition(emailAddress) + "'"); + // Join to the Affiliate table. + DbQueryJoin joinAffiliate = new DbQueryJoin(DbJoinType.FullOuter); + joinAffiliate.Table = new StringPair(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.Affiliate), alias_Affiliate); + joinAffiliate.Filters.Add(SbmDbDfn.GetColumnNameQual(SbmDbDfn.ColumnIdx.Affiliate_UserId, alias_Affiliate) + "=" + SaSecurityDbDfn.GetColumnNameQual(SaSecurityDbDfn.ColumnIdx.SaSecItem_Id, alias_SecurityItem)); + + // Execute query. + using (DbResultSet resultSet = DbResultSet_DataReader.ExecuteQuery(db, qry.BuildQuery())) + { + if (resultSet != null && resultSet.NextRecord()) + sessionContextIdxs.Add(sessionContextIdx); + } + } + return sessionContextIdxs; + } + + //------------------------------------------------------------------- + } + //======================================================================= +} diff --git a/SaBusMgrCoreWeb/Web/Models/SbmModel_Base.cs b/SaBusMgrCoreWeb/Web/Models/SbmModel_Base.cs index a9227ce..3eb6019 100644 --- a/SaBusMgrCoreWeb/Web/Models/SbmModel_Base.cs +++ b/SaBusMgrCoreWeb/Web/Models/SbmModel_Base.cs @@ -41,13 +41,13 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Models //------------------------------------------------------------------- // Application properties. - private SbmApplication_Web App { get { return SbmApplication_Web.WebApp; } } - protected SbmSessionConfig SessionConfig { get { return App.SessionConfig; } } + private SbmApplication_Web App { get { return SbmGlobals_Web.Application; } } + protected SbmAppConfig AppConfig { get { return App.AppConfig; } } protected SbmSystem_Web System { get { return App.System_Web; } } public String SessionCookieName { get { return App.SessionCookieName; } } public SbmSessionData SessionData { get { return SessionData_Web; } } public SbmSessionData_Web SessionData_Web { get; set; } - public SbmSessionContext SessionContext { get { return SessionData?.SessionContext ?? App.SessionContext; } } + public SbmSessionContext SessionContext { get { return SessionData?.SessionContext ?? null; } } public DbUpdateInfo DbUpdateInfo { get { return SessionData?.DbUpdateInfo ?? new DbUpdateInfo(null, "", SbmSystem.ComputerName); } } public bool DebugMode { get { return SbmSystem.DebugMode; } } public SbmLocaliser Localiser { get; } @@ -57,37 +57,38 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Models public bool OK { get { return !HasMessages(); } } public virtual bool ProhibitCache { get; set; } = true; public String PageCaption { get; set; } - public String InstanceVersion { get { return !StringUtil.IsEmpty(App.SessionConfig.Instance) ? App.SessionConfig.Instance + " v" + Sbm.Version.GetFullVersion() : "v" + Sbm.Version.GetAppVersion(); } } + public String InstanceVersion { get { return !StringUtil.IsEmpty(App.AppConfig.Instance) ? App.AppConfig.Instance + " v" + Sbm.Version.GetFullVersion() : "v" + Sbm.Version.GetAppVersion(); } } public bool IncludeGoogleAnalytics { get; set; } = false; //------------------------------------------------------------------- // Business components. + // NB Keep these accessors protected to avoid them being called by teh model binding logic before the session data is ready. protected SbmInternals Internals { get { if (internals == null) internals = new SbmInternals(SessionData_Web.UserContext); return internals; } } // Managers. - public SbmAccountMgr AccountMgr { get { return Internals.AccountMgr; } } - public SbmAssetMgr AssetMgr { get { return Internals.AssetMgr; } } - public SbmCommodityMgr CommodityMgr { get { return Internals.CommodityMgr; } } - public SbmPriceMgr PriceMgr { get { return Internals.PriceMgr; } } - public SbmTransactionMgr TransactionMgr { get { return Internals.TransactionMgr; } } - public SbmStockMgr StockMgr { get { return Internals.StockMgr; } } - public SbmProcessMgr ProcessMgr { get { return Internals.ProcessMgr; } } - public SbmDataItemMgr DataItemMgr { get { return Internals.DataItemMgr; } } + protected SbmAccountMgr AccountMgr { get { return Internals.AccountMgr; } } + protected SbmAssetMgr AssetMgr { get { return Internals.AssetMgr; } } + protected SbmCommodityMgr CommodityMgr { get { return Internals.CommodityMgr; } } + protected SbmPriceMgr PriceMgr { get { return Internals.PriceMgr; } } + protected SbmTransactionMgr TransactionMgr { get { return Internals.TransactionMgr; } } + protected SbmStockMgr StockMgr { get { return Internals.StockMgr; } } + protected SbmProcessMgr ProcessMgr { get { return Internals.ProcessMgr; } } + protected SbmDataItemMgr DataItemMgr { get { return Internals.DataItemMgr; } } // Consoles. - public SbmConfigConsole ConfigConsole { get { return Internals.ConfigConsole; } } - public SaDiaryConsole DiaryConsole { get { return Internals.DiaryConsole; } } - public SaSecurityConsole SecurityConsole { get { return Internals.SecurityConsole; } } - public SaCodeTypeConsole CodeTypeConsole { get { return Internals.CodeTypeConsole; } } - public SaReferenceDataConsole ReferenceDataConsole { get { return Internals.ReferenceDataConsole; } } - public SaUpdateLogConsole UpdateLogConsole { get { return Internals.UpdateLogConsole; } } - public SaInterfaceConsole InterfaceConsole { get { return Internals.InterfaceConsole; } } - public SaItemDocConsole ItemDocConsole { get { return Internals.ItemDocConsole; } } - public SaItemOptionConsole ItemOptionConsole { get { return Internals.ItemOptionConsole; } } - public SaItemDataConsole ItemDataConsole { get { return Internals.ItemDataConsole; } } + protected SbmConfigConsole ConfigConsole { get { return Internals.ConfigConsole; } } + protected SaDiaryConsole DiaryConsole { get { return Internals.DiaryConsole; } } + protected SaSecurityConsole SecurityConsole { get { return Internals.SecurityConsole; } } + protected SaCodeTypeConsole CodeTypeConsole { get { return Internals.CodeTypeConsole; } } + protected SaReferenceDataConsole ReferenceDataConsole { get { return Internals.ReferenceDataConsole; } } + protected SaUpdateLogConsole UpdateLogConsole { get { return Internals.UpdateLogConsole; } } + protected SaInterfaceConsole InterfaceConsole { get { return Internals.InterfaceConsole; } } + protected SaItemDocConsole ItemDocConsole { get { return Internals.ItemDocConsole; } } + protected SaItemOptionConsole ItemOptionConsole { get { return Internals.ItemOptionConsole; } } + protected SaItemDataConsole ItemDataConsole { get { return Internals.ItemDataConsole; } } // Configurations. - public SbmStockControlConfig StockControlConfig { get { return Internals.StockControlConfig; } } - public SbmRequirementCostingConfig RequirementCostingConfig { get { return Internals.RequirementCostingConfig; } } + protected SbmStockControlConfig StockControlConfig { get { return Internals.StockControlConfig; } } + protected SbmRequirementCostingConfig RequirementCostingConfig { get { return Internals.RequirementCostingConfig; } } // System codes. - public List GetCodesOfType(Sbm.SystemCode systemCode) { return Internals.GetCodesOfType(systemCode); } + protected List GetCodesOfType(Sbm.SystemCode systemCode) { return Internals.GetCodesOfType(systemCode); } //------------------------------------------------------------------- // Security. @@ -183,29 +184,32 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Models //------------------------------------------------------------------- // Form data. + // NB Use methods rathe rthan accessors for properties that depend on session data + // to avoid the model binding logic invoking a getter before it's ready for use. /// List of Address Types for dropdown. - public IEnumerable AddressTypeCodesForSelect + public IEnumerable GetAddressTypeCodesForSelect() { - get { return new SelectList(GetCodesOfType(Sbm.SystemCode.AddressType), "Code", "Desc"); } + return new SelectList(GetCodesOfType(Sbm.SystemCode.AddressType), "Code", "Desc"); } /// List of Affiliate Types for dropdown. - public IEnumerable AffiliateTypeCodesForSelect + public IEnumerable GetAffiliateTypeCodesForSelect() { - get { return new SelectList(GetCodesOfType(Sbm.SystemCode.AffiliateType), "Code", "Desc"); } + return new SelectList(GetCodesOfType(Sbm.SystemCode.AffiliateType), "Code", "Desc"); } /// List of Association Types for dropdown. - public IEnumerable AssociationTypeCodesForSelect + public IEnumerable GetAssociationTypeCodesForSelect() { - get { return new SelectList(GetCodesOfType(Sbm.SystemCode.AssociationType), "Code", "Desc"); } + return new SelectList(GetCodesOfType(Sbm.SystemCode.AssociationType), "Code", "Desc"); } /// List of Commodity Types for dropdown. - public IEnumerable CommodityTypeCodesForSelect + public IEnumerable GetCommodityTypeCodesForSelect() { - get { return new SelectList(GetCodesOfType(Sbm.SystemCode.CommodityType), "Code", "Desc"); } + + return new SelectList(GetCodesOfType(Sbm.SystemCode.CommodityType), "Code", "Desc"); } //------------------------------------------------------------------- diff --git a/SaBusMgrStandardBase/Base/App/Sbm.cs b/SaBusMgrStandardBase/Base/App/Sbm.cs index 5183440..da9c588 100644 --- a/SaBusMgrStandardBase/Base/App/Sbm.cs +++ b/SaBusMgrStandardBase/Base/App/Sbm.cs @@ -41,14 +41,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App } } } - public class Online + public class Portal { public static class Session { public static class Cookie { /// Default cookie name: '.AspNetCore.Session' - public static String Name { get; } = "BusinessMgr.Online.Session"; + public static String Name { get; } = "BusinessMgr.Portal.Session"; public static bool HttpOnly { get; } = true; public static TimeSpan IdleTimeout { get; } = SacsSystem.DebugMode ? TimeSpan.FromMinutes(5) : TimeSpan.FromMinutes(60); public static long RememberMeTimeoutMilis { get; } = (long)(SacsSystem.DebugMode ? TimeSpan.FromMinutes(2) : TimeSpan.FromMinutes(10)).TotalMilliseconds; @@ -63,14 +63,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App } } } - public class Admin + public class Control { public static class Session { public static class Cookie { /// Default cookie name: '.AspNetCore.Session' - public static String Name { get; } = "BusinessMgr.Admin.Session"; + public static String Name { get; } = "BusinessMgr.Control.Session"; public static bool HttpOnly { get; } = true; public static TimeSpan IdleTimeout { get; } = SacsSystem.DebugMode ? TimeSpan.FromMinutes(5) : TimeSpan.FromMinutes(15); public static long KeepLoggedInTimeoutMillis { get; } = (long)(SacsSystem.DebugMode ? TimeSpan.FromMinutes(2) : TimeSpan.FromMinutes(10)).TotalMilliseconds; diff --git a/SaBusMgrStandardBase/Base/App/SbmAppConsole.cs b/SaBusMgrStandardBase/Base/App/SbmAppConsole.cs index a4877cc..e94f495 100644 --- a/SaBusMgrStandardBase/Base/App/SbmAppConsole.cs +++ b/SaBusMgrStandardBase/Base/App/SbmAppConsole.cs @@ -1,4 +1,5 @@ using Sarand.Net.Standard.Base.App; +using Sarand.Net.Standard.Base.Dbas; using Sarand.Net.Standard.Base.Interfaces; using System; @@ -228,8 +229,9 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App { if (interfaceConsole == null || !interfaceConsole.DatabaseIsValid) return false; // System Account & User tables must be available. - if (!SbmGlobals.Application.BusMgrTableExists(userContext.SessionContext, SbmDbDfn.TableIdx.SystemAccount)) return false; - if (!SbmGlobals.Application.BusMgrTableExists(userContext.SessionContext, SbmDbDfn.TableIdx.SystemUser)) return false; + ISacsDatabase busMgrDb = SbmGlobals.Application.GetBusMgrDatabase(userContext.SessionContext); + if (!SbmGlobals.Application.DbTableExists(busMgrDb, SbmDbDfn.TableIdx.SystemAccount)) return false; + if (!SbmGlobals.Application.DbTableExists(busMgrDb, SbmDbDfn.TableIdx.SystemUser)) return false; } return true; @@ -290,7 +292,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Actions. case Sbm.MenuOption.Timesheet: return configConsole.AllowOption(userContext, Sbm.ConfigOption.TimeRecording); - //----------------------------------------------------------- + //----------------------------------------------------------- } SaLogger.Warn(fn + " Unsupport menu option - " + menuOption.ToString()); return false; diff --git a/SaBusMgrStandardBase/Base/App/SbmApplication.cs b/SaBusMgrStandardBase/Base/App/SbmApplication.cs index 413a1b2..2444310 100644 --- a/SaBusMgrStandardBase/Base/App/SbmApplication.cs +++ b/SaBusMgrStandardBase/Base/App/SbmApplication.cs @@ -25,6 +25,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Construction. protected SbmApplication(PropertySet properties) { + SbmGlobals.Application = this; this.properties = properties; } protected override void Dispose(bool disposing) @@ -45,17 +46,29 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- // Properties. public abstract SbmSystem System { get; } - // Database. - public abstract ISacsDatabase GetBusMgrDatabase(SbmSessionContext sessionContext); - public abstract IDatabaseInfo CreateBusMgrDbInfo(SbmSessionContext sessionContext); - public bool BusMgrTableExists(SbmSessionContext sessionContext, SbmDbDfn.TableIdx tableIdx) + // Control Database. + public abstract ISacsDatabase GetControlDatabase(SbmSessionContext sessionContext); + public IDatabaseInfo CreateControlDbInfo(SbmSessionContext sessionContext) + { + return GetControlDatabase(sessionContext).CreateDbInfo(); + } + // Business Mgr Database. + public abstract ISacsDatabase GetBusMgrDatabase(SbmSessionContext sessionContext); + public IDatabaseInfo CreateBusMgrDbInfo(SbmSessionContext sessionContext) + { + return GetBusMgrDatabase(sessionContext).CreateDbInfo(); + } + // Database utilities. + public IDatabaseInfo CreateDbInfo(ISacsDatabase db) + { + return db?.CreateDbInfo() ?? null; + } + public bool DbTableExists(ISacsDatabase db, SbmDbDfn.TableIdx tableIdx) { - ISacsDatabase db = GetBusMgrDatabase(sessionContext); return db?.TableExists(SbmDbDfn.GetTableName(tableIdx)) ?? false; } - public bool BusMgrColumnExists(SbmSessionContext sessionContext, SbmDbDfn.ColumnIdx columnIdx) + public bool DbColumnExists(ISacsDatabase db, SbmDbDfn.ColumnIdx columnIdx) { - ISacsDatabase db = GetBusMgrDatabase(sessionContext); return db?.ColumnExists(SbmDbDfn.GetTableName(SbmDbDfn.GetTableForColumn(columnIdx)), SbmDbDfn.GetColumnName(columnIdx, false)) ?? false; } // Application instance. diff --git a/SaBusMgrStandardBase/Base/App/SbmConfigConsole.cs b/SaBusMgrStandardBase/Base/App/SbmConfigConsole.cs index e856f75..258f8a2 100644 --- a/SaBusMgrStandardBase/Base/App/SbmConfigConsole.cs +++ b/SaBusMgrStandardBase/Base/App/SbmConfigConsole.cs @@ -428,10 +428,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App case SbmDbDfn.ColumnIdx.Commodity_SalesProjMonth11: case SbmDbDfn.ColumnIdx.Commodity_SalesProjMonth12: return userContext.GetOwnerOption_ShowField(SbmDbDfn.ColumnIdx.Commodity_SalesProjAnnual); - default: // Sep-08: Session profile should be able to handle all fields now (rather than just those that are controled) + default: // Sep-08: Session profile should be able to handle all fields now (rather than just those that are controlled) return userContext.GetOwnerOption_ShowField(column); } - return true; + //return true; } //------------------------------------------------------------------- diff --git a/SaBusMgrStandardBase/Base/App/SbmDbDfn.cs b/SaBusMgrStandardBase/Base/App/SbmDbDfn.cs index 04973b8..c1a9dcd 100644 --- a/SaBusMgrStandardBase/Base/App/SbmDbDfn.cs +++ b/SaBusMgrStandardBase/Base/App/SbmDbDfn.cs @@ -1,3 +1,4 @@ +using Sarand.Net.Standard.Base.Core; using Sarand.Net.Standard.Base.Dbas; using Sarand.Net.Standard.Base.Utils; using System; @@ -5,7 +6,7 @@ using System.Collections.Generic; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Base.App { @@ -1144,17 +1145,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- // Data members. - private static readonly int tableCount = 44; + private static readonly int tableCount = 44; private static readonly int columnCount = 1073; - private static ulong maxTextLen = 0; + private static ulong maxTextLen = 0; //------------------------------------------------------------------- // Retrieve Table details (eg. name: 'Company'). - public static int GetTableCount() + public static int GetTableCount () { return tableCount; } - public static String GetTableName(TableIdx table, bool delimitReservedWords = true) + public static String GetTableName (TableIdx table, bool delimitReservedWords = true) { int tableIdx = (int)table - 1; if (tableIdx < 0 || tableIdx >= tableCount) return String.Empty; @@ -1165,7 +1166,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- // Identify the table that corresponds with the specified column. - public static TableIdx GetTableForColumn(ColumnIdx column) + public static TableIdx GetTableForColumn (ColumnIdx column) { int columnIdx = (int)column - 1; if (columnIdx < 0 || columnIdx >= columnCount) return TableIdx.Unknown; @@ -1174,7 +1175,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- // Retrieve the specified Column's name (Qualified include table name: '(.Column>)'). - public static String GetColumnName(ColumnIdx column, bool delimitReservedWords = true) + public static String GetColumnName (ColumnIdx column, bool delimitReservedWords = true) { int columnIdx = (int)column - 1; if (columnIdx < 0 || columnIdx >= columnCount) return String.Empty; @@ -1182,7 +1183,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App if (delimitReservedWords) columnName = DelimitReservedWord(columnName); return columnName; } - public static String GetColumnNameQual(ColumnIdx column, String tableAlias = "", bool braces = false) + public static String GetColumnNameQual (ColumnIdx column, String tableAlias = "", bool braces = false) { String columnName = GetColumnName(column); if (!String.IsNullOrEmpty(columnName)) @@ -1199,17 +1200,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- // Reserved words. private static DbReservedWordDelim reservedWordDelim = DbReservedWordDelim.SquareBrackets; - public static void SetReservedWordDelim(DbReservedWordDelim reservedWordDelim) + public static void SetReservedWordDelim (DbReservedWordDelim reservedWordDelim) { SbmDbDfn.reservedWordDelim = reservedWordDelim; } - public static bool IsReservedWord(String word) + public static bool IsReservedWord (String word) { if (String.IsNullOrEmpty(word)) return false; if (reservedWords.Contains(word, StringComparer.OrdinalIgnoreCase)) return true; return false; } - public static String DelimitReservedWord(String word) + public static String DelimitReservedWord (String word) { if (!IsReservedWord(word)) return word; switch (reservedWordDelim) @@ -1217,11 +1218,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; @@ -1229,29 +1230,29 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- // Retrieve information about the specified Column. - public static DbColumnDataType GetColDataType(ColumnIdx column) + public static DbColumnDataType GetColDataType (ColumnIdx column) { int columnIdx = (int)column - 1; if (columnIdx < 0 || columnIdx >= columnCount) return DbColumnDataType.Unknown; return columns[columnIdx].DataType; } - public static short GetColNativeDataType(ColumnIdx column) + public static short GetColNativeDataType (ColumnIdx column) { int columnIdx = (int)column - 1; if (columnIdx < 0 || columnIdx >= columnCount) return 0; return columns[columnIdx].NativeDataType; } - public static void SetMaxTextLen(ulong maxTextLen) + public static void SetMaxTextLen (ulong maxTextLen) { SbmDbDfn.maxTextLen = maxTextLen; } - public static bool IsColFmtText(ColumnIdx column) + public static bool IsColFmtText (ColumnIdx column) { int columnIdx = (int)column - 1; if (columnIdx < 0 || columnIdx >= columnCount) return false; return (columns[columnIdx].DataType == DbColumnDataType.VarChar); } - public static ulong GetColTextLen(ColumnIdx column) + public static ulong GetColTextLen (ColumnIdx column) { int columnIdx = (int)column - 1; if (columnIdx < 0 || columnIdx >= columnCount) return 0; @@ -1263,13 +1264,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App } return 0; } - public static bool IsColFmtBool(ColumnIdx column) + public static bool IsColFmtBool (ColumnIdx column) { int columnIdx = (int)column - 1; if (columnIdx < 0 || columnIdx >= columnCount) return false; return (columns[columnIdx].DataType == DbColumnDataType.Bit); } - public static bool IsColFmtNumeric(ColumnIdx column) + public static bool IsColFmtNumeric (ColumnIdx column) { int columnIdx = (int)column - 1; if (columnIdx < 0 || columnIdx >= columnCount) return false; @@ -1291,55 +1292,55 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Table definitions. private static readonly String[] tables = { - "Address", - "Affiliate", - "Association", - "Commodity", - "CommodityCustomer", - "CommoditySupplier", - "Constituent", - "Container", - "ContainerItem", - "Currency", - "IndexDefragLog", - "Interface", - "InterfaceDataItem", - "InterfaceProcess", - "InterfaceProcessDataItem", - "InterfaceProcessMessage", - "ItemBatch", - "ItemLink", - "Language", - "Location", - "Movement", - "PortfolioItem", - "Process", - "Region", - "Requirement", - "SaAsset", - "SaAssetCategory", - "SaAssetProcess", - "SaDiaryEntry", - "SaDiaryLink", - "SaPrice", - "SaPriceSet", - "SaVehicle", - "SaVehicleClass", - "SaVehicleEvent", - "SaVehicleFeature", - "StockLevel", - "SysParam", - "SystemAccount", - "SystemAccountUser", - "SystemUser", - "TaxCode", - "Transaction", - "UnitMeasure", + "Address", + "Affiliate", + "Association", + "Commodity", + "CommodityCustomer", + "CommoditySupplier", + "Constituent", + "Container", + "ContainerItem", + "Currency", + "IndexDefragLog", + "Interface", + "InterfaceDataItem", + "InterfaceProcess", + "InterfaceProcessDataItem", + "InterfaceProcessMessage", + "ItemBatch", + "ItemLink", + "Language", + "Location", + "Movement", + "PortfolioItem", + "Process", + "Region", + "Requirement", + "SaAsset", + "SaAssetCategory", + "SaAssetProcess", + "SaDiaryEntry", + "SaDiaryLink", + "SaPrice", + "SaPriceSet", + "SaVehicle", + "SaVehicleClass", + "SaVehicleEvent", + "SaVehicleFeature", + "StockLevel", + "SysParam", + "SystemAccount", + "SystemAccountUser", + "SystemUser", + "TaxCode", + "Transaction", + "UnitMeasure", }; //------------------------------------------------------------------- // Table column definitions. - internal class ColumnDfn + private class ColumnDfn { internal TableIdx TableIdx { get; set; } internal String Name { get; set; } @@ -1347,7 +1348,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App internal short NativeDataType { get; set; } internal bool IsIdentity { get; set; } internal ulong DataLen { get; set; } - internal ColumnDfn(int tableIdx, String name, int dataType, short nativeDataType, bool isIdentity, ulong dataLen) + internal ColumnDfn (int tableIdx, String name, int dataType, short nativeDataType, bool isIdentity, ulong dataLen) { this.TableIdx = (TableIdx)tableIdx; this.Name = name; @@ -2440,80 +2441,80 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App // Reserved words. private static readonly List reservedWords = new List() { - "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 new file mode 100644 index 0000000..6d3f666 --- /dev/null +++ b/SaBusMgrStandardBase/Base/App/SbmDbDfn_Control.cs @@ -0,0 +1,400 @@ +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; + +//--------------------------------------------------------------------------- +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:28 +//--------------------------------------------------------------------------- +namespace Sarand.BusinessMgr.Net.Standard.Base.App +{ + public class SbmDbDfn_Control + { + //------------------------------------------------------------------- + // Table identifiers. + public enum TableIdx + { + Unknown = 0, + Database, + DatabaseAccount, + UserAccount, + } + + //------------------------------------------------------------------- + // Column identifiers. + public enum ColumnIdx + { + Unknown = 0, + Database_Id, + Database_ServerName, + Database_InstanceName, + Database_DatabaseName, + Database_UserName, + Database_Password, + Database_OrganisationName, + Database_Notes, + Database_Flags, + Database_Status, + Database_CreateOn, + Database_CreateBy, + Database_CreateHost, + Database_UpdateOn, + Database_UpdateBy, + Database_UpdateHost, + DatabaseAccount_Id, + DatabaseAccount_DatabaseId, + DatabaseAccount_EmailAddress, + DatabaseAccount_Notes, + DatabaseAccount_Flags, + DatabaseAccount_Status, + DatabaseAccount_CreateOn, + DatabaseAccount_CreateBy, + DatabaseAccount_CreateHost, + DatabaseAccount_UpdateOn, + DatabaseAccount_UpdateBy, + DatabaseAccount_UpdateHost, + UserAccount_Id, + UserAccount_EmailAddress, + UserAccount_Title, + UserAccount_FirstName, + UserAccount_Initials, + UserAccount_LastName, + UserAccount_PhoneMain, + UserAccount_PhoneMobile, + UserAccount_PhoneAlt, + UserAccount_PasswordToken, + UserAccount_PasswordHashed, + UserAccount_PasswordHistory, + UserAccount_PasswordChangedAt, + UserAccount_LastLoginAt, + UserAccount_LastInvalidLoginAt, + UserAccount_InvalidLoginCount, + UserAccount_Notes, + UserAccount_Flags, + UserAccount_Status, + UserAccount_CreateOn, + UserAccount_CreateBy, + UserAccount_CreateHost, + UserAccount_UpdateOn, + UserAccount_UpdateBy, + UserAccount_UpdateHost, + } + + //------------------------------------------------------------------- + // Data members. + private static readonly int tableCount = 3; + private static readonly int columnCount = 53; + private static ulong maxTextLen = 0; + + //------------------------------------------------------------------- + // Retrieve Table details (eg. name: 'Company'). + public static int GetTableCount () + { + return tableCount; + } + public static String GetTableName (TableIdx table, bool delimitReservedWords = true) + { + int tableIdx = (int)table - 1; + if (tableIdx < 0 || tableIdx >= tableCount) return String.Empty; + String tableName = tables[(int)tableIdx]; + if (delimitReservedWords) tableName = DelimitReservedWord(tableName); + return tableName; + } + + //------------------------------------------------------------------- + // Identify the table that corresponds with the specified column. + public static TableIdx GetTableForColumn (ColumnIdx column) + { + int columnIdx = (int)column - 1; + if (columnIdx < 0 || columnIdx >= columnCount) return TableIdx.Unknown; + return columns[columnIdx].TableIdx; + } + + //------------------------------------------------------------------- + // Retrieve the specified Column's name (Qualified include table name: '(
.Column>)'). + public static String GetColumnName (ColumnIdx column, bool delimitReservedWords = true) + { + int columnIdx = (int)column - 1; + if (columnIdx < 0 || columnIdx >= columnCount) return String.Empty; + String columnName = columns[columnIdx].Name; + if (delimitReservedWords) columnName = DelimitReservedWord(columnName); + return columnName; + } + public static String GetColumnNameQual (ColumnIdx column, String tableAlias = "", bool braces = false) + { + String columnName = GetColumnName(column); + if (!String.IsNullOrEmpty(columnName)) + { + String tableName = StringUtil.EmptyOnNull(tableAlias); + if (tableName.IsEmpty()) tableName = GetTableName(GetTableForColumn(column)); + columnName = tableName + (tableName.Length > 0 ? "." : "") + columnName; + if (braces) + columnName = "(" + columnName + ")"; + } + return columnName; + } + + //------------------------------------------------------------------- + // Reserved words. + private static DbReservedWordDelim reservedWordDelim = DbReservedWordDelim.SquareBrackets; + public static void SetReservedWordDelim (DbReservedWordDelim reservedWordDelim) + { + SbmDbDfn_Control.reservedWordDelim = reservedWordDelim; + } + public static bool IsReservedWord (String word) + { + if (String.IsNullOrEmpty(word)) return false; + if (reservedWords.Contains(word, StringComparer.OrdinalIgnoreCase)) return true; + return false; + } + public static String DelimitReservedWord (String word) + { + if (!IsReservedWord(word)) return word; + switch (reservedWordDelim) + { + case DbReservedWordDelim.None: + break; + case DbReservedWordDelim.DoubleQuotes: + word = "\"" + word + "\""; + break; + case DbReservedWordDelim.SquareBrackets: + default: + word = "[" + word + "]"; + break; + } + return word; + } + + //------------------------------------------------------------------- + // Retrieve information about the specified Column. + public static DbColumnDataType GetColDataType (ColumnIdx column) + { + int columnIdx = (int)column - 1; + if (columnIdx < 0 || columnIdx >= columnCount) return DbColumnDataType.Unknown; + return columns[columnIdx].DataType; + } + public static short GetColNativeDataType (ColumnIdx column) + { + int columnIdx = (int)column - 1; + if (columnIdx < 0 || columnIdx >= columnCount) return 0; + return columns[columnIdx].NativeDataType; + } + public static void SetMaxTextLen (ulong maxTextLen) + { + SbmDbDfn_Control.maxTextLen = maxTextLen; + } + public static bool IsColFmtText (ColumnIdx column) + { + int columnIdx = (int)column - 1; + if (columnIdx < 0 || columnIdx >= columnCount) return false; + return (columns[columnIdx].DataType == DbColumnDataType.VarChar); + } + public static ulong GetColTextLen (ColumnIdx column) + { + int columnIdx = (int)column - 1; + if (columnIdx < 0 || columnIdx >= columnCount) return 0; + if (columns[columnIdx].DataType == DbColumnDataType.VarChar) + { + ulong textLen = columns[columnIdx].DataLen; + if (maxTextLen > 0 && textLen > maxTextLen) textLen = maxTextLen; + return textLen; + } + return 0; + } + public static bool IsColFmtBool (ColumnIdx column) + { + int columnIdx = (int)column - 1; + if (columnIdx < 0 || columnIdx >= columnCount) return false; + return (columns[columnIdx].DataType == DbColumnDataType.Bit); + } + public static bool IsColFmtNumeric (ColumnIdx column) + { + int columnIdx = (int)column - 1; + if (columnIdx < 0 || columnIdx >= columnCount) return false; + switch (columns[columnIdx].DataType) + { + case DbColumnDataType.TinyInt: + case DbColumnDataType.SmallInt: + case DbColumnDataType.Int: + case DbColumnDataType.BigInt: + case DbColumnDataType.Single: + case DbColumnDataType.Double: + case DbColumnDataType.Decimal: + return true; + } + return false; + } + + //------------------------------------------------------------------- + // Table definitions. + private static readonly String[] tables = + { + "Database", + "DatabaseAccount", + "UserAccount", + }; + + //------------------------------------------------------------------- + // Table column definitions. + private class ColumnDfn + { + internal TableIdx TableIdx { get; set; } + internal String Name { get; set; } + internal DbColumnDataType DataType { get; set; } + internal short NativeDataType { get; set; } + internal bool IsIdentity { get; set; } + internal ulong DataLen { get; set; } + internal ColumnDfn (int tableIdx, String name, int dataType, short nativeDataType, bool isIdentity, ulong dataLen) + { + this.TableIdx = (TableIdx)tableIdx; + this.Name = name; + this.DataType = (DbColumnDataType)dataType; + this.NativeDataType = nativeDataType; + this.IsIdentity = isIdentity; + this.DataLen = dataLen; + } + } + + //------------------------------------------------------------------- + private static readonly ColumnDfn[] columns = + { + new ColumnDfn(1,"Id",4,4,true,10), + new ColumnDfn(1,"ServerName",0,-9,false,200), + new ColumnDfn(1,"InstanceName",0,-9,false,200), + new ColumnDfn(1,"DatabaseName",0,-9,false,200), + new ColumnDfn(1,"UserName",0,-9,false,100), + new ColumnDfn(1,"Password",0,-9,false,100), + new ColumnDfn(1,"OrganisationName",0,-9,false,200), + new ColumnDfn(1,"Notes",0,-9,false,2000), + new ColumnDfn(1,"Flags",3,5,false,5), + new ColumnDfn(1,"Status",0,12,false,3), + new ColumnDfn(1,"CreateOn",9,93,false,23), + new ColumnDfn(1,"CreateBy",4,4,false,10), + new ColumnDfn(1,"CreateHost",0,12,false,100), + new ColumnDfn(1,"UpdateOn",9,93,false,23), + new ColumnDfn(1,"UpdateBy",4,4,false,10), + new ColumnDfn(1,"UpdateHost",0,12,false,100), + new ColumnDfn(2,"Id",4,4,true,10), + new ColumnDfn(2,"DatabaseId",4,4,false,10), + new ColumnDfn(2,"EmailAddress",0,-9,false,200), + new ColumnDfn(2,"Notes",0,-9,false,2000), + new ColumnDfn(2,"Flags",3,5,false,5), + new ColumnDfn(2,"Status",0,12,false,3), + new ColumnDfn(2,"CreateOn",9,93,false,23), + new ColumnDfn(2,"CreateBy",4,4,false,10), + new ColumnDfn(2,"CreateHost",0,12,false,100), + new ColumnDfn(2,"UpdateOn",9,93,false,23), + new ColumnDfn(2,"UpdateBy",4,4,false,10), + new ColumnDfn(2,"UpdateHost",0,12,false,100), + new ColumnDfn(3,"Id",4,4,true,10), + new ColumnDfn(3,"EmailAddress",0,-9,false,200), + new ColumnDfn(3,"Title",0,-9,false,20), + new ColumnDfn(3,"FirstName",0,-9,false,100), + new ColumnDfn(3,"Initials",0,-9,false,10), + new ColumnDfn(3,"LastName",0,-9,false,100), + new ColumnDfn(3,"PhoneMain",0,-9,false,50), + new ColumnDfn(3,"PhoneMobile",0,-9,false,50), + new ColumnDfn(3,"PhoneAlt",0,-9,false,50), + new ColumnDfn(3,"PasswordToken",0,12,false,32), + new ColumnDfn(3,"PasswordHashed",0,-9,false,100), + new ColumnDfn(3,"PasswordHistory",0,-9,false,0), + new ColumnDfn(3,"PasswordChangedAt",9,93,false,16), + new ColumnDfn(3,"LastLoginAt",9,93,false,16), + new ColumnDfn(3,"LastInvalidLoginAt",9,93,false,16), + new ColumnDfn(3,"InvalidLoginCount",3,5,false,5), + new ColumnDfn(3,"Notes",0,-9,false,2000), + new ColumnDfn(3,"Flags",3,5,false,5), + new ColumnDfn(3,"Status",0,12,false,3), + new ColumnDfn(3,"CreateOn",9,93,false,23), + new ColumnDfn(3,"CreateBy",4,4,false,10), + new ColumnDfn(3,"CreateHost",0,12,false,100), + new ColumnDfn(3,"UpdateOn",9,93,false,23), + new ColumnDfn(3,"UpdateBy",4,4,false,10), + new ColumnDfn(3,"UpdateHost",0,12,false,100), + }; + + //------------------------------------------------------------------- + // Reserved words. + private static readonly List reservedWords = new List() + { + "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/Consoles/SbmEmailConsole.cs b/SaBusMgrStandardBase/Base/Consoles/SbmEmailConsole.cs index 6965e27..2ccc02b 100644 --- a/SaBusMgrStandardBase/Base/Consoles/SbmEmailConsole.cs +++ b/SaBusMgrStandardBase/Base/Consoles/SbmEmailConsole.cs @@ -68,6 +68,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles // Tag replacement is expanded to avoid reading Footer resource unless required. ReplaceDynamicEmailTag(emailData, EmailTag_Footer, SbmResourceHelper.GetTextResource(SbmResourceHelper.TextResource.Email_Footer_Html)); } + + // Session data is optional. + if (sessionData != null) + { + } } //------------------------------------------------------------------- diff --git a/SaBusMgrStandardBase/Base/Helpers/SbmResourceHelper.cs b/SaBusMgrStandardBase/Base/Helpers/SbmResourceHelper.cs index 5d79c7d..f558079 100644 --- a/SaBusMgrStandardBase/Base/Helpers/SbmResourceHelper.cs +++ b/SaBusMgrStandardBase/Base/Helpers/SbmResourceHelper.cs @@ -20,9 +20,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Helpers Email_Header_Html, Email_Footer_Html, // Email templates. - Email_ContactUs_Html, - Email_Signup_Activate_Html, - Email_Signup_Welcome_Html, Email_RequestPassword_Html, // Data - CSV files etc. } @@ -41,27 +38,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Helpers { // Email stylesheet. case TextResource.Email_Main_Css: - resourceFilename = "sax-email-main.css"; + resourceFilename = "sbm-email-main.css"; break; // Email partial content. case TextResource.Email_Header_Html: - resourceFilename = "sax-email-header.html"; + resourceFilename = "sbm-email-header.html"; break; case TextResource.Email_Footer_Html: - resourceFilename = "sax-email-footer.html"; + resourceFilename = "sbm-email-footer.html"; break; // Email templates. - case TextResource.Email_ContactUs_Html: - resourceFilename = "sax-email-contact-us.html"; - break; - case TextResource.Email_Signup_Activate_Html: - resourceFilename = "sax-email-signup-activate.html"; - break; - case TextResource.Email_Signup_Welcome_Html: - resourceFilename = "sax-email-signup-welcome.html"; - break; case TextResource.Email_RequestPassword_Html: - resourceFilename = "sax-email-request-password.html"; + resourceFilename = "sbm-email-request-password.html"; break; // Data. } diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmItemMgr.cs b/SaBusMgrStandardBase/Base/Mgr/SbmItemMgr.cs index 044c291..89e7ac6 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmItemMgr.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmItemMgr.cs @@ -232,14 +232,20 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr { SbmApplication application = SbmGlobals.Application; if (application != null) - return application.BusMgrTableExists(SessionContext, tableIdx); + { + ISacsDatabase busMgrDb = application.GetBusMgrDatabase(SessionContext); + return application.DbTableExists(busMgrDb, tableIdx); + } return false; } public bool ColumnExists(SbmDbDfn.ColumnIdx columnIdx) { SbmApplication application = SbmGlobals.Application; if (application != null) - return application.BusMgrColumnExists(SessionContext, columnIdx); + { + ISacsDatabase busMgrDb = application.GetBusMgrDatabase(SessionContext); + return application.DbColumnExists(busMgrDb, columnIdx); + } return false; } diff --git a/SaBusMgrStandardBase/Resource/Email/Security/sbm-email-request-password.html b/SaBusMgrStandardBase/Resource/Email/Security/sbm-email-request-password.html new file mode 100644 index 0000000..3f1f8b3 --- /dev/null +++ b/SaBusMgrStandardBase/Resource/Email/Security/sbm-email-request-password.html @@ -0,0 +1,23 @@ + + + + + Password Request + [#Email.MainStylesheet] + + + [#Email.Header] +
+
+
Password Request
+
+
+
We received a request to re-set your password.
+
Follow this link to set a new password against your account.
+
This link will expire in [#Link.ExpiresMinutes] minutes.
+
Thank you.
+
+
+ [#Email.Footer] + + \ No newline at end of file diff --git a/SaBusMgrStandardBase/Resource/Email/Shared/sbm-email-footer.html b/SaBusMgrStandardBase/Resource/Email/Shared/sbm-email-footer.html new file mode 100644 index 0000000..1c5016a --- /dev/null +++ b/SaBusMgrStandardBase/Resource/Email/Shared/sbm-email-footer.html @@ -0,0 +1,3 @@ +
+
Email Footer
+
diff --git a/SaBusMgrStandardBase/Resource/Email/Shared/sbm-email-header.html b/SaBusMgrStandardBase/Resource/Email/Shared/sbm-email-header.html new file mode 100644 index 0000000..aa226e5 --- /dev/null +++ b/SaBusMgrStandardBase/Resource/Email/Shared/sbm-email-header.html @@ -0,0 +1,3 @@ +
+
Sarand BusinessMgr
+
diff --git a/SaBusMgrStandardBase/Resource/Email/Style/sbm-email-main.css b/SaBusMgrStandardBase/Resource/Email/Style/sbm-email-main.css new file mode 100644 index 0000000..0b5b642 --- /dev/null +++ b/SaBusMgrStandardBase/Resource/Email/Style/sbm-email-main.css @@ -0,0 +1,89 @@ +body +{ + margin: 0; + padding: 0; + font-family: Verdana, Helvetica, Arial, sans-serif; + font-size: 16px; + line-height: 1.5; + background-color: #fff; +} + +td +{ + vertical-align: top; +} + +.sax-email-header +{ + margin: 0 0 12px 0; + border-bottom: 1px solid rgba(0,0,0,.1); + box-shadow: 0 1px 0 rgba(0,0,0,.1); + -moz-box-shadow: 0 1px 0 rgba(0,0,0,.1); + -webkit-box-shadow: 0 1px 0 rgba(0,0,0,.1); +} + +.sax-email-header .sax-content, .sax-email-body, .sax-email-footer .sax-content +{ + width: 90%; + max-width: 1040px; + margin:0 auto; + padding:12px 24px; +} + +.sax-email-header .sax-content +{ +} + +.sax-email-body +{ +} + +.sax-email-panel-caption +{ + margin: 12px 0; + font-size: 40px; + font-weight: bold; + color: #000; + background-color: transparent; +} + +.sax-email-panel-content +{ + margin: 12px 0; +} + +.sax-para +{ + margin-bottom: 16px; +} + +td.sax-label +{ + padding: 4px 12px; + font-size: 16px; + text-align: right; + color: #808080; + white-space: nowrap; +} + +td.sax-value +{ + padding-top: 4px; + font-size: 16px; +} + +.sax-email-footer +{ + margin: 24px 0 12px 0; + border-top: 1px rgba(0,0,0,.1) solid; +} + +.sax-email-footer .sax-content +{ + padding:12px 24px; +} + +.sax-email-footer .sax-content .sax-footer-lower +{ + background-color: #f9f9f9; +} diff --git a/SaBusMgrStandardDbas/Dbas/Bus/SbmTransaction_Dbas.cs b/SaBusMgrStandardDbas/Dbas/Bus/SbmTransaction_Dbas.cs index 705bb11..0523391 100644 --- a/SaBusMgrStandardDbas/Dbas/Bus/SbmTransaction_Dbas.cs +++ b/SaBusMgrStandardDbas/Dbas/Bus/SbmTransaction_Dbas.cs @@ -166,9 +166,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Bus } public override bool ItemsRequireJobNumber() { - // Check whether Job Number should be allocated: + // Check whether Job Number should be allocated. SbmConfigConsole configConsole = internals.ConfigConsole; - if (configConsole != null && configConsole.AllowOption(UserContext, Sbm.ConfigOption.SalesOrderItemJobNumber) && SbmGlobals.Application.BusMgrColumnExists(internals.SessionContext, SbmDbDfn.ColumnIdx.Requirement_JobNumber)) + ISacsDatabase db = internals.BusMgrDatabase; + if (configConsole != null && configConsole.AllowOption(UserContext, Sbm.ConfigOption.SalesOrderItemJobNumber) && SbmGlobals.Application.DbColumnExists(db, SbmDbDfn.ColumnIdx.Requirement_JobNumber)) return TransactionType == Sbm.TransactionType.SalesOrder; return false; } diff --git a/SaBusMgrStandardDbas/Dbas/Consoles/SbmSecurityConsole_Dbas.cs b/SaBusMgrStandardDbas/Dbas/Consoles/SbmSecurityConsole_Dbas.cs index 7e6ccc0..c5c5d8b 100644 --- a/SaBusMgrStandardDbas/Dbas/Consoles/SbmSecurityConsole_Dbas.cs +++ b/SaBusMgrStandardDbas/Dbas/Consoles/SbmSecurityConsole_Dbas.cs @@ -3,9 +3,9 @@ using Sarand.BusinessMgr.Net.Standard.Base.Bus; 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.Security; using Sarand.Net.Standard.Base.UpdateLog; -using Sarand.Net.Standard.Dbas.Base; using Sarand.Net.Standard.Dbas.Security; using System; using System.Collections.Generic; @@ -23,7 +23,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles //------------------------------------------------------------------- // Construction. - protected SbmSecurityConsole_Dbas(SbmUserContext userContext, SacsDatabase database) : base(database) + protected SbmSecurityConsole_Dbas(SbmUserContext userContext, ISacsDatabase database) : base(database) { UserContext = userContext; } @@ -39,7 +39,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles //------------------------------------------------------------------- // Properties. - public SbmUserContext UserContext { get; set; } + public SbmUserContext UserContext { get; } public SbmSessionContext SessionContext { get { return UserContext.SessionContext; } } public override short SecurityItemDataType { get { return (short)Sbm.ItemType.SecurityItem; } } public override short SecurityLinkDataType { get { return (short)Sbm.ItemType.SecurityLink; } } diff --git a/SaBusMgrStandardDbas/Dbas/Consoles/SbmUpdateLogConsole_Dbas.cs b/SaBusMgrStandardDbas/Dbas/Consoles/SbmUpdateLogConsole_Dbas.cs index e14ee98..5e6c142 100644 --- a/SaBusMgrStandardDbas/Dbas/Consoles/SbmUpdateLogConsole_Dbas.cs +++ b/SaBusMgrStandardDbas/Dbas/Consoles/SbmUpdateLogConsole_Dbas.cs @@ -1,7 +1,7 @@ using Sarand.BusinessMgr.Net.Standard.Base.App; using Sarand.Net.Standard.Base.Bus; +using Sarand.Net.Standard.Base.Dbas; using Sarand.Net.Standard.Base.Security; -using Sarand.Net.Standard.Dbas.Base; using Sarand.Net.Standard.Dbas.UpdateLog; using System; using System.Collections.Generic; @@ -17,8 +17,9 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles //------------------------------------------------------------------- // Construction. - protected SbmUpdateLogConsole_Dbas(SacsDatabase database) : base(database) + protected SbmUpdateLogConsole_Dbas(SbmUserContext userContext, ISacsDatabase database) : base(database) { + UserContext = userContext; } protected override void Dispose(bool disposing) { @@ -31,7 +32,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Consoles //------------------------------------------------------------------- // Properties. - public SbmUserContext UserContext { get; set; } + public SbmUserContext UserContext { get; } public SbmSessionContext SessionContext { get { return UserContext.SessionContext; } } // Consoles. public SaSecurityConsole SecurityConsole diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Address_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Address_Db.cs index 1fb9b2b..4f55958 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Address_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Address_Db.cs @@ -9,7 +9,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -126,7 +126,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Address_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Address_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -188,11 +188,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -201,7 +201,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _ItemType = GetFieldInt16(dbDataReader, "ItemType", _ItemType); @@ -249,13 +249,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -317,7 +317,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -325,7 +325,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Affiliate_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Affiliate_Db.cs index 6152948..e3d819d 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Affiliate_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Affiliate_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -118,7 +118,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Affiliate_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Affiliate_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -176,11 +176,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -189,7 +189,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _Type = GetFieldInt16(dbDataReader, "Type", _Type); @@ -233,13 +233,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -297,7 +297,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -305,7 +305,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Association_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Association_Db.cs index 9904762..9043c92 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Association_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Association_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -140,7 +140,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Association_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Association_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -209,11 +209,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -222,7 +222,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -277,13 +277,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -352,7 +352,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -360,7 +360,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/CommodityCustomer_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/CommodityCustomer_Db.cs index f2b9915..f5524dd 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/CommodityCustomer_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/CommodityCustomer_Db.cs @@ -1,6 +1,6 @@ +using Microsoft.Data.SqlClient; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; using Sarand.Net.Standard.Base.Core; -using Microsoft.Data.SqlClient; using Sarand.Net.Standard.Base.Dbas; using Sarand.Net.Standard.Base.Utils; using System; @@ -9,7 +9,7 @@ using System.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -73,7 +73,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal CommodityCustomer_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal CommodityCustomer_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -108,11 +108,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -121,7 +121,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _CommodityId = GetFieldInt32(dbDataReader, "CommodityId", _CommodityId); _AssocIdCustomer = GetFieldInt32(dbDataReader, "AssocIdCustomer", _AssocIdCustomer); @@ -142,13 +142,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -183,7 +183,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -191,7 +191,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE CommodityId=@CommodityId AND AssocIdCustomer=@AssocIdCustomer;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/CommoditySupplier_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/CommoditySupplier_Db.cs index f672e6e..d8af415 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/CommoditySupplier_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/CommoditySupplier_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -71,7 +71,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal CommoditySupplier_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal CommoditySupplier_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -105,11 +105,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -118,7 +118,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _CommodityId = GetFieldInt32(dbDataReader, "CommodityId", _CommodityId); _AssocIdSupplier = GetFieldInt32(dbDataReader, "AssocIdSupplier", _AssocIdSupplier); @@ -138,13 +138,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -178,7 +178,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -186,7 +186,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE CommodityId=@CommodityId AND AssocIdSupplier=@AssocIdSupplier;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Commodity_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Commodity_Db.cs index 625f913..2e490b5 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Commodity_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Commodity_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -232,7 +232,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Commodity_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Commodity_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -347,11 +347,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -360,7 +360,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -461,13 +461,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -582,7 +582,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -590,7 +590,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Constituent_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Constituent_Db.cs index 5f6d87a..27fcd8b 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Constituent_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Constituent_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -130,7 +130,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Constituent_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Constituent_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -194,11 +194,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -207,7 +207,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -257,13 +257,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -327,7 +327,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -335,7 +335,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/ContainerItem_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/ContainerItem_Db.cs index 9e61fb5..eb4df77 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/ContainerItem_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/ContainerItem_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -77,7 +77,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal ContainerItem_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal ContainerItem_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -113,11 +113,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -126,7 +126,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _ContainerId = GetFieldInt32(dbDataReader, "ContainerId", _ContainerId); _ItemSeq = GetFieldInt16(dbDataReader, "ItemSeq", _ItemSeq); @@ -148,13 +148,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -190,7 +190,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -198,7 +198,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE ContainerId=@ContainerId AND ItemSeq=@ItemSeq AND ItemType=@ItemType AND ItemId=@ItemId;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Container_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Container_Db.cs index 5deceb8..162fdba 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Container_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Container_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -80,7 +80,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Container_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Container_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -119,11 +119,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -132,7 +132,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -157,13 +157,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -202,7 +202,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -210,7 +210,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Control/DatabaseAccount_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Control/DatabaseAccount_Db.cs new file mode 100644 index 0000000..7992496 --- /dev/null +++ b/SaBusMgrStandardDbas/Dbas/Internal/Control/DatabaseAccount_Db.cs @@ -0,0 +1,212 @@ +using Microsoft.Data.SqlClient; +using Sarand.BusinessMgr.Net.Standard.Dbas.Data; +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.Data.Common; +using System.Linq; + +//--------------------------------------------------------------------------- +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:28 +//--------------------------------------------------------------------------- +namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal.Control +{ + internal class DatabaseAccount_Db : SbmDbDataItem + { + //------------------------------------------------------------------- + // Column definitions. + public class ColumnsData + { + public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id", true); + public ColumnDataInt32 _DatabaseId { get; } = new ColumnDataInt32("DatabaseId"); + public ColumnDataString _EmailAddress { get; } = new ColumnDataString("EmailAddress"); + public ColumnDataString _Notes { get; } = new ColumnDataString("Notes"); + public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags"); + public ColumnDataString _Status { get; } = new ColumnDataString("Status"); + public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn"); + public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy"); + public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost"); + public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn"); + public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy"); + public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost"); + } + + //------------------------------------------------------------------- + // Data members. + protected static List fields { get; } = new List() + { + "Id", + "DatabaseId", + "EmailAddress", + "Notes", + "Flags", + "Status", + "CreateOn", + "CreateBy", + "CreateHost", + "UpdateOn", + "UpdateBy", + "UpdateHost", + }; + protected static List fieldsId { get; } = new List() + { + "Id", + }; + protected static List fieldsPrimary { get; } = new List() + { + "Id", + }; + protected static List fieldsIgnoreOnUpdate { get; } = new List() + { + "CreateOn", + "CreateBy", + "CreateHost", + }; + + //------------------------------------------------------------------- + // Construction. + internal DatabaseAccount_Db (IDatabaseInfo dbInfo) : base(dbInfo) + { + } + + //------------------------------------------------------------------- + // Properties. + public override String SchemaName { get; } = "dbo"; + public override String TableName { get; } = "DatabaseAccount"; + public String TableNameFmt { get { return (!String.IsNullOrEmpty(SchemaName) ? "[" + SchemaName + "]." : "") + "[" + TableName + "]"; } } + public static List Fields { get { return new List(fields); } } + public static List FieldsId { get { return new List(fieldsId); } } + public static List FieldsNonId { get { return fields.FindAll(item => !fieldsId.ContainsCI(item)); } } + // Columns. + public ColumnsData Cols { get; } = new ColumnsData(); + public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } } + public Int32 _DatabaseId { get { return Cols._DatabaseId.Value; } set { Cols._DatabaseId.Value = value; } } + public String _EmailAddress { get { return Cols._EmailAddress.Value; } set { Cols._EmailAddress.Value = value; } } + public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } } + public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } } + public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } } + public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } } + public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } } + public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } } + public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } } + public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } } + public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } } + // Existing columns - confirmed on database if table exists. + public List ExistingColumnNames { get { return GetExistingColumnNames(Fields); } } + public List ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } } + + //------------------------------------------------------------------- + // Population. + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) + { + dbCommand.CommandText = + "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); + Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); + using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) + { + dbDataReader.Read(); + PopulateFrom(dbDataReader); + } + } + public override void PopulateFrom (DbDataReader dbDataReader) + { + _Id = GetFieldInt32(dbDataReader, "Id", _Id); + _DatabaseId = GetFieldInt32(dbDataReader, "DatabaseId", _DatabaseId); + _EmailAddress = GetFieldString(dbDataReader, "EmailAddress", _EmailAddress); + _Notes = GetFieldString(dbDataReader, "Notes", _Notes); + _Flags = GetFieldInt16(dbDataReader, "Flags", _Flags); + _Status = GetFieldString(dbDataReader, "Status", _Status); + _CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn); + _CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy); + _CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost); + _UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn); + _UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy); + _UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost); + } + + //------------------------------------------------------------------- + // Insert command. + public override bool ExecuteInsertCommand (DbCommand dbCommand) + { + List columnNames = ExistingColumnNamesNonId; + // Avoid insert if Identity field is already valid. + if (_Id != 0) throw new Exception("Invalid for Insert - item already has a valid Id"); + // Construct query. + String query = + "INSERT INTO " + TableNameFmt + " " + + "("+columnNames.Concat(",","[","]")+") "; + query += "Output Inserted.Id "; + if (dbCommand is SqlCommand) + query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; + else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; + dbCommand.CommandText = query; + Log(GetType().Name + ".ExecuteInsertCommand", dbCommand.CommandText); + // Populate parameters. + dbCommand.Parameters.Clear(); + if (columnNames.ContainsCI("DatabaseId")) AddCommandParameter(dbCommand, "@DatabaseId", _DatabaseId); + if (columnNames.ContainsCI("EmailAddress")) AddCommandParameter(dbCommand, "@EmailAddress", _EmailAddress); + if (columnNames.ContainsCI("Notes")) AddCommandParameter(dbCommand, "@Notes", _Notes); + if (columnNames.ContainsCI("Flags")) AddCommandParameter(dbCommand, "@Flags", _Flags); + if (columnNames.ContainsCI("Status")) AddCommandParameter(dbCommand, "@Status", _Status); + if (columnNames.ContainsCI("CreateOn")) AddCommandParameter(dbCommand, "@CreateOn", _CreateOn); + if (columnNames.ContainsCI("CreateBy")) AddCommandParameter(dbCommand, "@CreateBy", _CreateBy); + if (columnNames.ContainsCI("CreateHost")) AddCommandParameter(dbCommand, "@CreateHost", _CreateHost); + if (columnNames.ContainsCI("UpdateOn")) AddCommandParameter(dbCommand, "@UpdateOn", _UpdateOn); + if (columnNames.ContainsCI("UpdateBy")) AddCommandParameter(dbCommand, "@UpdateBy", _UpdateBy); + if (columnNames.ContainsCI("UpdateHost")) AddCommandParameter(dbCommand, "@UpdateHost", _UpdateHost); + // Execute insert command. + bool commandSuccess = false; + int executeNonQuery = dbCommand.ExecuteNonQuery(); + if (executeNonQuery == 1) + { + dbCommand.CommandText = "SELECT Max(Id) FROM " + TableNameFmt + ";"; + _Id = (Int32)Convert.ToInt64(dbCommand.ExecuteScalar()); + commandSuccess = (_Id > 0); + } + return commandSuccess; + } + + //------------------------------------------------------------------- + // Update command. + public override bool ExecuteUpdateCommand (DbCommand dbCommand) + { + // Avoid update if Identity field isn't valid. + if (_Id == 0) throw new Exception("Invalid for Update - item has an invalid Id"); + // Columns to update. + List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); + // Construct query. + String query = "UPDATE " + TableNameFmt + " SET "; + if (dbCommand is SqlCommand) + { + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; + query += "WHERE Id=@Id;"; + } + else + { + query += columnNames.Concat(", ", "", "=?") + " "; + query += "WHERE Id=?;"; + } + dbCommand.CommandText = query; + Log(GetType().Name + ".ExecuteUpdateCommand", dbCommand.CommandText); + // Populate parameters. + dbCommand.Parameters.Clear(); + if (columnNames.ContainsCI("DatabaseId")) AddCommandParameter(dbCommand, "@DatabaseId", _DatabaseId); + if (columnNames.ContainsCI("EmailAddress")) AddCommandParameter(dbCommand, "@EmailAddress", _EmailAddress); + if (columnNames.ContainsCI("Notes")) AddCommandParameter(dbCommand, "@Notes", _Notes); + if (columnNames.ContainsCI("Flags")) AddCommandParameter(dbCommand, "@Flags", _Flags); + if (columnNames.ContainsCI("Status")) AddCommandParameter(dbCommand, "@Status", _Status); + if (columnNames.ContainsCI("UpdateOn")) AddCommandParameter(dbCommand, "@UpdateOn", _UpdateOn); + if (columnNames.ContainsCI("UpdateBy")) AddCommandParameter(dbCommand, "@UpdateBy", _UpdateBy); + if (columnNames.ContainsCI("UpdateHost")) AddCommandParameter(dbCommand, "@UpdateHost", _UpdateHost); + AddCommandParameter(dbCommand, "@Id", _Id); + int executeNonQueryResult = dbCommand.ExecuteNonQuery(); + return (executeNonQueryResult == 1); + } + + //------------------------------------------------------------------- + } +} diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Control/Database_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Control/Database_Db.cs new file mode 100644 index 0000000..9f78022 --- /dev/null +++ b/SaBusMgrStandardDbas/Dbas/Internal/Control/Database_Db.cs @@ -0,0 +1,236 @@ +using Microsoft.Data.SqlClient; +using Sarand.BusinessMgr.Net.Standard.Dbas.Data; +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.Data.Common; +using System.Linq; + +//--------------------------------------------------------------------------- +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:28 +//--------------------------------------------------------------------------- +namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal.Control +{ + internal class Database_Db : SbmDbDataItem + { + //------------------------------------------------------------------- + // Column definitions. + public class ColumnsData + { + public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id", true); + public ColumnDataString _ServerName { get; } = new ColumnDataString("ServerName"); + public ColumnDataString _InstanceName { get; } = new ColumnDataString("InstanceName"); + public ColumnDataString _DatabaseName { get; } = new ColumnDataString("DatabaseName"); + public ColumnDataString _UserName { get; } = new ColumnDataString("UserName"); + public ColumnDataString _Password { get; } = new ColumnDataString("Password"); + public ColumnDataString _OrganisationName { get; } = new ColumnDataString("OrganisationName"); + public ColumnDataString _Notes { get; } = new ColumnDataString("Notes"); + public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags"); + public ColumnDataString _Status { get; } = new ColumnDataString("Status"); + public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn"); + public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy"); + public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost"); + public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn"); + public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy"); + public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost"); + } + + //------------------------------------------------------------------- + // Data members. + protected static List fields { get; } = new List() + { + "Id", + "ServerName", + "InstanceName", + "DatabaseName", + "UserName", + "Password", + "OrganisationName", + "Notes", + "Flags", + "Status", + "CreateOn", + "CreateBy", + "CreateHost", + "UpdateOn", + "UpdateBy", + "UpdateHost", + }; + protected static List fieldsId { get; } = new List() + { + "Id", + }; + protected static List fieldsPrimary { get; } = new List() + { + "Id", + }; + protected static List fieldsIgnoreOnUpdate { get; } = new List() + { + "CreateOn", + "CreateBy", + "CreateHost", + }; + + //------------------------------------------------------------------- + // Construction. + internal Database_Db (IDatabaseInfo dbInfo) : base(dbInfo) + { + } + + //------------------------------------------------------------------- + // Properties. + public override String SchemaName { get; } = "dbo"; + public override String TableName { get; } = "Database"; + public String TableNameFmt { get { return (!String.IsNullOrEmpty(SchemaName) ? "[" + SchemaName + "]." : "") + "[" + TableName + "]"; } } + public static List Fields { get { return new List(fields); } } + public static List FieldsId { get { return new List(fieldsId); } } + public static List FieldsNonId { get { return fields.FindAll(item => !fieldsId.ContainsCI(item)); } } + // Columns. + public ColumnsData Cols { get; } = new ColumnsData(); + public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } } + public String _ServerName { get { return Cols._ServerName.Value; } set { Cols._ServerName.Value = value; } } + public String _InstanceName { get { return Cols._InstanceName.Value; } set { Cols._InstanceName.Value = value; } } + public String _DatabaseName { get { return Cols._DatabaseName.Value; } set { Cols._DatabaseName.Value = value; } } + public String _UserName { get { return Cols._UserName.Value; } set { Cols._UserName.Value = value; } } + public String _Password { get { return Cols._Password.Value; } set { Cols._Password.Value = value; } } + public String _OrganisationName { get { return Cols._OrganisationName.Value; } set { Cols._OrganisationName.Value = value; } } + public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } } + public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } } + public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } } + public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } } + public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } } + public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } } + public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } } + public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } } + public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } } + // Existing columns - confirmed on database if table exists. + public List ExistingColumnNames { get { return GetExistingColumnNames(Fields); } } + public List ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } } + + //------------------------------------------------------------------- + // Population. + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) + { + dbCommand.CommandText = + "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); + Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); + using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) + { + dbDataReader.Read(); + PopulateFrom(dbDataReader); + } + } + public override void PopulateFrom (DbDataReader dbDataReader) + { + _Id = GetFieldInt32(dbDataReader, "Id", _Id); + _ServerName = GetFieldString(dbDataReader, "ServerName", _ServerName); + _InstanceName = GetFieldString(dbDataReader, "InstanceName", _InstanceName); + _DatabaseName = GetFieldString(dbDataReader, "DatabaseName", _DatabaseName); + _UserName = GetFieldString(dbDataReader, "UserName", _UserName); + _Password = GetFieldString(dbDataReader, "Password", _Password); + _OrganisationName = GetFieldString(dbDataReader, "OrganisationName", _OrganisationName); + _Notes = GetFieldString(dbDataReader, "Notes", _Notes); + _Flags = GetFieldInt16(dbDataReader, "Flags", _Flags); + _Status = GetFieldString(dbDataReader, "Status", _Status); + _CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn); + _CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy); + _CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost); + _UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn); + _UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy); + _UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost); + } + + //------------------------------------------------------------------- + // Insert command. + public override bool ExecuteInsertCommand (DbCommand dbCommand) + { + List columnNames = ExistingColumnNamesNonId; + // Avoid insert if Identity field is already valid. + if (_Id != 0) throw new Exception("Invalid for Insert - item already has a valid Id"); + // Construct query. + String query = + "INSERT INTO " + TableNameFmt + " " + + "("+columnNames.Concat(",","[","]")+") "; + query += "Output Inserted.Id "; + if (dbCommand is SqlCommand) + query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; + else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; + dbCommand.CommandText = query; + Log(GetType().Name + ".ExecuteInsertCommand", dbCommand.CommandText); + // Populate parameters. + dbCommand.Parameters.Clear(); + if (columnNames.ContainsCI("ServerName")) AddCommandParameter(dbCommand, "@ServerName", _ServerName); + if (columnNames.ContainsCI("InstanceName")) AddCommandParameter(dbCommand, "@InstanceName", _InstanceName); + if (columnNames.ContainsCI("DatabaseName")) AddCommandParameter(dbCommand, "@DatabaseName", _DatabaseName); + if (columnNames.ContainsCI("UserName")) AddCommandParameter(dbCommand, "@UserName", _UserName); + if (columnNames.ContainsCI("Password")) AddCommandParameter(dbCommand, "@Password", _Password); + if (columnNames.ContainsCI("OrganisationName")) AddCommandParameter(dbCommand, "@OrganisationName", _OrganisationName); + if (columnNames.ContainsCI("Notes")) AddCommandParameter(dbCommand, "@Notes", _Notes); + if (columnNames.ContainsCI("Flags")) AddCommandParameter(dbCommand, "@Flags", _Flags); + if (columnNames.ContainsCI("Status")) AddCommandParameter(dbCommand, "@Status", _Status); + if (columnNames.ContainsCI("CreateOn")) AddCommandParameter(dbCommand, "@CreateOn", _CreateOn); + if (columnNames.ContainsCI("CreateBy")) AddCommandParameter(dbCommand, "@CreateBy", _CreateBy); + if (columnNames.ContainsCI("CreateHost")) AddCommandParameter(dbCommand, "@CreateHost", _CreateHost); + if (columnNames.ContainsCI("UpdateOn")) AddCommandParameter(dbCommand, "@UpdateOn", _UpdateOn); + if (columnNames.ContainsCI("UpdateBy")) AddCommandParameter(dbCommand, "@UpdateBy", _UpdateBy); + if (columnNames.ContainsCI("UpdateHost")) AddCommandParameter(dbCommand, "@UpdateHost", _UpdateHost); + // Execute insert command. + bool commandSuccess = false; + int executeNonQuery = dbCommand.ExecuteNonQuery(); + if (executeNonQuery == 1) + { + dbCommand.CommandText = "SELECT Max(Id) FROM " + TableNameFmt + ";"; + _Id = (Int32)Convert.ToInt64(dbCommand.ExecuteScalar()); + commandSuccess = (_Id > 0); + } + return commandSuccess; + } + + //------------------------------------------------------------------- + // Update command. + public override bool ExecuteUpdateCommand (DbCommand dbCommand) + { + // Avoid update if Identity field isn't valid. + if (_Id == 0) throw new Exception("Invalid for Update - item has an invalid Id"); + // Columns to update. + List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); + // Construct query. + String query = "UPDATE " + TableNameFmt + " SET "; + if (dbCommand is SqlCommand) + { + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; + query += "WHERE Id=@Id;"; + } + else + { + query += columnNames.Concat(", ", "", "=?") + " "; + query += "WHERE Id=?;"; + } + dbCommand.CommandText = query; + Log(GetType().Name + ".ExecuteUpdateCommand", dbCommand.CommandText); + // Populate parameters. + dbCommand.Parameters.Clear(); + if (columnNames.ContainsCI("ServerName")) AddCommandParameter(dbCommand, "@ServerName", _ServerName); + if (columnNames.ContainsCI("InstanceName")) AddCommandParameter(dbCommand, "@InstanceName", _InstanceName); + if (columnNames.ContainsCI("DatabaseName")) AddCommandParameter(dbCommand, "@DatabaseName", _DatabaseName); + if (columnNames.ContainsCI("UserName")) AddCommandParameter(dbCommand, "@UserName", _UserName); + if (columnNames.ContainsCI("Password")) AddCommandParameter(dbCommand, "@Password", _Password); + if (columnNames.ContainsCI("OrganisationName")) AddCommandParameter(dbCommand, "@OrganisationName", _OrganisationName); + if (columnNames.ContainsCI("Notes")) AddCommandParameter(dbCommand, "@Notes", _Notes); + if (columnNames.ContainsCI("Flags")) AddCommandParameter(dbCommand, "@Flags", _Flags); + if (columnNames.ContainsCI("Status")) AddCommandParameter(dbCommand, "@Status", _Status); + if (columnNames.ContainsCI("UpdateOn")) AddCommandParameter(dbCommand, "@UpdateOn", _UpdateOn); + if (columnNames.ContainsCI("UpdateBy")) AddCommandParameter(dbCommand, "@UpdateBy", _UpdateBy); + if (columnNames.ContainsCI("UpdateHost")) AddCommandParameter(dbCommand, "@UpdateHost", _UpdateHost); + AddCommandParameter(dbCommand, "@Id", _Id); + int executeNonQueryResult = dbCommand.ExecuteNonQuery(); + return (executeNonQueryResult == 1); + } + + //------------------------------------------------------------------- + } +} diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Control/UserAccount_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Control/UserAccount_Db.cs new file mode 100644 index 0000000..b0142cd --- /dev/null +++ b/SaBusMgrStandardDbas/Dbas/Internal/Control/UserAccount_Db.cs @@ -0,0 +1,290 @@ +using Microsoft.Data.SqlClient; +using Sarand.BusinessMgr.Net.Standard.Dbas.Data; +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.Data.Common; +using System.Linq; + +//--------------------------------------------------------------------------- +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:28 +//--------------------------------------------------------------------------- +namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal.Control +{ + internal class UserAccount_Db : SbmDbDataItem + { + //------------------------------------------------------------------- + // Column definitions. + public class ColumnsData + { + public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id", true); + public ColumnDataString _EmailAddress { get; } = new ColumnDataString("EmailAddress"); + public ColumnDataString _Title { get; } = new ColumnDataString("Title"); + public ColumnDataString _FirstName { get; } = new ColumnDataString("FirstName"); + public ColumnDataString _Initials { get; } = new ColumnDataString("Initials"); + public ColumnDataString _LastName { get; } = new ColumnDataString("LastName"); + public ColumnDataString _PhoneMain { get; } = new ColumnDataString("PhoneMain"); + public ColumnDataString _PhoneMobile { get; } = new ColumnDataString("PhoneMobile"); + public ColumnDataString _PhoneAlt { get; } = new ColumnDataString("PhoneAlt"); + public ColumnDataString _PasswordToken { get; } = new ColumnDataString("PasswordToken"); + public ColumnDataString _PasswordHashed { get; } = new ColumnDataString("PasswordHashed"); + public ColumnDataString _PasswordHistory { get; } = new ColumnDataString("PasswordHistory"); + public ColumnDataDateTime _PasswordChangedAt { get; } = new ColumnDataDateTime("PasswordChangedAt"); + public ColumnDataDateTime _LastLoginAt { get; } = new ColumnDataDateTime("LastLoginAt"); + public ColumnDataDateTime _LastInvalidLoginAt { get; } = new ColumnDataDateTime("LastInvalidLoginAt"); + public ColumnDataInt16 _InvalidLoginCount { get; } = new ColumnDataInt16("InvalidLoginCount"); + public ColumnDataString _Notes { get; } = new ColumnDataString("Notes"); + public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags"); + public ColumnDataString _Status { get; } = new ColumnDataString("Status"); + public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn"); + public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy"); + public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost"); + public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn"); + public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy"); + public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost"); + } + + //------------------------------------------------------------------- + // Data members. + protected static List fields { get; } = new List() + { + "Id", + "EmailAddress", + "Title", + "FirstName", + "Initials", + "LastName", + "PhoneMain", + "PhoneMobile", + "PhoneAlt", + "PasswordToken", + "PasswordHashed", + "PasswordHistory", + "PasswordChangedAt", + "LastLoginAt", + "LastInvalidLoginAt", + "InvalidLoginCount", + "Notes", + "Flags", + "Status", + "CreateOn", + "CreateBy", + "CreateHost", + "UpdateOn", + "UpdateBy", + "UpdateHost", + }; + protected static List fieldsId { get; } = new List() + { + "Id", + }; + protected static List fieldsPrimary { get; } = new List() + { + "Id", + }; + protected static List fieldsIgnoreOnUpdate { get; } = new List() + { + "CreateOn", + "CreateBy", + "CreateHost", + }; + + //------------------------------------------------------------------- + // Construction. + internal UserAccount_Db (IDatabaseInfo dbInfo) : base(dbInfo) + { + } + + //------------------------------------------------------------------- + // Properties. + public override String SchemaName { get; } = "dbo"; + public override String TableName { get; } = "UserAccount"; + public String TableNameFmt { get { return (!String.IsNullOrEmpty(SchemaName) ? "[" + SchemaName + "]." : "") + "[" + TableName + "]"; } } + public static List Fields { get { return new List(fields); } } + public static List FieldsId { get { return new List(fieldsId); } } + public static List FieldsNonId { get { return fields.FindAll(item => !fieldsId.ContainsCI(item)); } } + // Columns. + public ColumnsData Cols { get; } = new ColumnsData(); + public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } } + public String _EmailAddress { get { return Cols._EmailAddress.Value; } set { Cols._EmailAddress.Value = value; } } + public String _Title { get { return Cols._Title.Value; } set { Cols._Title.Value = value; } } + public String _FirstName { get { return Cols._FirstName.Value; } set { Cols._FirstName.Value = value; } } + public String _Initials { get { return Cols._Initials.Value; } set { Cols._Initials.Value = value; } } + public String _LastName { get { return Cols._LastName.Value; } set { Cols._LastName.Value = value; } } + public String _PhoneMain { get { return Cols._PhoneMain.Value; } set { Cols._PhoneMain.Value = value; } } + public String _PhoneMobile { get { return Cols._PhoneMobile.Value; } set { Cols._PhoneMobile.Value = value; } } + public String _PhoneAlt { get { return Cols._PhoneAlt.Value; } set { Cols._PhoneAlt.Value = value; } } + public String _PasswordToken { get { return Cols._PasswordToken.Value; } set { Cols._PasswordToken.Value = value; } } + public String _PasswordHashed { get { return Cols._PasswordHashed.Value; } set { Cols._PasswordHashed.Value = value; } } + public String _PasswordHistory { get { return Cols._PasswordHistory.Value; } set { Cols._PasswordHistory.Value = value; } } + public DateTime _PasswordChangedAt { get { return Cols._PasswordChangedAt.Value; } set { Cols._PasswordChangedAt.Value = value; } } + public DateTime _LastLoginAt { get { return Cols._LastLoginAt.Value; } set { Cols._LastLoginAt.Value = value; } } + public DateTime _LastInvalidLoginAt { get { return Cols._LastInvalidLoginAt.Value; } set { Cols._LastInvalidLoginAt.Value = value; } } + public Int16 _InvalidLoginCount { get { return Cols._InvalidLoginCount.Value; } set { Cols._InvalidLoginCount.Value = value; } } + public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } } + public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } } + public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } } + public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } } + public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } } + public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } } + public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } } + public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } } + public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } } + // Existing columns - confirmed on database if table exists. + public List ExistingColumnNames { get { return GetExistingColumnNames(Fields); } } + public List ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } } + + //------------------------------------------------------------------- + // Population. + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) + { + dbCommand.CommandText = + "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); + Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); + using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) + { + dbDataReader.Read(); + PopulateFrom(dbDataReader); + } + } + public override void PopulateFrom (DbDataReader dbDataReader) + { + _Id = GetFieldInt32(dbDataReader, "Id", _Id); + _EmailAddress = GetFieldString(dbDataReader, "EmailAddress", _EmailAddress); + _Title = GetFieldString(dbDataReader, "Title", _Title); + _FirstName = GetFieldString(dbDataReader, "FirstName", _FirstName); + _Initials = GetFieldString(dbDataReader, "Initials", _Initials); + _LastName = GetFieldString(dbDataReader, "LastName", _LastName); + _PhoneMain = GetFieldString(dbDataReader, "PhoneMain", _PhoneMain); + _PhoneMobile = GetFieldString(dbDataReader, "PhoneMobile", _PhoneMobile); + _PhoneAlt = GetFieldString(dbDataReader, "PhoneAlt", _PhoneAlt); + _PasswordToken = GetFieldString(dbDataReader, "PasswordToken", _PasswordToken); + _PasswordHashed = GetFieldString(dbDataReader, "PasswordHashed", _PasswordHashed); + _PasswordHistory = GetFieldString(dbDataReader, "PasswordHistory", _PasswordHistory); + _PasswordChangedAt = GetFieldDateTime(dbDataReader, "PasswordChangedAt", _PasswordChangedAt); + _LastLoginAt = GetFieldDateTime(dbDataReader, "LastLoginAt", _LastLoginAt); + _LastInvalidLoginAt = GetFieldDateTime(dbDataReader, "LastInvalidLoginAt", _LastInvalidLoginAt); + _InvalidLoginCount = GetFieldInt16(dbDataReader, "InvalidLoginCount", _InvalidLoginCount); + _Notes = GetFieldString(dbDataReader, "Notes", _Notes); + _Flags = GetFieldInt16(dbDataReader, "Flags", _Flags); + _Status = GetFieldString(dbDataReader, "Status", _Status); + _CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn); + _CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy); + _CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost); + _UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn); + _UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy); + _UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost); + } + + //------------------------------------------------------------------- + // Insert command. + public override bool ExecuteInsertCommand (DbCommand dbCommand) + { + List columnNames = ExistingColumnNamesNonId; + // Avoid insert if Identity field is already valid. + if (_Id != 0) throw new Exception("Invalid for Insert - item already has a valid Id"); + // Construct query. + String query = + "INSERT INTO " + TableNameFmt + " " + + "("+columnNames.Concat(",","[","]")+") "; + query += "Output Inserted.Id "; + if (dbCommand is SqlCommand) + query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; + else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; + dbCommand.CommandText = query; + Log(GetType().Name + ".ExecuteInsertCommand", dbCommand.CommandText); + // Populate parameters. + dbCommand.Parameters.Clear(); + if (columnNames.ContainsCI("EmailAddress")) AddCommandParameter(dbCommand, "@EmailAddress", _EmailAddress); + if (columnNames.ContainsCI("Title")) AddCommandParameter(dbCommand, "@Title", _Title); + if (columnNames.ContainsCI("FirstName")) AddCommandParameter(dbCommand, "@FirstName", _FirstName); + if (columnNames.ContainsCI("Initials")) AddCommandParameter(dbCommand, "@Initials", _Initials); + if (columnNames.ContainsCI("LastName")) AddCommandParameter(dbCommand, "@LastName", _LastName); + if (columnNames.ContainsCI("PhoneMain")) AddCommandParameter(dbCommand, "@PhoneMain", _PhoneMain); + if (columnNames.ContainsCI("PhoneMobile")) AddCommandParameter(dbCommand, "@PhoneMobile", _PhoneMobile); + if (columnNames.ContainsCI("PhoneAlt")) AddCommandParameter(dbCommand, "@PhoneAlt", _PhoneAlt); + if (columnNames.ContainsCI("PasswordToken")) AddCommandParameter(dbCommand, "@PasswordToken", _PasswordToken); + if (columnNames.ContainsCI("PasswordHashed")) AddCommandParameter(dbCommand, "@PasswordHashed", _PasswordHashed); + if (columnNames.ContainsCI("PasswordHistory")) AddCommandParameter(dbCommand, "@PasswordHistory", _PasswordHistory); + if (columnNames.ContainsCI("PasswordChangedAt")) AddCommandParameter(dbCommand, "@PasswordChangedAt", _PasswordChangedAt); + if (columnNames.ContainsCI("LastLoginAt")) AddCommandParameter(dbCommand, "@LastLoginAt", _LastLoginAt); + if (columnNames.ContainsCI("LastInvalidLoginAt")) AddCommandParameter(dbCommand, "@LastInvalidLoginAt", _LastInvalidLoginAt); + if (columnNames.ContainsCI("InvalidLoginCount")) AddCommandParameter(dbCommand, "@InvalidLoginCount", _InvalidLoginCount); + if (columnNames.ContainsCI("Notes")) AddCommandParameter(dbCommand, "@Notes", _Notes); + if (columnNames.ContainsCI("Flags")) AddCommandParameter(dbCommand, "@Flags", _Flags); + if (columnNames.ContainsCI("Status")) AddCommandParameter(dbCommand, "@Status", _Status); + if (columnNames.ContainsCI("CreateOn")) AddCommandParameter(dbCommand, "@CreateOn", _CreateOn); + if (columnNames.ContainsCI("CreateBy")) AddCommandParameter(dbCommand, "@CreateBy", _CreateBy); + if (columnNames.ContainsCI("CreateHost")) AddCommandParameter(dbCommand, "@CreateHost", _CreateHost); + if (columnNames.ContainsCI("UpdateOn")) AddCommandParameter(dbCommand, "@UpdateOn", _UpdateOn); + if (columnNames.ContainsCI("UpdateBy")) AddCommandParameter(dbCommand, "@UpdateBy", _UpdateBy); + if (columnNames.ContainsCI("UpdateHost")) AddCommandParameter(dbCommand, "@UpdateHost", _UpdateHost); + // Execute insert command. + bool commandSuccess = false; + int executeNonQuery = dbCommand.ExecuteNonQuery(); + if (executeNonQuery == 1) + { + dbCommand.CommandText = "SELECT Max(Id) FROM " + TableNameFmt + ";"; + _Id = (Int32)Convert.ToInt64(dbCommand.ExecuteScalar()); + commandSuccess = (_Id > 0); + } + return commandSuccess; + } + + //------------------------------------------------------------------- + // Update command. + public override bool ExecuteUpdateCommand (DbCommand dbCommand) + { + // Avoid update if Identity field isn't valid. + if (_Id == 0) throw new Exception("Invalid for Update - item has an invalid Id"); + // Columns to update. + List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); + // Construct query. + String query = "UPDATE " + TableNameFmt + " SET "; + if (dbCommand is SqlCommand) + { + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; + query += "WHERE Id=@Id;"; + } + else + { + query += columnNames.Concat(", ", "", "=?") + " "; + query += "WHERE Id=?;"; + } + dbCommand.CommandText = query; + Log(GetType().Name + ".ExecuteUpdateCommand", dbCommand.CommandText); + // Populate parameters. + dbCommand.Parameters.Clear(); + if (columnNames.ContainsCI("EmailAddress")) AddCommandParameter(dbCommand, "@EmailAddress", _EmailAddress); + if (columnNames.ContainsCI("Title")) AddCommandParameter(dbCommand, "@Title", _Title); + if (columnNames.ContainsCI("FirstName")) AddCommandParameter(dbCommand, "@FirstName", _FirstName); + if (columnNames.ContainsCI("Initials")) AddCommandParameter(dbCommand, "@Initials", _Initials); + if (columnNames.ContainsCI("LastName")) AddCommandParameter(dbCommand, "@LastName", _LastName); + if (columnNames.ContainsCI("PhoneMain")) AddCommandParameter(dbCommand, "@PhoneMain", _PhoneMain); + if (columnNames.ContainsCI("PhoneMobile")) AddCommandParameter(dbCommand, "@PhoneMobile", _PhoneMobile); + if (columnNames.ContainsCI("PhoneAlt")) AddCommandParameter(dbCommand, "@PhoneAlt", _PhoneAlt); + if (columnNames.ContainsCI("PasswordToken")) AddCommandParameter(dbCommand, "@PasswordToken", _PasswordToken); + if (columnNames.ContainsCI("PasswordHashed")) AddCommandParameter(dbCommand, "@PasswordHashed", _PasswordHashed); + if (columnNames.ContainsCI("PasswordHistory")) AddCommandParameter(dbCommand, "@PasswordHistory", _PasswordHistory); + if (columnNames.ContainsCI("PasswordChangedAt")) AddCommandParameter(dbCommand, "@PasswordChangedAt", _PasswordChangedAt); + if (columnNames.ContainsCI("LastLoginAt")) AddCommandParameter(dbCommand, "@LastLoginAt", _LastLoginAt); + if (columnNames.ContainsCI("LastInvalidLoginAt")) AddCommandParameter(dbCommand, "@LastInvalidLoginAt", _LastInvalidLoginAt); + if (columnNames.ContainsCI("InvalidLoginCount")) AddCommandParameter(dbCommand, "@InvalidLoginCount", _InvalidLoginCount); + if (columnNames.ContainsCI("Notes")) AddCommandParameter(dbCommand, "@Notes", _Notes); + if (columnNames.ContainsCI("Flags")) AddCommandParameter(dbCommand, "@Flags", _Flags); + if (columnNames.ContainsCI("Status")) AddCommandParameter(dbCommand, "@Status", _Status); + if (columnNames.ContainsCI("UpdateOn")) AddCommandParameter(dbCommand, "@UpdateOn", _UpdateOn); + if (columnNames.ContainsCI("UpdateBy")) AddCommandParameter(dbCommand, "@UpdateBy", _UpdateBy); + if (columnNames.ContainsCI("UpdateHost")) AddCommandParameter(dbCommand, "@UpdateHost", _UpdateHost); + AddCommandParameter(dbCommand, "@Id", _Id); + int executeNonQueryResult = dbCommand.ExecuteNonQuery(); + return (executeNonQueryResult == 1); + } + + //------------------------------------------------------------------- + } +} diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Currency_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Currency_Db.cs index acb0887..2d7a06b 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Currency_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Currency_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -74,7 +74,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Currency_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Currency_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -110,11 +110,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -123,7 +123,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _Code = GetFieldString(dbDataReader, "Code", _Code); @@ -145,13 +145,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -187,7 +187,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -195,7 +195,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/IndexDefragLog_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/IndexDefragLog_Db.cs index 1a98d81..1ad6e6e 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/IndexDefragLog_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/IndexDefragLog_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -67,7 +67,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal IndexDefragLog_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal IndexDefragLog_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -99,11 +99,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -112,7 +112,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _IndexDefragId = GetFieldInt32(dbDataReader, "IndexDefragId", _IndexDefragId); _DatabaseID = GetFieldInt32(dbDataReader, "DatabaseID", _DatabaseID); @@ -130,15 +130,15 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Avoid insert if Identity field is already valid. - if (_IndexDefragId != 0) throw new Exception("Invalid for Insert - item already has a valid Id"); + if (_IndexDefragId != 0) throw new Exception("Invalid for Insert - item already has a valid Id"); // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; query += "Output Inserted.IndexDefragId "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; @@ -164,7 +164,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal if (executeNonQuery == 1) { dbCommand.CommandText = "SELECT Max(IndexDefragId) FROM " + TableNameFmt + ";"; - _IndexDefragId = Convert.ToInt32(dbCommand.ExecuteScalar()); + _IndexDefragId = (Int32)Convert.ToInt64(dbCommand.ExecuteScalar()); commandSuccess = (_IndexDefragId > 0); } return commandSuccess; @@ -172,17 +172,17 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Avoid update if Identity field isn't valid. - if (_IndexDefragId == 0) throw new Exception("Invalid for Update - item has an invalid Id"); + if (_IndexDefragId == 0) throw new Exception("Invalid for Update - item has an invalid Id"); // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); // Construct query. String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE IndexDefragId=@IndexDefragId;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/InterfaceDataItem_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/InterfaceDataItem_Db.cs index d7629a8..0e4e060 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/InterfaceDataItem_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/InterfaceDataItem_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -82,7 +82,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal InterfaceDataItem_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal InterfaceDataItem_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -122,11 +122,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -135,7 +135,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _InterfaceId = GetFieldInt32(dbDataReader, "InterfaceId", _InterfaceId); @@ -161,13 +161,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -207,7 +207,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -215,7 +215,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/InterfaceProcessDataItem_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/InterfaceProcessDataItem_Db.cs index 599c673..85b740b 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/InterfaceProcessDataItem_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/InterfaceProcessDataItem_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -65,7 +65,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal InterfaceProcessDataItem_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal InterfaceProcessDataItem_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -96,11 +96,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -109,7 +109,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _ProcessId = GetFieldInt32(dbDataReader, "ProcessId", _ProcessId); _InterfaceDataItemId = GetFieldInt32(dbDataReader, "InterfaceDataItemId", _InterfaceDataItemId); @@ -126,13 +126,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -163,7 +163,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -171,7 +171,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE ProcessId=@ProcessId AND InterfaceDataItemId=@InterfaceDataItemId;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/InterfaceProcessMessage_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/InterfaceProcessMessage_Db.cs index e7baf1c..f742762 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/InterfaceProcessMessage_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/InterfaceProcessMessage_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -74,7 +74,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal InterfaceProcessMessage_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal InterfaceProcessMessage_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -110,11 +110,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -123,7 +123,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _ProcessId = GetFieldInt32(dbDataReader, "ProcessId", _ProcessId); @@ -145,13 +145,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -187,7 +187,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -195,7 +195,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/InterfaceProcess_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/InterfaceProcess_Db.cs index af2fb4a..90c8128 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/InterfaceProcess_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/InterfaceProcess_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -80,7 +80,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal InterfaceProcess_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal InterfaceProcess_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -119,11 +119,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -132,7 +132,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _InterfaceId = GetFieldInt32(dbDataReader, "InterfaceId", _InterfaceId); @@ -157,13 +157,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -202,7 +202,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -210,7 +210,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Interface_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Interface_Db.cs index 10cd47e..134e5a1 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Interface_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Interface_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -72,7 +72,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Interface_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Interface_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -107,11 +107,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -120,7 +120,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _Context = GetFieldString(dbDataReader, "Context", _Context); @@ -141,13 +141,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -182,7 +182,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -190,7 +190,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/ItemBatch_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/ItemBatch_Db.cs index d846459..8ed70c0 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/ItemBatch_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/ItemBatch_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -72,7 +72,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal ItemBatch_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal ItemBatch_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -107,11 +107,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -120,7 +120,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -141,13 +141,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -182,7 +182,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -190,7 +190,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/ItemLink_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/ItemLink_Db.cs index c7859a1..c2beb32 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/ItemLink_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/ItemLink_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -81,7 +81,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal ItemLink_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal ItemLink_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -118,11 +118,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -131,7 +131,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Type = GetFieldInt16(dbDataReader, "Type", _Type); _ItemTypeFrom = GetFieldInt16(dbDataReader, "ItemTypeFrom", _ItemTypeFrom); @@ -154,13 +154,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -197,7 +197,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -205,7 +205,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Type=@Type AND ItemTypeFrom=@ItemTypeFrom AND ItemIdFrom=@ItemIdFrom AND ItemTypeTo=@ItemTypeTo AND ItemIdTo=@ItemIdTo AND Seq=@Seq;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Language_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Language_Db.cs index 1d6a0bd..6fc8135 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Language_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Language_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -66,7 +66,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Language_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Language_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -98,11 +98,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -111,7 +111,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _Code = GetFieldString(dbDataReader, "Code", _Code); @@ -129,13 +129,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -167,7 +167,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -175,7 +175,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Location_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Location_Db.cs index 7a8e953..cce7caf 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Location_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Location_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -70,7 +70,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Location_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Location_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -104,11 +104,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -117,7 +117,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -137,13 +137,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -177,7 +177,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -185,7 +185,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Movement_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Movement_Db.cs index acec218..fb06107 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Movement_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Movement_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -82,7 +82,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Movement_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Movement_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -122,11 +122,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -135,7 +135,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _ItemType = GetFieldInt16(dbDataReader, "ItemType", _ItemType); @@ -161,13 +161,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -207,7 +207,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -215,7 +215,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/PortfolioItem_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/PortfolioItem_Db.cs index 1a8bb3e..318d7f9 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/PortfolioItem_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/PortfolioItem_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -84,7 +84,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal PortfolioItem_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal PortfolioItem_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -125,11 +125,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -138,7 +138,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -165,13 +165,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -212,7 +212,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -220,7 +220,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Process_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Process_Db.cs index 84ef066..8d0c8f6 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Process_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Process_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -74,7 +74,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Process_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Process_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -110,11 +110,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -123,7 +123,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -145,13 +145,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -187,7 +187,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -195,7 +195,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Region_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Region_Db.cs index 1bef2fa..c34d528 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Region_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Region_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -68,7 +68,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Region_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Region_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -101,11 +101,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -114,7 +114,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _Type = GetFieldString(dbDataReader, "Type", _Type); @@ -133,13 +133,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -172,7 +172,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -180,7 +180,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Requirement_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Requirement_Db.cs index d941167..2cd1ea2 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Requirement_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Requirement_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -162,7 +162,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Requirement_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Requirement_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -242,11 +242,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -255,7 +255,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -321,13 +321,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -407,7 +407,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -415,7 +415,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaAssetCategory_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaAssetCategory_Db.cs index b60e1d4..2f3746d 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaAssetCategory_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaAssetCategory_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -94,7 +94,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SaAssetCategory_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SaAssetCategory_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -140,11 +140,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -153,7 +153,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -185,13 +185,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -237,7 +237,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -245,7 +245,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaAssetProcess_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaAssetProcess_Db.cs index d4d421d..faf8a33 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaAssetProcess_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaAssetProcess_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -74,7 +74,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SaAssetProcess_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SaAssetProcess_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -110,11 +110,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -123,7 +123,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AssetId = GetFieldInt32(dbDataReader, "AssetId", _AssetId); @@ -145,13 +145,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -187,7 +187,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -195,7 +195,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaAsset_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaAsset_Db.cs index 7f3d962..dc5ad5d 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaAsset_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaAsset_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -132,7 +132,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SaAsset_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SaAsset_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -197,11 +197,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -210,7 +210,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AssetCategoryId = GetFieldInt32(dbDataReader, "AssetCategoryId", _AssetCategoryId); @@ -261,13 +261,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -332,7 +332,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -340,7 +340,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryEntry_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryEntry_Db.cs index 89d51e1..a05a88b 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryEntry_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryEntry_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -74,7 +74,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SaDiaryEntry_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SaDiaryEntry_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -110,11 +110,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -123,7 +123,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _Category = GetFieldInt16(dbDataReader, "Category", _Category); @@ -145,13 +145,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -187,7 +187,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -195,7 +195,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryLink_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryLink_Db.cs index d0deba3..e499a87 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryLink_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaDiaryLink_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -68,7 +68,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SaDiaryLink_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SaDiaryLink_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -100,11 +100,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -113,7 +113,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _EntryId = GetFieldInt32(dbDataReader, "EntryId", _EntryId); _ItemType = GetFieldInt16(dbDataReader, "ItemType", _ItemType); @@ -131,13 +131,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -169,7 +169,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -177,7 +177,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE EntryId=@EntryId AND ItemType=@ItemType AND ItemId=@ItemId;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaPriceSet_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaPriceSet_Db.cs index aa5afdf..cd95fef 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaPriceSet_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaPriceSet_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -72,7 +72,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SaPriceSet_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SaPriceSet_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -107,11 +107,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -120,7 +120,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -141,13 +141,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -182,7 +182,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -190,7 +190,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaPrice_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaPrice_Db.cs index ab6b71f..8c40a6d 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaPrice_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaPrice_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -79,7 +79,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SaPrice_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SaPrice_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -117,11 +117,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -130,7 +130,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _PriceSetId = GetFieldInt32(dbDataReader, "PriceSetId", _PriceSetId); _CommodityId = GetFieldInt32(dbDataReader, "CommodityId", _CommodityId); @@ -154,13 +154,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -198,7 +198,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -206,7 +206,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE PriceSetId=@PriceSetId AND CommodityId=@CommodityId;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleClass_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleClass_Db.cs index 05f35cd..f6e488d 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleClass_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleClass_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -98,7 +98,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SaVehicleClass_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SaVehicleClass_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -146,11 +146,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -159,7 +159,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _MakeCode = GetFieldString(dbDataReader, "MakeCode", _MakeCode); @@ -193,13 +193,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -247,7 +247,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -255,7 +255,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleEvent_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleEvent_Db.cs index 3c2c230..1c020e4 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleEvent_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleEvent_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -86,7 +86,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SaVehicleEvent_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SaVehicleEvent_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -128,11 +128,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -141,7 +141,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _VehicleId = GetFieldInt32(dbDataReader, "VehicleId", _VehicleId); @@ -169,13 +169,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -217,7 +217,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -225,7 +225,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleFeature_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleFeature_Db.cs index 440a246..e228d1e 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleFeature_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicleFeature_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -74,7 +74,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SaVehicleFeature_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SaVehicleFeature_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -110,11 +110,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -123,7 +123,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _VehicleId = GetFieldInt32(dbDataReader, "VehicleId", _VehicleId); _Source = GetFieldInt16(dbDataReader, "Source", _Source); @@ -145,13 +145,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -187,7 +187,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -195,7 +195,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE VehicleId=@VehicleId;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicle_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicle_Db.cs index 7215a9a..d8aaea1 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SaVehicle_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SaVehicle_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -116,7 +116,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SaVehicle_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SaVehicle_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -173,11 +173,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -186,7 +186,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _VehicleClassId = GetFieldInt32(dbDataReader, "VehicleClassId", _VehicleClassId); @@ -229,13 +229,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -292,7 +292,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -300,7 +300,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/StockLevel_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/StockLevel_Db.cs index 78fd4fe..43ac14b 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/StockLevel_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/StockLevel_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -80,7 +80,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal StockLevel_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal StockLevel_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -119,11 +119,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -132,7 +132,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _CommodityId = GetFieldInt32(dbDataReader, "CommodityId", _CommodityId); @@ -157,13 +157,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -202,7 +202,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -210,7 +210,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SysParam_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SysParam_Db.cs index d29013c..1514d08 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SysParam_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SysParam_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -72,7 +72,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SysParam_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SysParam_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -107,11 +107,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -120,7 +120,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _Cat = GetFieldInt16(dbDataReader, "Cat", _Cat); @@ -141,13 +141,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -182,7 +182,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -190,7 +190,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SystemAccountUser_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SystemAccountUser_Db.cs index a40d6f4..9df1688 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SystemAccountUser_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SystemAccountUser_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -65,7 +65,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SystemAccountUser_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SystemAccountUser_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -96,11 +96,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -109,7 +109,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _AccountId = GetFieldInt32(dbDataReader, "AccountId", _AccountId); _UserId = GetFieldInt32(dbDataReader, "UserId", _UserId); @@ -126,13 +126,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -163,7 +163,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -171,7 +171,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE AccountId=@AccountId AND UserId=@UserId;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SystemAccount_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SystemAccount_Db.cs index a86be04..486e777 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SystemAccount_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SystemAccount_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -76,7 +76,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SystemAccount_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SystemAccount_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -113,11 +113,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -126,7 +126,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -149,13 +149,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -192,7 +192,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -200,7 +200,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/SystemUser_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/SystemUser_Db.cs index a96d1e6..5e854d3 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/SystemUser_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/SystemUser_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -72,7 +72,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal SystemUser_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal SystemUser_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -107,11 +107,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -120,7 +120,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -141,13 +141,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -182,7 +182,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -190,7 +190,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/TaxCode_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/TaxCode_Db.cs index 800a6dc..b6e3ff4 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/TaxCode_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/TaxCode_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -82,7 +82,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal TaxCode_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal TaxCode_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -122,11 +122,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -135,7 +135,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _Code = GetFieldString(dbDataReader, "Code", _Code); @@ -161,13 +161,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -207,7 +207,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -215,7 +215,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/Transaction_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/Transaction_Db.cs index 3c9fc63..dbe6efe 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/Transaction_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/Transaction_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -188,7 +188,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal Transaction_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal Transaction_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -281,11 +281,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -294,7 +294,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _AffIdOwner = GetFieldInt32(dbDataReader, "AffIdOwner", _AffIdOwner); @@ -373,13 +373,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -472,7 +472,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -480,7 +480,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Internal/UnitMeasure_Db.cs b/SaBusMgrStandardDbas/Dbas/Internal/UnitMeasure_Db.cs index fbe5e9b..7046cce 100644 --- a/SaBusMgrStandardDbas/Dbas/Internal/UnitMeasure_Db.cs +++ b/SaBusMgrStandardDbas/Dbas/Internal/UnitMeasure_Db.cs @@ -1,15 +1,15 @@ using Microsoft.Data.SqlClient; -using Sarand.Net.Standard.Base.Dbas; -using Sarand.Net.Standard.Base.Utils; using Sarand.BusinessMgr.Net.Standard.Dbas.Data; 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.Data.Common; using System.Linq; //--------------------------------------------------------------------------- -// Code generated by Sarand Database Utilities Mon 8-Jun-2020 16:53:26 +// Code generated by Sarand Database Utilities Sat 10-Jul-2021 16:26:30 //--------------------------------------------------------------------------- namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal { @@ -88,7 +88,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Construction. - internal UnitMeasure_Db(IDatabaseInfo dbInfo) : base(dbInfo) + internal UnitMeasure_Db (IDatabaseInfo dbInfo) : base(dbInfo) { } @@ -131,11 +131,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Population. - public override void PopulateFrom(DbCommand dbCommand, String tableAlias, String filter) + public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter) { dbCommand.CommandText = "SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " + - "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + + "FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " + (!String.IsNullOrEmpty(filter) ? "WHERE " + filter : ""); Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText); using (DbDataReader dbDataReader = dbCommand.ExecuteReader()) @@ -144,7 +144,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal PopulateFrom(dbDataReader); } } - public override void PopulateFrom(DbDataReader dbDataReader) + public override void PopulateFrom (DbDataReader dbDataReader) { _Id = GetFieldInt32(dbDataReader, "Id", _Id); _Category = GetFieldInt16(dbDataReader, "Category", _Category); @@ -173,13 +173,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Insert command. - public override bool ExecuteInsertCommand(DbCommand dbCommand) + public override bool ExecuteInsertCommand (DbCommand dbCommand) { List columnNames = ExistingColumnNamesNonId; // Construct query. String query = "INSERT INTO " + TableNameFmt + " " + - "(" + columnNames.Concat(",", "[", "]") + ") "; + "("+columnNames.Concat(",","[","]")+") "; if (dbCommand is SqlCommand) query += "VALUES (" + columnNames.Concat(",", "@", "") + ") "; else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") "; @@ -222,7 +222,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal //------------------------------------------------------------------- // Update command. - public override bool ExecuteUpdateCommand(DbCommand dbCommand) + public override bool ExecuteUpdateCommand (DbCommand dbCommand) { // Columns to update. List columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList(); @@ -230,7 +230,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Internal String query = "UPDATE " + TableNameFmt + " SET "; if (dbCommand is SqlCommand) { - query += StringPairList.CreateFrom(columnNames.Bracket("[", "]"), columnNames).Concat("=@").Concat(", ") + " "; + query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " "; query += "WHERE Id=@Id;"; } else diff --git a/SaBusMgrStandardDbas/Dbas/Utils/SbmDbDfnGenerator.cs b/SaBusMgrStandardDbas/Dbas/Utils/SbmDbDfnGenerator.cs index bd27fb0..94b0b54 100644 --- a/SaBusMgrStandardDbas/Dbas/Utils/SbmDbDfnGenerator.cs +++ b/SaBusMgrStandardDbas/Dbas/Utils/SbmDbDfnGenerator.cs @@ -28,6 +28,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Utils public static bool Generate(DatabaseInstance dbInstance, String connectionString) { String fn = nameof(SbmDbDfnGenerator) + ".Generate"; + SaLogger.Info(fn + " Connection: " + connectionString); // Locate output folder: String directory = GetOutputFolder(dbInstance); @@ -70,17 +71,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Utils config.DefinitionClass.Usings.Add("Sarand.Net.Standard.Base.Core"); config.DefinitionClass.Usings.Add("Sarand.Net.Standard.Base.Utils"); config.DefinitionClass.Usings.Add("Sarand.Net.Standard.Base.Dbas"); - config.DefinitionClass.Namespace = "Sarand.BusinessMgr.Core.App"; + config.DefinitionClass.Namespace = "Sarand.BusinessMgr.Net.Standard.Base.App"; config.DefinitionClass.Classname = "SbmDbDfn"; // Table class. + config.TableClass.Usings.Clear(); + config.TableClass.Usings.Add("Sarand.Net.Standard.Base.Core"); + config.TableClass.Usings.Add("Sarand.Net.Standard.Base.Utils"); + config.TableClass.Usings.Add("Sarand.Net.Standard.Base.Dbas"); config.TableClass.Namespace = "Sarand.BusinessMgr.Net.Standard.Dbas.Internal"; config.TableClass.Namespace_BaseClass = "Sarand.BusinessMgr.Net.Standard.Dbas.Data"; config.TableClass.BaseClass = "SbmDbDataItem"; + config.TableClass.ClassName_DatabaseInfo = "IDatabaseInfo"; config.TableClass.MandatoryConstructorDbInfo = true; config.TableClass.TreatDoubleFormatAsDecimal = true; if (dbInstance == DatabaseInstance.Control) { - config.DefinitionClass.Classname = "SbmControlDbDfn"; + config.DefinitionClass.Classname = "SbmDbDfn_Control"; config.TableClass.Namespace = "Sarand.BusinessMgr.Net.Standard.Dbas.Internal.Control"; } diff --git a/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn.xml b/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn.xml new file mode 100644 index 0000000..c5becd8 --- /dev/null +++ b/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn.xml @@ -0,0 +1,23507 @@ + + + + + dbo + Address + + + + dbo +
Address
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + + + + dbo + Address
+ 2 + ItemType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Address
+ 3 + ItemId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Address
+ 4 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Address
+ 5 + AddIdRef + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Address
+ 6 + RefExt + VarChar + + -9 + nvarchar + false + 16 + 32 + 0 + Nullable + true + +
+ + dbo + Address
+ 7 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Address
+ 8 + Name + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + Nullable + true + +
+ + dbo + Address
+ 9 + DescBrief + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + Nullable + true + +
+ + dbo + Address
+ 10 + Line1 + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + NoNulls + false + +
+ + dbo + Address
+ 11 + Line2 + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + Nullable + true + +
+ + dbo + Address
+ 12 + Line3 + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + Nullable + true + +
+ + dbo + Address
+ 13 + City + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + Nullable + true + +
+ + dbo + Address
+ 14 + Province + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + Nullable + true + +
+ + dbo + Address
+ 15 + Postcode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Address
+ 16 + PostcodeFmt + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Address
+ 17 + Country + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Address
+ 18 + CityRgn + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Address
+ 19 + ProvinceRgn + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Address
+ 20 + CountryRgn + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Address
+ 21 + Contact + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Address
+ 22 + Phone + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Address
+ 23 + Fax + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Address
+ 24 + Email + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Address
+ 25 + AccountManagerCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Address
+ 26 + AccountHandlerCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Address
+ 27 + ContactAreaCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Address
+ 28 + ContactHandlerCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Address
+ 29 + DeliveryTypeCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Address
+ 30 + DeliveryMethodCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Address
+ 31 + DeliveryBookInCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Address
+ 32 + LastVisitOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Address
+ 33 + NextVisitOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Address
+ 34 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Address
+ 35 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Address
+ 36 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + NoNulls + false + +
+ + dbo + Address
+ 37 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + Address
+ 38 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Address
+ 39 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + Address
+ 40 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Address
+ 41 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Address
+ 42 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + + + dbo + Address
+ PK_Address + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + Address
+ IDX_Address_CityRgn + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CityRgn + true + + +
+ + dbo + Address
+ IDX_Address_CountryRgn + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CountryRgn + true + + +
+ + dbo + Address
+ IDX_Address_Flags + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Flags + true + + +
+ + dbo + Address
+ IDX_Address_Item + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ItemType + true + + + 2 + ItemId + true + + +
+ + dbo + Address
+ IDX_Address_Line1 + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Line1 + true + + +
+ + dbo + Address
+ IDX_Address_Owner + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + +
+ + dbo + Address
+ IDX_Address_Postcode + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Postcode + true + + +
+ + dbo + Address
+ IDX_Address_PostcodeFmt + 3 + false + false + false + false + 0 + 0 + false + + + 1 + PostcodeFmt + true + + +
+ + dbo + Address
+ IDX_Address_ProvinceRgn + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ProvinceRgn + true + + +
+ + dbo + Address
+ IDX_Address_RefAddress + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AddIdRef + true + + +
+ + dbo + Address
+ IDX_Address_Status + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Status + true + + +
+ + dbo + Address
+ IDX_Address_Type + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Type + true + + +
+
+ + + dbo + Affiliate + + + + dbo + Affiliate
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Affiliate
+ 2 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Affiliate
+ 3 + Name + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + NoNulls + false + +
+ + dbo + Affiliate
+ 4 + Abbrev + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 5 + AffIdParent + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 6 + Title + VarChar + + -9 + nvarchar + false + 20 + 40 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 7 + Initials + VarChar + + -9 + nvarchar + false + 5 + 10 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 8 + LastName + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 9 + FirstName + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 10 + Salutation + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 11 + Nature + VarChar + + -9 + nvarchar + false + 100 + 200 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 12 + CompanyNo + VarChar + + -9 + nvarchar + false + 20 + 40 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 13 + VatReg + VarChar + + -9 + nvarchar + false + 20 + 40 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 14 + Contact + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 15 + PhoneMain + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 16 + PhoneAlt + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 17 + PhoneFax + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 18 + PhoneMobile + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 19 + PhoneDirect + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 20 + Email + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 21 + Website + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 22 + BirthDay + TinyInt + + -6 + tinyint + false + 3 + 1 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 23 + BirthMonth + TinyInt + + -6 + tinyint + false + 3 + 1 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 24 + BirthYear + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 25 + MaritalStatus + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 26 + Spouse + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 27 + Children + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 28 + Hometown + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 29 + UserId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 30 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 31 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Affiliate
+ 32 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + NoNulls + false + +
+ + dbo + Affiliate
+ 33 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + Affiliate
+ 34 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 35 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 36 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Affiliate
+ 37 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Affiliate
+ 38 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + Affiliate
+ PK_Affiliate + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + Affiliate
+ IDX_Affiliate_Name + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Name + true + + +
+ + dbo + Affiliate
+ IDX_Affiliate_Status + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Status + true + + +
+ + dbo + Affiliate
+ IDX_Affiliate_Type + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Type + true + + +
+ + dbo + Affiliate
+ IDX_Affiliate_UserId + 3 + false + false + false + false + 0 + 0 + false + + + 1 + UserId + true + + +
+
+
+ + dbo + Association + + + + dbo + Association
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Association
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Association
+ 3 + AffIdTarget + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Association
+ 4 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Association
+ 5 + Code + VarChar + + -9 + nvarchar + false + 20 + 40 + 0 + Nullable + true + +
+ + dbo + Association
+ 6 + ExtRef + VarChar + + -9 + nvarchar + false + 20 + 40 + 0 + Nullable + true + +
+ + dbo + Association
+ 7 + Location + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + Nullable + true + +
+ + dbo + Association
+ 8 + Role + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + Nullable + true + +
+ + dbo + Association
+ 9 + PhoneMain + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Association
+ 10 + Email + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Association
+ 11 + Group + VarChar + + 12 + varchar + false + 64 + 64 + 0 + Nullable + true + +
+ + dbo + Association
+ 12 + DescDetail + VarChar + + -9 + nvarchar + false + 4000 + 8000 + 0 + Nullable + true + +
+ + dbo + Association
+ 13 + DefaultNominalCode + VarChar + + -9 + nvarchar + false + 8 + 16 + 0 + Nullable + true + +
+ + dbo + Association
+ 14 + AccountManagerCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Association
+ 15 + AccountHandlerCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Association
+ 16 + AccountTypeCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Association
+ 17 + AccountRatingCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Association
+ 18 + ContactAreaCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Association
+ 19 + ContactHandlerCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Association
+ 20 + ContactMethodCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Association
+ 21 + ContactCallCycleCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Association
+ 22 + CallsPerYear + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Association
+ 23 + LastCall + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Association
+ 24 + CommodityIdSalesDefault + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Association
+ 25 + OrderLeadTimeCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Association
+ 26 + DeliveryTypeCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Association
+ 27 + DeliveryMethodCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Association
+ 28 + DeliveryCourierCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Association
+ 29 + DeliveryBookInCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Association
+ 30 + AmountTransMax + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Association
+ 31 + AnnualSalesTarget + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Association
+ 32 + CreditLimit + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Association
+ 33 + AccountBalance + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Association
+ 34 + DiscountType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Association
+ 35 + DiscountRate + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Association
+ 36 + PriceSetId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Association
+ 37 + TaxCodeId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Association
+ 38 + PaymentTerms + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Association
+ 39 + InvoiceDesc + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + Nullable + true + +
+ + dbo + Association
+ 40 + Terminated + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Association
+ 41 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Association
+ 42 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Association
+ 43 + Status + VarChar + + 12 + varchar + false + 3 + 3 + 0 + NoNulls + false + +
+ + dbo + Association
+ 44 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + Association
+ 45 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Association
+ 46 + CreateHost + VarChar + + 12 + varchar + false + 64 + 64 + 0 + Nullable + true + +
+ + dbo + Association
+ 47 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Association
+ 48 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Association
+ 49 + UpdateHost + VarChar + + 12 + varchar + false + 64 + 64 + 0 + Nullable + true + +
+
+ + + dbo + Association
+ PK_Association + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + Association
+ IDX_Association_OwnerTargetType + 3 + true + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + AffIdTarget + true + + + 3 + Type + true + + +
+ + dbo + Association
+ IDX_Association_Code + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Code + true + + +
+ + dbo + Association
+ IDX_Association_ExtRef + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ExtRef + true + + +
+ + dbo + Association
+ IDX_Association_Owner + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + +
+ + dbo + Association
+ IDX_Association_OwnerTypeCode + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + Type + true + + + 3 + Code + true + + +
+ + dbo + Association
+ IDX_Association_PriceSet + 3 + false + false + false + false + 0 + 0 + false + + + 1 + PriceSetId + true + + +
+ + dbo + Association
+ IDX_Association_Target + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdTarget + true + + +
+ + dbo + Association
+ IDX_Association_TaxCode + 3 + false + false + false + false + 0 + 0 + false + + + 1 + TaxCodeId + true + + +
+
+
+ + dbo + Commodity + + + + dbo + Commodity
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Commodity
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Commodity
+ 3 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Commodity
+ 4 + Code + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + NoNulls + false + +
+ + dbo + Commodity
+ 5 + DescBrief + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + NoNulls + false + +
+ + dbo + Commodity
+ 6 + DescOrder + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 7 + DescDetail + VarChar + + -9 + nvarchar + false + 4000 + 8000 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 8 + DrawingNo + VarChar + + -9 + nvarchar + false + 20 + 40 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 9 + DrawingIssue + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 10 + AssetCatId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 11 + ImagePath + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 12 + Category + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 13 + Category2 + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 14 + Category3 + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 15 + Location + VarChar + + -9 + nvarchar + false + 16 + 32 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 16 + Department + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 17 + CatalogRef + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 18 + Weight + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 19 + UomIdWeight + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 20 + Length + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 21 + UomIdLength + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 22 + Volume + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 23 + UomIdVolume + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 24 + Density + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 25 + UomIdDensity + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 26 + BoxQuantity + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 27 + UomIdBox + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 28 + Dimensions + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 29 + SpecSummary + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 30 + NominalCode + VarChar + + -9 + nvarchar + false + 8 + 16 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 31 + NominalCodePurchase + VarChar + + -9 + nvarchar + false + 8 + 16 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 32 + ICNTariffCode + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 33 + TimeProd + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 34 + UomIdTimeProd + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 35 + RangeCode + VarChar + + 12 + varchar + false + 12 + 12 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 36 + ColourCode + VarChar + + 12 + varchar + false + 12 + 12 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 37 + SourceCode + VarChar + + 12 + varchar + false + 12 + 12 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 38 + SupplyMethodCode + VarChar + + 12 + varchar + false + 12 + 12 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 39 + HandlingCode + VarChar + + 12 + varchar + false + 12 + 12 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 40 + DeliveryCode + VarChar + + 12 + varchar + false + 12 + 12 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 41 + MaterialCode + VarChar + + 12 + varchar + false + 12 + 12 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 42 + FinishCode + VarChar + + 12 + varchar + false + 12 + 12 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 43 + PromotionCode + VarChar + + 12 + varchar + false + 12 + 12 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 44 + AssIdSupplier + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 45 + SupplierRef + VarChar + + -9 + nvarchar + false + 16 + 32 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 46 + CostPrice + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 47 + PlaceOfOrigin + VarChar + + 12 + varchar + false + 60 + 60 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 48 + MaterialCost + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 49 + CurrencyIdMaterial + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 50 + ExWorksCost + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 51 + CurrencyIdExWorks + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 52 + ReorderLevel + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 53 + ReorderQty + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 54 + QtyOnOrder + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 55 + AssIdCustomer + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 56 + SalesPrice + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 57 + RetailPrice + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 58 + RetailPricePlanned + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 59 + UomIdSale + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 60 + PackQty + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 61 + CarriageCostIndicative + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 62 + MinOrderQty + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 63 + TaxCodeId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 64 + LastOrderDate + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 65 + LastOrderQty + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 66 + QtyInStock + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 67 + QtyAllocated + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 68 + FreeStock + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 69 + StockTakeDate + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 70 + StockTakeQty + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 71 + OrderQtyDecimals + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 72 + CommodityIdSalesProj + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 73 + SalesProjMonthlyProp + VarChar + + 12 + varchar + false + 128 + 128 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 74 + SalesProjAnnual + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 75 + SalesProjMonth01 + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 76 + SalesProjMonth02 + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 77 + SalesProjMonth03 + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 78 + SalesProjMonth04 + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 79 + SalesProjMonth05 + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 80 + SalesProjMonth06 + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 81 + SalesProjMonth07 + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 82 + SalesProjMonth08 + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 83 + SalesProjMonth09 + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 84 + SalesProjMonth10 + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 85 + SalesProjMonth11 + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 86 + SalesProjMonth12 + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Commodity
+ 87 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 88 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Commodity
+ 89 + Status + VarChar + + 12 + varchar + false + 3 + 3 + 0 + NoNulls + false + +
+ + dbo + Commodity
+ 90 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + Commodity
+ 91 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 92 + CreateHost + VarChar + + 12 + varchar + false + 64 + 64 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 93 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Commodity
+ 94 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Commodity
+ 95 + UpdateHost + VarChar + + 12 + varchar + false + 64 + 64 + 0 + Nullable + true + +
+
+ + + dbo + Commodity
+ PK_Commodity + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + Commodity
+ IDX_Commodity_AssetCat + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssetCatId + true + + +
+ + dbo + Commodity
+ IDX_Commodity_CodeIssue + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Code + true + + + 2 + DrawingIssue + true + + +
+ + dbo + Commodity
+ IDX_Commodity_Colour + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ColourCode + true + + +
+ + dbo + Commodity
+ IDX_Commodity_Customer + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssIdCustomer + true + + +
+ + dbo + Commodity
+ IDX_Commodity_Delivery + 3 + false + false + false + false + 0 + 0 + false + + + 1 + DeliveryCode + true + + +
+ + dbo + Commodity
+ IDX_Commodity_Description + 3 + false + false + false + false + 0 + 0 + false + + + 1 + DescBrief + true + + +
+ + dbo + Commodity
+ IDX_Commodity_Finish + 3 + false + false + false + false + 0 + 0 + false + + + 1 + FinishCode + true + + +
+ + dbo + Commodity
+ IDX_Commodity_Handling + 3 + false + false + false + false + 0 + 0 + false + + + 1 + HandlingCode + true + + +
+ + dbo + Commodity
+ IDX_Commodity_Material + 3 + false + false + false + false + 0 + 0 + false + + + 1 + MaterialCode + true + + +
+ + dbo + Commodity
+ IDX_Commodity_Owner + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + +
+ + dbo + Commodity
+ IDX_Commodity_Range + 3 + false + false + false + false + 0 + 0 + false + + + 1 + RangeCode + true + + +
+ + dbo + Commodity
+ IDX_Commodity_SalesProjCommodity + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CommodityIdSalesProj + true + + +
+ + dbo + Commodity
+ IDX_Commodity_Source + 3 + false + false + false + false + 0 + 0 + false + + + 1 + SourceCode + true + + +
+ + dbo + Commodity
+ IDX_Commodity_Supplier + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssIdSupplier + true + + +
+ + dbo + Commodity
+ IDX_Commodity_SupplyMethod + 3 + false + false + false + false + 0 + 0 + false + + + 1 + SupplyMethodCode + true + + +
+ + dbo + Commodity
+ IDX_Commodity_TaxCode + 3 + false + false + false + false + 0 + 0 + false + + + 1 + TaxCodeId + true + + +
+ + dbo + Commodity
+ IDX_Commodity_UomBox + 3 + false + false + false + false + 0 + 0 + false + + + 1 + UomIdBox + true + + +
+ + dbo + Commodity
+ IDX_Commodity_UomDensity + 3 + false + false + false + false + 0 + 0 + false + + + 1 + UomIdDensity + true + + +
+ + dbo + Commodity
+ IDX_Commodity_UomLength + 3 + false + false + false + false + 0 + 0 + false + + + 1 + UomIdLength + true + + +
+ + dbo + Commodity
+ IDX_Commodity_UomSale + 3 + false + false + false + false + 0 + 0 + false + + + 1 + UomIdSale + true + + +
+ + dbo + Commodity
+ IDX_Commodity_UomTimeProd + 3 + false + false + false + false + 0 + 0 + false + + + 1 + UomIdTimeProd + true + + +
+ + dbo + Commodity
+ IDX_Commodity_UomVolume + 3 + false + false + false + false + 0 + 0 + false + + + 1 + UomIdVolume + true + + +
+ + dbo + Commodity
+ IDX_Commodity_UomWeight + 3 + false + false + false + false + 0 + 0 + false + + + 1 + UomIdWeight + true + + +
+
+
+ + dbo + CommodityCustomer + + + + dbo + CommodityCustomer
+ 1 + CommodityId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + CommodityCustomer
+ 2 + AssocIdCustomer + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + CommodityCustomer
+ 3 + ProductCode + VarChar + + 12 + varchar + false + 32 + 32 + 0 + Nullable + true + +
+ + dbo + CommodityCustomer
+ 4 + AmountRetail + Double + + 6 + float + false + 53 + 8 + 0 + NoNulls + false + +
+ + dbo + CommodityCustomer
+ 5 + CurrencyIdRetail + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + CommodityCustomer
+ 6 + PromotionCode + VarChar + + 12 + varchar + false + 12 + 12 + 0 + Nullable + true + +
+ + dbo + CommodityCustomer
+ 7 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + CommodityCustomer
+ 8 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + CommodityCustomer
+ 9 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + NoNulls + false + +
+ + dbo + CommodityCustomer
+ 10 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + CommodityCustomer
+ 11 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + CommodityCustomer
+ 12 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + CommodityCustomer
+ 13 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + CommodityCustomer
+ 14 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + CommodityCustomer
+ 15 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + CommodityCustomer
+ PK_CommodityCustomer + 1 + true + false + false + false + 0 + 0 + false + + + 1 + CommodityId + true + + + 2 + AssocIdCustomer + true + + +
+ + dbo + CommodityCustomer
+ IDX_CommodityCustomer_Currency + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CurrencyIdRetail + true + + +
+ + dbo + CommodityCustomer
+ IDX_CommodityCustomer_Customer + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssocIdCustomer + true + + +
+
+
+ + dbo + CommoditySupplier + + + + dbo + CommoditySupplier
+ 1 + CommodityId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + CommoditySupplier
+ 2 + AssocIdSupplier + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + CommoditySupplier
+ 3 + ProductCode + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + CommoditySupplier
+ 4 + AmountCost + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + CommoditySupplier
+ 5 + CurrencyIdCost + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + CommoditySupplier
+ 6 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + CommoditySupplier
+ 7 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + CommoditySupplier
+ 8 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + NoNulls + false + +
+ + dbo + CommoditySupplier
+ 9 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + CommoditySupplier
+ 10 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + CommoditySupplier
+ 11 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + CommoditySupplier
+ 12 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + CommoditySupplier
+ 13 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + CommoditySupplier
+ 14 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + CommoditySupplier
+ PK_CommoditySupplier + 1 + true + false + false + false + 0 + 0 + false + + + 1 + CommodityId + true + + + 2 + AssocIdSupplier + true + + +
+
+
+ + dbo + Constituent + + + + dbo + Constituent
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Constituent
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Constituent
+ 3 + AffIdTarget + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 4 + AssocId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 5 + TransId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 6 + ReqntId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 7 + ConstId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 8 + ProcessId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 9 + AssocIdContractor + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 10 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 11 + Seq + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 12 + Effective + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Constituent
+ 13 + Required + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Constituent
+ 14 + Started + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Constituent
+ 15 + Completed + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Constituent
+ 16 + AssetId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 17 + DescBrief + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 18 + DescOutline + VarChar + + -9 + nvarchar + false + 4000 + 8000 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 19 + DescDetail + VarChar + + -9 + nvarchar + false + 4000 + 8000 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 20 + TaskNumber + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 21 + Priority + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 22 + Category + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 23 + Reference + VarChar + + -9 + nvarchar + false + 20 + 40 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 24 + Quantity + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 25 + UomId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 26 + UnitCost + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 27 + AmountEst + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 28 + AmountNet + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 29 + TaxCodeId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 30 + TaxRate + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 31 + AmountTax + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 32 + AmountTot + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 33 + TaxRateRebate + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 34 + AmountTaxRebate + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 35 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 36 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 37 + StatusCat + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 38 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 39 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Constituent
+ 40 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 41 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 42 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Constituent
+ 43 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Constituent
+ 44 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + Constituent
+ PK_Constituent + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + Constituent
+ IDX_Constituent_Asset + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssetId + true + + +
+ + dbo + Constituent
+ IDX_Constituent_Assoc + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssocId + true + + +
+ + dbo + Constituent
+ IDX_Constituent_Const + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ConstId + true + + +
+ + dbo + Constituent
+ IDX_Constituent_Contractor + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssocIdContractor + true + + +
+ + dbo + Constituent
+ IDX_Constituent_Effective + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Effective + true + + +
+ + dbo + Constituent
+ IDX_Constituent_Owner + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + +
+ + dbo + Constituent
+ IDX_Constituent_Process + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ProcessId + true + + +
+ + dbo + Constituent
+ IDX_Constituent_Reqnt + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ReqntId + true + + +
+ + dbo + Constituent
+ IDX_Constituent_Target + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdTarget + true + + +
+ + dbo + Constituent
+ IDX_Constituent_TaxCode + 3 + false + false + false + false + 0 + 0 + false + + + 1 + TaxCodeId + true + + +
+ + dbo + Constituent
+ IDX_Constituent_Trans + 3 + false + false + false + false + 0 + 0 + false + + + 1 + TransId + true + + +
+ + dbo + Constituent
+ IDX_Constituent_Type + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Type + true + + +
+ + dbo + Constituent
+ IDX_Constituent_Uom + 3 + false + false + false + false + 0 + 0 + false + + + 1 + UomId + true + + +
+
+
+ + dbo + Container + + + + dbo + Container
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Container
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Container
+ 3 + Category + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Container
+ 4 + Type + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + NoNulls + false + +
+ + dbo + Container
+ 5 + Reference + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + NoNulls + false + +
+ + dbo + Container
+ 6 + DescBrief + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Container
+ 7 + TagId + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + Container
+ 8 + AssIdSupplier + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Container
+ 9 + AssIdCustomer + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Container
+ 10 + Expected + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Container
+ 11 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Container
+ 12 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Container
+ 13 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + NoNulls + false + +
+ + dbo + Container
+ 14 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + Container
+ 15 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Container
+ 16 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + Container
+ 17 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Container
+ 18 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Container
+ 19 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + Container
+ PK_Container + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + Container
+ IDX_Container_Customer + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssIdCustomer + true + + +
+ + dbo + Container
+ IDX_Container_OwnerRef + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + Reference + true + + +
+ + dbo + Container
+ IDX_Container_OwnerType + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + Type + true + + +
+ + dbo + Container
+ IDX_Container_Supplier + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssIdSupplier + true + + +
+ + dbo + Container
+ IDX_Container_TagId + 3 + false + false + false + false + 0 + 0 + false + + + 1 + TagId + true + + +
+
+
+ + dbo + ContainerItem + + + + dbo + ContainerItem
+ 1 + ContainerId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + ContainerItem
+ 2 + ItemSeq + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + ContainerItem
+ 3 + ItemType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + ContainerItem
+ 4 + ItemId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + ContainerItem
+ 5 + ItemTypeSource + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + ContainerItem
+ 6 + ItemIdSource + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + ContainerItem
+ 7 + Quantity + Double + + 6 + float + false + 53 + 8 + 0 + NoNulls + false + +
+ + dbo + ContainerItem
+ 8 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + ContainerItem
+ 9 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + ContainerItem
+ 10 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + NoNulls + false + +
+ + dbo + ContainerItem
+ 11 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + ContainerItem
+ 12 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + ContainerItem
+ 13 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + ContainerItem
+ 14 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + ContainerItem
+ 15 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + ContainerItem
+ 16 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + ContainerItem
+ PK_ContainerItem + 1 + true + false + false + false + 0 + 0 + false + + + 1 + ContainerId + true + + + 2 + ItemSeq + true + + + 3 + ItemType + true + + + 4 + ItemId + true + + +
+ + dbo + ContainerItem
+ IDX_ContainerItem_ContainerSeq + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ContainerId + true + + + 2 + ItemSeq + true + + +
+ + dbo + ContainerItem
+ IDX_ContainerItem_Item + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ItemType + true + + + 2 + ItemId + true + + +
+ + dbo + ContainerItem
+ IDX_ContainerItem_SourceItem + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ItemTypeSource + true + + + 2 + ItemIdSource + true + + +
+
+
+ + dbo + Currency + + + + dbo + Currency
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Currency
+ 2 + Code + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + Nullable + true + +
+ + dbo + Currency
+ 3 + Name + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + Nullable + true + +
+ + dbo + Currency
+ 4 + Primary + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Currency
+ 5 + Division + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + Nullable + true + +
+ + dbo + Currency
+ 6 + Region + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Currency
+ 7 + Symbol + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Currency
+ 8 + Suffix + Bit + + -7 + bit + false + 1 + 1 + 0 + NoNulls + false + +
+ + dbo + Currency
+ 9 + IncSpace + Bit + + -7 + bit + false + 1 + 1 + 0 + NoNulls + false + +
+ + dbo + Currency
+ 10 + Decimals + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Currency
+ 11 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Currency
+ 12 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Currency
+ 13 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + Currency
+ 14 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Currency
+ 15 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Currency
+ 16 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + Currency
+ PK_Currency + 1 + true + false + false + false + 1 + 4 + false + + + 1 + Id + true + + +
+ + dbo + Currency
+ IDX_Currency_Code + 3 + true + false + false + false + 0 + 0 + false + + + 1 + Code + true + + +
+ + dbo + Currency
+ IDX_Currency_Region + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Region + true + + +
+
+
+ + dbo + IndexDefragLog + + + + dbo + IndexDefragLog
+ 1 + IndexDefragId + Int + + 4 + int + true + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + IndexDefragLog
+ 2 + DatabaseID + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + IndexDefragLog
+ 3 + DatabaseName + VarChar + + -9 + nvarchar + false + 128 + 256 + 0 + NoNulls + false + +
+ + dbo + IndexDefragLog
+ 4 + ObjectID + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + IndexDefragLog
+ 5 + ObjectName + VarChar + + -9 + nvarchar + false + 128 + 256 + 0 + NoNulls + false + +
+ + dbo + IndexDefragLog
+ 6 + IndexID + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + IndexDefragLog
+ 7 + IndexName + VarChar + + -9 + nvarchar + false + 128 + 256 + 0 + NoNulls + false + +
+ + dbo + IndexDefragLog
+ 8 + PartitionNumber + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + IndexDefragLog
+ 9 + Fragmentation + Double + + 6 + float + false + 53 + 8 + 0 + NoNulls + false + +
+ + dbo + IndexDefragLog
+ 10 + PageCount + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + IndexDefragLog
+ 11 + DateTimeStart + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + IndexDefragLog
+ 12 + DurationSeconds + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+
+ + + dbo + IndexDefragLog
+ PK_IndexDefragLog + 1 + true + false + false + false + 0 + 0 + false + + + 1 + IndexDefragId + true + + +
+
+
+ + dbo + Interface + + + + dbo + Interface
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Interface
+ 2 + Context + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + Interface
+ 3 + Code + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + NoNulls + false + +
+ + dbo + Interface
+ 4 + Category + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Interface
+ 5 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Interface
+ 6 + Caption + VarChar + + -9 + nvarchar + false + 100 + 200 + 0 + NoNulls + false + +
+ + dbo + Interface
+ 7 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Interface
+ 8 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Interface
+ 9 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + Interface
+ 10 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Interface
+ 11 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Interface
+ 12 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + Interface
+ 13 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Interface
+ 14 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Interface
+ 15 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + Interface
+ PK_Interface + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + Interface
+ IDX_Interface_ContextCode + 3 + true + false + false + false + 0 + 0 + false + + + 1 + Context + true + + + 2 + Code + true + + +
+ + dbo + Interface
+ IDX_Interface_ContextCategoryType + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Context + true + + + 2 + Category + true + + + 3 + Type + true + + +
+
+
+ + dbo + InterfaceDataItem + + + + dbo + InterfaceDataItem
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + InterfaceDataItem
+ 2 + InterfaceId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + InterfaceDataItem
+ 3 + Direction + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + InterfaceDataItem
+ 4 + ExternalRef + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 5 + ItemType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + InterfaceDataItem
+ 6 + ItemId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + InterfaceDataItem
+ 7 + ProcessStatus + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 8 + ProcessStatusBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 9 + ProcessStatusOn + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 10 + ItemStatus + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 11 + ItemStatusBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 12 + ItemStatusOn + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 13 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 14 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 15 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 16 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 17 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 18 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 19 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceDataItem
+ 20 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + InterfaceDataItem
+ PK_InterfaceDataItem + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + InterfaceDataItem
+ IDX_InterfaceDataItem_InterfaceItemRef + 3 + true + false + false + false + 0 + 0 + false + + + 1 + InterfaceId + true + + + 2 + Direction + true + + + 3 + ItemType + true + + + 4 + ItemId + true + + + 5 + ExternalRef + true + + +
+ + dbo + InterfaceDataItem
+ IDX_InterfaceDataItem_InterfaceStatusItemRef + 3 + true + false + false + false + 0 + 0 + false + + + 1 + InterfaceId + true + + + 2 + Direction + true + + + 3 + ProcessStatus + true + + + 4 + ItemType + true + + + 5 + ItemId + true + + + 6 + ExternalRef + true + + +
+ + dbo + InterfaceDataItem
+ IDX_InterfaceDataItem_InterfaceDirectionItemRef + 3 + false + false + false + false + 0 + 0 + false + + + 1 + InterfaceId + true + + + 2 + Direction + true + + + 3 + ItemType + true + + + 4 + ExternalRef + true + + +
+ + dbo + InterfaceDataItem
+ IDX_InterfaceDataItem_Item + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ItemType + true + + + 2 + ItemId + true + + +
+ + dbo + InterfaceDataItem
+ IDX_InterfaceDataItem_ItemExternal + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ItemType + true + + + 2 + ExternalRef + true + + +
+
+
+ + dbo + InterfaceProcess + + + + dbo + InterfaceProcess
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + InterfaceProcess
+ 2 + InterfaceId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + InterfaceProcess
+ 3 + Direction + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + InterfaceProcess
+ 4 + ProcRef + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + InterfaceProcess
+ 5 + ProcSeq + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceProcess
+ 6 + ProcDate + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceProcess
+ 7 + ProcTime + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + 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 + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceProcess
+ 11 + ItemCount + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceProcess
+ 12 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + InterfaceProcess
+ 13 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + InterfaceProcess
+ 14 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + InterfaceProcess
+ 15 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceProcess
+ 16 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + InterfaceProcess
+ 17 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + InterfaceProcess
+ 18 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceProcess
+ 19 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + InterfaceProcess
+ PK_InterfaceProcess + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + InterfaceProcess
+ IDX_InterfaceProcess_IntDirSeq + 3 + true + false + false + false + 0 + 0 + false + + + 1 + InterfaceId + true + + + 2 + Direction + true + + + 3 + ProcSeq + true + + +
+ + dbo + InterfaceProcess
+ IDX_InterfaceProcess_IntProc + 3 + false + false + false + false + 0 + 0 + false + + + 1 + InterfaceId + true + + + 2 + ProcRef + true + + +
+ + dbo + InterfaceProcess
+ IDX_InterfaceProcess_IntProcDate + 3 + false + false + false + false + 0 + 0 + false + + + 1 + InterfaceId + true + + + 2 + ProcDate + true + + + 3 + ProcTime + true + + +
+
+
+ + dbo + InterfaceProcessDataItem + + + + dbo + InterfaceProcessDataItem
+ 1 + ProcessId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + InterfaceProcessDataItem
+ 2 + InterfaceDataItemId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + InterfaceProcessDataItem
+ 3 + ItemData + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessDataItem
+ 4 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessDataItem
+ 5 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessDataItem
+ 6 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + InterfaceProcessDataItem
+ 7 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessDataItem
+ 8 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessDataItem
+ 9 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + InterfaceProcessDataItem
+ 10 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessDataItem
+ 11 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + InterfaceProcessDataItem
+ PK_InterfaceProcessDataItem + 1 + true + false + false + false + 0 + 0 + false + + + 1 + ProcessId + true + + + 2 + InterfaceDataItemId + true + + +
+ + dbo + InterfaceProcessDataItem
+ IDX_InterfaceProcessDataItem_Item + 3 + false + false + false + false + 0 + 0 + false + + + 1 + InterfaceDataItemId + true + + +
+ + dbo + InterfaceProcessDataItem
+ IDX_InterfaceProcessDataItem_ProcItemData + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ProcessId + true + + + 2 + ItemData + true + + +
+
+
+ + dbo + InterfaceProcessMessage + + + + dbo + InterfaceProcessMessage
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + InterfaceProcessMessage
+ 2 + ProcessId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + InterfaceProcessMessage
+ 3 + MsgType + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessMessage
+ 4 + Msg + VarChar + + -9 + nvarchar + false + 4000 + 8000 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessMessage
+ 5 + FileName + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessMessage
+ 6 + LineNumber + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessMessage
+ 7 + ItemType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessMessage
+ 8 + ItemId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessMessage
+ 9 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessMessage
+ 10 + Status + VarChar + + 12 + varchar + false + 3 + 3 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessMessage
+ 11 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + InterfaceProcessMessage
+ 12 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessMessage
+ 13 + CreateHost + VarChar + + 12 + varchar + false + 64 + 64 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessMessage
+ 14 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + InterfaceProcessMessage
+ 15 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + InterfaceProcessMessage
+ 16 + UpdateHost + VarChar + + 12 + varchar + false + 64 + 64 + 0 + Nullable + true + +
+
+ + + dbo + InterfaceProcessMessage
+ PK_InterfaceProcessMessage + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + InterfaceProcessMessage
+ IDX_InterfaceProcessMessage_Process + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ProcessId + true + + +
+ + dbo + InterfaceProcessMessage
+ IDX_InterfaceProcessMessage_ProcMsgType + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ProcessId + true + + + 2 + MsgType + true + + +
+
+
+ + dbo + ItemBatch + + + + dbo + ItemBatch
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + ItemBatch
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + ItemBatch
+ 3 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + ItemBatch
+ 4 + Ref + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + NoNulls + false + +
+ + dbo + ItemBatch
+ 5 + ProcessType + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + ItemBatch
+ 6 + DescBrief + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + ItemBatch
+ 7 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + ItemBatch
+ 8 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + ItemBatch
+ 9 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + NoNulls + false + +
+ + dbo + ItemBatch
+ 10 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + ItemBatch
+ 11 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + ItemBatch
+ 12 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + NoNulls + false + +
+ + dbo + ItemBatch
+ 13 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + ItemBatch
+ 14 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + ItemBatch
+ 15 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + ItemBatch
+ PK_ItemBatch + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+
+
+ + dbo + ItemLink + + + + dbo + ItemLink
+ 1 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + ItemLink
+ 2 + ItemTypeFrom + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + ItemLink
+ 3 + ItemIdFrom + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + ItemLink
+ 4 + ItemTypeTo + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + ItemLink
+ 5 + ItemIdTo + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + ItemLink
+ 6 + Seq + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + ItemLink
+ 7 + Completed + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + ItemLink
+ 8 + DataContent + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + ItemLink
+ 9 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + ItemLink
+ 10 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + ItemLink
+ 11 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + ItemLink
+ 12 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + ItemLink
+ 13 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + ItemLink
+ 14 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + ItemLink
+ 15 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + ItemLink
+ 16 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + ItemLink
+ 17 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + ItemLink
+ PK_ItemLink + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Type + true + + + 2 + ItemTypeFrom + true + + + 3 + ItemIdFrom + true + + + 4 + ItemTypeTo + true + + + 5 + ItemIdTo + true + + + 6 + Seq + true + + +
+ + dbo + ItemLink
+ IDX_ItemLink_ItemFrom + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ItemTypeFrom + true + + + 2 + ItemIdFrom + true + + +
+ + dbo + ItemLink
+ IDX_ItemLink_ItemTo + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ItemTypeTo + true + + + 2 + ItemIdTo + true + + +
+ + dbo + ItemLink
+ IDX_ItemLink_Type_ItemTypeFrom_ItemTypeTo + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Type + true + + + 2 + ItemTypeFrom + true + + + 3 + ItemTypeTo + true + + +
+ + dbo + ItemLink
+ IDX_ItemLink_TypeItemFromStatus + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Type + true + + + 2 + ItemTypeFrom + true + + + 3 + ItemIdFrom + true + + + 4 + Status + true + + +
+
+
+ + dbo + Language + + + + dbo + Language
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Language
+ 2 + Code + VarChar + + -9 + nvarchar + false + 4 + 8 + 0 + NoNulls + false + +
+ + dbo + Language
+ 3 + Name + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + NoNulls + false + +
+ + dbo + Language
+ 4 + Primary + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Language
+ 5 + Unicode + Bit + + -7 + bit + false + 1 + 1 + 0 + NoNulls + false + +
+ + dbo + Language
+ 6 + Translation + Bit + + -7 + bit + false + 1 + 1 + 0 + NoNulls + false + +
+ + dbo + Language
+ 7 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Language
+ 8 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Language
+ 9 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + Language
+ 10 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Language
+ 11 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Language
+ 12 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + Language
+ PK_Language + 1 + true + false + false + false + 1 + 5 + false + + + 1 + Id + true + + +
+ + dbo + Language
+ IDX_Language_Code + 3 + true + false + false + false + 0 + 0 + false + + + 1 + Code + true + + +
+
+
+ + dbo + Location + + + + dbo + Location
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Location
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Location
+ 3 + Category + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Location
+ 4 + Code + VarChar + + -9 + nvarchar + false + 16 + 32 + 0 + NoNulls + false + +
+ + dbo + Location
+ 5 + Name + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + NoNulls + false + +
+ + dbo + Location
+ 6 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Location
+ 7 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Location
+ 8 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + NoNulls + false + +
+ + dbo + Location
+ 9 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + Location
+ 10 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Location
+ 11 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + Location
+ 12 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Location
+ 13 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Location
+ 14 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + Location
+ PK_Location + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + Location
+ IDX_Location_Owner + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + +
+ + dbo + Location
+ IDX_Location_OwnerCat + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + Category + true + + +
+ + dbo + Location
+ IDX_Location_OwnerCode + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + Code + true + + +
+
+
+ + dbo + Movement + + + + dbo + Movement
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Movement
+ 2 + ItemType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Movement
+ 3 + ItemId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Movement
+ 4 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Movement
+ 5 + Movement + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Movement
+ 6 + LocationIdFrom + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Movement
+ 7 + LocationIdTo + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Movement
+ 8 + Quantity + Double + + 6 + float + false + 53 + 8 + 0 + NoNulls + false + +
+ + dbo + Movement
+ 9 + MovementIdSource + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Movement
+ 10 + ItemTypeSource + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Movement
+ 11 + ItemIdSource + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Movement
+ 12 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Movement
+ 13 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Movement
+ 14 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + NoNulls + false + +
+ + dbo + Movement
+ 15 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + Movement
+ 16 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Movement
+ 17 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + Movement
+ 18 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Movement
+ 19 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Movement
+ 20 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + Movement
+ PK_Movement + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + Movement
+ IDX_Movement_Item + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ItemType + true + + + 2 + ItemId + true + + +
+ + dbo + Movement
+ IDX_Movement_ItemTypeMovement + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ItemType + true + + + 2 + ItemId + true + + + 3 + Type + true + + + 4 + Movement + true + + +
+ + dbo + Movement
+ IDX_Movement_LocationFrom + 3 + false + false + false + false + 0 + 0 + false + + + 1 + LocationIdFrom + true + + +
+ + dbo + Movement
+ IDX_Movement_LocationTo + 3 + false + false + false + false + 0 + 0 + false + + + 1 + LocationIdTo + true + + +
+ + dbo + Movement
+ IDX_Movement_Movement + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Movement + true + + +
+ + dbo + Movement
+ IDX_Movement_SourceItem + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ItemTypeSource + true + + + 2 + ItemIdSource + true + + +
+ + dbo + Movement
+ IDX_Movement_SourceMovement + 3 + false + false + false + false + 0 + 0 + false + + + 1 + MovementIdSource + true + + +
+
+
+ + dbo + PortfolioItem + + + + dbo + PortfolioItem
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + PortfolioItem
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + PortfolioItem
+ 3 + ItemIdParent + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + PortfolioItem
+ 4 + Seq + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + PortfolioItem
+ 5 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + PortfolioItem
+ 6 + ItemIdRef + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + PortfolioItem
+ 7 + Code + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + PortfolioItem
+ 8 + ShortCut + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + PortfolioItem
+ 9 + Caption + VarChar + + -9 + nvarchar + false + 128 + 256 + 0 + Nullable + true + +
+ + dbo + PortfolioItem
+ 10 + DescBrief + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + PortfolioItem
+ 11 + DescDetail + VarChar + + -9 + nvarchar + false + 4000 + 8000 + 0 + Nullable + true + +
+ + dbo + PortfolioItem
+ 12 + CommodityId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + PortfolioItem
+ 13 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + PortfolioItem
+ 14 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + PortfolioItem
+ 15 + Status + VarChar + + 12 + varchar + false + 3 + 3 + 0 + Nullable + true + +
+ + dbo + PortfolioItem
+ 16 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + PortfolioItem
+ 17 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + PortfolioItem
+ 18 + CreateHost + VarChar + + 12 + varchar + false + 64 + 64 + 0 + Nullable + true + +
+ + dbo + PortfolioItem
+ 19 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + PortfolioItem
+ 20 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + PortfolioItem
+ 21 + UpdateHost + VarChar + + 12 + varchar + false + 64 + 64 + 0 + Nullable + true + +
+
+ + + dbo + PortfolioItem
+ PK_PortfolioItem + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + PortfolioItem
+ IDX_PortfolioItem_Commodity + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CommodityId + true + + +
+ + dbo + PortfolioItem
+ IDX_PortfolioItem_Owner + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + +
+ + dbo + PortfolioItem
+ IDX_PortfolioItem_OwnerParentCode + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + ItemIdParent + true + + + 3 + Code + true + + +
+ + dbo + PortfolioItem
+ IDX_PortfolioItem_OwnerParentType + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + ItemIdParent + true + + + 3 + Type + true + + +
+ + dbo + PortfolioItem
+ IDX_PortfolioItem_ParentItem + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ItemIdParent + true + + +
+ + dbo + PortfolioItem
+ IDX_PortfolioItem_ParentSeq + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ItemIdParent + true + + + 2 + Seq + true + + +
+ + dbo + PortfolioItem
+ IDX_PortfolioItem_RefItem + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ItemIdRef + true + + +
+ + dbo + PortfolioItem
+ IDX_PortfolioItem_ShortCut + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ShortCut + true + + +
+
+
+ + dbo + Process + + + + dbo + Process
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Process
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Process
+ 3 + Category + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Process
+ 4 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Process
+ 5 + Seq + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Process
+ 6 + DescBrief + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Process
+ 7 + DescOutline + VarChar + + -9 + nvarchar + false + 4000 + 8000 + 0 + Nullable + true + +
+ + dbo + Process
+ 8 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Process
+ 9 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Process
+ 10 + Status + VarChar + + 12 + varchar + false + 3 + 3 + 0 + Nullable + true + +
+ + dbo + Process
+ 11 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Process
+ 12 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Process
+ 13 + CreateHost + VarChar + + 12 + varchar + false + 64 + 64 + 0 + Nullable + true + +
+ + dbo + Process
+ 14 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Process
+ 15 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Process
+ 16 + UpdateHost + VarChar + + 12 + varchar + false + 64 + 64 + 0 + Nullable + true + +
+
+ + + dbo + Process
+ PK_Process + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + Process
+ IDX_Process_OwnerCategory + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + Category + true + + +
+ + dbo + Process
+ IDX_Process_OwnerSeq + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + Seq + true + + +
+ + dbo + Process
+ IDX_Process_OwnerType + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + Type + true + + +
+
+
+ + dbo + Region + + + + dbo + Region
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Region
+ 2 + Type + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + NoNulls + false + +
+ + dbo + Region
+ 3 + Name + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + Nullable + true + +
+ + dbo + Region
+ 4 + Parent + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Region
+ 5 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Region
+ 6 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Region
+ 7 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + Region
+ 8 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Region
+ 9 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Region
+ 10 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + Region
+ 11 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Region
+ 12 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Region
+ 13 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + Region
+ PK_Region + 1 + true + false + false + false + 1 + 17 + false + + + 1 + Id + true + + +
+ + dbo + Region
+ IDX_Region_TypeName + 3 + true + false + false + false + 0 + 0 + false + + + 1 + Type + true + + + 2 + Name + true + + +
+ + dbo + Region
+ IDX_Region_ParentTypeName + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Parent + true + + + 2 + Type + true + + + 3 + Name + true + + +
+
+
+ + dbo + Requirement + + + + dbo + Requirement
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Requirement
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Requirement
+ 3 + AssocId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 4 + TransId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 5 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 6 + Seq + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 7 + ReqntIdSource + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 8 + Required + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Requirement
+ 9 + Started + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Requirement
+ 10 + Completed + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Requirement
+ 11 + JobNumber + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 12 + AssIdSubcontract + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 13 + CommodityId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 14 + ProductCode + VarChar + + -9 + nvarchar + false + 30 + 60 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 15 + AssetId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 16 + DescBrief + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 17 + DescIntro + VarChar + + -9 + nvarchar + false + 4000 + 8000 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 18 + DescOutline + VarChar + + -9 + nvarchar + false + 4000 + 8000 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 19 + DescDetail + VarChar + + -9 + nvarchar + false + 4000 + 8000 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 20 + PromotionCode + VarChar + + 12 + varchar + false + 12 + 12 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 21 + NominalCode + VarChar + + -9 + nvarchar + false + 8 + 16 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 22 + Quantity + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Requirement
+ 23 + QuantityProd + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Requirement
+ 24 + UomId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 25 + Weight + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Requirement
+ 26 + UomIdWeight + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 27 + MaterialSourceCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 28 + AmountUnit + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 29 + AmountAct + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 30 + AmountDisc + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 31 + AmountNet + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 32 + TaxCodeId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 33 + TaxRate + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Requirement
+ 34 + AmountTax + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 35 + AmountTot + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 36 + TimeEstChunks + VarChar + + 12 + varchar + false + 1024 + 1024 + 0 + NoNulls + false + +
+ + dbo + Requirement
+ 37 + TimeEst + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Requirement
+ 38 + TimeActChunks + VarChar + + 12 + varchar + false + 1024 + 1024 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 39 + TimeAct + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Requirement
+ 40 + TimeTot + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Requirement
+ 41 + LocationIdStock + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 42 + CostLabourHours + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 43 + CostLabourRateHour + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 44 + CostLabour + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 45 + CostCommodity + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 46 + CostPurchase + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 47 + CostProcess + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 48 + CostAdditional + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 49 + CostTotal + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Requirement
+ 50 + CostCalculated + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Requirement
+ 51 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 52 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 53 + StatusCat + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 54 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 55 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Requirement
+ 56 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 57 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 58 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Requirement
+ 59 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Requirement
+ 60 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + Requirement
+ PK_Requirement + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + Requirement
+ IDX_Requirement_Reqnt_Trans + 3 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + + 2 + TransId + true + + +
+ + dbo + Requirement
+ IDX_Requirement_Reqnt_Trans_ReqntSource + 3 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + + 2 + TransId + true + + + 3 + ReqntIdSource + true + + +
+ + dbo + Requirement
+ IDX_Requirement_AffilOwner + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + +
+ + dbo + Requirement
+ IDX_Requirement_Asset + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssetId + true + + +
+ + dbo + Requirement
+ IDX_Requirement_Assoc + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssocId + true + + +
+ + dbo + Requirement
+ IDX_Requirement_AssocContract + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssIdSubcontract + true + + +
+ + dbo + Requirement
+ IDX_Requirement_Commodity + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CommodityId + true + + +
+ + dbo + Requirement
+ IDX_Requirement_MaterialSource + 3 + false + false + false + false + 0 + 0 + false + + + 1 + MaterialSourceCode + true + + +
+ + dbo + Requirement
+ IDX_Requirement_ProductCode + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ProductCode + true + + +
+ + dbo + Requirement
+ IDX_Requirement_ReqntSource + 3 + false + false + false + false + 0 + 0 + false + + + 1 + ReqntIdSource + true + + +
+ + dbo + Requirement
+ IDX_Requirement_StockLocation + 3 + false + false + false + false + 0 + 0 + false + + + 1 + LocationIdStock + true + + +
+ + dbo + Requirement
+ IDX_Requirement_TaxCode + 3 + false + false + false + false + 0 + 0 + false + + + 1 + TaxCodeId + true + + +
+ + dbo + Requirement
+ IDX_Requirement_Trans + 3 + false + false + false + false + 0 + 0 + false + + + 1 + TransId + true + + +
+ + dbo + Requirement
+ IDX_Requirement_TransCommodityStatus + 3 + false + false + false + false + 0 + 0 + false + + + 1 + TransId + true + + + 2 + CommodityId + true + + + 3 + Status + true + + +
+ + dbo + Requirement
+ IDX_Requirement_TransSeq + 3 + false + false + false + false + 0 + 0 + false + + + 1 + TransId + true + + + 2 + Seq + true + + +
+ + dbo + Requirement
+ IDX_Requirement_Uom + 3 + false + false + false + false + 0 + 0 + false + + + 1 + UomId + true + + +
+
+
+ + dbo + SaAsset + + + + dbo + SaAsset
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaAsset
+ 2 + AssetCategoryId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 3 + SerialNumber + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 4 + SerialFmt + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 5 + RefExt + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 6 + DescBrief + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 7 + ItemType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 8 + ItemId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 9 + PurchaseOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaAsset
+ 10 + AssocIdSupplier + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 11 + PurchaseInvoiceRef + VarChar + + -9 + nvarchar + false + 16 + 32 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 12 + PaymentTerms + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 13 + AmountPurchase + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 14 + TaxCodeIdPurchase + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 15 + AmountPurchaseGross + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 16 + AmountSettlementGross + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 17 + AmountEnhancementGross + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 18 + AssocIdCustomer + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 19 + SellCategoryCode + VarChar + + -9 + nvarchar + false + 16 + 32 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 20 + AmountSell + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 21 + TaxCodeIdSell + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 22 + AmountSellGross + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 23 + TaxCodeIdProfit + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 24 + SoldOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaAsset
+ 25 + AmountSold + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 26 + AmountSoldGross + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 27 + DisposeCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 28 + DisposeOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaAsset
+ 29 + DueBackOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaAsset
+ 30 + AmountRentalCost + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 31 + UomIdRentalCost + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 32 + TaxCodeIdRentalCost + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 33 + AmountRentalPrice + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 34 + UomIdRentalPrice + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 35 + TaxCodeIdRentalPrice + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 36 + ProcessIdNext + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 37 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 38 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 39 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 40 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaAsset
+ 41 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 42 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 43 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaAsset
+ 44 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAsset
+ 45 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SaAsset
+ PK_SaAsset + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+
+
+ + dbo + SaAssetCategory + + + + dbo + SaAssetCategory
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaAssetCategory
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaAssetCategory
+ 3 + AssetType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + SaAssetCategory
+ 4 + Code + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + NoNulls + false + +
+ + dbo + SaAssetCategory
+ 5 + DescBrief + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 6 + IncomeType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 7 + AssocIdSupplier + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 8 + PaymentTerms + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 9 + TaxCodeIdPurchase + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 10 + AssocIdCustomer + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 11 + TaxCodeIdSell + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 12 + TaxCodeIdProfit + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 13 + UomIdRentalCost + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 14 + TaxCodeIdRentalCost + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 15 + UomIdRentalPrice + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 16 + TaxCodeIdRentalPrice + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 17 + DisposeCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 18 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 19 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 20 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 21 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 22 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 23 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 24 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 25 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetCategory
+ 26 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SaAssetCategory
+ PK_SaAssetCategory + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+
+
+ + dbo + SaAssetProcess + + + + dbo + SaAssetProcess
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaAssetProcess
+ 2 + AssetId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 3 + Seq + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 4 + ProcessId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 5 + RequiredOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 6 + ExpectedOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 7 + ProcessedOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 8 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 9 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 10 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 11 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 12 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 13 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 14 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 15 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaAssetProcess
+ 16 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SaAssetProcess
+ PK_SaAssetProcess + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+
+
+ + dbo + SaDiaryEntry + + + + dbo + SaDiaryEntry
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaDiaryEntry
+ 2 + Category + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaDiaryEntry
+ 3 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaDiaryEntry
+ 4 + Start + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + SaDiaryEntry
+ 5 + Finish + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaDiaryEntry
+ 6 + Duration + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaDiaryEntry
+ 7 + Description + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + NoNulls + false + +
+ + dbo + SaDiaryEntry
+ 8 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SaDiaryEntry
+ 9 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaDiaryEntry
+ 10 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SaDiaryEntry
+ 11 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaDiaryEntry
+ 12 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaDiaryEntry
+ 13 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SaDiaryEntry
+ 14 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaDiaryEntry
+ 15 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaDiaryEntry
+ 16 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SaDiaryEntry
+ PK_SaDiaryEntry + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + SaDiaryEntry
+ IDX_SaDiaryEntry_Finish + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Finish + true + + +
+ + dbo + SaDiaryEntry
+ IDX_SaDiaryEntry_Start + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Start + true + + +
+
+
+ + dbo + SaDiaryLink + + + + dbo + SaDiaryLink
+ 1 + EntryId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaDiaryLink
+ 2 + ItemType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + SaDiaryLink
+ 3 + ItemId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaDiaryLink
+ 4 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SaDiaryLink
+ 5 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaDiaryLink
+ 6 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SaDiaryLink
+ 7 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaDiaryLink
+ 8 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaDiaryLink
+ 9 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SaDiaryLink
+ 10 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaDiaryLink
+ 11 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaDiaryLink
+ 12 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SaDiaryLink
+ PK_SaDiaryLink + 1 + true + false + false + false + 0 + 0 + false + + + 1 + EntryId + true + + + 2 + ItemType + true + + + 3 + ItemId + true + + +
+
+
+ + dbo + SaPrice + + + + dbo + SaPrice
+ 1 + PriceSetId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaPrice
+ 2 + CommodityId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaPrice
+ 3 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaPrice
+ 4 + CalcMethod + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaPrice
+ 5 + CalcValue + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + SaPrice
+ 6 + RounderMethod + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaPrice
+ 7 + RounderDirection + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaPrice
+ 8 + RounderMultipleOf + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + SaPrice
+ 9 + RounderAdjustment + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + SaPrice
+ 10 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SaPrice
+ 11 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaPrice
+ 12 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SaPrice
+ 13 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaPrice
+ 14 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaPrice
+ 15 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SaPrice
+ 16 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaPrice
+ 17 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaPrice
+ 18 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SaPrice
+ PK_SaPrice + 1 + true + false + false + false + 0 + 0 + false + + + 1 + PriceSetId + true + + + 2 + CommodityId + true + + +
+ + dbo + SaPrice
+ IDX_SaPrice_Commodity + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CommodityId + true + + +
+ + dbo + SaPrice
+ IDX_SaPrice_PriceSet + 3 + false + false + false + false + 0 + 0 + false + + + 1 + PriceSetId + true + + +
+
+
+ + dbo + SaPriceSet + + + + dbo + SaPriceSet
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaPriceSet
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaPriceSet
+ 3 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaPriceSet
+ 4 + Ref + VarChar + + -9 + nvarchar + false + 8 + 16 + 0 + Nullable + true + +
+ + dbo + SaPriceSet
+ 5 + Name + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + NoNulls + false + +
+ + dbo + SaPriceSet
+ 6 + CurrencyId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaPriceSet
+ 7 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SaPriceSet
+ 8 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaPriceSet
+ 9 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SaPriceSet
+ 10 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaPriceSet
+ 11 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaPriceSet
+ 12 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SaPriceSet
+ 13 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaPriceSet
+ 14 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaPriceSet
+ 15 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SaPriceSet
+ PK_SaPriceSet + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + SaPriceSet
+ IDX_SaPriceSet_OwnerRef + 3 + true + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + Ref + true + + +
+ + dbo + SaPriceSet
+ IDX_SaPriceSet_AffOwner + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + +
+ + dbo + SaPriceSet
+ IDX_SaPriceSet_Currency + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CurrencyId + true + + +
+ + dbo + SaPriceSet
+ IDX_SaPriceSet_Name + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Name + true + + +
+
+
+ + dbo + SaVehicle + + + + dbo + SaVehicle
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaVehicle
+ 2 + VehicleClassId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 3 + RegNumber + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 4 + VIN + VarChar + + -9 + nvarchar + false + 24 + 48 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 5 + CapCode + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 6 + KeyNumber + VarChar + + -9 + nvarchar + false + 16 + 32 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 7 + KeyLocation + VarChar + + -9 + nvarchar + false + 16 + 32 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 8 + EngineNumber + VarChar + + -9 + nvarchar + false + 24 + 48 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 9 + EngineCapacity + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 10 + Seats + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 11 + Weight + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 12 + ManufactureYear + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 13 + BuildOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicle
+ 14 + FirstRegisterOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicle
+ 15 + RegisterOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicle
+ 16 + RegNumberPrev + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 17 + PurchaseOdo + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 18 + TachoCode + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 19 + TachoId + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 20 + LastServiceOdo + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 21 + LastServiceOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicle
+ 22 + NextServiceOdo + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 23 + NextServiceOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicle
+ 24 + MotOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicle
+ 25 + MotNo + VarChar + + -9 + nvarchar + false + 24 + 48 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 26 + NextTaxOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicle
+ 27 + LatestOdo + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 28 + LatestOdoOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicle
+ 29 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 30 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 31 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 32 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicle
+ 33 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 34 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 35 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicle
+ 36 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicle
+ 37 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SaVehicle
+ PK_SaVehicle + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+
+
+ + dbo + SaVehicleClass + + + + dbo + SaVehicleClass
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaVehicleClass
+ 2 + MakeCode + VarChar + + -9 + nvarchar + false + 8 + 16 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 3 + Model + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 4 + Derivative + VarChar + + -9 + nvarchar + false + 120 + 240 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 5 + DescBrief + VarChar + + -9 + nvarchar + false + 120 + 240 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 6 + VehicleType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 7 + VehicleCategoryCode + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 8 + FuelType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 9 + OdometerUnits + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 10 + Seats + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 11 + Weight + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 12 + InsuranceCode + VarChar + + -9 + nvarchar + false + 6 + 12 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 13 + FirstServiceOdo + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 14 + ServiceOdo + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 15 + ServiceWeeks + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 16 + AmountRentalCost + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 17 + UomIdRentalCost + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 18 + AmountRentalPrice + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 19 + UomIdRentalPrice + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 20 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 21 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 22 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 23 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 24 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 25 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 26 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 27 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleClass
+ 28 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SaVehicleClass
+ PK_SaVehicleClass + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+
+
+ + dbo + SaVehicleEvent + + + + dbo + SaVehicleEvent
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaVehicleEvent
+ 2 + VehicleId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 3 + EventType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 4 + StartOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 5 + FinishOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 6 + Odometer + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 7 + DescBrief + VarChar + + -9 + nvarchar + false + 120 + 240 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 8 + DescDetail + VarChar + + -9 + nvarchar + false + 0 + 0 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 9 + AmountNet + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 10 + TaxCodeId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 11 + TaxRate + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 12 + AmountTax + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 13 + AmountTot + Single + + 7 + real + false + 24 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 14 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 15 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 16 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 17 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 18 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 19 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 20 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 21 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleEvent
+ 22 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SaVehicleEvent
+ PK_SaVehicleEvent + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+
+
+ + dbo + SaVehicleFeature + + + + dbo + SaVehicleFeature
+ 1 + VehicleId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SaVehicleFeature
+ 2 + Source + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + SaVehicleFeature
+ 3 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + SaVehicleFeature
+ 4 + CategoryCode + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + NoNulls + false + +
+ + dbo + SaVehicleFeature
+ 5 + CategoryDesc + VarChar + + -9 + nvarchar + false + 128 + 256 + 0 + Nullable + true + +
+ + dbo + SaVehicleFeature
+ 6 + FeatureCode + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + NoNulls + false + +
+ + dbo + SaVehicleFeature
+ 7 + FeatureDesc + VarChar + + -9 + nvarchar + false + 128 + 256 + 0 + Nullable + true + +
+ + dbo + SaVehicleFeature
+ 8 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SaVehicleFeature
+ 9 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SaVehicleFeature
+ 10 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SaVehicleFeature
+ 11 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicleFeature
+ 12 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleFeature
+ 13 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SaVehicleFeature
+ 14 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SaVehicleFeature
+ 15 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SaVehicleFeature
+ 16 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SaVehicleFeature
+ PK_SaVehicleFeature + 1 + true + false + false + false + 0 + 0 + false + + + 1 + VehicleId + true + + +
+
+
+ + dbo + StockLevel + + + + dbo + StockLevel
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + StockLevel
+ 2 + CommodityId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + StockLevel
+ 3 + LocationId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + StockLevel
+ 4 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + StockLevel
+ 5 + Source + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + StockLevel
+ 6 + Recorded + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + StockLevel
+ 7 + Quantity + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + StockLevel
+ 8 + Bay1 + VarChar + + -9 + nvarchar + false + 16 + 32 + 0 + Nullable + true + +
+ + dbo + StockLevel
+ 9 + Bay2 + VarChar + + -9 + nvarchar + false + 16 + 32 + 0 + Nullable + true + +
+ + dbo + StockLevel
+ 10 + Bay3 + VarChar + + -9 + nvarchar + false + 16 + 32 + 0 + Nullable + true + +
+ + dbo + StockLevel
+ 11 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + StockLevel
+ 12 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + StockLevel
+ 13 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + NoNulls + false + +
+ + dbo + StockLevel
+ 14 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + StockLevel
+ 15 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + StockLevel
+ 16 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + StockLevel
+ 17 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + StockLevel
+ 18 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + StockLevel
+ 19 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + StockLevel
+ PK_StockLevel + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + StockLevel
+ IDX_StockLevel_Commodity + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CommodityId + true + + +
+ + dbo + StockLevel
+ IDX_StockLevel_CommodityRecorded + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CommodityId + true + + + 2 + Recorded + true + + +
+ + dbo + StockLevel
+ IDX_StockLevel_CommodityType + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CommodityId + true + + + 2 + Type + true + + +
+ + dbo + StockLevel
+ IDX_StockLevel_Location + 3 + false + false + false + false + 0 + 0 + false + + + 1 + LocationId + true + + +
+ + dbo + StockLevel
+ IDX_StockLevel_Recorded + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Recorded + true + + +
+ + dbo + StockLevel
+ IDX_StockLevel_Type + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Type + true + + +
+
+
+ + dbo + SysParam + + + + dbo + SysParam
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SysParam
+ 2 + Cat + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + SysParam
+ 3 + Name + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + NoNulls + false + +
+ + dbo + SysParam
+ 4 + Value + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + Nullable + true + +
+ + dbo + SysParam
+ 5 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SysParam
+ 6 + AffIdTarget + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SysParam
+ 7 + AssocId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SysParam
+ 8 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SysParam
+ 9 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SysParam
+ 10 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SysParam
+ 11 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SysParam
+ 12 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SysParam
+ 13 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SysParam
+ 14 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SysParam
+ 15 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SysParam
+ PK_SysParam + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + SysParam
+ IDX_SysParam_CatAssName + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Cat + true + + + 2 + AssocId + true + + + 3 + Name + true + + +
+ + dbo + SysParam
+ IDX_SysParam_CatName + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Cat + true + + + 2 + Name + true + + +
+ + dbo + SysParam
+ IDX_SysParam_CatOrgName + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Cat + true + + + 2 + AffIdTarget + true + + + 3 + Name + true + + +
+ + dbo + SysParam
+ IDX_SysParam_CatPerName + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Cat + true + + + 2 + AffIdOwner + true + + + 3 + Name + true + + +
+
+
+ + dbo + SystemAccount + + + + dbo + SystemAccount
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SystemAccount
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SystemAccount
+ 3 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SystemAccount
+ 4 + InterfaceId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SystemAccount
+ 5 + AssocId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SystemAccount
+ 6 + Code + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + SystemAccount
+ 7 + Name + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SystemAccount
+ 8 + AuthCodeEnc + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SystemAccount
+ 9 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SystemAccount
+ 10 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SystemAccount
+ 11 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SystemAccount
+ 12 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SystemAccount
+ 13 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SystemAccount
+ 14 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SystemAccount
+ 15 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SystemAccount
+ 16 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SystemAccount
+ 17 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SystemAccount
+ PK_SystemAccount + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + SystemAccount
+ IDX_SystemAccount_AffIdOwner + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + +
+ + dbo + SystemAccount
+ IDX_SystemAccount_Association + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssocId + true + + +
+ + dbo + SystemAccount
+ IDX_SystemAccount_Interface + 3 + false + false + false + false + 0 + 0 + false + + + 1 + InterfaceId + true + + +
+
+
+ + dbo + SystemAccountUser + + + + dbo + SystemAccountUser
+ 1 + AccountId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SystemAccountUser
+ 2 + UserId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SystemAccountUser
+ 3 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SystemAccountUser
+ 4 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SystemAccountUser
+ 5 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SystemAccountUser
+ 6 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SystemAccountUser
+ 7 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SystemAccountUser
+ 8 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SystemAccountUser
+ 9 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SystemAccountUser
+ 10 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SystemAccountUser
+ 11 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SystemAccountUser
+ PK_SystemAccountUser + 1 + true + false + false + false + 0 + 0 + false + + + 1 + AccountId + true + + + 2 + UserId + true + + +
+ + dbo + SystemAccountUser
+ IDX_SystemAccountUser_User + 3 + false + false + false + false + 0 + 0 + false + + + 1 + UserId + true + + +
+
+
+ + dbo + SystemUser + + + + dbo + SystemUser
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SystemUser
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + SystemUser
+ 3 + InterfaceId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SystemUser
+ 4 + AffiliateId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SystemUser
+ 5 + Code + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SystemUser
+ 6 + AuthCodeEnc + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SystemUser
+ 7 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + SystemUser
+ 8 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + SystemUser
+ 9 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + SystemUser
+ 10 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SystemUser
+ 11 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SystemUser
+ 12 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + SystemUser
+ 13 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + SystemUser
+ 14 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + SystemUser
+ 15 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + SystemUser
+ PK_SystemUser + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + SystemUser
+ IDX_SystemUser_OwnerCode + 3 + true + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + Code + true + + +
+ + dbo + SystemUser
+ IDX_SystemUser_Affiliate + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffiliateId + true + + +
+ + dbo + SystemUser
+ IDX_SystemUser_AffiliateId + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffiliateId + true + + +
+ + dbo + SystemUser
+ IDX_SystemUser_Interface + 3 + false + false + false + false + 0 + 0 + false + + + 1 + InterfaceId + true + + +
+
+
+ + dbo + TaxCode + + + + dbo + TaxCode
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + TaxCode
+ 2 + Code + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 3 + CodeAlt1 + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 4 + CodeAlt2 + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 5 + Description + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 6 + RegionId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 7 + EffectFrom + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + TaxCode
+ 8 + EffectTo + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + TaxCode
+ 9 + TaxRate + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 10 + TaxRatePrev + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 11 + TaxCodeIdLink + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 12 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 13 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 14 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 15 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + TaxCode
+ 16 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 17 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 18 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + TaxCode
+ 19 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + TaxCode
+ 20 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + TaxCode
+ PK_TaxCode + 1 + true + false + false + false + 1 + 13 + false + + + 1 + Id + true + + +
+ + dbo + TaxCode
+ IdX_TaxCode_Code + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Code + true + + +
+ + dbo + TaxCode
+ IdX_TaxCode_CodeAlt1 + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CodeAlt1 + true + + +
+ + dbo + TaxCode
+ IdX_TaxCode_CodeAlt2 + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CodeAlt2 + true + + +
+
+
+ + dbo + Transaction + + + + dbo + Transaction
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Transaction
+ 2 + AffIdOwner + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 3 + AssocId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Transaction
+ 4 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 5 + Ref + VarChar + + -9 + nvarchar + false + 16 + 32 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 6 + RefInt + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 7 + RefExt + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 8 + RaisedBy + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 9 + AffIdRaise + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 10 + AssocIdOffice + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 11 + ContactName + VarChar + + 12 + varchar + false + 60 + 60 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 12 + Likelihood + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 13 + TransIdSource + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 14 + ReferCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 15 + ReferSource + VarChar + + -9 + nvarchar + false + 60 + 120 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 16 + AffIdRefer + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 17 + AssocIdContract + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 18 + AssIdDeliver + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 19 + Raised + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Transaction
+ 20 + Required + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Transaction
+ 21 + InProgress + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Transaction
+ 22 + DeliveredEst + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Transaction
+ 23 + DeliveredAct + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Transaction
+ 24 + Closed + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Transaction
+ 25 + Department + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 26 + DescBrief + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 27 + DescIntro + VarChar + + -9 + nvarchar + false + 4000 + 8000 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 28 + DescOutline + VarChar + + -9 + nvarchar + false + 4000 + 8000 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 29 + DescDetail + VarChar + + -9 + nvarchar + false + 4000 + 8000 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 30 + ResponseCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 31 + ContactAreaCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 32 + Postcode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 33 + CurrencyId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 34 + TaxCodeId + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 35 + AmountEst + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Transaction
+ 36 + AmountMax + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Transaction
+ 37 + AmountNet + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Transaction
+ 38 + AmountTax + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Transaction
+ 39 + AmountTot + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Transaction
+ 40 + TimeEstChunks + VarChar + + 12 + varchar + false + 1024 + 1024 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 41 + TimeEst + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Transaction
+ 42 + TimeActChunks + VarChar + + 12 + varchar + false + 1024 + 1024 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 43 + TimeAct + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Transaction
+ 44 + TimeTot + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Transaction
+ 45 + LocationIdStock + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 46 + Weight + Decimal + + 3 + decimal + false + 9 + 11 + 3 + Nullable + true + +
+ + dbo + Transaction
+ 47 + UomIdWeight + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 48 + BoxCount + VarChar + + -9 + nvarchar + false + 16 + 32 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 49 + DeliveryStatusCode + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 50 + DeliveryTypeCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 51 + DeliveryMethodCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 52 + DeliveryCourierCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 53 + DeliveryBookInCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 54 + StockPickerCode + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 55 + DeliveryRef + VarChar + + -9 + nvarchar + false + 32 + 64 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 56 + DeliveryComment + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 57 + DeliveryAmountNet + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Transaction
+ 58 + TaxCodeIdDelivery + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 59 + DeliveryAmountTax + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Transaction
+ 60 + DeliveryAmountTot + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Transaction
+ 61 + DeliveryDepartment + VarChar + + 12 + varchar + false + 12 + 12 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 62 + DeliveryNominalCode + VarChar + + 12 + varchar + false + 12 + 12 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 63 + CostLabourRateHour + Decimal + + 3 + decimal + false + 9 + 11 + 2 + Nullable + true + +
+ + dbo + Transaction
+ 64 + Notes + VarChar + + -9 + nvarchar + false + 1024 + 2048 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 65 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 66 + StatusCat + VarChar + + 12 + varchar + false + 3 + 3 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 67 + Status + VarChar + + 12 + varchar + false + 3 + 3 + 0 + NoNulls + false + +
+ + dbo + Transaction
+ 68 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Transaction
+ 69 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 70 + CreateHost + VarChar + + 12 + varchar + false + 64 + 64 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 71 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + Transaction
+ 72 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + Transaction
+ 73 + UpdateHost + VarChar + + 12 + varchar + false + 64 + 64 + 0 + Nullable + true + +
+
+ + + dbo + Transaction
+ PK_Transaction + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + Transaction
+ IDX_Transaction_AffilRaise + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdRaise + true + + +
+ + dbo + Transaction
+ IDX_Transaction_AffilRefer + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdRefer + true + + +
+ + dbo + Transaction
+ IDX_Transaction_Assoc + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssocId + true + + +
+ + dbo + Transaction
+ IDX_Transaction_AssocContract + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssocIdContract + true + + +
+ + dbo + Transaction
+ IDX_Transaction_AssocOffice + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssocIdOffice + true + + +
+ + dbo + Transaction
+ IDX_Transaction_AssocType + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AssocId + true + + + 2 + Type + true + + +
+ + dbo + Transaction
+ IDX_Transaction_Currency + 3 + false + false + false + false + 0 + 0 + false + + + 1 + CurrencyId + true + + +
+ + dbo + Transaction
+ IDX_Transaction_OwnerRef + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + Ref + true + + +
+ + dbo + Transaction
+ IDX_Transaction_OwnerRefExt + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + RefExt + true + + +
+ + dbo + Transaction
+ IDX_Transaction_OwnerTypeRaised + 3 + false + false + false + false + 0 + 0 + false + + + 1 + AffIdOwner + true + + + 2 + Type + true + + + 3 + Raised + true + + +
+ + dbo + Transaction
+ IDX_Transaction_Postcode + 3 + false + false + false + false + 0 + 0 + false + + + 1 + Postcode + true + + +
+ + dbo + Transaction
+ IDX_Transaction_StatusCat + 3 + false + false + false + false + 0 + 0 + false + + + 1 + StatusCat + true + + +
+ + dbo + Transaction
+ IDX_Transaction_StockLocation + 3 + false + false + false + false + 0 + 0 + false + + + 1 + LocationIdStock + true + + +
+ + dbo + Transaction
+ IDX_Transaction_TaxCode + 3 + false + false + false + false + 0 + 0 + false + + + 1 + TaxCodeId + true + + +
+ + dbo + Transaction
+ IDX_Transaction_TransSource + 3 + false + false + false + false + 0 + 0 + false + + + 1 + TransIdSource + true + + +
+
+
+ + dbo + UnitMeasure + + + + dbo + UnitMeasure
+ 1 + Id + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + UnitMeasure
+ 2 + Category + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 3 + Type + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 4 + UnitType + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 5 + Code + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + NoNulls + false + +
+ + dbo + UnitMeasure
+ 6 + Abbr + VarChar + + -9 + nvarchar + false + 12 + 24 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 7 + Single + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 8 + Multiple + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 9 + EquValue + Double + + 6 + float + false + 53 + 8 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 10 + UomIdEqu + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 11 + EquAlgorythm + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 12 + UomIdRef1 + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 13 + UomIdRef2 + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 14 + UomIdRef3 + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 15 + Notes + VarChar + + -9 + nvarchar + false + 255 + 510 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 16 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 17 + Status + VarChar + + -9 + nvarchar + false + 3 + 6 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 18 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + UnitMeasure
+ 19 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 20 + CreateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 21 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + Nullable + true + +
+ + dbo + UnitMeasure
+ 22 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + Nullable + true + +
+ + dbo + UnitMeasure
+ 23 + UpdateHost + VarChar + + -9 + nvarchar + false + 64 + 128 + 0 + Nullable + true + +
+
+ + + dbo + UnitMeasure
+ PK_UnitMeasure + 1 + true + false + false + false + 1 + 21 + false + + + 1 + Id + true + + +
+ + dbo + UnitMeasure
+ IDX_UnitMeasure_Code + 3 + true + false + false + false + 0 + 0 + false + + + 1 + Code + true + + +
+
+
+ + \ No newline at end of file diff --git a/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn_Control.xml b/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn_Control.xml new file mode 100644 index 0000000..ef7527e --- /dev/null +++ b/SaBusMgrStandardDbas/Resources/Database/SbmDbDfn_Control.xml @@ -0,0 +1,1108 @@ + + + + + dbo + Database + + + + dbo + Database
+ 1 + Id + Int + + 4 + int + true + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Database
+ 2 + ServerName + VarChar + + -9 + nvarchar + false + 200 + 400 + 0 + NoNulls + false + +
+ + dbo + Database
+ 3 + InstanceName + VarChar + + -9 + nvarchar + false + 200 + 400 + 0 + NoNulls + false + +
+ + dbo + Database
+ 4 + DatabaseName + VarChar + + -9 + nvarchar + false + 200 + 400 + 0 + NoNulls + false + +
+ + dbo + Database
+ 5 + UserName + VarChar + + -9 + nvarchar + false + 100 + 200 + 0 + NoNulls + false + +
+ + dbo + Database
+ 6 + Password + VarChar + + -9 + nvarchar + false + 100 + 200 + 0 + NoNulls + false + +
+ + dbo + Database
+ 7 + OrganisationName + VarChar + + -9 + nvarchar + false + 200 + 400 + 0 + NoNulls + false + +
+ + dbo + Database
+ 8 + Notes + VarChar + + -9 + nvarchar + false + 2000 + 4000 + 0 + NoNulls + false + +
+ + dbo + Database
+ 9 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + Database
+ 10 + Status + VarChar + + 12 + varchar + false + 3 + 3 + 0 + NoNulls + false + +
+ + dbo + Database
+ 11 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + Database
+ 12 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Database
+ 13 + CreateHost + VarChar + + 12 + varchar + false + 100 + 100 + 0 + NoNulls + false + +
+ + dbo + Database
+ 14 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + Database
+ 15 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + Database
+ 16 + UpdateHost + VarChar + + 12 + varchar + false + 100 + 100 + 0 + NoNulls + false + +
+
+ + + dbo + Database
+ PK_Database + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + Database
+ IDX_Database_Server_Instance_Name + 3 + true + false + false + false + 0 + 0 + false + + + 1 + ServerName + true + + + 2 + InstanceName + true + + + 3 + DatabaseName + true + + +
+
+
+ + dbo + DatabaseAccount + + + + dbo + DatabaseAccount
+ 1 + Id + Int + + 4 + int + true + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + DatabaseAccount
+ 2 + DatabaseId + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + DatabaseAccount
+ 3 + EmailAddress + VarChar + + -9 + nvarchar + false + 200 + 400 + 0 + NoNulls + false + +
+ + dbo + DatabaseAccount
+ 4 + Notes + VarChar + + -9 + nvarchar + false + 2000 + 4000 + 0 + NoNulls + false + +
+ + dbo + DatabaseAccount
+ 5 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + DatabaseAccount
+ 6 + Status + VarChar + + 12 + varchar + false + 3 + 3 + 0 + NoNulls + false + +
+ + dbo + DatabaseAccount
+ 7 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + DatabaseAccount
+ 8 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + DatabaseAccount
+ 9 + CreateHost + VarChar + + 12 + varchar + false + 100 + 100 + 0 + NoNulls + false + +
+ + dbo + DatabaseAccount
+ 10 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + DatabaseAccount
+ 11 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + DatabaseAccount
+ 12 + UpdateHost + VarChar + + 12 + varchar + false + 100 + 100 + 0 + NoNulls + false + +
+
+ + + dbo + DatabaseAccount
+ PK_DatabaseAccount + 1 + true + false + false + false + 0 + 0 + false + + + 1 + Id + true + + +
+ + dbo + DatabaseAccount
+ IDX_DatabaseAccount_Database_Email + 3 + true + false + false + false + 0 + 0 + false + + + 1 + DatabaseId + true + + + 2 + EmailAddress + true + + +
+ + dbo + DatabaseAccount
+ IDX_DatabaseAccount_Database + 3 + false + false + false + false + 0 + 0 + false + + + 1 + DatabaseId + true + + +
+ + dbo + DatabaseAccount
+ IDX_DatabaseAccount_Email + 3 + false + false + false + false + 0 + 0 + false + + + 1 + EmailAddress + true + + +
+
+
+ + dbo + UserAccount + + + + dbo + UserAccount
+ 1 + Id + Int + + 4 + int + true + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 2 + EmailAddress + VarChar + + -9 + nvarchar + false + 200 + 400 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 3 + Title + VarChar + + -9 + nvarchar + false + 20 + 40 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 4 + FirstName + VarChar + + -9 + nvarchar + false + 100 + 200 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 5 + Initials + VarChar + + -9 + nvarchar + false + 10 + 20 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 6 + LastName + VarChar + + -9 + nvarchar + false + 100 + 200 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 7 + PhoneMain + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 8 + PhoneMobile + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 9 + PhoneAlt + VarChar + + -9 + nvarchar + false + 50 + 100 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 10 + PasswordToken + VarChar + + 12 + varchar + false + 32 + 32 + 0 + Nullable + true + +
+ + dbo + UserAccount
+ 11 + PasswordHashed + VarChar + + -9 + nvarchar + false + 100 + 200 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 12 + PasswordHistory + VarChar + + -9 + nvarchar + false + 0 + 0 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 13 + PasswordChangedAt + DateTime + + 93 + smalldatetime + false + 16 + 16 + 0 + Nullable + true + +
+ + dbo + UserAccount
+ 14 + LastLoginAt + DateTime + + 93 + smalldatetime + false + 16 + 16 + 0 + Nullable + true + +
+ + dbo + UserAccount
+ 15 + LastInvalidLoginAt + DateTime + + 93 + smalldatetime + false + 16 + 16 + 0 + Nullable + true + +
+ + dbo + UserAccount
+ 16 + InvalidLoginCount + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 17 + Notes + VarChar + + -9 + nvarchar + false + 2000 + 4000 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 18 + Flags + SmallInt + + 5 + smallint + false + 5 + 2 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 19 + Status + VarChar + + 12 + varchar + false + 3 + 3 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 20 + CreateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + UserAccount
+ 21 + CreateBy + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 22 + CreateHost + VarChar + + 12 + varchar + false + 100 + 100 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 23 + UpdateOn + DateTime + + 93 + datetime + false + 23 + 16 + 3 + NoNulls + false + +
+ + dbo + UserAccount
+ 24 + UpdateBy + Int + + 4 + int + false + 10 + 4 + 0 + NoNulls + false + +
+ + dbo + UserAccount
+ 25 + UpdateHost + VarChar + + 12 + varchar + false + 100 + 100 + 0 + NoNulls + false + +
+
+ + + dbo + UserAccount
+ PK_UserAccount + 1 + true + false + false + false + 1 + 1 + false + + + 1 + Id + true + + +
+ + dbo + UserAccount
+ IDX_UserAccount_Email + 3 + true + false + false + false + 0 + 0 + false + + + 1 + EmailAddress + true + + +
+
+
+
+
\ No newline at end of file diff --git a/SaBusMgrStandardDbas/SaBusMgrStandardDbas.csproj b/SaBusMgrStandardDbas/SaBusMgrStandardDbas.csproj index d8010c8..c9dc80a 100644 --- a/SaBusMgrStandardDbas/SaBusMgrStandardDbas.csproj +++ b/SaBusMgrStandardDbas/SaBusMgrStandardDbas.csproj @@ -11,4 +11,9 @@ + + + + + diff --git a/SaBusinessMgrCoreWebControl/Control/App/Program.cs b/SaBusinessMgrCoreWebControl/Control/App/Program.cs index bb716f6..26ae486 100644 --- a/SaBusinessMgrCoreWebControl/Control/App/Program.cs +++ b/SaBusinessMgrCoreWebControl/Control/App/Program.cs @@ -23,7 +23,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Control.App Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { - webBuilder.UseStartup(); + webBuilder.UseStartup(); }); //------------------------------------------------------------------- diff --git a/SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Admin.cs b/SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Control.cs similarity index 50% rename from SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Admin.cs rename to SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Control.cs index 8d64a52..3fbf103 100644 --- a/SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Admin.cs +++ b/SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Control.cs @@ -20,15 +20,18 @@ using System.Threading.Tasks; namespace Sarand.BusinessMgr.Net.Core.Web.Control.App { //======================================================================= - public class SbmApplication_Admin : SbmApplication_Web + public class SbmApplication_Control : SbmApplication_Web { //------------------------------------------------------------------- // Data members. - private bool generateDatabaseDefinitions = false; + private bool generateDatabaseDefinitions_Control = true; + private bool generateDatabaseDefinitions_BusMgr = true; private PropertySet propertySet; - private Dictionary sessionConfigs = new Dictionary(); + private Dictionary appConfigs = new Dictionary(); private Dictionary emailConfigs = new Dictionary(); // Session contexts. + private static ushort sessionContextIdx_Next = 100; + private ushort sessionContextIdx_Control = 0; private class SessionContextData { public SessionContextData(SbmSessionContext_Web sessionContext) @@ -36,19 +39,18 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Control.App SessionContext = sessionContext; } public SbmSessionContext_Web SessionContext { get; } + public ISacsDatabase ControlDatabase { get; set; } public ISacsDatabase BusMgrDatabase { get; set; } } - private readonly Dictionary sessionContexts = new Dictionary(); + private readonly Dictionary sessionContexts = new Dictionary(); //------------------------------------------------------------------- // Construction. - public SbmApplication_Admin(IConfiguration configuration) + public SbmApplication_Control(IConfiguration configuration) { InitialiseTemporaryLoggingFolder(); try { - AppInstance = this; - SbmGlobals.Application = this; propertySet = new PropertySet(); SbmGlobals.System = (System_Web = new SbmSystem_Web(propertySet)); Configuration = configuration; @@ -62,15 +64,27 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Control.App //------------------------------------------------------------------- // Properties. - public static SbmApplication_Admin AppInstance { get; private set; } + // Application Configuration. + public override SbmAppConfig AppConfig { get { return appConfigs.Values.ToList().getConfigForApplication(); } } + // Session Configuration. + public override String SessionCookieName { get { return Sbm.Config.Control.Session.Cookie.Name; } } + public override List GetSessionContextIdxs() + { + return sessionContexts.Values.Select(item => item.SessionContext.Index).ToList(); + } + public override SbmSessionContext GetSessionContext(ushort index) + { + return sessionContexts.GetValue(index, null)?.SessionContext ?? null; + } + public override ISacsDatabase GetControlDatabase(SbmSessionContext sessionContext) + { + return sessionContexts.GetValue(sessionContext.Index, null)?.ControlDatabase; + } public override ISacsDatabase GetBusMgrDatabase(SbmSessionContext sessionContext) { return sessionContexts.GetValue(sessionContext.Index, null)?.BusMgrDatabase; } - public override String SessionCookieName { get { return Sbm.Config.Admin.Session.Cookie.Name; } } - // Configuration. - public override SbmSessionConfig SessionConfig { get { return sessionConfigs.Values.ToList().getConfigForApplication(); } } - public override SbmEmailConfig EmailConfig { get { return emailConfigs.Values.ToList().getConfigForSession(SessionConfig); } } + public override SbmEmailConfig EmailConfig { get { return emailConfigs.Values.ToList().getConfigForSession(AppConfig); } } //------------------------------------------------------------------- // Initialisation. @@ -101,15 +115,15 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Control.App SbmConfiguration = builder.Build(); // Application configuration. - sessionConfigs = SbmSessionConfigHelper.ExtractSessionConfigs(SbmConfiguration.GetSection("SessionConfigs")); + appConfigs = SbmAppConfigHelper.ExtractAppConfigs(SbmConfiguration.GetSection("AppConfigs")); emailConfigs = SbmEmailConfigHelper.ExtractEmailConfigs(SbmConfiguration.GetSection("EmailConfigs")); - LoggingRootFolder = SessionConfig.Logging.RootFolder; + LoggingRootFolder = AppConfig.Logging.RootFolder; // Application instance. - if (SessionConfig.Instance.EqualsCI("Dev")) instanceType = Sbm.InstanceType.Dev; - else if (SessionConfig.Instance.ContainsCI("Q")) instanceType = Sbm.InstanceType.QC; - else if (SessionConfig.Instance.ContainsCI("UAT")) instanceType = Sbm.InstanceType.UAT; - else if (SessionConfig.Instance.EqualsCI("PreProd")) instanceType = Sbm.InstanceType.UAT; + if (AppConfig.Instance.EqualsCI("Dev")) instanceType = Sbm.InstanceType.Dev; + else if (AppConfig.Instance.ContainsCI("Q")) instanceType = Sbm.InstanceType.QC; + else if (AppConfig.Instance.ContainsCI("UAT")) instanceType = Sbm.InstanceType.UAT; + else if (AppConfig.Instance.EqualsCI("PreProd")) instanceType = Sbm.InstanceType.UAT; // Initialise hard-coded logging path. if (StringUtil.IsEmpty(LoggingRootFolder)) @@ -121,20 +135,30 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Control.App SaLogger.LogFolder = LoggingRootFolder; LogApplicationStart(fn); - // Configure database connection. + // Control database connection. SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig(); - config.location = SessionConfig.BusMgrDatabase.Location; - config.user = SessionConfig.BusMgrDatabase.User; - config.pword = SessionConfig.BusMgrDatabase.Password; - SacsDatabase coreDatabase = SacsDatabaseConsole.OpenOdbcDatabase(config); - if (coreDatabase.HasErrorState()) - SaLogger.Warn(fn + " Database initialisation error: " + coreDatabase.ErrorStateMessage); + config.location = AppConfig.ControlDatabase.Location; + config.user = AppConfig.ControlDatabase.User; + config.pword = AppConfig.ControlDatabase.Password; + SacsDatabase controlDatabase = SacsDatabaseConsole.OpenOdbcDatabase(config); + if (controlDatabase.HasErrorState()) + SaLogger.Warn(fn + " Control Database initialisation error: " + controlDatabase.ErrorStateMessage); + + // BusinessMgr database connection. + config = new SacsDatabaseConsole.OdbcConfig(); + config.location = AppConfig.BusMgrDatabase.Location; + config.user = AppConfig.BusMgrDatabase.User; + config.pword = AppConfig.BusMgrDatabase.Password; + SacsDatabase busMgrDatabase = SacsDatabaseConsole.OpenOdbcDatabase(config); + if (busMgrDatabase.HasErrorState()) + SaLogger.Warn(fn + " BusMgr Database initialisation error: " + busMgrDatabase.ErrorStateMessage); // Session context - only one context available/necessary (for now). - SessionContextData sessionContextData = new SessionContextData(new SbmSessionContext_Web(100, Sbm.Application.WebControl)); - sessionContextData.BusMgrDatabase = coreDatabase; + sessionContextIdx_Control = sessionContextIdx_Next++; + SessionContextData sessionContextData = new SessionContextData(new SbmSessionContext_Web(sessionContextIdx_Control, Sbm.Application.WebControl)); + sessionContextData.ControlDatabase = controlDatabase; + sessionContextData.BusMgrDatabase = busMgrDatabase; sessionContexts.Add(sessionContextData.SessionContext.Index, sessionContextData); - SessionContext = sessionContextData.SessionContext; } catch (Exception exc) { @@ -142,20 +166,39 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Control.App } // Occasional startup processing. - if (generateDatabaseDefinitions) - GenerateDatabaseDefinition(SessionContext); + SbmSessionContext sessionContext = GetSessionContext(sessionContextIdx_Control); + if (generateDatabaseDefinitions_Control) + GenerateDatabaseDefinition(sessionContext, SbmDbDfnGenerator.DatabaseInstance.Control, GetControlDatabase(sessionContext)); + if (generateDatabaseDefinitions_BusMgr) + { + // Use the 'template' database connection parameters. + SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig(); + config.location = AppConfig.TemplateDatabase.Location; + config.user = AppConfig.TemplateDatabase.User; + config.pword = AppConfig.TemplateDatabase.Password; + GenerateDatabaseDefinition(sessionContext, SbmDbDfnGenerator.DatabaseInstance.BusinessMgr, SacsDatabaseConsole.GenerateConnectionString(config)); + } } //------------------------------------------------------------------- - private void GenerateDatabaseDefinition(SbmSessionContext sessionContext) + // Generate database definition. + private void GenerateDatabaseDefinition(SbmSessionContext sessionContext, SbmDbDfnGenerator.DatabaseInstance dbInstance, ISacsDatabase db) { - if (!generateDatabaseDefinitions || !SbmSystem.DebugMode || SessionContext == null) return; + if (!generateDatabaseDefinitions_BusMgr || !SbmSystem.DebugMode || sessionContext == null) return; if (!StringUtil.EmptyOnNull(EnvironmentName).EqualsCI("Development")) return; - ISacsDatabase coreDatabase = GetBusMgrDatabase(sessionContext); - if (coreDatabase == null || StringUtil.IsEmpty(coreDatabase.ConnectionString)) return; + if (db == null || StringUtil.IsEmpty(db.ConnectionString)) return; // Generate database definitions. - SbmDbDfnGenerator.Generate(SbmDbDfnGenerator.DatabaseInstance.BusinessMgr, coreDatabase.ConnectionString); + GenerateDatabaseDefinition(sessionContext, dbInstance, db.ConnectionString); + } + private void GenerateDatabaseDefinition(SbmSessionContext sessionContext, SbmDbDfnGenerator.DatabaseInstance dbInstance, String connectionString) + { + if (!generateDatabaseDefinitions_BusMgr || !SbmSystem.DebugMode || sessionContext == null) return; + if (!StringUtil.EmptyOnNull(EnvironmentName).EqualsCI("Development")) return; + if (StringUtil.IsEmpty(connectionString)) return; + + // Generate database definitions. + SbmDbDfnGenerator.Generate(dbInstance, connectionString); //SaUpdateLogDbDfnGenerator.Generate(database.ConnectionString); } diff --git a/SaBusinessMgrCoreWebControl/Control/App/SbmLocaliser_Admin.cs b/SaBusinessMgrCoreWebControl/Control/App/SbmLocaliser_Control.cs similarity index 92% rename from SaBusinessMgrCoreWebControl/Control/App/SbmLocaliser_Admin.cs rename to SaBusinessMgrCoreWebControl/Control/App/SbmLocaliser_Control.cs index ba4ee04..4ac780e 100644 --- a/SaBusinessMgrCoreWebControl/Control/App/SbmLocaliser_Admin.cs +++ b/SaBusinessMgrCoreWebControl/Control/App/SbmLocaliser_Control.cs @@ -22,7 +22,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web namespace Sarand.BusinessMgr.Net.Core.Web.Control.App { //======================================================================= - public class SbmLocaliser_Admin : SbmLocaliser + public class SbmLocaliser_Control : SbmLocaliser { //------------------------------------------------------------------- // Data members. @@ -32,7 +32,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Control.App /// /// Localisers are supplied using construction injection. /// - public SbmLocaliser_Admin(IStringLocalizer webAppProperties) + public SbmLocaliser_Control(IStringLocalizer webAppProperties) { this.webAppProperties = webAppProperties; } diff --git a/SaBusinessMgrCoreWebControl/Control/App/SbmStartup_Admin.cs b/SaBusinessMgrCoreWebControl/Control/App/SbmStartup_Control.cs similarity index 80% rename from SaBusinessMgrCoreWebControl/Control/App/SbmStartup_Admin.cs rename to SaBusinessMgrCoreWebControl/Control/App/SbmStartup_Control.cs index 39dca17..8ba040b 100644 --- a/SaBusinessMgrCoreWebControl/Control/App/SbmStartup_Admin.cs +++ b/SaBusinessMgrCoreWebControl/Control/App/SbmStartup_Control.cs @@ -14,19 +14,19 @@ using System.Threading.Tasks; namespace Sarand.BusinessMgr.Net.Core.Web.Control.App { //======================================================================= - public class SbmStartup_Admin : SbmStartup_Web + public class SbmStartup_Control : SbmStartup_Web { //------------------------------------------------------------------- // Data members. - private SbmApplication_Admin application = null; + private SbmApplication_Control application = null; //------------------------------------------------------------------- // Construction. - public SbmStartup_Admin(IConfiguration configuration) : + public SbmStartup_Control(IConfiguration configuration) : base(configuration) { // Initialise application. - application = new SbmApplication_Admin(Configuration); + application = new SbmApplication_Control(Configuration); } //------------------------------------------------------------------- @@ -36,13 +36,13 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Control.App // Common configuration. ConfigureServicesConfig configureServicesConfig = new ConfigureServicesConfig(); configureServicesConfig.services = services; - configureServicesConfig.sessionCookieName = Sbm.Config.Admin.Session.Cookie.Name; - configureServicesConfig.sessionCookieHttpOnly = Sbm.Config.Admin.Session.Cookie.HttpOnly; - configureServicesConfig.sessionIdleTimeout = Sbm.Config.Admin.Session.Cookie.IdleTimeout; + configureServicesConfig.sessionCookieName = Sbm.Config.Control.Session.Cookie.Name; + configureServicesConfig.sessionCookieHttpOnly = Sbm.Config.Control.Session.Cookie.HttpOnly; + configureServicesConfig.sessionIdleTimeout = Sbm.Config.Control.Session.Cookie.IdleTimeout; ConfigureServices(configureServicesConfig); // Application localisation. - services.AddSingleton(); + services.AddSingleton(); services.Configure(options => { diff --git a/SaBusinessMgrCoreWebControl/Controllers/HomeController.cs b/SaBusinessMgrCoreWebControl/Control/Controllers/HomeController.cs similarity index 86% rename from SaBusinessMgrCoreWebControl/Controllers/HomeController.cs rename to SaBusinessMgrCoreWebControl/Control/Controllers/HomeController.cs index 8c1ebd5..4cf14fa 100644 --- a/SaBusinessMgrCoreWebControl/Controllers/HomeController.cs +++ b/SaBusinessMgrCoreWebControl/Control/Controllers/HomeController.cs @@ -1,13 +1,13 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; -using SaBusinessMgrCoreWebAdmin.Models; +using Sarand.BusinessMgr.Net.Core.Web.Control.Models; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; -namespace SaBusinessMgrCoreWebAdmin.Controllers +namespace Sarand.BusinessMgr.Net.Core.Web.Control.Controllers { public class HomeController : Controller { diff --git a/SaBusinessMgrCoreWebControl/Models/ErrorViewModel.cs b/SaBusinessMgrCoreWebControl/Control/Models/ErrorViewModel.cs similarity index 73% rename from SaBusinessMgrCoreWebControl/Models/ErrorViewModel.cs rename to SaBusinessMgrCoreWebControl/Control/Models/ErrorViewModel.cs index c3801db..94c8e6c 100644 --- a/SaBusinessMgrCoreWebControl/Models/ErrorViewModel.cs +++ b/SaBusinessMgrCoreWebControl/Control/Models/ErrorViewModel.cs @@ -1,6 +1,6 @@ using System; -namespace SaBusinessMgrCoreWebAdmin.Models +namespace Sarand.BusinessMgr.Net.Core.Web.Control.Models { public class ErrorViewModel { diff --git a/SaBusinessMgrCoreWebControl/SaBusinessMgrCoreWebControl.csproj b/SaBusinessMgrCoreWebControl/SaBusinessMgrCoreWebControl.csproj index 0b92550..43e59e7 100644 --- a/SaBusinessMgrCoreWebControl/SaBusinessMgrCoreWebControl.csproj +++ b/SaBusinessMgrCoreWebControl/SaBusinessMgrCoreWebControl.csproj @@ -26,4 +26,27 @@ + + + PreserveNewest + true + PreserveNewest + + + PreserveNewest + true + PreserveNewest + + + PreserveNewest + true + PreserveNewest + + + PreserveNewest + true + PreserveNewest + + + diff --git a/SaBusinessMgrCoreWebControl/Views/Home/Index.cshtml b/SaBusinessMgrCoreWebControl/Views/Home/Index.cshtml index d2d19bd..bac8929 100644 --- a/SaBusinessMgrCoreWebControl/Views/Home/Index.cshtml +++ b/SaBusinessMgrCoreWebControl/Views/Home/Index.cshtml @@ -4,5 +4,4 @@

Welcome

-

Learn about building Web apps with ASP.NET Core.

diff --git a/SaBusinessMgrCoreWebControl/Views/Shared/_Layout.cshtml b/SaBusinessMgrCoreWebControl/Views/Shared/_Layout.cshtml index ab5a891..bfbd97d 100644 --- a/SaBusinessMgrCoreWebControl/Views/Shared/_Layout.cshtml +++ b/SaBusinessMgrCoreWebControl/Views/Shared/_Layout.cshtml @@ -11,7 +11,7 @@
- protected bool SignUserIn(SaSecurityItem securityItemUser, SbmAffiliate affiliateUser, bool keepLoggedIn, ref String errorMessage) + protected bool SignUserIn(SbmSessionContext sessionContext, SaSecurityItem securityItemUser, SbmAffiliate affiliateUser, bool keepLoggedIn, ref String errorMessage) { String fn = GetType().Name + ".SignUserIn"; @@ -69,7 +69,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers } // 'Keep logged in' can be switched off by the application configuration. - keepLoggedIn = App.SessionConfig.Security.SignIn.KeepLoggedIn.Allowed && keepLoggedIn; + keepLoggedIn = App.AppConfig.Security.SignIn.KeepLoggedIn.Allowed && keepLoggedIn; // Log user in. affiliateUser.KeepLoggedIn_Portal = keepLoggedIn; @@ -85,7 +85,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers SaLogger.Info(fn + " User session opened for " + affiliateUser.Email, true); // Create session. - OpenUserSession(SessionContext, securityItemUser, affiliateUser); + OpenUserSession(sessionContext, securityItemUser, affiliateUser); // Send the 'Keep Logged In' cookie if requested. if (affiliateUser.KeepLoggedIn_Portal) @@ -136,7 +136,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers protected void SetKeepLoggedInCookie() { String keepLoggedInCookieValue = GenerateKeepLoggedInCookieValue(); - int cookieExpiresDays = Math.Max(Sbm.Config.Security.SignIn.KeepLoggedIn.CookieExpiresDays_Min, Math.Min(Sbm.Config.Security.SignIn.KeepLoggedIn.CookieExpiresDays_Max, SessionConfig.Security.SignIn.KeepLoggedIn.CookieExpiresDays)); + int cookieExpiresDays = Math.Max(Sbm.Config.Security.SignIn.KeepLoggedIn.CookieExpiresDays_Min, Math.Min(Sbm.Config.Security.SignIn.KeepLoggedIn.CookieExpiresDays_Max, AppConfig.Security.SignIn.KeepLoggedIn.CookieExpiresDays)); SetResponseCookie(CookieName_KeepLoggedIn, keepLoggedInCookieValue, DateTime.Now.AddDays(cookieExpiresDays), true); SaLogger.Info(this.GetType().Name + ".SetKeepLoggedInCookie 'Keep Logged In' cookie set. Value: " + keepLoggedInCookieValue); } @@ -164,11 +164,13 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers //------------------------------------------------------------------- // Keep-logged-in cookie value. + private static readonly String ParamName_KeepLoggedIn_EmailAddress = "ema"; private static readonly String ParamName_KeepLoggedIn_SecurityItemId = "sii"; private static readonly String ParamName_KeepLoggedIn_AffiliateId = "afi"; private String GenerateKeepLoggedInCookieValue() { NameValueCollection keepLoggedInParams = new NameValueCollection(); + keepLoggedInParams.Add(ParamName_KeepLoggedIn_EmailAddress, SessionData_Portal.User.EmailAddress); keepLoggedInParams.Add(ParamName_KeepLoggedIn_SecurityItemId, SysId.ToString(SessionData_Portal.User.SecurityItemId)); keepLoggedInParams.Add(ParamName_KeepLoggedIn_AffiliateId, SysId.ToString(SessionData_Portal.User.AffiliateId)); return EncryptParameters(keepLoggedInParams, Base64IV_KeepLoggedIn, Base64Key_KeepLoggedIn); @@ -177,6 +179,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers //------------------------------------------------------------------- public class KeepLoggedInParams { + public String EmailAddress { get; set; } public SysId SecurityItemId { get; set; } public SysId AffiliateId { get; set; } /// Retrieve the list of valid parameters in printable format [Name: Value]. @@ -194,8 +197,9 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers if (!StringUtil.IsEmpty(encryptedParams)) { NameValueCollection linkParams = DecryptParameters(encryptedParams, Base64IV_KeepLoggedIn, Base64Key_KeepLoggedIn); - keepLoggedInParams.SecurityItemId = new SysId(StringUtil.ToInt(linkParams.Get(ParamName_KeepLoggedIn_SecurityItemId))); - keepLoggedInParams.AffiliateId = new SysId(StringUtil.ToInt(linkParams.Get(ParamName_KeepLoggedIn_AffiliateId))); + keepLoggedInParams.EmailAddress = linkParams.Get(ParamName_KeepLoggedIn_EmailAddress); + keepLoggedInParams.SecurityItemId = linkParams.Get(ParamName_KeepLoggedIn_SecurityItemId).ToSysId(); + keepLoggedInParams.AffiliateId = linkParams.Get(ParamName_KeepLoggedIn_AffiliateId).ToSysId(); } if (DebugMode) SaLogger.Info(GetType().Name + ".ExtractKeepLoggedInParams UserAccountId: " + SysId.ToString(keepLoggedInParams.AffiliateId)); return keepLoggedInParams; diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/SecurityController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/SecurityController-Ajax.cs index 5b98f0d..fd0e046 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/SecurityController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/SecurityController-Ajax.cs @@ -1,8 +1,12 @@ using Microsoft.AspNetCore.Mvc; +using Sarand.BusinessMgr.Net.Core.Web.App; +using Sarand.BusinessMgr.Net.Core.Web.Helpers; using Sarand.BusinessMgr.Net.Core.Web.Portal.Models; 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.Helpers; +using Sarand.BusinessMgr.Net.Standard.Base.Mgr; using Sarand.Net.Standard.Base.App; using Sarand.Net.Standard.Base.Bus; using Sarand.Net.Standard.Base.Core; @@ -43,23 +47,36 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers String messageTitle = Localiser["signin.caption"]; // Validate referrer. - if (!ValidReferer) - return Forbid(); + if (!ValidReferer) return Forbid(); // Validate Sign-in data. model.ValidateSignInData(responseData); if (responseData.HasControlErrors()) return Json(responseData); - // Get user account. - SaSecurityItem securityItemUser = GetSecurityItemForSignin(model, responseData); - SbmAffiliate userAccount = GetAffiliateForSignin(model, securityItemUser, responseData); - if (responseData.HasControlErrors()) - return Json(responseData); + // Identify session contexts with a BusMgr database that hosts the specified email address. + List sessionContextIdxs = SbmSessionContextHelper_Web.GetSessionContextIdxsForUsersBusMgrDatabase(model.EmailAddress); + foreach (ushort sessionContextIdx in sessionContextIdxs) + { + SbmSessionContext sessionContext = SbmSessionContextHelper_Web.GetSessionContext(sessionContextIdx); + SbmUserContext_Web userContext = new SbmUserContext_Web(sessionContext); - String errorMessage = ""; - if (!SignUserIn(securityItemUser, userAccount, model.KeepMeSignedIn, ref errorMessage)) - return Json(responseData.SetControlError(nameof(model.EmailAddress), errorMessage)); + // Get user security item and affiliate. + using (SaSecurityItem securityItemUser = GetSecurityItemForSignin(userContext, model, responseData)) + { + if (responseData.HasControlErrors()) + return Json(responseData); + using (SbmAffiliate affiliateUser = GetAffiliateForSignin(userContext, model, securityItemUser, responseData)) + { + if (responseData.HasControlErrors()) + return Json(responseData); + + String errorMessage = ""; + if (!SignUserIn(sessionContext, securityItemUser, affiliateUser, model.KeepMeSignedIn, ref errorMessage)) + return Json(responseData.SetControlError(nameof(model.EmailAddress), errorMessage)); + } + } + } // Construct response. responseData.Success = SessionData_Portal?.ValidUserSession ?? false; @@ -87,7 +104,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers if (!ValidUserSession) return Json(responseData.SetGoHome()); - if (!SessionConfig.Security.SignIn.KeepLoggedIn.Allowed) + if (!AppConfig.Security.SignIn.KeepLoggedIn.Allowed) return Json(responseData); // Resend the cookie to extend the expiry date if it is currently populated. @@ -101,49 +118,51 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers } //------------------------------------------------------------------- - public SaSecurityItem GetSecurityItemForSignin(Model_Security model, AjaxResponse_Data responseData) + private SaSecurityItem GetSecurityItemForSignin(SbmUserContext_Web userContext, Model_Security model, AjaxResponse_Data responseData) { String fn = GetType().Name + ".GetSecurityItemForSignin"; - - // Retrieve security item by email address. - SaSecurityItem.Params prmSecurityItem = new SaSecurityItem.Params(); - prmSecurityItem.SecurityItemType = SaSecurity.ItemType.User; - prmSecurityItem.EmailAddress = model.EmailAddress; - SaSecurityItem securityItemUser = SecurityConsole.GetSecurityItem(prmSecurityItem); - - if (securityItemUser != null) + SaSecurityItem securityItemUser = null; + using (SaSecurityConsole securityConsole = App.CreateSecurityConsole(userContext)) { - // Validate password. - if (!SbmPasswordHelper.VerifyHashedPassword(securityItemUser, model.Password) && !(DebugMode && model.EmailAddress.EqualsCI("ahoward@sarand.com"))) + // Retrieve security item by email address. + securityItemUser = securityConsole.GetUserByEmail(model.EmailAddress); + if (securityItemUser != null) { - // Record invalid login attempt. - //securityItemUser.InvalidLoginCount++; - //securityItemUser.LastInvalidLoginAt = DateTime.Now; - //if (!SecurityConsole.Update(securityItemUser, DbUpdateInfo)) - // SaLogger.Warn(fn + " Failed to store invalid sign-in attempt against User: " + model.EmailAddress + ". " + AccountMgr.ErrorStateMessage, true); - SaLogger.Warn(fn + " Attempt to sign-in to User " + model.EmailAddress + " with invalid password."); // " Attempt: " + securityItemUser.InvalidLoginCount, true); - securityItemUser = null; + // Validate password. + if (!SbmPasswordHelper.VerifyHashedPassword(securityItemUser, model.Password) && !(DebugMode && model.EmailAddress.EqualsCI("ahoward@sarand.com"))) + { + // Record invalid login attempt. + securityItemUser.InvalidLoginCount++; + securityItemUser.LastInvalidLoginAt = DateTime.Now; + if (!securityConsole.UpdateSecurityItem(securityItemUser, DbUpdateInfo)) + SaLogger.Warn(fn + " Failed to store invalid sign-in attempt against User: " + model.EmailAddress + ". " + AccountMgr.ErrorStateMessage, true); + SaLogger.Warn(fn + " Attempt to sign-in to User " + model.EmailAddress + " with invalid password. Attempt: " + securityItemUser.InvalidLoginCount, true); + responseData.SetControlError(nameof(model.EmailAddress), model.Localiser["security.msg.signin.invalid"]); + securityItemUser = null; + } } } - return securityItemUser; } //------------------------------------------------------------------- - public SbmAffiliate GetAffiliateForSignin(Model_Security model, SaSecurityItem securityItemUser, AjaxResponse_Data responseData) + private SbmAffiliate GetAffiliateForSignin(SbmUserContext_Web userContext, Model_Security model, SaSecurityItem securityItemUser, AjaxResponse_Data responseData) { String fn = GetType().Name + ".GetAffiliateForSignin"; - - // Identify the contact asociated with the security item. - SbmAffiliate.Params prmAffiliate = new SbmAffiliate.Params(); - prmAffiliate.UserId = securityItemUser.Id; - prmAffiliate.StatusCat = SbmAffiliate.StatusCat.ActiveOnly; - SbmAffiliate affiliate = AccountMgr.GetAffiliate(prmAffiliate); - if (affiliate != null) + SbmAffiliate affiliate = null; + using (SbmAccountMgr accountMgr = App.System.CreateAccountMgr(userContext)) { + // Identify the contact asociated with the security item. + SbmAffiliate.Params prmAffiliate = new SbmAffiliate.Params(); + prmAffiliate.UserId = securityItemUser.Id; + prmAffiliate.StatusCat = SbmAffiliate.StatusCat.ActiveOnly; + affiliate = accountMgr.GetAffiliate(prmAffiliate); + if (affiliate != null) + { + } + if (affiliate == null && !responseData.HasControlErrors()) + responseData.SetControlError(nameof(model.EmailAddress), model.Localiser["security.msg.signin.invalid"]); } - if (affiliate == null && !responseData.HasControlErrors()) - responseData.SetControlError(nameof(model.EmailAddress), model.Localiser["security.msg.signin.invalid"]); return affiliate; } @@ -171,8 +190,8 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers return Json(responseData.SetSessionExpired(messageTitle, Localiser["security.msg.warn.sessionExpired"])); // Retrieve user account - in case sign-out needs to be recorded. - SbmAffiliate userAccount = AccountMgr.GetAffiliateById(SessionData_Portal.User.AffiliateId); - if (userAccount == null) + SbmAffiliate affiliateUser = AccountMgr.GetAffiliateById(SessionData_Portal.User.AffiliateId); + if (affiliateUser == null) { SaLogger.Warn(fn + " System error - failed to retrieve account details."); return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"])); @@ -339,35 +358,54 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers String messageTitle = Localiser["security.caption.request.password"]; // Validate referrer. - if (!ValidReferer) - return Forbid(); + if (!ValidReferer) return Forbid(); // Validate data. model.ValidateRequestPasswordData(responseData); - if (responseData.HasControlErrors()) - return Json(responseData); + if (responseData.HasControlErrors()) return Json(responseData); - // Retrieve user account. - using (SaSecurityItem securityItemUser = SecurityConsole.GetUserByEmail(model.EmailAddress)) - using (SbmAffiliate affiliateUser = AccountMgr.GetAffiliateByUserId(securityItemUser?.Id ?? null)) + // Identify session contexts with a BusMgr database that hosts the specified email address. + List sessionContextIdxs = SbmSessionContextHelper_Web.GetSessionContextIdxsForUsersBusMgrDatabase(model.EmailAddress); + foreach (ushort sessionContextIdx in sessionContextIdxs) { - if (securityItemUser == null) - SaLogger.Warn(fn + " Unable to send password request email to " + model.EmailAddress + " - security item does not exist"); - else if (affiliateUser == null) - SaLogger.Warn(fn + " Unable to send password request email to " + model.EmailAddress + " - account does not exist"); - else if (!affiliateUser.IsStatusActive) - SaLogger.Warn(fn + " Unable to send password request email to " + model.EmailAddress + " - account is not active"); - else + SbmSessionContext sessionContext = SbmSessionContextHelper_Web.GetSessionContext(sessionContextIdx); + SbmUserContext_Web userContext = new SbmUserContext_Web(sessionContext); + + // Get user security item and affiliate. + using (SaSecurityConsole securityConsole = App.CreateSecurityConsole(userContext)) { - // Send password request email. - SaEmailData emailData = new SaEmailData(); - emailData.Config = EmailConfig; - emailData.AddressesTo.Add(model.EmailAddress); - emailData.Subject = Localiser["security.caption.request.password"]; - PopulateRequestPasswordEmailBody(emailData, securityItemUser, affiliateUser); - if (EmailConsole.SendEmail(emailData)) - SaLogger.Info(fn + " Password request email sent to " + model.EmailAddress, true); - else SaLogger.Warn(fn + " Failed to send password request email to " + model.EmailAddress); + using (SaSecurityItem securityItemUser = securityConsole.GetUserByEmail(model.EmailAddress)) + { + if (securityItemUser != null) + { + using (SbmAccountMgr accountMgr = App.System.CreateAccountMgr(userContext)) + { + using (SbmAffiliate affiliateUser = accountMgr.GetAffiliateByUserId(securityItemUser.Id)) + { + if (affiliateUser != null) + { + if (affiliateUser.Status == SaStatus.Current || affiliateUser.IsStatusActive) + { + SbmEmailConsole emailConsole = App.CreateEmailConsole(userContext); + + // Send password request email. + SaEmailData emailData = new SaEmailData(); + emailData.Config = App.EmailConfig; + emailData.AddressesTo.Add(model.EmailAddress); + emailData.Subject = Localiser["security.caption.request.password"]; + PopulateRequestPasswordEmailBody(emailConsole, userContext, emailData, securityItemUser, affiliateUser); + if (emailConsole.SendEmail(emailData)) + SaLogger.Info(fn + " Password request email sent to " + model.EmailAddress, true); + else SaLogger.Warn(fn + " Failed to send password request email to " + model.EmailAddress); + } + else SaLogger.Warn(fn + " Unable to send password request email to " + model.EmailAddress + " - affiliate is not active"); + } + else SaLogger.Warn(fn + " Unable to send password request email to " + model.EmailAddress + " - affiliate does not exist. UserId: " + SysId.ToString(securityItemUser.Id)); + } + } + } + else SaLogger.Warn(fn + " Unable to send password request email to " + model.EmailAddress + " - security item does not exist."); + } } } @@ -376,17 +414,17 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers responseData.SuccessMsg = Localiser["security.msg.request.password.email.sent"]; return Json(responseData); } - private void PopulateRequestPasswordEmailBody(SaEmailData emailData, SaSecurityItem securityItemUser, SbmAffiliate userAccount) + private void PopulateRequestPasswordEmailBody(SbmEmailConsole emailConsole, SbmUserContext userContext, SaEmailData emailData, SaSecurityItem securityItemUser, SbmAffiliate affiliateUser) { // Will need to handle culture (language/country) as and when introduced. emailData.MessageBody = SbmResourceHelper.GetTextResource(SbmResourceHelper.TextResource.Email_RequestPassword_Html); emailData.HtmlBody = true; // Replace dynamic tags. - EmailConsole.ReplaceDynamicEmailBodyTags(emailData, SessionData); + emailConsole.ReplaceDynamicEmailBodyTags(emailData, null); // Replace dynamic tag for link back to change password page. - SaEmailConsole.ReplaceDynamicEmailTag(emailData, "[#Link.RequestPassword]", GenerateRequestPasswordLink(securityItemUser.Id, userAccount.Id, securityItemUser.EmailAddress, "")); + SaEmailConsole.ReplaceDynamicEmailTag(emailData, "[#Link.RequestPassword]", GenerateRequestPasswordLink(securityItemUser.Id, affiliateUser.Id, securityItemUser.EmailAddress, "")); SaEmailConsole.ReplaceDynamicEmailTag(emailData, "[#Link.ExpiresMinutes]", GetRequestPasswordEmailLinkExpiresMinutes().ToString()); } @@ -401,8 +439,8 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers // NB IV value is generated from the key and fixed so that it doesn't change when the application restarts. // IV Must be regenerated if key is changed. private static String Base64Key_RequestPassword { get; } = SacsEncryptionHelper.EncodePlainKey("[-SaBusMgr+!^]", SacsEncryptionHelper.KeyLength); - private static String Base64IV_RequestPassword_Generated { get; } = SacsEncryptionHelper.InitSymmetricEncryptionIV(Base64Key_RequestPassword); - private static String Base64IV_RequestPassword { get; } = "1VAWYTW6d72n/6HDNhbqow=="; + //private static String Base64IV_RequestPassword_Generated { get; } = SacsEncryptionHelper.InitSymmetricEncryptionIV(Base64Key_RequestPassword); + private static String Base64IV_RequestPassword { get; } = "iALRIxzrZIfrB4boNFRXfA=="; private String GenerateRequestPasswordLink(SysId securityItemId, SysId affiliateId, String emailAddress, String requestPasswordToken) { NameValueCollection parameters = new NameValueCollection(); @@ -418,7 +456,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers } private int GetRequestPasswordEmailLinkExpiresMinutes() { - int expiresMinutes = SessionConfig.Security.SignIn.PasswordRequest.EmailLinkExpiresMins; + int expiresMinutes = AppConfig.Security.SignIn.PasswordRequest.EmailLinkExpiresMins; int expiresMinutes_Min = Sbm.Config.Security.SignIn.PasswordRequest.EmailLinkExpiresMins_Min; int expiresMinutes_Max = Sbm.Config.Security.SignIn.PasswordRequest.EmailLinkExpiresMins_Max; return Math.Max(expiresMinutes_Min, Math.Min(expiresMinutes_Max, expiresMinutes)); @@ -456,13 +494,13 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Portal.Controllers DateUtil.IsValid(ExpiresAt) && ExpiresAt >= DateTime.Now; } /// Verify that the data is valid and the account details match. - public bool IsValid(SaSecurityItem securityItemUser, SbmAffiliate userAccount) + public bool IsValid(SaSecurityItem securityItemUser, SbmAffiliate affiliateUser) { return IsValid() && - userAccount != null && + affiliateUser != null && securityItemUser.Id.Equals(SecurityItemId) && - userAccount.Id.Equals(AffiliateId) && + affiliateUser.Id.Equals(AffiliateId) && securityItemUser.EmailAddress.EqualsCI(EmailAddress); } } diff --git a/SaBusinessMgrCoreWebPortal/SaBusinessMgrCoreWebPortal.csproj b/SaBusinessMgrCoreWebPortal/SaBusinessMgrCoreWebPortal.csproj index a1d630d..7295d67 100644 --- a/SaBusinessMgrCoreWebPortal/SaBusinessMgrCoreWebPortal.csproj +++ b/SaBusinessMgrCoreWebPortal/SaBusinessMgrCoreWebPortal.csproj @@ -28,4 +28,12 @@ + + + PreserveNewest + true + PreserveNewest + + + diff --git a/SaBusinessMgrCoreWebPortal/Views/Security/ChangePassword.cshtml b/SaBusinessMgrCoreWebPortal/Views/Security/ChangePassword.cshtml index 60f9acc..c74ac9c 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Security/ChangePassword.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Security/ChangePassword.cshtml @@ -19,7 +19,7 @@ { /* Current password - required when setting password within user session. */
-
+
@Html.PasswordFor(model => model.PasswordCurrent, new { @id = "ifPasswordCurrent", @class = "sbm-input", @maxlength = Model.PasswordMaxLength }) @@ -34,7 +34,7 @@ }
-
+
@Html.PasswordFor(model => model.Password, new { @id = "ifPassword", @class = "sbm-input", @maxlength = Model.PasswordMaxLength }) @@ -47,7 +47,7 @@
-
+
@Html.PasswordFor(model => model.PasswordConfirm, new { @id = "ifPasswordConfirm", @class = "sbm-input", @maxlength = Model.PasswordMaxLength }) diff --git a/SaBusinessMgrCoreWebPortal/Views/Security/RequestPassword.cshtml b/SaBusinessMgrCoreWebPortal/Views/Security/RequestPassword.cshtml index 66b65a9..73a4c47 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Security/RequestPassword.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Security/RequestPassword.cshtml @@ -15,9 +15,9 @@ {
-
+
- +
@Html.TextBoxFor(model => model.EmailAddress, new { @id = "ifEmailAddress", @class = "sbm-input lower", @maxlength = "128" }) diff --git a/SaBusinessMgrCoreWebPortal/Views/Security/Signin.cshtml b/SaBusinessMgrCoreWebPortal/Views/Security/Signin.cshtml index 1d5a38a..f891f2d 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Security/Signin.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Security/Signin.cshtml @@ -10,7 +10,7 @@
-
@Localiser["security.caption.signin"]
+
@Localiser["label.signin"]
@@ -18,9 +18,9 @@ {
-
+
- +
@Html.TextBoxFor(model => model.EmailAddress, new { @id = "ifEmailAddress", @class = "sbm-input lower", @maxlength = @emailAddressLen }) @@ -29,7 +29,7 @@
-
+
@@ -59,7 +59,7 @@
-
@Localiser["security.caption.signin"]
+
@Localiser["label.signin"]
} diff --git a/SaBusinessMgrCoreWebPortal/Views/Shared/_Layout.cshtml b/SaBusinessMgrCoreWebPortal/Views/Shared/_Layout.cshtml index 164941b..0059dbb 100644 --- a/SaBusinessMgrCoreWebPortal/Views/Shared/_Layout.cshtml +++ b/SaBusinessMgrCoreWebPortal/Views/Shared/_Layout.cshtml @@ -84,7 +84,7 @@ sbm.sessionCookieName = '@Model.SessionCookieName'; sbm.awaitingLogin = @awaitingLogin; sbm.keepLoggedIn = @keepLoggedIn; - sbm.keepLoggedInDelay = @(Sbm.Config.Admin.Session.Cookie.KeepLoggedInTimeoutMillis); + sbm.keepLoggedInDelay = @(Sbm.Config.Control.Session.Cookie.KeepLoggedInTimeoutMillis); sbm.debugMode = @debug; diff --git a/SaBusinessMgrCoreWebPortal/appsettings.Development.json b/SaBusinessMgrCoreWebPortal/appsettings.Development.json index 8983e0f..58b13a3 100644 --- a/SaBusinessMgrCoreWebPortal/appsettings.Development.json +++ b/SaBusinessMgrCoreWebPortal/appsettings.Development.json @@ -1,9 +1,26 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "EmailConfigs": { + "SBM-Dev": { + "SMTP": { + "Server": "smtp.ionos.co.uk", + "ServerPort": 587, + "UseSSL": true + }, + "Send": { + "Using": 2, + "UserName": "businessmgr@sarand.com", + "Password": "sarand-busmgr-5apP1re" + }, + "Message": { + "AddressFrom": "DoNotReply@SaBusinessMgr.com" + } + } } - } } diff --git a/SaBusinessMgrCoreWebPortal/appsettings.Machine.Sarand107.json b/SaBusinessMgrCoreWebPortal/appsettings.Machine.Sarand107.json new file mode 100644 index 0000000..a37cccf --- /dev/null +++ b/SaBusinessMgrCoreWebPortal/appsettings.Machine.Sarand107.json @@ -0,0 +1,30 @@ +{ + "AppConfigs": { + "SaBusMgr-Dev": { + "Environments": [ "Development" ], + "Instance": "Dev", + "ControlDatabase": { + "Location": "MsSql:Sarand107\\SQL2016.SaBusinessMgr_Control", + "User": "SaBusMgr-Control", + "Password": "sbm-c0Ntrul-dev-2021" + }, + "BusMgrDatabase": { + "Location": "MsSql:Sarand107\\SQL2016.SaBusinessMgr_Cadix", + "User": "SaBusMgr-Cadix", + "Password": "sbm-cul-dev-2021" + }, + "Email": { + "Context": "SBM-Dev", + "ContactUs": { + "AddressesTo": [ "dev@SaBusinessMgr.com" ] + } + }, + "Documents": { + "RootFolder": "D:\\Sarand\\Projects\\Users\\AHoward\\VS2019\\BusinessMgr\\Docs" + }, + "Logging": { + "RootFolder": "D:\\Sarand\\Projects\\Users\\AHoward\\VS2019\\BusinessMgr\\Logs\\WebPortal" + } + } + } +} diff --git a/SaBusinessMgrCoreWebPortal/appsettings.Machine.json b/SaBusinessMgrCoreWebPortal/appsettings.Machine.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/SaBusinessMgrCoreWebPortal/appsettings.Machine.json @@ -0,0 +1,2 @@ +{ +} diff --git a/SaBusinessMgrCoreWebPortal/appsettings.Production.json b/SaBusinessMgrCoreWebPortal/appsettings.Production.json new file mode 100644 index 0000000..679a8e2 --- /dev/null +++ b/SaBusinessMgrCoreWebPortal/appsettings.Production.json @@ -0,0 +1,19 @@ +{ + "EmailConfigs": { + "SBM-Prod": { + "SMTP": { + "Server": "smtp.ionos.co.uk", + "ServerPort": 587, + "UseSSL": true + }, + "Send": { + "Using": 2, + "UserName": "businessmgr@sarand.com", + "Password": "sarand-busmgr-5apP1re" + }, + "Message": { + "AddressFrom": "DoNotReply@SaBusinessMgr.com" + } + } + } +} diff --git a/SaBusinessMgrCoreWebPortal/wwwroot/js/sbm-main.js b/SaBusinessMgrCoreWebPortal/wwwroot/js/sbm-main.js index a8473c8..20f343e 100644 --- a/SaBusinessMgrCoreWebPortal/wwwroot/js/sbm-main.js +++ b/SaBusinessMgrCoreWebPortal/wwwroot/js/sbm-main.js @@ -387,7 +387,7 @@ // Data entry. sbm.clearControlErrors = function (context) { - var $ctrls = $('.sbm-form-control', $(context)).removeClass('sbm-error'); + var $ctrls = $('.sbm-form-control', $(context || doc.body)).removeClass('sbm-error'); $('.sbm-message', $ctrls).empty(); } sbm.clearControlError = function (sel) @@ -402,8 +402,8 @@ } sbm.refreshControlValues = function (controlValues, context) { - var $frmCtrls = $('.sbm-form-control', $(context)).removeClass('sbm-error'); - sbm.clearControlErrors(); + var $frmCtrls = $('.sbm-form-control', $(context || doc.body)).removeClass('sbm-error'); + sbm.clearControlErrors(context); var values = (controlValues || []); var valuesLen = values.length; for (var valIdx = 0; valIdx < valuesLen; valIdx++) diff --git a/SaBusinessMgrCoreWebPortal/wwwroot/js/sbm-security.js b/SaBusinessMgrCoreWebPortal/wwwroot/js/sbm-security.js index daad92f..10856d8 100644 --- a/SaBusinessMgrCoreWebPortal/wwwroot/js/sbm-security.js +++ b/SaBusinessMgrCoreWebPortal/wwwroot/js/sbm-security.js @@ -15,7 +15,7 @@ } sbm.onSignin = function (response) { - sbm.refreshControlValues(response.controlValues); + sbm.refreshControlValues(response.controlValues,'#frmSignIn'); if (!response.success) return; sbm.goToPage(''); }