private void btnDelete_Click(object sender, EventArgs e) { Privilege currentPrivilege = this.CurrentPrivilege; if (currentPrivilege != null) { if (MessageBox.Show("确实删除当前权限吗?", "删除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, 0, false) == DialogResult.Yes) { pList.Remove(currentPrivilege); currentPrivilege.Delete(); gridControl1.RefreshDataSource(); MessageBox.Show("删除成功。", "删除提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
public void DeleteExistsUser(string id, string tableName) { Privilege.Delete(id); }