private void btnDeleteUsers_Click(object sender, EventArgs e) { bool flag = false; if (selectedKeyIDList.Count == 0) { MessageBox.Show("请选择要删除的用户!"); } else { foreach (string userID in selectedKeyIDList) { UserBusinessLogic userBusinessLogic = new UserBusinessLogic(); flag = userBusinessLogic.DeleteUsersById(userID); } if (!flag) { MessageBox.Show("删除失败!"); } else { MessageBox.Show("删除成功!"); } } this.dgvUsers.DataSource = this.usersBindingSource; UserManageForm_Load(sender, e); selectedKeyIDList.Clear(); }