Пример #1
0
        private void btnUserEdutAuthen_Click(object sender, RoutedEventArgs e)
        {
            string username   = "";
            string userAuthen = "";
            string userLevel  = "";

            if (gridUserMgr.SelectedItems.Count > 0)
            {
                username  = (gridUserMgr.Columns[1].GetCellContent(gridUserMgr.SelectedItem) as TextBlock).Text;
                userLevel = (gridUserMgr.Columns[2].GetCellContent(gridUserMgr.SelectedItem) as TextBlock).Text;
                if (!DbUser.GetUserAuthen(username, out userAuthen))
                {
                    CpldBase.InfoBox.InfoMsg("读取用户权限错误,请联系管理员");
                    return;
                }

                authenEditHandler            = new AuthenEdit();
                authenEditHandler.Username   = username;
                authenEditHandler.UserLevel  = userLevel;
                authenEditHandler.UserAuthen = userAuthen;
                authenEditHandler.ShowDialog();
            }
            else
            {
                CpldBase.InfoBox.InfoMsg("请选择需要修改权限的用户");
            }
        }