Exemplo n.º 1
0
        private void ribeDeleteUser_Click(object sender, EventArgs e)
        {
            UserVM vm = this.gvUser.GetRow(this.gvUser.FocusedRowHandle) as UserVM;//获取选中行的实体

            if (vm.Account.ToLower() == "admin")
            {
                XtraMessageBox.Show("can not delete user  admin!", "提示", MessageBoxButtons.OK);

                return;
            }



            int resDeleteUsers = _bll.DeleteUsers(vm);

            if (resDeleteUsers > 0)
            {
                XtraMessageBox.Show("删除成功!", "提示", MessageBoxButtons.OK);

                RequestGridData();
            }
            else
            {
                XtraMessageBox.Show("删除失败!", "提示", MessageBoxButtons.OK);
            }
        }