private void FillUserProfile() { IUsersProfile mUserProfile = null; try { mUserProfile = AppService.Create <IUsersProfile>(); mUserProfile.AppManager = this.mappmanager; // retrieve List <AccessLevel> AccessLevelList = mUserProfile.SearchAccessLevel("", "Active"); if (AccessLevelList != null) { if (AccessLevelList.Count > 0) { ddlUserProfile.Items.Clear(); ddlUserProfile.DataSource = AccessLevelList; ddlUserProfile.DataTextField = "AccessLevelName"; ddlUserProfile.DataValueField = "Id"; ddlUserProfile.DataBind(); } } ddlUserProfile.Items.Insert(0, new ListItem("-- Select --", "0")); } catch { throw; } }
private List <AccessLevel> SearchAccessLevels() { IUsersProfile service = null; try { //Build the search Entity string Name = txtAccessLevelName.Value.Trim(); string Status = ddlStatus.Items[ddlStatus.SelectedIndex].Value; //create a service service = AppService.Create <IUsersProfile>(); service.AppManager = this.mappmanager; this.divMessage.InnerHtml = ""; //Invoke the service method this.AccessLevelList = service.SearchAccessLevel(Name, Status); if (AccessLevelList != null) { // this.ShowHideValidationMessage(false); this.HideIntialView(true); this.hdrGridHeader.InnerText = cntlist + " (" + AccessLevelList.Count + " " + cntFound + ")"; } } catch (ValidationException ve) { this.DisplayValidationError(ve); this.hdrGridHeader.InnerText = ""; } catch { throw; } finally { if (service != null) { //Dispose the services. service.Dispose(); } } return(AccessLevelList); }