"List of accounts is loaded too slow" issue fixed
This commit is contained in:
parent
383319ee01
commit
991806473b
3 changed files with 39 additions and 34 deletions
|
@ -618,21 +618,23 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
DataProvider.SearchExchangeAccountsByTypes(SecurityContext.User.UserId, itemId,
|
DataProvider.SearchExchangeAccountsByTypes(SecurityContext.User.UserId, itemId,
|
||||||
accountTypes, filterColumn, filterValue, sortColumn));
|
accountTypes, filterColumn, filterValue, sortColumn));
|
||||||
|
|
||||||
|
return tmpAccounts;
|
||||||
|
|
||||||
List<ExchangeAccount> exAccounts = new List<ExchangeAccount>();
|
// on large lists is very slow
|
||||||
|
|
||||||
foreach (ExchangeAccount tmpAccount in tmpAccounts.ToArray())
|
//List<ExchangeAccount> exAccounts = new List<ExchangeAccount>();
|
||||||
{
|
|
||||||
if (tmpAccount.AccountType == ExchangeAccountType.SecurityGroup || tmpAccount.AccountType == ExchangeAccountType.DefaultSecurityGroup
|
|
||||||
? OrganizationController.GetSecurityGroupGeneralSettings(itemId, tmpAccount.AccountId) == null
|
|
||||||
: OrganizationController.GetUserGeneralSettings(itemId, tmpAccount.AccountId) == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
exAccounts.Add(tmpAccount);
|
//foreach (ExchangeAccount tmpAccount in tmpAccounts.ToArray())
|
||||||
}
|
//{
|
||||||
|
// if (tmpAccount.AccountType == ExchangeAccountType.SecurityGroup || tmpAccount.AccountType == ExchangeAccountType.DefaultSecurityGroup
|
||||||
|
// ? OrganizationController.GetSecurityGroupGeneralSettings(itemId, tmpAccount.AccountId) == null
|
||||||
|
// : OrganizationController.GetUserGeneralSettings(itemId, tmpAccount.AccountId) == null)
|
||||||
|
// continue;
|
||||||
|
|
||||||
return exAccounts;
|
// exAccounts.Add(tmpAccount);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//return exAccounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static SystemFilesPaged GetEnterpriseFoldersPagedInternal(int itemId, string filterValue, string sortColumn, int startRow, int maximumRows)
|
protected static SystemFilesPaged GetEnterpriseFoldersPagedInternal(int itemId, string filterValue, string sortColumn, int startRow, int maximumRows)
|
||||||
|
|
|
@ -2843,33 +2843,36 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
DataProvider.SearchExchangeAccountsByTypes(SecurityContext.User.UserId, itemId,
|
DataProvider.SearchExchangeAccountsByTypes(SecurityContext.User.UserId, itemId,
|
||||||
accountTypes, filterColumn, filterValue, sortColumn));
|
accountTypes, filterColumn, filterValue, sortColumn));
|
||||||
|
|
||||||
|
return tmpAccounts;
|
||||||
|
|
||||||
List<ExchangeAccount> accounts = new List<ExchangeAccount>();
|
// on large lists is very slow
|
||||||
|
|
||||||
foreach (ExchangeAccount tmpAccount in tmpAccounts.ToArray())
|
//List<ExchangeAccount> accounts = new List<ExchangeAccount>();
|
||||||
{
|
|
||||||
bool bSuccess = false;
|
|
||||||
|
|
||||||
switch (tmpAccount.AccountType)
|
//foreach (ExchangeAccount tmpAccount in tmpAccounts.ToArray())
|
||||||
{
|
//{
|
||||||
case ExchangeAccountType.SecurityGroup:
|
// bool bSuccess = false;
|
||||||
bSuccess = GetSecurityGroupGeneralSettings(itemId, tmpAccount.AccountId) != null;
|
|
||||||
break;
|
|
||||||
case ExchangeAccountType.DistributionList:
|
|
||||||
bSuccess = ExchangeServerController.GetDistributionListGeneralSettings(itemId, tmpAccount.AccountId) != null;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
bSuccess = GetUserGeneralSettings(itemId, tmpAccount.AccountId) != null;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bSuccess)
|
// switch (tmpAccount.AccountType)
|
||||||
{
|
// {
|
||||||
accounts.Add(tmpAccount);
|
// case ExchangeAccountType.SecurityGroup:
|
||||||
}
|
// bSuccess = GetSecurityGroupGeneralSettings(itemId, tmpAccount.AccountId) != null;
|
||||||
}
|
// break;
|
||||||
|
// case ExchangeAccountType.DistributionList:
|
||||||
|
// bSuccess = ExchangeServerController.GetDistributionListGeneralSettings(itemId, tmpAccount.AccountId) != null;
|
||||||
|
// break;
|
||||||
|
// default:
|
||||||
|
// bSuccess = GetUserGeneralSettings(itemId, tmpAccount.AccountId) != null;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
|
||||||
return accounts;
|
// if (bSuccess)
|
||||||
|
// {
|
||||||
|
// accounts.Add(tmpAccount);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
//return accounts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,14 +300,14 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
enterpriseStorageSpaceStats.QuotaUsedValue = stats.UsedEnterpriseStorageSpace;
|
enterpriseStorageSpaceStats.QuotaUsedValue = stats.UsedEnterpriseStorageSpace;
|
||||||
if (stats.AllocatedEnterpriseStorageSpace != -1) enterpriseStorageSpaceStats.QuotaAvailable = tenantStats.AllocatedEnterpriseStorageSpace - tenantStats.UsedEnterpriseStorageSpace;
|
if (stats.AllocatedEnterpriseStorageSpace != -1) enterpriseStorageSpaceStats.QuotaAvailable = tenantStats.AllocatedEnterpriseStorageSpace - tenantStats.UsedEnterpriseStorageSpace;
|
||||||
|
|
||||||
lnkBESUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "enterprisestorage_folders",
|
lnkEnterpriseStorageSpace.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "enterprisestorage_folders",
|
||||||
"SpaceID=" + PanelSecurity.PackageId.ToString());
|
"SpaceID=" + PanelSecurity.PackageId.ToString());
|
||||||
|
|
||||||
enterpriseStorageFoldersStats.QuotaValue = stats.AllocatedEnterpriseStorageFolders;
|
enterpriseStorageFoldersStats.QuotaValue = stats.AllocatedEnterpriseStorageFolders;
|
||||||
enterpriseStorageFoldersStats.QuotaUsedValue = stats.CreatedEnterpriseStorageFolders;
|
enterpriseStorageFoldersStats.QuotaUsedValue = stats.CreatedEnterpriseStorageFolders;
|
||||||
if (stats.AllocatedEnterpriseStorageFolders != -1) enterpriseStorageFoldersStats.QuotaAvailable = tenantStats.AllocatedEnterpriseStorageFolders - tenantStats.CreatedEnterpriseStorageFolders;
|
if (stats.AllocatedEnterpriseStorageFolders != -1) enterpriseStorageFoldersStats.QuotaAvailable = tenantStats.AllocatedEnterpriseStorageFolders - tenantStats.CreatedEnterpriseStorageFolders;
|
||||||
|
|
||||||
lnkBESUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "enterprisestorage_folders",
|
lnkEnterpriseStorageFolders.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "enterprisestorage_folders",
|
||||||
"SpaceID=" + PanelSecurity.PackageId.ToString());
|
"SpaceID=" + PanelSecurity.PackageId.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue