private void UserList_Load(object sender, System.EventArgs e) { this.RoleComboBox.Items.AddRange(RoleProcessor.GetRoles().ToArray()); if (this.RoleComboBox.Items.Count == 0) { this.RoleComboBox.Text = Constants.WarningMessages.NoRoles; } if (user.IsDeleted) { NoRadioButton.Checked = true; } else { YesRadioButton.Checked = true; } UsernameTextBox.Text = user.Username; EmailTextBox.Text = user.Email; PhoneNumberTextBox.Text = user.PhoneNumber; RoleComboBox.Text = user.Role.ToString(); this.PhoneNumberInfoLabel.Visible = false; this.EmailInfoLabel.Visible = false; this.UsernameInfoLabel.Visible = false; }
public bool IsRoleValid(string role) { return(RoleProcessor.GetRoles().Contains(role)); }