fix issue with "Service Level" DropDownList on UserGeneralSetings page.

This commit is contained in:
vfedosevich 2014-09-16 16:02:32 +03:00
parent 732f827e82
commit 243c065ebb
3 changed files with 8 additions and 5 deletions

View file

@ -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;
}
}

View file

@ -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;
}

View file

@ -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;
}
}