diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ObjectUtils.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ObjectUtils.cs index 4359ca98..eabcbf15 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ObjectUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ObjectUtils.cs @@ -188,6 +188,22 @@ namespace WebsitePanel.EnterpriseServer // get type properties PropertyInfo[] props = GetTypeProperties(type); + // leave only a property from the DataReader + DataTable readerSchema = reader.GetSchemaTable(); + if (readerSchema != null) + { + List propslist = new List(); + foreach (DataRow field in readerSchema.Rows) + { + string columnName = System.Convert.ToString(field["ColumnName"]); + + foreach (PropertyInfo prop in props) + if (columnName.ToLower() == prop.Name.ToLower()) + propslist.Add(prop); + } + props = propslist.ToArray(); + } + // iterate through reader while (reader.Read()) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 7a8f6762..b3a6199a 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -2034,6 +2034,10 @@ namespace WebsitePanel.EnterpriseServer DataProvider.SearchOrganizationAccounts(SecurityContext.User.UserId, itemId, filterColumn, filterValue, sortColumn, includeMailboxes)); + return Tmpaccounts; + + // on large lists is very slow + /* List Accounts = new List(); foreach (OrganizationUser user in Tmpaccounts.ToArray()) @@ -2042,6 +2046,7 @@ namespace WebsitePanel.EnterpriseServer } return Accounts; + */ } public static int GetAccountIdByUserPrincipalName(int itemId, string userPrincipalName) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.cs index 561d897c..655d8c20 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.cs @@ -104,6 +104,10 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls chkIncludeLists.Visible = DistributionListsEnabled; chkIncludeLists.Checked = DistributionListsEnabled; } + + // increase timeout + ScriptManager scriptMngr = ScriptManager.GetCurrent(this.Page); + scriptMngr.AsyncPostBackTimeout = 300; } private void BindSelectedAccount(ExchangeAccount account) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs index da7d0b53..7407ff8f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs @@ -151,7 +151,9 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls protected void Page_Load(object sender, EventArgs e) { - + // increase timeout + ScriptManager scriptMngr = ScriptManager.GetCurrent(this.Page); + scriptMngr.AsyncPostBackTimeout = 300; } private void BindSelectedAccount(OrganizationUser account) @@ -288,6 +290,8 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (e.CommandName == "SelectAccount") { string[] parts = e.CommandArgument.ToString().Split('|'); + + /* OrganizationUser account = new OrganizationUser(); account.AccountName = parts[0]; account.DisplayName = parts[1]; @@ -295,6 +299,11 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls account.AccountId = Utils.ParseInt(parts[3]); account.SamAccountName = parts[4]; account.SubscriberNumber = parts[5]; + */ + + int AccountId = Utils.ParseInt(parts[3]); + + OrganizationUser account = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, AccountId); // set account BindSelectedAccount(account);