Exemplo n.º 1
0
        /// <summary>
        /// 权限变更事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void fixAuthorityPage_UserAuthorityChanged(object sender, UserAuthorityEventArgs e)
        {
            try
            {
                var state = accountManager.UpdateAccountAuthority(accountManager.LoginAccount.UserName,
                                                                  (int)e.Authority);
                if (state)
                {
                    fixAuthorityPage.UpdateShow(accountManager.LoginAccount.UserName,
                                                (Secure.AuthorityLevel)accountManager.LoginAccount.PowerLevel);

                    accountManager.SaveAccountInformation();
                    MessageBox.Show("修改权限成功。", "修改权限");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "修改用户权限");
            }
        }
Exemplo n.º 2
0
 protected virtual void OnAuthorityChanged(UserAuthorityEventArgs e)
 {
     this.AuthorityChanged?.Invoke(this, e);
 }