Esempio n. 1
0
        private void ribeDeleteRoleMenu_Click(object sender, EventArgs e)
        {
            RoleMenusVM roleMenusVM = this.gvRoleMenus.GetRow(this.gvRoleMenus.FocusedRowHandle) as RoleMenusVM;//获取选中行的实体

            if (roleMenusVM.RoleName.ToLower() == "admin")
            {
                XtraMessageBox.Show("can not delete role admin!", "提示", MessageBoxButtons.OK);
                return;
            }

            int resDeleteUserRoles = _bll.DeleteRoleMenus(roleMenusVM);

            if (resDeleteUserRoles > 0)
            {
                XtraMessageBox.Show("删除成功!", "提示", MessageBoxButtons.OK);
                RequestRoleMenusData();
                this.slueRoles.EditValue = null;
            }
            else
            {
                XtraMessageBox.Show("删除失败!", "提示", MessageBoxButtons.OK);
            }
        }