diff --git a/SaBusMgrCoreProcs/Procs/Interfaces/SbmInterfaceProcess.cs b/SaBusMgrCoreProcs/Procs/Interfaces/SbmInterfaceProcess.cs index 527e82b..2421c1c 100644 --- a/SaBusMgrCoreProcs/Procs/Interfaces/SbmInterfaceProcess.cs +++ b/SaBusMgrCoreProcs/Procs/Interfaces/SbmInterfaceProcess.cs @@ -87,8 +87,6 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces { if (disposing) { - if (interfaceProcess != null) interfaceProcess.Dispose(); interfaceProcess = null; - if (interfaceObj != null) interfaceObj.Dispose(); interfaceObj = null; } base.Dispose(disposing); } @@ -191,10 +189,6 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Interfaces else if (!HasErrorMessage()) AddErrorMessage("Failed to store interface process: " + InterfaceConsole.ErrorStateMessage); - // Clean-up. - interfaceProcess.Dispose(); - interfaceProcess = null; - return true; } diff --git a/SaBusMgrCoreWeb/Web/App/SbmInstanceConfig_Control.cs b/SaBusMgrCoreWeb/Web/App/SbmInstanceConfig_Control.cs index f340ac2..7ea8799 100644 --- a/SaBusMgrCoreWeb/Web/App/SbmInstanceConfig_Control.cs +++ b/SaBusMgrCoreWeb/Web/App/SbmInstanceConfig_Control.cs @@ -66,7 +66,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App // Populate Repository Configuration parameters. private void PopulateControlParams() { - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { SbmcItemMgr controlItemMgr = SbmGlobals_Web.System.CreateControlItemMgr(); if (controlItemMgr != null) @@ -80,14 +80,13 @@ namespace Sarand.BusinessMgr.Net.Core.Web.App private void PopulateControlParams(SbmcItemMgr controlItemMgr, ItemId paramItemId) { if (!ItemId.IsValid(paramItemId)) return; - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Query item params. SbmcItemParam.Params prmParam = new SbmcItemParam.Params(); prmParam.ItemIdsIncluded.Add(paramItemId); prmParam.StatusCat = SbmcItemParam.StatusCat.ActiveOnly; List itemParams = controlItemMgr.GetItemParamList(prmParam); - disposables.AddRange(itemParams); foreach (SbmcItemParam itemParam in itemParams) PopulateControlParam(itemParam); } diff --git a/SaBusMgrCoreWeb/Web/Middleware/ValidateAntiForgeryTokenMiddleware.cs b/SaBusMgrCoreWeb/Web/Middleware/ValidateAntiForgeryTokenMiddleware.cs index 24710f6..8546c12 100644 --- a/SaBusMgrCoreWeb/Web/Middleware/ValidateAntiForgeryTokenMiddleware.cs +++ b/SaBusMgrCoreWeb/Web/Middleware/ValidateAntiForgeryTokenMiddleware.cs @@ -41,11 +41,12 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Middleware public async Task Invoke(HttpContext context) { + String fn = GetType().Name + ".Invoke"; // SysUtil.Fn not useable. // Log action. //String rawTarget = context.Features.Get().RawTarget; HashSet pathsToIgnore = new HashSet(StringComparer.InvariantCultureIgnoreCase) { "/Security/Ajax/ScorePassword", "/Security/Ajax/KeepLoggedIn" }; if (SbmSystem.DebugMode && !context.Request.Method.EqualsCI("GET") && !pathsToIgnore.Contains($"{context.Request.Path}")) - SaLogger.Debug($"{SysUtil.Fn} Action: '{Regex.Replace($"{context.Request.Path}", "^/", "")}'. Method: {context.Request.Method}."); + SaLogger.Debug($"{fn} Action: '{Regex.Replace($"{context.Request.Path}", "^/", "")}'. Method: {context.Request.Method}."); // Intercept POST requests and apply anti-forgery test. if (HttpMethods.IsPost(context.Request.Method)) @@ -59,7 +60,7 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Middleware } catch (Exception exc) { - SaLogger.Warn($"{SysUtil.Fn} " + ExceptionUtil.GetLogMessage(exc)); + SaLogger.Warn($"{fn} " + ExceptionUtil.GetLogMessage(exc)); throw; } } diff --git a/SaBusMgrStandardBase/Base/App/Sbm-Version.cs b/SaBusMgrStandardBase/Base/App/Sbm-Version.cs index f2de82c..ca9a470 100644 --- a/SaBusMgrStandardBase/Base/App/Sbm-Version.cs +++ b/SaBusMgrStandardBase/Base/App/Sbm-Version.cs @@ -15,7 +15,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App //------------------------------------------------------------------- public static class Version { - private static String version { get; } = "3.0.1.6"; + private static String version { get; } = "3.0.1.7"; // Retrieve version. public static String GetFullVersion() { return version; } public static String GetAppVersion() diff --git a/SaBusMgrStandardBase/Base/App/SbmSysParamCache.cs b/SaBusMgrStandardBase/Base/App/SbmSysParamCache.cs index 0721268..288e0c0 100644 --- a/SaBusMgrStandardBase/Base/App/SbmSysParamCache.cs +++ b/SaBusMgrStandardBase/Base/App/SbmSysParamCache.cs @@ -224,7 +224,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App /// Clear the params cached for the current user. public void Clear() { - ListUtil.ClearAndDispose(mbr.UserSysParams); + mbr.UserSysParams.Clear(); Modified = false; } diff --git a/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole.cs b/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole.cs index b9bd4a0..ea475d6 100644 --- a/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole.cs +++ b/SaBusMgrStandardBase/Base/Consoles/SbmAccountsConsole.cs @@ -78,13 +78,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles mbr.InterfaceOptions.AddRange(Internals.GetSystemCodes(Sbm.SystemCode.InterfaceOption)); Reset(); } - protected override void Dispose(bool disposing) - { - if (disposing) - { - } - base.Dispose(disposing); - } //------------------------------------------------------------------- // Properties. diff --git a/SaBusMgrStandardBase/Base/Consoles/SbmCoreInstanceConsole.cs b/SaBusMgrStandardBase/Base/Consoles/SbmCoreInstanceConsole.cs index add898e..114e053 100644 --- a/SaBusMgrStandardBase/Base/Consoles/SbmCoreInstanceConsole.cs +++ b/SaBusMgrStandardBase/Base/Consoles/SbmCoreInstanceConsole.cs @@ -23,7 +23,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles /// - Initialisation of new repository. /// - Bringing static (tax codes etc) and reference data up to date. /// - public abstract class SbmCoreInstanceConsole : SaErrorStateItem, ISbmCoreInstanceConsole + public abstract class SbmCoreInstanceConsole : SacsDisposableStateItem, ISbmCoreInstanceConsole { //------------------------------------------------------------------- // Definitions. @@ -266,7 +266,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles ClearErrorState(); if (!ValidateRepositoryInitialisionData(initData)) return false; - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { //----------------------------------------------------------- // Organisation Contact. @@ -284,7 +284,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles // Create new organisation. affiliateOrganisation = Internals.AccountMgr.CreateAffiliate(Sbm.AffiliateType.Commercial); } - disposables.Add(affiliateOrganisation); // Populate properties. affiliateOrganisation.Name = initData.Organisation.Name; @@ -312,7 +311,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles // Retrieve existing Internal Association for Organisation. SbmAssociation associationInternal = Internals.AccountMgr.GetInternalAssociation(affiliateOrganisation.Id); - disposables.Add(associationInternal); if (associationInternal != null && SysId.IsValid(initData.Organisation.AssociationId) && !associationInternal.Id.Equals(initData.Organisation.AssociationId)) // Failed to validate existing Internal Association against supplied Association Id. return SetErrorState($"Identified Internal Association (Id. {initData.Organisation.AssociationId}) doesn't match existing association ({associationInternal.Id})."); @@ -322,7 +320,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles associationInternal = Internals.AccountMgr.GetAssociationById(initData.Organisation.AssociationId); if (associationInternal == null) return SetErrorState($"Failed to retrieve supplied Internal Association. Id: {initData.Organisation.AssociationId}."); - disposables.Add(associationInternal); if (!associationInternal.AffiliateIdOwner.Equals(affiliateOrganisation.Id)) return SetErrorState($"Supplied Internal Association has different Owner ({associationInternal.AffiliateIdOwner}) to Organisation ({affiliateOrganisation.Id})."); if (!associationInternal.AffiliateIdTarget.Equals(affiliateOrganisation.Id)) @@ -330,7 +327,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles } if (associationInternal == null) associationInternal = Internals.AccountMgr.CreateAssociation(affiliateOrganisation.Id, Sbm.AssociationType.Internal, affiliateOrganisation.Id); - disposables.Add(associationInternal); // Store Internal Association. if (!SysId.IsValid(associationInternal.Id)) @@ -359,7 +355,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles securityItemUser = SecurityConsole.GetSecurityItemById(SaSecurity.ItemType.User, initData.User.SecurityItemId); if (securityItemUser == null) return SetErrorState($"Failed to retrieve supplied User Security Item. Id: {initData.User.SecurityItemId}."); - disposables.Add(securityItemUser); if (!securityItemUser.Code.Equals(initData.User.Code)) return SetErrorState($"Supplied User Security Item doesn't match supplied code. Expected: {initData.User.Code}. Found: {securityItemUser.Code}."); } @@ -367,7 +362,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles { // Retrieve Security Item by code. securityItemUser = SecurityConsole.GetSecurityItemByCode(SaSecurity.ItemType.User, initData.User.Code); - disposables.Add(securityItemUser); } if (securityItemUser == null) { @@ -377,7 +371,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles securityItemUser = SecurityConsole.GetSecurityItemByCode(SaSecurity.ItemType.User, initData.User.Code); if (securityItemUser == null) return SetErrorState($"Failed to retrieve User Security Item after creation. Code: {initData.User.Code}."); - disposables.Add(securityItemUser); } // Populate User Security Item properties. @@ -404,28 +397,24 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles affiliateUser = Internals.AccountMgr.GetAffiliateById(initData.User.AffiliateId); if (affiliateUser == null) return SetErrorState($"Failed to retrieve User Contact. Id: {initData.User.AffiliateId}."); - disposables.Add(affiliateUser); } if (affiliateUser == null) { // Retrieve User Contact by User Code. affiliateUser = Internals.AccountMgr.GetAffiliateByUserId(securityItemUser.Id); - disposables.Add(affiliateUser); } if (affiliateUser == null) { // Retrieve User Contact by name. affiliateUser = Internals.AccountMgr.GetIndividualByName(initData.User.FirstName, initData.User.LastName); - disposables.Add(affiliateUser); } if (affiliateUser == null) { // Create User Contact. affiliateUser = Internals.AccountMgr.CreateAffiliate(Sbm.AffiliateType.Individual); - disposables.Add(affiliateUser); } // Populate User Contact properties. @@ -454,7 +443,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles if (associationMember == null) // Create Member Association. associationMember = Internals.AccountMgr.CreateAssociation(affiliateOrganisation.Id, Sbm.AssociationType.Member, affiliateUser.Id); - disposables.Add(associationMember); associationMember.Supervised = true; // Store User Association. diff --git a/SaBusMgrStandardBase/Base/Consoles/SbmDemoInstanceConsole.cs b/SaBusMgrStandardBase/Base/Consoles/SbmDemoInstanceConsole.cs index 47820e7..0d9c736 100644 --- a/SaBusMgrStandardBase/Base/Consoles/SbmDemoInstanceConsole.cs +++ b/SaBusMgrStandardBase/Base/Consoles/SbmDemoInstanceConsole.cs @@ -17,7 +17,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles /// - Populate example data. /// - Populate Demo Account User. /// - public abstract class SbmDemoInstanceConsole : SaErrorStateItem, ISbmDemoInstanceConsole + public abstract class SbmDemoInstanceConsole : SacsDisposableStateItem, ISbmDemoInstanceConsole { //------------------------------------------------------------------- // Definitions. diff --git a/SaBusMgrStandardBase/Base/Mgr/Control/SbmcControlMgr.cs b/SaBusMgrStandardBase/Base/Mgr/Control/SbmcControlMgr.cs index 2315849..767a3be 100644 --- a/SaBusMgrStandardBase/Base/Mgr/Control/SbmcControlMgr.cs +++ b/SaBusMgrStandardBase/Base/Mgr/Control/SbmcControlMgr.cs @@ -69,12 +69,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control if (ItemId.IsValid(itemId)) { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { if (itemId.Type == (short)SbmcHierarchyItem.ItemType.UserAccount) { SbmcUserAccount userAccount = ControlAccountMgr.GetUserAccountById(itemId.Id); - disposables.Add(userAccount); if (userAccount != null) return userAccount.GetDisplayName(); return $"UserAccount #{itemId.Id}"; @@ -82,7 +81,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control if (itemId.Type == (short)SbmcHierarchyItem.ItemType.Owner) { SbmcOwner owner = ControlInstanceMgr.GetOwnerById(itemId.Id); - disposables.Add(owner); if (owner != null) return owner.Name; return $"Owner #{itemId.Id}"; @@ -90,7 +88,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control if (itemId.Type == (short)SbmcHierarchyItem.ItemType.Repository) { SbmcRepository repository = ControlInstanceMgr.GetRepositoryById(itemId.Id); - disposables.Add(repository); if (repository != null) return repository.Context; return $"Repository #{itemId.Id}"; diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Affiliate.cs b/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Affiliate.cs index 4b877a8..f93d057 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Affiliate.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Affiliate.cs @@ -175,22 +175,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr { ClearErrorState(); if (!SysId.IsValid(associationId)) return null; - using (SbmAssociation association = GetAssociationById(associationId)) - { - if (association != null) - return GetAffiliateById(association.AffiliateIdTarget); - } + SbmAssociation association = GetAssociationById(associationId); + if (association != null) + return GetAffiliateById(association.AffiliateIdTarget); return null; } public SbmAffiliate GetTargetAffiliateByAssocTypeCode(Sbm.AssociationType associationType, String associationCode) { ClearErrorState(); if ((int)associationType < 1 || StringUtil.IsBlank(associationCode)) return null; - using (SbmAssociation association = GetAssociationByTypeCode(associationType, associationCode)) - { - if (association != null) - return GetAffiliateById(association.AffiliateIdTarget); - } + SbmAssociation association = GetAssociationByTypeCode(associationType, associationCode); + if (association != null) + return GetAffiliateById(association.AffiliateIdTarget); return null; } @@ -431,10 +427,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr prmAffiliate.AssociationType = Sbm.AssociationType.Member; prmAffiliate.TargetSupervised = SbmAffiliate.Params.Supervised.Yes; foreach (SbmAffiliate affiliate in GetAffiliateList(prmAffiliate)) - { affiliateIdNames.Add(affiliate.Id, affiliate.Name); - affiliate.Dispose(); - } return affiliateIdNames; } diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Association.cs b/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Association.cs index 24356c3..80f8cea 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Association.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmAccountMgr_Association.cs @@ -350,13 +350,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr if (errField.TaxCodeId != SacsHierarchyItem.ValidValue.Ignore && SysId.IsValid(data.TaxCodeId)) { // Association TaxCode. - using (SaTaxCode taxCode = Internals.GetTaxCodeById(data.TaxCodeId)) + SaTaxCode taxCode = Internals.GetTaxCodeById(data.TaxCodeId); + if (taxCode == null) { - if (taxCode == null) - { - errField.TaxCodeId = SacsHierarchyItem.ValidValue.Invalid; - return SetErrorState("Tax Code not found"); - } + errField.TaxCodeId = SacsHierarchyItem.ValidValue.Invalid; + return SetErrorState("Tax Code not found"); } } return true; diff --git a/SaBusMgrStandardBase/Base/Mgr/SbmCommodityMgr_PortfolioItem.cs b/SaBusMgrStandardBase/Base/Mgr/SbmCommodityMgr_PortfolioItem.cs index 9b51d9f..0e27b17 100644 --- a/SaBusMgrStandardBase/Base/Mgr/SbmCommodityMgr_PortfolioItem.cs +++ b/SaBusMgrStandardBase/Base/Mgr/SbmCommodityMgr_PortfolioItem.cs @@ -78,13 +78,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr else { // Retrieve the parent and make a note of its parent. - using (SbmPortfolioItem parentPortfolioItem = GetPortfolioItemById(itemIdParent)) - { - if (parentPortfolioItem != null) - itemIdParent = parentPortfolioItem.ItemIdParent; - else - itemIdParent = new SysId(); - } + SbmPortfolioItem parentPortfolioItem = GetPortfolioItemById(itemIdParent); + if (parentPortfolioItem != null) + itemIdParent = parentPortfolioItem.ItemIdParent; + else + itemIdParent = new SysId(); } } return publishedToWebStore; diff --git a/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-Commodity-Utils.cs b/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-Commodity-Utils.cs index 9b74963..e4d1c25 100644 --- a/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-Commodity-Utils.cs +++ b/SaBusMgrStandardDbas/Dbas/Mgr/SbmCommodityMgr_Dbas-Commodity-Utils.cs @@ -212,7 +212,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr List costEstimatesCopy = null; if (commodity.CostEstimates == null && SysId.IsValid(commodity.Id)) { - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { SbmItemLink.Params prmItemLink = new SbmItemLink.Params(); prmItemLink.ItemLinkType = Sbm.ItemLinkType.ItemCostEstimate; @@ -221,7 +221,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr List itemLinks = DataItemMgr.GetItemLinkList(prmItemLink); if (itemLinks != null) { - disposables.AddRange(itemLinks); foreach (SbmItemLink itemLink in itemLinks) { SbmCostEstimate costEstimate = new SbmCostEstimate(itemLink.DataContent); diff --git a/SaBusMgrTest_Control/SaBusMgrTest_Control.csproj b/SaBusMgrTest_Control/SaBusMgrTest_Control.csproj index 16aea1a..3925f92 100644 --- a/SaBusMgrTest_Control/SaBusMgrTest_Control.csproj +++ b/SaBusMgrTest_Control/SaBusMgrTest_Control.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable enable @@ -15,10 +15,10 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - + + diff --git a/SaBusMgrTest_Control/Web/Control/App/SbmApplication_SessionData_Tester.cs b/SaBusMgrTest_Control/Web/Control/App/SbmApplication_SessionData_Tester.cs index 8b3c71f..6e0ba20 100644 --- a/SaBusMgrTest_Control/Web/Control/App/SbmApplication_SessionData_Tester.cs +++ b/SaBusMgrTest_Control/Web/Control/App/SbmApplication_SessionData_Tester.cs @@ -34,7 +34,7 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App [TestMethod] public void Test_Application_SessionData_Serialization() { - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Internals. SbmcAccountMgr accountMgr = Internals_Control.ControlAccountMgr; @@ -42,7 +42,6 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App // User account. SbmcUserAccount userAccount = accountMgr.GetUserAccountByEmailAddress("andy@sarand.com"); - disposables.Add(userAccount); Assert.IsNotNull(userAccount); // Session Context? diff --git a/SaBusMgrTest_Control/Web/Control/App/SbmApplication_Tester.cs b/SaBusMgrTest_Control/Web/Control/App/SbmApplication_Tester.cs index a6f848c..2f04a0a 100644 --- a/SaBusMgrTest_Control/Web/Control/App/SbmApplication_Tester.cs +++ b/SaBusMgrTest_Control/Web/Control/App/SbmApplication_Tester.cs @@ -58,7 +58,7 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App public void Test_Application_Internals_Control() { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Control internals. Assert.IsNotNull(Internals_Control); @@ -82,11 +82,10 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App public void Test_Application_CoreInstanceConsole() { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Repository. SbmcRepository repository = GetRandomActiveRepository(); - disposables.Add(repository); Assert.IsNotNull(repository); // Instance console. @@ -101,11 +100,10 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App public void Test_Application_Internals_Core() { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Repository. SbmcRepository repository = GetRandomActiveRepository(); - disposables.Add(repository); Assert.IsNotNull(repository); // Instance console. @@ -120,11 +118,10 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App public void Test_Application_SessionContexts() { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Repository. SbmcRepository repository = GetRandomActiveRepository(); - disposables.Add(repository); Assert.IsNotNull(repository); SbmCoreInstanceConsole instanceConsole = new SbmCoreInstanceConsole_Control(SessionData_Control, repository); diff --git a/SaBusMgrTest_Control/Web/Control/App/SbmApplication_Tester_Base.cs b/SaBusMgrTest_Control/Web/Control/App/SbmApplication_Tester_Base.cs index c0d86dc..6519d0d 100644 --- a/SaBusMgrTest_Control/Web/Control/App/SbmApplication_Tester_Base.cs +++ b/SaBusMgrTest_Control/Web/Control/App/SbmApplication_Tester_Base.cs @@ -73,13 +73,8 @@ namespace Sarand.BusinessMgr.Test.Web.Control.App // Core Instance Console. protected SbmCoreInstanceConsole_Control CreateCoreInstanceConsole(String repositoryContext) { - // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) - { - SbmcRepository repository = Internals_Control.ControlInstanceMgr.GetRepositoryByContext(repositoryContext); - disposables.Add(repository); - return new SbmCoreInstanceConsole_Control(SessionData_Control, repository); - } + SbmcRepository repository = Internals_Control.ControlInstanceMgr.GetRepositoryByContext(repositoryContext); + return new SbmCoreInstanceConsole_Control(SessionData_Control, repository); } //------------------------------------------------------------------- diff --git a/SaBusMgrTest_Portal/SaBusMgrTest_Portal.csproj b/SaBusMgrTest_Portal/SaBusMgrTest_Portal.csproj index af77de6..ed216c7 100644 --- a/SaBusMgrTest_Portal/SaBusMgrTest_Portal.csproj +++ b/SaBusMgrTest_Portal/SaBusMgrTest_Portal.csproj @@ -9,15 +9,15 @@ 10.0 - net6.0 + net8.0 false Sarand.BusinessMgr.Test - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_Database_Tester.cs b/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_Database_Tester.cs index 43069f8..19dd0dd 100644 --- a/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_Database_Tester.cs +++ b/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_Database_Tester.cs @@ -24,7 +24,7 @@ namespace Sarand.BusinessMgr.Test.Web.Portal.App public void Test_PasswordEncoding() { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Session configuration. string repositoryContext = "Mimo"; @@ -51,7 +51,7 @@ namespace Sarand.BusinessMgr.Test.Web.Portal.App Dictionary passwordHashes = new Dictionary(); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Session configuration. string repositoryContext = "Mimo"; diff --git a/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_DemoRepository_Tester.cs b/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_DemoRepository_Tester.cs index 3b2a9d5..fd7278d 100644 --- a/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_DemoRepository_Tester.cs +++ b/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_DemoRepository_Tester.cs @@ -21,7 +21,7 @@ namespace Sarand.BusinessMgr.Test.Web.Portal.App public void Test_SessionData_Demo() { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Demo Session configuration. string repositoryContext = Sbm.RepositoryContext_Demo; @@ -49,7 +49,7 @@ namespace Sarand.BusinessMgr.Test.Web.Portal.App public void Test_SessionData_NonDemo() { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Non-Demo Session configuration. string repositoryContext = "Mimo"; diff --git a/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_Portal_Tester.cs b/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_Portal_Tester.cs index db62d73..d805eb6 100644 --- a/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_Portal_Tester.cs +++ b/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_Portal_Tester.cs @@ -50,7 +50,7 @@ namespace Sarand.BusinessMgr.Test.Web.Portal.App public void Test_Application_ControlInternals() { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Control database. SbmInternals_Control internalsControl = new SbmInternals_Control(); diff --git a/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_SessionData_Tester.cs b/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_SessionData_Tester.cs index 971c3d8..61ad044 100644 --- a/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_SessionData_Tester.cs +++ b/SaBusMgrTest_Portal/Web/Portal/App/SbmApplication_SessionData_Tester.cs @@ -35,7 +35,7 @@ namespace Sarand.BusinessMgr.Test.Web.Portal.App public void Test_Application_SessionData_Serialization() { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Session configuration. string repositoryContext = "Mimo"; @@ -163,7 +163,7 @@ namespace Sarand.BusinessMgr.Test.Web.Portal.App public void Test_Application_SessionData_SecurityProfile() { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { //----------------------------------------------------------- // Initialisation. diff --git a/SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Control.cs b/SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Control.cs index 097d5a5..113d962 100644 --- a/SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Control.cs +++ b/SaBusinessMgrCoreWebControl/Control/App/SbmApplication_Control.cs @@ -135,7 +135,7 @@ namespace Sarand.BusinessMgr.Web.Control.App /// public ushort GetCoreSessionIndexForControlRepository(SysId ownerId, SysId repositoryId) { - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { CoreInstanceContextData sessionContext = coreInstances.Values.FirstOrDefault(item => item.ControlRepositoryId.Equals(repositoryId)); if (sessionContext != null) return sessionContext.SessionContext.Index; @@ -143,7 +143,6 @@ namespace Sarand.BusinessMgr.Web.Control.App SbmcInstanceMgr instanceMgr = System.CreateControlInstanceMgr(); disposables.Add(instanceMgr); SbmcRepository repository = instanceMgr.GetRepositoryById(repositoryId); - disposables.Add(repository); if (repository != null) { // Core database connection. @@ -216,7 +215,7 @@ namespace Sarand.BusinessMgr.Web.Control.App { Development = env.IsDevelopment(); environmentName = env.EnvironmentName; - SaLogger.LogFilenamePrefix = "Sbm-Web-Adm"; + SaLogger.LogFilenamePrefix = "Sbm-Web-Ctl"; SaLogger.IncludeHostInFileMessage = false; SaLogger.IncludeUserInFileMessage = false; diff --git a/SaBusinessMgrCoreWebControl/Control/Components/SbmController_Control.cs b/SaBusinessMgrCoreWebControl/Control/Components/SbmController_Control.cs index 8140a8c..dcd1bba 100644 --- a/SaBusinessMgrCoreWebControl/Control/Components/SbmController_Control.cs +++ b/SaBusinessMgrCoreWebControl/Control/Components/SbmController_Control.cs @@ -81,7 +81,7 @@ namespace Sarand.BusinessMgr.Web.Control.Components protected bool SignUserIn(SbmcUserAccount userAccount, bool keepLoggedIn, ref string errorMessage) { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Validate User Account, just in case - should have been done before arriving here! if (userAccount == null) @@ -160,25 +160,23 @@ namespace Sarand.BusinessMgr.Web.Control.Components string logSuffix = keepLoggedInParams.GetValidParams().Concat("", " ", "."); if (keepLoggedInParams.IsValid()) { - using (SbmcUserAccount userAccount = ControlAccountMgr.GetUserAccountById(keepLoggedInParams.UserAccountId)) + SbmcUserAccount userAccount = ControlAccountMgr.GetUserAccountById(keepLoggedInParams.UserAccountId); + if (userAccount != null) { - if (userAccount != null) + if (userAccount.IsStatusActive) { - if (userAccount.IsStatusActive) + string errorMessage = ""; + if (SignUserIn(userAccount, true, ref errorMessage)) { - string errorMessage = ""; - if (SignUserIn(userAccount, true, ref errorMessage)) - { - // Successful login. - SaLogger.Info($"{SysUtil.Fn} Keep Logged In cookie found.{logSuffix}"); - return true; - } - else SaLogger.Warn($"{SysUtil.Fn} Keep Logged In cookie found but failed to sign user in: {errorMessage}.{logSuffix}"); + // Successful login. + SaLogger.Info($"{SysUtil.Fn} Keep Logged In cookie found.{logSuffix}"); + return true; } - else SaLogger.Warn($"{SysUtil.Fn} Keep Logged In cookie found but UserAccount is not active.{logSuffix}"); + else SaLogger.Warn($"{SysUtil.Fn} Keep Logged In cookie found but failed to sign user in: {errorMessage}.{logSuffix}"); } - else SaLogger.Warn($"{SysUtil.Fn} Keep Logged In cookie found but UserAccount not found.{logSuffix}"); + else SaLogger.Warn($"{SysUtil.Fn} Keep Logged In cookie found but UserAccount is not active.{logSuffix}"); } + else SaLogger.Warn($"{SysUtil.Fn} Keep Logged In cookie found but UserAccount not found.{logSuffix}"); } ClearKeepLoggedInCookie(); return false; diff --git a/SaBusinessMgrCoreWebControl/Control/Controllers/Account/UserAccountController-Ajax.cs b/SaBusinessMgrCoreWebControl/Control/Controllers/Account/UserAccountController-Ajax.cs index 791149f..0b9d94b 100644 --- a/SaBusinessMgrCoreWebControl/Control/Controllers/Account/UserAccountController-Ajax.cs +++ b/SaBusinessMgrCoreWebControl/Control/Controllers/Account/UserAccountController-Ajax.cs @@ -181,7 +181,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Account RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -191,7 +191,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Account // Retrieve item. SbmcUserAccount user = ControlAccountMgr.GetUserAccountById(userAccountId); - disposables.Add(user); if (user == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve user for Id: '" + userAccountId + "'"); @@ -222,7 +221,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Account RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify user. @@ -234,7 +233,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Account // Retrieve user. SbmcUserAccount user = ControlAccountMgr.GetUserAccountByEmailAddress(model.Filter.EmailAddress); - disposables.Add(user); if (user == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve user for Email: " + model.Filter.EmailAddress); @@ -283,12 +281,11 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Account return Json(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve existing item. SbmcUserAccount user = ControlAccountMgr.GetUserAccountById(userAccountId); - disposables.Add(user); if (user == null && SysId.IsValid(userAccountId)) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve user for Id: '" + model.User.Id + "'"); @@ -364,13 +361,12 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Account RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve user. SysId userAccountId = SysId.ToSysId(model.User.Id); SbmcUserAccount userAccount = ControlAccountMgr.GetUserAccountById(userAccountId); - disposables.Add(userAccount); if (userAccount == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve user for Id: '" + model.User.Id + "'"); diff --git a/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/OwnerController-Ajax.cs b/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/OwnerController-Ajax.cs index daefe2d..9d7fc8f 100644 --- a/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/OwnerController-Ajax.cs +++ b/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/OwnerController-Ajax.cs @@ -165,7 +165,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -175,7 +175,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance // Retrieve item. SbmcOwner owner = ControlInstanceMgr.GetOwnerById(ownerId); - disposables.Add(owner); if (owner == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve owner for Id: '" + ownerId + "'"); @@ -224,12 +223,11 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance return Json(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve existing item. SbmcOwner owner = ControlInstanceMgr.GetOwnerById(ownerId); - disposables.Add(owner); if (owner == null && SysId.IsValid(ownerId)) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve owner for Id: '" + model.Owner.Id + "'"); diff --git a/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/RepositoryController-Ajax.cs b/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/RepositoryController-Ajax.cs index 0bc1676..9fac593 100644 --- a/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/RepositoryController-Ajax.cs +++ b/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/RepositoryController-Ajax.cs @@ -164,7 +164,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -174,7 +174,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance // Retrieve item. SbmcRepository repository = ControlInstanceMgr.GetRepositoryById(repositoryId); - disposables.Add(repository); if (repository == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve repository for Id: '" + repositoryId + "'"); @@ -183,7 +182,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance // Owner. SbmcOwner owner = ControlInstanceMgr.GetOwnerById(repository.OwnerId); - disposables.Add(owner); if (owner == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve owner for Id: '" + repository.OwnerId + "'"); @@ -231,7 +229,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -241,7 +239,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance // Retrieve item. SbmcRepository repository = ControlInstanceMgr.GetRepositoryById(repositoryId); - disposables.Add(repository); if (repository == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve repository for Id: '" + repositoryId + "'"); @@ -309,12 +306,11 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance return Json(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve existing item. SbmcRepository repository = ControlInstanceMgr.GetRepositoryById(repositoryId); - disposables.Add(repository); if (repository == null && SysId.IsValid(repositoryId)) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve repository for Id: '" + model.Repository.Id + "'"); @@ -324,7 +320,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance // Owner. SysId ownerId = repository?.OwnerId ?? SysId.ToSysId(model.Repository.OwnerId); SbmcOwner owner = ControlInstanceMgr.GetOwnerById(ownerId); - disposables.Add(owner); if (owner == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve owner for Id: '" + ownerId + "'"); diff --git a/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/RepositoryDatabaseController-Ajax.cs b/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/RepositoryDatabaseController-Ajax.cs index 49f2e20..16d3687 100644 --- a/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/RepositoryDatabaseController-Ajax.cs +++ b/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/RepositoryDatabaseController-Ajax.cs @@ -59,7 +59,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Validate Repository. @@ -70,7 +70,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"])); } SbmcRepository repository = ControlInstanceMgr.GetRepositoryByContext(model.DatabaseFilter.Context); - disposables.Add(repository); if (repository == null) { SaLogger.Warn($"{SysUtil.Fn} Repository does not exist. Context: {model.DatabaseFilter.Context}."); @@ -165,7 +164,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Validate Repository. @@ -176,7 +175,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"])); } SbmcRepository repository = ControlInstanceMgr.GetRepositoryByContext(model.DatabaseFilter.Context); - disposables.Add(repository); if (repository == null) { SaLogger.Warn($"{SysUtil.Fn} Repository does not exist. Context: {model.DatabaseFilter.Context}."); diff --git a/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/RepositoryInitController-Ajax.cs b/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/RepositoryInitController-Ajax.cs index 8e82bdd..6ef88bc 100644 --- a/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/RepositoryInitController-Ajax.cs +++ b/SaBusinessMgrCoreWebControl/Control/Controllers/Instance/RepositoryInitController-Ajax.cs @@ -98,7 +98,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Validate Repository. @@ -109,7 +109,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"])); } SbmcRepository repository = ControlInstanceMgr.GetRepositoryById(repositoryId); - disposables.Add(repository); if (repository == null) { SaLogger.Warn($"{SysUtil.Fn} Repository does not exist. Id: {repositoryId}."); @@ -120,7 +119,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance // Owner. SbmcOwner owner = ControlInstanceMgr.GetOwnerById(repository.OwnerId); - disposables.Add(owner); if (owner == null) { SaLogger.Warn($"{SysUtil.Fn} Owner does not exist. Id: {repository.OwnerId}."); @@ -140,9 +138,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance foreach (SbmAssociation association in instanceConsole.Internals.AccountMgr.GetAssociationList(prm)) { // Retrieve Organisation details. - disposables.Add(association); SbmAffiliate affiliateOrganisation = instanceConsole.Internals.AccountMgr.GetAffiliateById(association.AffiliateIdOwner); - disposables.Add(affiliateOrganisation); // Organisation details. RepositoryOrganisationData organisation = new RepositoryOrganisationData() @@ -163,12 +159,9 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance prmAffiliateUser.SortColumns.Add(instanceConsole.Internals.AccountMgr.GetAffiliateColumnDfn(SbmAffiliate.Column.Id)); foreach (SbmAffiliate affiliateUser in instanceConsole.Internals.AccountMgr.GetAffiliateList(prmAffiliateUser)) { - disposables.Add(affiliateUser); - // Lookup security details. if (!SysId.IsValid(affiliateUser.UserId)) continue; SaSecurityItem securityItemUser = instanceConsole.Internals.SecurityConsole.GetSecurityItemById(SaSecurity.ItemType.User, affiliateUser.UserId); - disposables.Add(securityItemUser); if (securityItemUser == null) continue; // Confirm security rights (SuperUser). @@ -219,7 +212,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Validate Repository. @@ -230,7 +223,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"])); } SbmcRepository repository = ControlInstanceMgr.GetRepositoryById(repositoryId); - disposables.Add(repository); if (repository == null) { SaLogger.Warn($"{SysUtil.Fn} Repository does not exist. Id: {repositoryId}."); @@ -254,7 +246,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance // Validate Organisation Affiliate. SbmAffiliate affiliateOrganisation = instanceConsole.Internals.AccountMgr.GetAffiliateById(affiliateIdOrganisation); - disposables.Add(affiliateOrganisation); if (affiliateOrganisation == null) { SaLogger.Warn($"{SysUtil.Fn} Affiliate not found for existing Organisation. Id: {model.Organisation.AffiliateId}."); @@ -278,7 +269,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance { // Validate Internal Association. SbmAssociation associationOrganisation = instanceConsole.Internals.AccountMgr.GetAssociationById(associationIdInternal); - disposables.Add(associationOrganisation); if (associationOrganisation == null) { SaLogger.Warn($"{SysUtil.Fn} Association not found for existing Organisation. Id: {model.Organisation.AssociationId}."); @@ -329,7 +319,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance // Validate User Affiliate. SbmAffiliate affiliateUser = instanceConsole.Internals.AccountMgr.GetAffiliateById(affiliateIdUser); - disposables.Add(affiliateUser); if (affiliateUser == null) { SaLogger.Warn($"{SysUtil.Fn} Affiliate not found for existing User. Id: {model.User.AffiliateId}."); @@ -352,7 +341,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance { // Validate User Security Item. SaSecurityItem securityItemUser = instanceConsole.Internals.SecurityConsole.GetSecurityItemById(SaSecurity.ItemType.User, secItemIdUser); - disposables.Add(securityItemUser); if (securityItemUser == null) { SaLogger.Warn($"{SysUtil.Fn} Security Item not found for existing User. Id: {model.User.SecurityItemId}."); diff --git a/SaBusinessMgrCoreWebControl/Control/Controllers/Param/ParamController-Ajax.cs b/SaBusinessMgrCoreWebControl/Control/Controllers/Param/ParamController-Ajax.cs index 15eef0c..947f3ca 100644 --- a/SaBusinessMgrCoreWebControl/Control/Controllers/Param/ParamController-Ajax.cs +++ b/SaBusinessMgrCoreWebControl/Control/Controllers/Param/ParamController-Ajax.cs @@ -277,7 +277,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Param RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -287,7 +287,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Param // Retrieve item. SbmcItemParam itemParam = ControlItemMgr.GetItemParamById(itemParamId); - disposables.Add(itemParam); if (itemParam == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve itemParam for Id: '" + itemParamId + "'"); @@ -336,12 +335,11 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Param return Json(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve existing item. SbmcItemParam itemParam = ControlItemMgr.GetItemParamById(itemParamId); - disposables.Add(itemParam); if (itemParam == null && SysId.IsValid(itemParamId)) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Item Param for Id: '" + model.Param.Id + "'"); diff --git a/SaBusinessMgrCoreWebControl/Control/Controllers/Security/SecurityController-Ajax.cs b/SaBusinessMgrCoreWebControl/Control/Controllers/Security/SecurityController-Ajax.cs index ec815e8..ef27b7d 100644 --- a/SaBusinessMgrCoreWebControl/Control/Controllers/Security/SecurityController-Ajax.cs +++ b/SaBusinessMgrCoreWebControl/Control/Controllers/Security/SecurityController-Ajax.cs @@ -42,12 +42,11 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers return Json(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Get user account. SbmcUserAccount userAccount = GetUserAccountForSignin(model, responseData); - disposables.Add(userAccount); if (responseData.HasControlErrors()) return Json(responseData); @@ -100,7 +99,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers SbmcUserAccount userAccount = null; // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify user account. @@ -108,7 +107,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers prmUserAccount.EmailAddress = model.EmailAddress; prmUserAccount.StatusCat = SbmcUserAccount.StatusCat.Any; List userAccounts = ControlAccountMgr.GetUserAccountList(prmUserAccount); - disposables.AddRange(userAccounts); foreach (SbmcUserAccount userAccountCandidate in userAccounts) { // Account must be active to allow sign-in. @@ -165,12 +163,11 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers return Json(responseData.SetSessionExpired(messageTitle, Localiser["security.msg.warn.sessionExpired"])); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve user account - in case sign-out needs to be recorded. SbmcUserAccount userAccount = ControlAccountMgr.GetUserAccountById(SessionData_Control.User.UserAccountId); - disposables.Add(userAccount); if (userAccount == null) { SaLogger.Warn($"{SysUtil.Fn} System error on sign-out - failed to retrieve account details. Id: " + SysId.ToInt(SessionData_Control.User.UserAccountId)); @@ -230,7 +227,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers String messageTitle = Localiser["caption.change.password"]; // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // If 'Request Password' encrypted params (from email link) are present, @@ -243,7 +240,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers { // Retrieve user account details and validate email address. userAccount = ControlAccountMgr.GetUserAccountById(requestPasswordParams.UserAccountId); - disposables.Add(userAccount); if (requestPasswordParams.IsValid(userAccount)) { validRequestPasswordParams = true; @@ -264,7 +260,6 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers if (userAccount == null && SessionData_Control != null) { userAccount = ControlAccountMgr.GetUserAccountById(SessionData_Control.User.UserAccountId); - disposables.Add(userAccount); } if (userAccount == null) return Json(responseData.SetControlError(nameof(model.Password), "System error - failed to retrieve account details.")); @@ -336,12 +331,11 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers return Json(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve user account. SbmcUserAccount userAccount = ControlAccountMgr.GetUserAccountByEmailAddress(model.EmailAddress); - disposables.Add(userAccount); if (userAccount == null) SaLogger.Warn($"{SysUtil.Fn} Unable to send password request email to " + model.EmailAddress + " - account does not exist"); else if (!userAccount.IsStatusActive) diff --git a/SaBusinessMgrCoreWebControl/Control/Controllers/Security/SecurityController.cs b/SaBusinessMgrCoreWebControl/Control/Controllers/Security/SecurityController.cs index 3b8b113..f532a5e 100644 --- a/SaBusinessMgrCoreWebControl/Control/Controllers/Security/SecurityController.cs +++ b/SaBusinessMgrCoreWebControl/Control/Controllers/Security/SecurityController.cs @@ -68,32 +68,30 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers if (requestPasswordParams.IsValid()) { String logSuffix = requestPasswordParams.GetValidParams().Concat("", " ", "."); - using (SbmcUserAccount userAccount = ControlAccountMgr.GetUserAccountById(requestPasswordParams.UserAccountId)) + SbmcUserAccount userAccount = ControlAccountMgr.GetUserAccountById(requestPasswordParams.UserAccountId); + if (userAccount != null) { - if (userAccount != null) + if (userAccount.IsStatusActive) { - if (userAccount.IsStatusActive) + if (requestPasswordParams.IsValid(userAccount)) { - if (requestPasswordParams.IsValid(userAccount)) - { - model.rpe = encryptedParams; - validSessionRequired = false; - } - else SaLogger.Warn($"{SysUtil.Fn} 'Request Password' parameters supplied but invalid. {logSuffix}"); + model.rpe = encryptedParams; + validSessionRequired = false; } - else SaLogger.Warn($"{SysUtil.Fn} 'Request Password' parameters supplied but account is not active. {logSuffix}"); + else SaLogger.Warn($"{SysUtil.Fn} 'Request Password' parameters supplied but invalid. {logSuffix}"); } - else + else SaLogger.Warn($"{SysUtil.Fn} 'Request Password' parameters supplied but account is not active. {logSuffix}"); + } + else + { + // User Account not found - redirect to Portal application. + String redirectParamName = ParamName_RequestPasswordEncrypted + "2"; + SaLogger.Warn($"{SysUtil.Fn} 'Request Password' parameters supplied but account is not 'Admin'. {logSuffix}"); + if (!Request.Query.Keys.Contains(redirectParamName) && !StringUtil.IsEmpty(AppConfig.URL.Portal.Root)) { - // User Account not found - redirect to Portal application. - String redirectParamName = ParamName_RequestPasswordEncrypted + "2"; - SaLogger.Warn($"{SysUtil.Fn} 'Request Password' parameters supplied but account is not 'Admin'. {logSuffix}"); - if (!Request.Query.Keys.Contains(redirectParamName) && !StringUtil.IsEmpty(AppConfig.URL.Portal.Root)) - { - UriBuilder uri = new UriBuilder(Regex.Replace(AppConfig.URL.Portal.Root, "/$", "") + "/Security/ChangePassword"); - uri.Query = $"{ParamName_RequestPasswordEncrypted}={Uri.EscapeDataString(encryptedParams)}&{redirectParamName}"; - return Redirect(uri.Uri.OriginalString); - } + UriBuilder uri = new UriBuilder(Regex.Replace(AppConfig.URL.Portal.Root, "/$", "") + "/Security/ChangePassword"); + uri.Query = $"{ParamName_RequestPasswordEncrypted}={Uri.EscapeDataString(encryptedParams)}&{redirectParamName}"; + return Redirect(uri.Uri.OriginalString); } } } diff --git a/SaBusinessMgrCoreWebControl/Control/Controllers/System/SystemController-Ajax-Database.cs b/SaBusinessMgrCoreWebControl/Control/Controllers/System/SystemController-Ajax-Database.cs index f2848da..699ebd7 100644 --- a/SaBusinessMgrCoreWebControl/Control/Controllers/System/SystemController-Ajax-Database.cs +++ b/SaBusinessMgrCoreWebControl/Control/Controllers/System/SystemController-Ajax-Database.cs @@ -60,7 +60,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.System return GetAjaxResult_InvalidSession(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposableItems = new DisposableCollection()) + using (DisposableCollection disposableItems = new DisposableCollection()) { // Database instance. Sbm.Database databaseInstance = EnumUtil.ParseEnum(StringUtil.EmptyOnNull(model.DatabaseFilter.Instance), Sbm.Database.Unknown); @@ -190,7 +190,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.System return GetAjaxResult_InvalidSession(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposableItems = new DisposableCollection()) + using (DisposableCollection disposableItems = new DisposableCollection()) { // Database instance. @@ -438,7 +438,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.System return GetAjaxResult_InvalidSession(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposableItems = new DisposableCollection()) + using (DisposableCollection disposableItems = new DisposableCollection()) { // Parameters. diff --git a/SaBusinessMgrCoreWebControl/Control/Models/Account/Model_UserAccount.cs b/SaBusinessMgrCoreWebControl/Control/Models/Account/Model_UserAccount.cs index cd0e5e3..fcd0872 100644 --- a/SaBusinessMgrCoreWebControl/Control/Models/Account/Model_UserAccount.cs +++ b/SaBusinessMgrCoreWebControl/Control/Models/Account/Model_UserAccount.cs @@ -65,7 +65,7 @@ namespace Sarand.BusinessMgr.Web.Control.Models.Account public bool ValidateUserData(Sacs.Web.Components.SaController.AjaxResponse_Data responseData) { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // User email. diff --git a/SaBusinessMgrCoreWebControl/Control/Models/Instance/Model_Owner.cs b/SaBusinessMgrCoreWebControl/Control/Models/Instance/Model_Owner.cs index b7aa712..8658756 100644 --- a/SaBusinessMgrCoreWebControl/Control/Models/Instance/Model_Owner.cs +++ b/SaBusinessMgrCoreWebControl/Control/Models/Instance/Model_Owner.cs @@ -59,7 +59,7 @@ namespace Sarand.BusinessMgr.Web.Control.Models.Instance public bool ValidateOwnerData(SbmController_Base.AjaxResponse_Data responseData) { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Owner name. diff --git a/SaBusinessMgrCoreWebControl/Control/Models/Instance/Model_Repository.cs b/SaBusinessMgrCoreWebControl/Control/Models/Instance/Model_Repository.cs index afcb0a6..0af6182 100644 --- a/SaBusinessMgrCoreWebControl/Control/Models/Instance/Model_Repository.cs +++ b/SaBusinessMgrCoreWebControl/Control/Models/Instance/Model_Repository.cs @@ -62,7 +62,7 @@ namespace Sarand.BusinessMgr.Web.Control.Models.Instance public bool ValidateRepositoryData(SbmController_Base.AjaxResponse_Data responseData) { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Repository Owner. diff --git a/SaBusinessMgrCoreWebControl/Control/Models/Instance/Model_RepositoryInit.cs b/SaBusinessMgrCoreWebControl/Control/Models/Instance/Model_RepositoryInit.cs index b320bc2..3212c42 100644 --- a/SaBusinessMgrCoreWebControl/Control/Models/Instance/Model_RepositoryInit.cs +++ b/SaBusinessMgrCoreWebControl/Control/Models/Instance/Model_RepositoryInit.cs @@ -118,7 +118,7 @@ namespace Sarand.BusinessMgr.Web.Control.Models.Instance public bool ValidateRepositoryData(SbmController_Base.AjaxResponse_Data responseData, SbmcRepository repository) { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { //----------------------------------------------------------- diff --git a/SaBusinessMgrCoreWebControl/Control/Models/Param/Model_Param.cs b/SaBusinessMgrCoreWebControl/Control/Models/Param/Model_Param.cs index 519142a..4ebe27b 100644 --- a/SaBusinessMgrCoreWebControl/Control/Models/Param/Model_Param.cs +++ b/SaBusinessMgrCoreWebControl/Control/Models/Param/Model_Param.cs @@ -73,7 +73,7 @@ namespace Sarand.BusinessMgr.Web.Control.Models.Param public bool ValidateParamData(Sacs.Web.Components.SaController.AjaxResponse_Data responseData) { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Check whether data suggests that Param exists. bool paramExists = StringUtil.ToBool(Param.Exists) && SysId.IsValid(SysId.ToSysId(Param.Id)); diff --git a/SaBusinessMgrCoreWebControl/Views/Instance/Repository/Database/Tables.cshtml b/SaBusinessMgrCoreWebControl/Views/Instance/Repository/Database/Tables.cshtml index 97cc463..b5aee11 100644 --- a/SaBusinessMgrCoreWebControl/Views/Instance/Repository/Database/Tables.cshtml +++ b/SaBusinessMgrCoreWebControl/Views/Instance/Repository/Database/Tables.cshtml @@ -61,10 +61,10 @@ @Localiser["label.schema"] @Localiser["label.table"] + @Localiser["label.rows"] @Localiser["label.columns"] @Localiser["label.indices"] - @Localiser["label.rows"] - +
@@ -83,9 +83,9 @@
+
-
@* Burger menu *@ diff --git a/SaBusinessMgrCoreWebControl/wwwroot/css/sbc-data.css b/SaBusinessMgrCoreWebControl/wwwroot/css/sbc-data.css index cc74b09..4ad32aa 100644 --- a/SaBusinessMgrCoreWebControl/wwwroot/css/sbc-data.css +++ b/SaBusinessMgrCoreWebControl/wwwroot/css/sbc-data.css @@ -172,9 +172,18 @@ ul.nav.sbc-burger.navbar-dark .dropdown:hover border-color: #c0c0c0; } -ul.nav.sbc-burger .sbc-ellipsis-dot +ul.nav.sbc-burger a .sbc-ellipsis-dot { display: inline-block; + width: 2px; + height: 2px; + margin: 1px 2px 4px 2px; + background-color: #808080; + border-radius: 1px; +} + +ul.nav.sbc-burger a:hover .sbc-ellipsis-dot +{ width: 4px; height: 4px; margin: 0 1px 3px 1px; diff --git a/SaBusinessMgrCoreWebControl/wwwroot/js/sbc-ins-rep-db.js b/SaBusinessMgrCoreWebControl/wwwroot/js/sbc-ins-rep-db.js index b1a7292..975d56c 100644 --- a/SaBusinessMgrCoreWebControl/wwwroot/js/sbc-ins-rep-db.js +++ b/SaBusinessMgrCoreWebControl/wwwroot/js/sbc-ins-rep-db.js @@ -54,9 +54,13 @@ $item.prop('id', cd.getItemId(item)); $('.SchemaName', $item).text(item.schemaName); $('.TableName', $item).text(item.tableName); + if (item.rowCount) $('.RowCount', $item).text(item.rowCount); if (item.columnCount) $('.ColumnCount', $item).text(item.columnCount); if (item.indexCount) $('.IndexCount', $item).text(item.indexCount); - if (item.rowCount) $('.RowCount', $item).text(item.rowCount); + // Actions. + var $bgr = $('.sbc-burger', $item).hide(); + let $mnu = $('ul.sbc-dropdown-menu', $bgr).empty(); + $bgr.toggle(!!$('.sbc-dropdown-item', $mnu).length); return $item; } cd.getItemId = function (item) diff --git a/SaBusinessMgrCoreWebPortal/Portal/App/SbmApplication_Portal.cs b/SaBusinessMgrCoreWebPortal/Portal/App/SbmApplication_Portal.cs index 96cd46a..39a1791 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/App/SbmApplication_Portal.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/App/SbmApplication_Portal.cs @@ -191,7 +191,7 @@ namespace Sarand.BusinessMgr.Web.Portal.App { Development = env.IsDevelopment(); environmentName = env.EnvironmentName; - SaLogger.LogFilenamePrefix = "Sbm-Web-Onl"; + SaLogger.LogFilenamePrefix = "Sbm-Web-Prt"; SaLogger.IncludeHostInFileMessage = false; SaLogger.IncludeUserInFileMessage = false; @@ -262,11 +262,9 @@ namespace Sarand.BusinessMgr.Web.Portal.App SbmcRepository.Params prmRepository = new SbmcRepository.Params(); prmRepository.ContextsIncluded.Add(repositoryContext); SbmcRepository repository = controlInstanceMgr.GetRepository(prmRepository); - disposables.Add(repository); // Retrieve Repository Owner. SbmcOwner owner = controlInstanceMgr.GetOwnerById(repository?.OwnerId); - disposables.Add(owner); // Validate configuration. if (repository != null && owner != null) diff --git a/SaBusinessMgrCoreWebPortal/Portal/Components/SbmController_Portal-Security.cs b/SaBusinessMgrCoreWebPortal/Portal/Components/SbmController_Portal-Security.cs index 4eb274e..8f6ab4a 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Components/SbmController_Portal-Security.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Components/SbmController_Portal-Security.cs @@ -212,35 +212,34 @@ namespace Sarand.BusinessMgr.Web.Portal.Components SbmSessionData_Portal sessionDataForUser = new SbmSessionData_Portal(sessionContext, keepLoggedInParams.RepositoryContext, null, null, null, null); using (SbmInternals internalsForUser = new SbmInternals(sessionDataForUser)) { - using (SaSecurityItem securityItemUser = internalsForUser.SecurityConsole.GetUserByEmail(keepLoggedInParams.EmailAddress)) - using (SbmAffiliate affiliateUser = internalsForUser.AccountMgr.GetAffiliateById(keepLoggedInParams.AffiliateIdUser)) - using (SbmAssociation associationOrganisation = internalsForUser.AccountMgr.GetAssociationById(keepLoggedInParams.AssociationIdOrganisation)) - using (SbmAffiliate affiliateOrganisation = internalsForUser.AccountMgr.GetAffiliateById(associationOrganisation?.AffiliateIdOwner ?? null)) + SaSecurityItem securityItemUser = internalsForUser.SecurityConsole.GetUserByEmail(keepLoggedInParams.EmailAddress); + SbmAffiliate affiliateUser = internalsForUser.AccountMgr.GetAffiliateById(keepLoggedInParams.AffiliateIdUser); + SbmAssociation associationOrganisation = internalsForUser.AccountMgr.GetAssociationById(keepLoggedInParams.AssociationIdOrganisation); + SbmAffiliate affiliateOrganisation = internalsForUser.AccountMgr.GetAffiliateById(associationOrganisation?.AffiliateIdOwner ?? null); + + if (securityItemUser != null && affiliateUser != null && associationOrganisation != null && affiliateOrganisation != null) { - if (securityItemUser != null && affiliateUser != null && associationOrganisation != null && affiliateOrganisation != null) + if (securityItemUser.Id.Equals(keepLoggedInParams.SecurityItemId) && affiliateUser.UserId.Equals(securityItemUser.Id)) { - if (securityItemUser.Id.Equals(keepLoggedInParams.SecurityItemId) && affiliateUser.UserId.Equals(securityItemUser.Id)) + if (affiliateUser.IsStatusCurrent) { - if (affiliateUser.IsStatusCurrent) + // Bring the Session Data up to date with the session properties. + sessionDataForUser.Refresh(securityItemUser, affiliateUser, associationOrganisation, affiliateOrganisation); + string errorMessage = ""; + if (SignUserIn(sessionDataForUser, internalsForUser, securityItemUser, affiliateUser, associationOrganisation, affiliateOrganisation, true, ref errorMessage)) { - // Bring the Session Data up to date with the session properties. - sessionDataForUser.Refresh(securityItemUser, affiliateUser, associationOrganisation, affiliateOrganisation); - string errorMessage = ""; - if (SignUserIn(sessionDataForUser, internalsForUser, securityItemUser, affiliateUser, associationOrganisation, affiliateOrganisation, true, ref errorMessage)) - { - // User auto-login successful. - SaLogger.Info(logPrefix + " 'Keep Logged In' cookie found." + logSuffix); - return true; - } - else SaLogger.Warn(logPrefix + "failed to sign user in: " + errorMessage + "." + logSuffix); + // User auto-login successful. + SaLogger.Info(logPrefix + " 'Keep Logged In' cookie found." + logSuffix); + return true; } - else SaLogger.Warn(logPrefix + "Affiliate is not active." + logSuffix); + else SaLogger.Warn(logPrefix + "failed to sign user in: " + errorMessage + "." + logSuffix); } - else SaLogger.Warn(logPrefix + "Security Item and Affiliate are inconsistent. " + logSuffix); + else SaLogger.Warn(logPrefix + "Affiliate is not active." + logSuffix); } - else if (!demoContext) - SaLogger.Warn(logPrefix + "Security Item or Affiliate not found. " + logSuffix); + else SaLogger.Warn(logPrefix + "Security Item and Affiliate are inconsistent. " + logSuffix); } + else if (!demoContext) + SaLogger.Warn(logPrefix + "Security Item or Affiliate not found. " + logSuffix); } } else SaLogger.Warn($"{SysUtil.Fn} Keep Logged In cookie found but no matching session contexts found." + logSuffix); diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Addresses/AddressController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Addresses/AddressController-Ajax.cs index e79543d..79f35b5 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Addresses/AddressController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Addresses/AddressController-Ajax.cs @@ -337,7 +337,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Addresses RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -347,7 +347,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Addresses // Retrieve item. SbmAddress address = AccountMgr.GetAddressById(addressId); - disposables.Add(address); if (address == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve address for Id: '{model.Address.Id}'"); @@ -398,12 +397,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Addresses } // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve existing item. SbmAddress address = AccountMgr.GetAddressById(addressId); - disposables.Add(address); if (address == null && SysId.IsValid(addressId)) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve address for Id: '{model.Address.Id}'"); @@ -430,7 +428,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Addresses if (address == null) { address = AccountMgr.CreateAddress((Sbm.ItemType)addressItemId.Type, addressItemId.Id, model.GetAddressType()); - disposables.Add(address); } // Populate item properties. @@ -536,7 +533,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Addresses RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -546,7 +543,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Addresses // Retrieve item. SbmAddress address = AccountMgr.GetAddressById(addressId); - disposables.Add(address); if (address == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve address for Id: '{model.Address.Id}'"); diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Assets/AssetCategoryController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Assets/AssetCategoryController-Ajax.cs index 4c04bee..202097a 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Assets/AssetCategoryController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Assets/AssetCategoryController-Ajax.cs @@ -261,7 +261,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Assets RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -271,7 +271,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Assets // Retrieve item. SbmAssetCategory assetCategory = AssetMgr.GetAssetCategoryById(assetCategoryId); - disposables.Add(assetCategory); if (assetCategory == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve assetCategory for Id: '" + assetCategoryId + "'"); @@ -321,12 +320,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Assets return Json(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve existing item. SbmAssetCategory assetCategory = AssetMgr.GetAssetCategoryById(assetCategoryId); - disposables.Add(assetCategory); if (assetCategory == null && SysId.IsValid(assetCategoryId)) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Asset Category for Id: '" + model.AssetCategory.Id + "'"); @@ -343,7 +341,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Assets return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"])); } assetCategory = AssetMgr.CreateAssetCategory(model.AssetCategory.AssetType); - disposables.Add(assetCategory); } // Populate item properties. diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Assets/AssetController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Assets/AssetController-Ajax.cs index e421073..27999d1 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Assets/AssetController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Assets/AssetController-Ajax.cs @@ -256,7 +256,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Assets RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -266,7 +266,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Assets // Retrieve item. SbmAsset asset = AssetMgr.GetAssetById(assetId); - disposables.Add(asset); if (asset == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve asset for Id: '" + assetId + "'"); @@ -275,7 +274,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Assets // Retrieve category. SbmAssetCategory assetCategory = AssetMgr.GetAssetCategoryById(asset.AssetCategoryId); - disposables.Add(assetCategory); if (assetCategory == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve asset category for Id: '" + asset.AssetCategoryId + "'"); @@ -325,12 +323,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Assets return Json(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve existing item. SbmAsset asset = AssetMgr.GetAssetById(assetId); - disposables.Add(asset); if (asset == null && SysId.IsValid(assetId)) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Asset for Id: '" + model.Asset.Id + "'"); @@ -342,7 +339,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Assets if (asset != null) { assetCategory = AssetMgr.GetAssetCategoryById(asset.AssetCategoryId); - disposables.Add(assetCategory); if (assetCategory == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Asset Category for existing Asset. Id: '" + asset.AssetCategoryId + "'"); @@ -352,7 +348,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Assets else { assetCategory = AssetMgr.GetAssetCategoryById(SysId.ToSysId(model.Asset.CategoryId)); - disposables.Add(assetCategory); if (assetCategory == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Asset Category for new Asset. Id: '" + model.Asset.CategoryId + "'"); diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Codes/CodeController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Codes/CodeController-Ajax.cs index 7184b8b..5aec8a3 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Codes/CodeController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Codes/CodeController-Ajax.cs @@ -180,7 +180,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Codes RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -190,7 +190,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Codes // Retrieve item. SaCode code = CodeTypeConsole.GetCodeById(codeId); - disposables.Add(code); if (code == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve code for Id: '" + codeId + "'"); @@ -199,7 +198,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Codes // Retrieve code type. SaCodeType codeType = CodeTypeConsole.GetCodeTypeById(code.CodeTypeId); - disposables.Add(codeType); if (codeType == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve code type for Id: '" + code.CodeTypeId + "'"); @@ -248,12 +246,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Codes return Json(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve existing item. SaCode code = CodeTypeConsole.GetCodeById(codeId); - disposables.Add(code); if (code == null && SysId.IsValid(codeId)) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Code Type for Id: '" + model.Code.Id + "'"); @@ -265,7 +262,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Codes if (code != null) { codeType = CodeTypeConsole.GetCodeTypeById(code.CodeTypeId); - disposables.Add(codeType); if (codeType == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Code Type for existing Code. Id: '" + code.CodeTypeId + "'"); @@ -275,7 +271,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Codes else { codeType = CodeTypeConsole.GetCodeTypeByCode(model.Code.CodeTypeCode); - disposables.Add(codeType); if (codeType == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Code Type for new Code. Code: '" + model.Code.CodeTypeCode + "'"); diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Codes/CodeTypeController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Codes/CodeTypeController-Ajax.cs index e5f1ca9..5d4514b 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Codes/CodeTypeController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Codes/CodeTypeController-Ajax.cs @@ -204,7 +204,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Codes RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -214,7 +214,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Codes // Retrieve item. SaCodeType codeType = CodeTypeConsole.GetCodeTypeById(codeTypeId); - disposables.Add(codeType); if (codeType == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Code Type for Id: {codeTypeId}."); @@ -263,12 +262,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Codes return Json(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve existing item. SaCodeType codeType = CodeTypeConsole.GetCodeTypeById(codeTypeId); - disposables.Add(codeType); if (codeType == null && SysId.IsValid(codeTypeId)) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Asset Category for Id: {model.CodeType.Id}."); diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Commodities/CommodityController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Commodities/CommodityController-Ajax.cs index 85c677e..3abc980 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Commodities/CommodityController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Commodities/CommodityController-Ajax.cs @@ -367,7 +367,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -377,7 +377,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities // Retrieve item. SbmCommodity commodity = CommodityMgr.GetCommodityById(commodityId); - disposables.Add(commodity); if (commodity == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve commodity for Id: '{model.Commodity.Id}'"); @@ -428,12 +427,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities } // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve existing item. SbmCommodity commodity = CommodityMgr.GetCommodityById(commodityId); - disposables.Add(commodity); if (commodity == null && SysId.IsValid(commodityId)) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve commodity for Id: '{model.Commodity.Id}'"); @@ -444,7 +442,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities if (commodity == null) { commodity = CommodityMgr.CreateCommodity(model.GetCommodityType(), model.Commodity.Code); - disposables.Add(commodity); } // Populate item properties. diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Contacts/AssociationController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Contacts/AssociationController-Ajax.cs index 667431e..5bdf9f8 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Contacts/AssociationController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Contacts/AssociationController-Ajax.cs @@ -61,11 +61,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Contacts else { // Retrieve owner contact details. - using (SbmAffiliate affiliateOwner = AccountMgr.GetAffiliateById(association.AffiliateIdOwner)) - { - if (affiliateOwner != null) - data.Field.Value.Add($"{Model_Association.ItemField.Owner}", affiliateOwner.GetDisplayName()); - } + SbmAffiliate affiliateOwner = AccountMgr.GetAffiliateById(association.AffiliateIdOwner); + if (affiliateOwner != null) + data.Field.Value.Add($"{Model_Association.ItemField.Owner}", affiliateOwner.GetDisplayName()); } data.Field.Value.Add($"{Model_Association.ItemField.Target}", affiliateTarget.GetDisplayName()); data.Field.Value.Add($"{Model_Association.ItemField.ReferenceExt}", association.RefExt); @@ -301,7 +299,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Contacts RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -311,7 +309,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Contacts // Retrieve item. SbmAssociation association = AccountMgr.GetAssociationById(associationId); - disposables.Add(association); if (association == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve association for Id: '" + model.Association.Id + "'"); @@ -319,7 +316,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Contacts } SbmAffiliate affiliateTarget = AccountMgr.GetAffiliateById(association.AffiliateIdTarget); - disposables.Add(affiliateTarget); // Construct response. model.PopulateItemConfig(responseData.Config, association, affiliateTarget); @@ -354,7 +350,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Contacts return Json(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Validate item Id against 'Exists' flag. @@ -373,7 +369,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Contacts // Retrieve existing item. SbmAssociation association = AccountMgr.GetAssociationById(associationId); - disposables.Add(association); if (association == null && SysId.IsValid(associationId)) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve association for Id: '" + model.Association.Id + "'"); @@ -391,7 +386,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Contacts } // New item. association = AccountMgr.CreateAssociation(SessionData_Portal.Organisation.AffiliateId, associationType, SysId.ToSysId(model.Association.TargetId)); - disposables.Add(association); } // Populate item properties. @@ -498,7 +492,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Contacts } SbmAffiliate affiliateTarget = AccountMgr.GetAffiliateById(association.AffiliateIdTarget); - disposables.Add(affiliateTarget); // Construct response. model.PopulateItemConfig(responseData.Config, association, affiliateTarget); diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Home/DemoController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Home/DemoController-Ajax.cs index 9aef667..0cb0298 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Home/DemoController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Home/DemoController-Ajax.cs @@ -127,7 +127,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Home if (responseData.HasControlErrors()) return Json(responseData); - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { //--------------------------------------------------------------- diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Security/SecurityController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Security/SecurityController-Ajax.cs index e7c91ee..d75f378 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Security/SecurityController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Security/SecurityController-Ajax.cs @@ -95,7 +95,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security // User's security item. SaSecurityItem securityItemUser = GetSecurityItemForSignin(sessionDataForUser, internalsForUser.SecurityConsole, model); - disposables.Add(securityItemUser); if (securityItemUser == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Security Item. Database: {busMgrDatabase.DatabaseName}. Email: {model.EmailAddress}."); @@ -109,7 +108,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security // User's affiliate. SbmAffiliate affiliateUser = GetAffiliateForSignin(internalsForUser.AccountMgr, model, securityItemUser); - disposables.Add(affiliateUser); if (affiliateUser == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Affiliate for signin. Database: {busMgrDatabase.DatabaseName}. UserId: {SysId.ToString(securityItemUser.Id)}."); @@ -121,7 +119,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security // User's organisation association. SbmAssociation associationOrganisation = GetOrganisationAssociationForSignIn(internalsForUser, model, sessionDataForUser); - disposables.Add(associationOrganisation); if (associationOrganisation == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to identify Organisation Association. Database: {busMgrDatabase.DatabaseName}. Email: {model.EmailAddress}."); @@ -130,7 +127,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security // User's organisation affiliate. SbmAffiliate affiliateOrganisation = internalsForUser.AccountMgr.GetAffiliateById(associationOrganisation?.AffiliateIdOwner ?? null); - disposables.Add(affiliateOrganisation); if (affiliateOrganisation == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Affiliate for organisation. Database: {busMgrDatabase.DatabaseName}. Id: " + SysId.ToString(associationOrganisation?.Id ?? null)); @@ -167,7 +163,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security if (!securityConsoleForUser.UpdateSecurityItem(securityItemUser, userContext.DbUpdateInfo)) SaLogger.Warn($"{SysUtil.Fn} Failed to store invalid sign-in attempt against User: {model.EmailAddress}. {AccountMgr.ErrorStateMessage}", true); SaLogger.Warn($"{SysUtil.Fn} Attempt to sign-in to User {model.EmailAddress} with invalid password. Attempt: {securityItemUser.InvalidLoginCount}.", true); - securityItemUser.Dispose(); securityItemUser = null; return null; } @@ -193,7 +188,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security if (affiliate.Status != SaStatus.Current) { SaLogger.Warn($"{SysUtil.Fn} Invalid Affiliate status for User Id: {SysId.ToString(securityItemUser.Id)}. Email: {model.EmailAddress}. Found: {affiliate.Status.ToString()}. Expected: Current.", true); - affiliate.Dispose(); affiliate = null; return null; } @@ -395,9 +389,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security else { SaLogger.Warn($"{SysUtil.Fn} 'Request Password' parameters supplied but invalid. Email: {storePasswordParams.EmailAddress}. SecurityItemId: {SysId.ToString(storePasswordParams.SecurityItemId)}. AffiliateId: {SysId.ToString(storePasswordParams.AffiliateId)}."); - if (securityItemUser != null) securityItemUser.Dispose(); securityItemUser = null; - if (affiliateUser != null) affiliateUser.Dispose(); affiliateUser = null; - if (internalsForUser != null) internalsForUser.Dispose(); internalsForUser = null; + securityItemUser = null; + affiliateUser = null; + internalsForUser = null; } } } @@ -409,21 +403,15 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security // User specific Internals if Request Password params supplied, otherwise use Session Internals for current User Session. SbmInternals internalsForStorePassword = internalsForUser ?? Internals; - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { - disposables.Add(internalsForUser); - disposables.Add(securityItemUser); - disposables.Add(affiliateUser); - // Retrieve user details if not previously populated. if (securityItemUser == null && SessionData_Portal != null) securityItemUser = internalsForStorePassword.SecurityConsole.GetSecurityItemById(SaSecurity.ItemType.User, SessionData_Portal.User.SecurityItemId); - disposables.Add(securityItemUser); if (securityItemUser == null) return Json(responseData.SetControlError(nameof(model.Password), "System error - failed to retrieve security item details.")); if (affiliateUser == null && SessionData_Portal != null) affiliateUser = internalsForStorePassword.AccountMgr.GetAffiliateById(SessionData_Portal.User.AffiliateId); - disposables.Add(affiliateUser); if (affiliateUser == null) return Json(responseData.SetControlError(nameof(model.Password), "System error - failed to retrieve affiliate details.")); @@ -505,33 +493,31 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security // Get user security item and affiliate. using (SbmInternals internalsForUser = new SbmInternals(sessionDataForUser)) - using (SaSecurityItem securityItemUser = internalsForUser.SecurityConsole.GetUserByEmail(model.EmailAddress)) { + SaSecurityItem securityItemUser = internalsForUser.SecurityConsole.GetUserByEmail(model.EmailAddress); if (securityItemUser != null) { - using (SbmAffiliate affiliateUser = internalsForUser.AccountMgr.GetAffiliateByUserId(securityItemUser.Id)) + SbmAffiliate affiliateUser = internalsForUser.AccountMgr.GetAffiliateByUserId(securityItemUser.Id); + if (affiliateUser != null) { - if (affiliateUser != null) + sessionDataForUser.Refresh(securityItemUser, affiliateUser, null, null); + if (affiliateUser.Status == SaStatus.Current || affiliateUser.IsStatusActive) { - sessionDataForUser.Refresh(securityItemUser, affiliateUser, null, null); - if (affiliateUser.Status == SaStatus.Current || affiliateUser.IsStatusActive) - { - SbmEmailConsole emailConsole = internalsForUser.EmailConsole; + SbmEmailConsole emailConsole = internalsForUser.EmailConsole; - // Send password request email. - SaEmailData emailData = new SaEmailData(); - emailData.Config = App.EmailConfig; - emailData.AddressesTo.Add(model.EmailAddress); - emailData.Subject = $"BusinessMgr - {Localiser["caption.request.password"]}"; - PopulateRequestPasswordEmailBody(emailConsole, sessionDataForUser, emailData, securityItemUser, affiliateUser); - if (emailConsole.SendEmail(emailData)) - SaLogger.Info($"{SysUtil.Fn} Password request email sent to {model.EmailAddress}.", true); - else SaLogger.Warn($"{SysUtil.Fn} Failed to send password request email to {model.EmailAddress}."); - } - else SaLogger.Warn($"{SysUtil.Fn} Unable to send password request email to {model.EmailAddress} - affiliate is not active"); + // Send password request email. + SaEmailData emailData = new SaEmailData(); + emailData.Config = App.EmailConfig; + emailData.AddressesTo.Add(model.EmailAddress); + emailData.Subject = $"BusinessMgr - {Localiser["caption.request.password"]}"; + PopulateRequestPasswordEmailBody(emailConsole, sessionDataForUser, emailData, securityItemUser, affiliateUser); + if (emailConsole.SendEmail(emailData)) + SaLogger.Info($"{SysUtil.Fn} Password request email sent to {model.EmailAddress}.", true); + else SaLogger.Warn($"{SysUtil.Fn} Failed to send password request email to {model.EmailAddress}."); } - else SaLogger.Warn($"{SysUtil.Fn} Unable to send password request email to {model.EmailAddress} - affiliate does not exist. UserId: {SysId.ToString(securityItemUser.Id)}."); + else SaLogger.Warn($"{SysUtil.Fn} Unable to send password request email to {model.EmailAddress} - affiliate is not active"); } + else SaLogger.Warn($"{SysUtil.Fn} Unable to send password request email to {model.EmailAddress} - affiliate does not exist. UserId: {SysId.ToString(securityItemUser.Id)}."); } else SaLogger.Warn($"{SysUtil.Fn} Unable to send password request email to {model.EmailAddress} - security item does not exist."); } diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Security/SecurityController.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Security/SecurityController.cs index 12ff7a1..6efd8b8 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Security/SecurityController.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Security/SecurityController.cs @@ -101,29 +101,27 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Security SbmSessionData_Portal sessionDataForUser = new SbmSessionData_Portal(sessionContext, changePasswordParams.RepositoryContext, null, null, null, null); using (SbmInternals internalsForUser = new SbmInternals(sessionDataForUser)) { - using (SaSecurityItem securityItemUser = internalsForUser.SecurityConsole.GetUserByEmail(changePasswordParams.EmailAddress)) - using (SbmAffiliate affiliateUser = internalsForUser.AccountMgr.GetAffiliateById(changePasswordParams.AffiliateId)) + SaSecurityItem securityItemUser = internalsForUser.SecurityConsole.GetUserByEmail(changePasswordParams.EmailAddress); + SbmAffiliate affiliateUser = internalsForUser.AccountMgr.GetAffiliateById(changePasswordParams.AffiliateId); + sessionDataForUser.Refresh(securityItemUser, affiliateUser, null, null); + if (securityItemUser != null && affiliateUser != null) { - sessionDataForUser.Refresh(securityItemUser, affiliateUser, null, null); - if (securityItemUser != null && affiliateUser != null) + if (securityItemUser.Id.Equals(changePasswordParams.SecurityItemId) && affiliateUser.UserId.Equals(securityItemUser.Id)) { - if (securityItemUser.Id.Equals(changePasswordParams.SecurityItemId) && affiliateUser.UserId.Equals(securityItemUser.Id)) + if (affiliateUser.IsStatusCurrent) { - if (affiliateUser.IsStatusCurrent) + if (changePasswordParams.IsValid(securityItemUser, affiliateUser)) { - if (changePasswordParams.IsValid(securityItemUser, affiliateUser)) - { - model.rpe = encryptedParams; - validSessionRequired = false; - } - else SaLogger.Warn(logPrefix + "Security Item and Affiliate are incompatible with parameters. " + logSuffix); + model.rpe = encryptedParams; + validSessionRequired = false; } - else SaLogger.Warn(logPrefix + "Affiliate is not active. " + logSuffix); + else SaLogger.Warn(logPrefix + "Security Item and Affiliate are incompatible with parameters. " + logSuffix); } - else SaLogger.Warn(logPrefix + "Security Item and Affiliate are inconsistent. " + logSuffix); + else SaLogger.Warn(logPrefix + "Affiliate is not active. " + logSuffix); } - else SaLogger.Warn(logPrefix + "Security Item or Affiliate not found. " + logSuffix); + else SaLogger.Warn(logPrefix + "Security Item and Affiliate are inconsistent. " + logSuffix); } + else SaLogger.Warn(logPrefix + "Security Item or Affiliate not found. " + logSuffix); } } } diff --git a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Vehicles/VehicleClassController-Ajax.cs b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Vehicles/VehicleClassController-Ajax.cs index a11139e..20f4e6e 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Controllers/Vehicles/VehicleClassController-Ajax.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Controllers/Vehicles/VehicleClassController-Ajax.cs @@ -170,7 +170,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Vehicles RefreshModel(model); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Identify item. @@ -180,7 +180,6 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Vehicles // Retrieve item. SbmVehicleClass vehicleClass = AssetMgr.GetVehicleClassById(vehicleClassId); - disposables.Add(vehicleClass); if (vehicleClass == null) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve vehicleClass for Id: '" + vehicleClassId + "'"); @@ -229,12 +228,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Vehicles return Json(responseData); // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Retrieve existing item. SbmVehicleClass vehicleClass = AssetMgr.GetVehicleClassById(vehicleClassId); - disposables.Add(vehicleClass); if (vehicleClass == null && SysId.IsValid(vehicleClassId)) { SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Vehicle Class for Id: '" + model.VehicleClass.Id + "'"); diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Assets/Model_Asset.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Assets/Model_Asset.cs index a260baa..9e0d35f 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Models/Assets/Model_Asset.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Assets/Model_Asset.cs @@ -76,7 +76,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Assets public bool ValidateAssetData(SbmController_Base.AjaxResponse_Data responseData) { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Asset Category. diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Assets/Model_AssetCategory.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Assets/Model_AssetCategory.cs index f291f28..d2ad1ae 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Models/Assets/Model_AssetCategory.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Assets/Model_AssetCategory.cs @@ -78,7 +78,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Assets public bool ValidateAssetCategoryData(SbmController_Base.AjaxResponse_Data responseData) { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // AssetCategory type. diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Codes/Model_Code.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Codes/Model_Code.cs index 6004359..d3385b0 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Models/Codes/Model_Code.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Codes/Model_Code.cs @@ -76,7 +76,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Codes public bool ValidateCodeData(SbmController_Base.AjaxResponse_Data responseData) { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Code Type. diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Codes/Model_CodeType.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Codes/Model_CodeType.cs index 49e7e91..298d33d 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Models/Codes/Model_CodeType.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Codes/Model_CodeType.cs @@ -61,7 +61,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Codes public bool ValidateCodeTypeData(SbmController_Base.AjaxResponse_Data responseData) { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Code. diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Commodities/Model_Commodity.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Commodities/Model_Commodity.cs index d60b2cb..d414ec5 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Models/Commodities/Model_Commodity.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Commodities/Model_Commodity.cs @@ -219,83 +219,78 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities if (!responseData.HasControlErrors()) { - using (DisposableCollection disposables = new DisposableCollection()) + // Retrieve existing commodity. + SbmCommodity commodity = null; + if (StringUtil.ToBool(Commodity.Exists) && SysId.IsValid(SysId.ToSysId(Commodity.Id))) { - // Retrieve existing commodity. - SbmCommodity commodity = null; - if (StringUtil.ToBool(Commodity.Exists) && SysId.IsValid(SysId.ToSysId(Commodity.Id))) - { - commodity = CommodityMgr.GetCommodityById(SysId.ToSysId(Commodity.Id)); - disposables.Add(commodity); - if (commodity == null) - responseData.SetMessage(Localiser["label.commodity"], Localiser["msg.something.gone.wrong"]); - } + commodity = CommodityMgr.GetCommodityById(SysId.ToSysId(Commodity.Id)); + if (commodity == null) + responseData.SetMessage(Localiser["label.commodity"], Localiser["msg.something.gone.wrong"]); + } - if (!responseData.HasControlErrors()) + if (!responseData.HasControlErrors()) + { + // Validate status. + String controlName = "CommodityStatusCode"; + if (GetCommodityStatus() == SaStatus.Current) { - // Validate status. - String controlName = "CommodityStatusCode"; - if (GetCommodityStatus() == SaStatus.Current) + // Check that no other current commodity exists with this code. + SbmCommodity.Params prmCommodity = new SbmCommodity.Params(); + // Ignore this commodity if it already exists. + if (StringUtil.ToBool(Commodity.Exists) && SysId.IsValid(SysId.ToSysId(Commodity.Id))) + prmCommodity.IdsExcluded.Add(SysId.ToSysId(Commodity.Id)); + // Ignore the commodity being superseded, if any. + if (SysId.IsValid(SysId.ToSysId(Commodity.IdSupersede))) + prmCommodity.IdsExcluded.Add(SysId.ToSysId(Commodity.IdSupersede)); + // Same code and issue. + prmCommodity.CodeFull = Commodity.Code; + prmCommodity.DrawingIssueFull = Commodity.DrawingIssue; + // Restrict to same customer. + prmCommodity.AssociationIdCustomer = Commodity.AssocIdCustomer != null ? SysId.ToSysId(Commodity.AssocIdCustomer) : commodity?.AssociationIdCustomer; + prmCommodity.StatusCat = SbmCommodity.StatusCat.Current; + List commodities = CommodityMgr.GetCommodityList(prmCommodity); + foreach (SbmCommodity commodityByCode in commodities) { - // Check that no other current commodity exists with this code. + responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]); + String msg = $"Another current Commodity already exists with this code: {Commodity.Code}."; + if (SysId.IsValid(commodityByCode.AssociationIdCustomer)) + msg += $" Customer: {AccountMgr.GetAssociationTargetName(commodityByCode.AssociationIdCustomer)}."; + else + msg += $" Customer: None."; + if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_DrawingIssue)) + msg += $" Issue: {Commodity.DrawingIssue}."; + else + msg += $" Issue: None."; + SaLogger.Warn($"{SysUtil.Fn} {msg}"); + responseData.SetControlError(GetFieldName(Model_Commodity.ItemField.Code), Localiser["msg.validation.duplicate.value"]); + break; + } + } + else if (GetCommodityStatus() == SaStatus.Superseded) + { + // Has the status already been confirmed. + if (!StringUtil.ToBool(Commodity.SupersededStatusConfirmed)) + { + // Check that a current commodity exists with this code. SbmCommodity.Params prmCommodity = new SbmCommodity.Params(); // Ignore this commodity if it already exists. if (StringUtil.ToBool(Commodity.Exists) && SysId.IsValid(SysId.ToSysId(Commodity.Id))) prmCommodity.IdsExcluded.Add(SysId.ToSysId(Commodity.Id)); - // Ignore the commodity being superseded, if any. - if (SysId.IsValid(SysId.ToSysId(Commodity.IdSupersede))) - prmCommodity.IdsExcluded.Add(SysId.ToSysId(Commodity.IdSupersede)); - // Same code and issue. + // Same code. prmCommodity.CodeFull = Commodity.Code; - prmCommodity.DrawingIssueFull = Commodity.DrawingIssue; - // Restrict to same customer. - prmCommodity.AssociationIdCustomer = Commodity.AssocIdCustomer != null ? SysId.ToSysId(Commodity.AssocIdCustomer) : commodity?.AssociationIdCustomer; prmCommodity.StatusCat = SbmCommodity.StatusCat.Current; - List commodities = CommodityMgr.GetCommodityList(prmCommodity); - disposables.AddRange(commodities); - foreach (SbmCommodity commodityByCode in commodities) + if (CommodityMgr.GetCommodityCount(prmCommodity) > 0) { - responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]); - String msg = $"Another current Commodity already exists with this code: {Commodity.Code}."; - if (SysId.IsValid(commodityByCode.AssociationIdCustomer)) - msg += $" Customer: {AccountMgr.GetAssociationTargetName(commodityByCode.AssociationIdCustomer)}."; - else - msg += $" Customer: None."; - if (SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_DrawingIssue)) - msg += $" Issue: {Commodity.DrawingIssue}."; - else - msg += $" Issue: None."; - SaLogger.Warn($"{SysUtil.Fn} {msg}"); - responseData.SetControlError(GetFieldName(Model_Commodity.ItemField.Code), Localiser["msg.validation.duplicate.value"]); - break; + String msg = "There are no other Commodities for this code\nwith a status of 'Current'.\n\nAre you sure that this commodity should be set to 'Superseded'?"; + responseData.SetConfirmMessage(Localiser["label.commodity"], msg); } } - else if (GetCommodityStatus() == SaStatus.Superseded) - { - // Has the status already been confirmed. - if (!StringUtil.ToBool(Commodity.SupersededStatusConfirmed)) - { - // Check that a current commodity exists with this code. - SbmCommodity.Params prmCommodity = new SbmCommodity.Params(); - // Ignore this commodity if it already exists. - if (StringUtil.ToBool(Commodity.Exists) && SysId.IsValid(SysId.ToSysId(Commodity.Id))) - prmCommodity.IdsExcluded.Add(SysId.ToSysId(Commodity.Id)); - // Same code. - prmCommodity.CodeFull = Commodity.Code; - prmCommodity.StatusCat = SbmCommodity.StatusCat.Current; - if (CommodityMgr.GetCommodityCount(prmCommodity) > 0) - { - String msg = "There are no other Commodities for this code\nwith a status of 'Current'.\n\nAre you sure that this commodity should be set to 'Superseded'?"; - responseData.SetConfirmMessage(Localiser["label.commodity"], msg); - } - } - } - else if (GetCommodityStatus() == SaStatus.Discontinued) - { - } - else if (GetCommodityStatus() == SaStatus.Deleted) - { - } + } + else if (GetCommodityStatus() == SaStatus.Discontinued) + { + } + else if (GetCommodityStatus() == SaStatus.Deleted) + { } } } diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Vehicles/Model_Vehicle.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Vehicles/Model_Vehicle.cs index e8c100b..1340172 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Models/Vehicles/Model_Vehicle.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Vehicles/Model_Vehicle.cs @@ -82,7 +82,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Vehicles public bool ValidateVehicleData(SbmController_Base.AjaxResponse_Data responseData) { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Vehicle Class. diff --git a/SaBusinessMgrCoreWebPortal/Portal/Models/Vehicles/Model_VehicleClass.cs b/SaBusinessMgrCoreWebPortal/Portal/Models/Vehicles/Model_VehicleClass.cs index 847c4b0..59badf8 100644 --- a/SaBusinessMgrCoreWebPortal/Portal/Models/Vehicles/Model_VehicleClass.cs +++ b/SaBusinessMgrCoreWebPortal/Portal/Models/Vehicles/Model_VehicleClass.cs @@ -69,7 +69,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Vehicles public bool ValidateVehicleClassData(Sacs.Web.Components.SaController.AjaxResponse_Data responseData) { // Record disposable items as they are created so all can be disposed when needed. - using (DisposableCollection disposables = new DisposableCollection()) + using (DisposableCollection disposables = new DisposableCollection()) { // Make. diff --git a/SaBusinessMgrCoreWebPortal/wwwroot/css/sbm-data.css b/SaBusinessMgrCoreWebPortal/wwwroot/css/sbm-data.css index cde022e..e68bedb 100644 --- a/SaBusinessMgrCoreWebPortal/wwwroot/css/sbm-data.css +++ b/SaBusinessMgrCoreWebPortal/wwwroot/css/sbm-data.css @@ -185,9 +185,18 @@ ul.nav.sbm-burger.navbar-dark .dropdown:hover border-color: #c0c0c0; } -ul.nav.sbm-burger .sbm-ellipsis-dot +ul.nav.sbm-burger a .sbm-ellipsis-dot { display: inline-block; + width: 2px; + height: 2px; + margin: 1px 2px 4px 2px; + background-color: #808080; + border-radius: 1px; +} + +ul.nav.sbm-burger a:hover .sbm-ellipsis-dot +{ width: 4px; height: 4px; margin: 0 1px 3px 1px;