protected List <OrganizationUser> GetAccountsWithoutPhone() { if (GridView == null || String.IsNullOrWhiteSpace(CheckboxesName)) { return(new List <OrganizationUser>()); } // Get checked users var ids = Utils.GetCheckboxValuesFromGrid <int>(GridView, CheckboxesName); var accountsWithoutPhones = new List <OrganizationUser>(); foreach (var id in ids) { var account = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, id); if (string.IsNullOrEmpty(account.MobilePhone)) { accountsWithoutPhones.Add(account); } } return(accountsWithoutPhones); }
protected void FillServiceLevelsList() { if (GridView == null || String.IsNullOrWhiteSpace(CheckboxesName)) { return; } List <int> ids = Utils.GetCheckboxValuesFromGrid <int>(GridView, CheckboxesName); List <OrganizationUser> users = ids.Select(id => ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, id)).ToList(); OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID); PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); if (cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) { List <ServiceLevel> enabledServiceLevels = new List <ServiceLevel>(); foreach (ServiceLevel serviceLevel in ES.Services.Organizations.GetSupportServiceLevels()) { int usersCount = users.Count - users.Count(x => (x.LevelId == serviceLevel.LevelId)); if (CheckServiceLevelQuota(serviceLevel.LevelName, stats.ServiceLevels, usersCount)) { enabledServiceLevels.Add(serviceLevel); } } ddlServiceLevels.DataSource = enabledServiceLevels; ddlServiceLevels.DataTextField = "LevelName"; ddlServiceLevels.DataValueField = "LevelId"; ddlServiceLevels.DataBind(); ddlServiceLevels.Items.Insert(0, new ListItem("<Select Service Level>", string.Empty)); ddlServiceLevels.Items.FindByValue(string.Empty).Selected = true; } }