コード例 #1
0
        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;
        }
コード例 #2
0
ファイル: UserService.cs プロジェクト: Slupov/SoftCinema-WFA
 public bool IsRoleValid(string role)
 {
     return(RoleProcessor.GetRoles().Contains(role));
 }