From 243c065ebb33cb0d1960746262a6ae9b3d00acc9 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 16 Sep 2014 16:02:32 +0300 Subject: [PATCH] fix issue with "Service Level" DropDownList on UserGeneralSetings page. --- .../WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs | 3 +-- .../ExchangeServer/OrganizationUserGeneralSettings.ascx.cs | 7 ++++++- .../WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs | 3 +-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs index 6473cd61..b3fa7da7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs @@ -204,7 +204,7 @@ namespace WebsitePanel.Portal.ExchangeServer bool enable = !string.IsNullOrEmpty(serviceLevel.LevelName); enable = enable ? cntx.Quotas.ContainsKey(Quotas.SERVICE_LEVELS + serviceLevel.LevelName) : false; - enable = enable ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue > 0 : false; + enable = enable ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue != 0 : false; if (!enable) { @@ -212,7 +212,6 @@ namespace WebsitePanel.Portal.ExchangeServer serviceLevel.LevelDescription = ""; } - //return ServiceLevels.Where(x => x.LevelId == levelId).DefaultIfEmpty(new ServiceLevel { LevelName = "", LevelDescription = "" }).FirstOrDefault(); return serviceLevel; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs index 27a541d6..7fe1cae5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs @@ -134,12 +134,17 @@ namespace WebsitePanel.Portal.HostedSolution addLevel = addLevel && cntx.Quotas.ContainsKey(Quotas.SERVICE_LEVELS + serviceLevel.LevelName); - addLevel = addLevel ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue > 0 : addLevel; + addLevel = addLevel ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue != 0 : addLevel; if (addLevel) { ddlServiceLevels.Items.Add(new ListItem(serviceLevel.LevelName, serviceLevel.LevelId.ToString())); + } + bool levelInDDL = ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()) != null; + + if (levelInDDL) + { ddlServiceLevels.Items.FindByValue(string.Empty).Selected = false; ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()).Selected = true; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs index ffe51701..1d9941bb 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs @@ -317,7 +317,7 @@ namespace WebsitePanel.Portal.HostedSolution bool enable = !string.IsNullOrEmpty(serviceLevel.LevelName); enable = enable ? cntx.Quotas.ContainsKey(Quotas.SERVICE_LEVELS + serviceLevel.LevelName) : false; - enable = enable ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue > 0 : false; + enable = enable ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue != 0 : false; if (!enable) { @@ -325,7 +325,6 @@ namespace WebsitePanel.Portal.HostedSolution serviceLevel.LevelDescription = ""; } - //return ServiceLevels.Where(x => x.LevelId == levelId).DefaultIfEmpty(new ServiceLevel { LevelName = "", LevelDescription = "" }).FirstOrDefault(); return serviceLevel; } }