/// <summary> /// Gets the Roles /// </summary> private void GetRoles() { string roleCategory = ""; //if (Session["SelectedProduct"].ToString() == "-1") //{ // roleCategory = "Portal"; //} //else //{ // roleCategory = "Product"; //} DropDownListRoles.DataSource = DataProvider.GetRoles("", roleCategory); DropDownListRoles.DataTextField = "ROLE_NAME"; DropDownListRoles.DataValueField = "ROLE_ID"; DropDownListRoles.DataBind(); }
/// <summary> /// Gets the Roles /// </summary> private void GetRoles() { string selectedProduct = Session["SelectedProduct"].ToString(); string roleCategory = "Portal"; if (selectedProduct != "-1") { roleCategory = "Product"; } SqlDataReader drRoles = DataProvider.GetRoles(null, roleCategory); DropDownListRoles.DataValueField = "ROLE_ID"; DropDownListRoles.DataTextField = "ROLE_NAME"; DropDownListRoles.DataSource = drRoles; DropDownListRoles.DataBind(); drRoles.Close(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // Populate the roles DropDownListRoles.DataSource = Roles.GetAllRoles(); DropDownListRoles.DataBind(); if (ActionType == Constants.Update) { UpdateAccountPageHeader.Visible = true; SubmitAccountDetails.Text = "Update Account"; DeleteAccount.Visible = true; UsernameTextbox.Enabled = false; if (!string.IsNullOrEmpty(UserName)) { MembershipUser currentUser = Membership.GetUser(UserName); ProfileCommon currentProfile = new ProfileCommon(); currentProfile = Profile.GetProfile(currentUser.UserName); UsernameTextbox.Text = currentUser.UserName; EmailTextbox.Text = currentUser.Email; DropDownListRoles.SelectedValue = Roles.GetRolesForUser(UserName).FirstOrDefault(); IsActive_RadioButton.Checked = currentUser.IsApproved; FirstNameTextbox.Text = currentProfile.FirstName; LastNameTextBox.Text = currentProfile.LastName; ContactTelNoTextBox.Text = currentProfile.Phone; } } else { CreateAccountPageHeader.Visible = true; SubmitAccountDetails.Text = "Create Account"; } } }