private void btnSave_Click(object sender, EventArgs e) { HallInfo hi = new HallInfo() { HTitle = txtHTitle.Text }; if (btnSave.Text.Equals("添加")) { if (_hiBll.Add(hi)) { UpdateHallEvent?.Invoke(); LoadList(); } else { MessageBox.Show("添加失败"); } } else if (btnSave.Text.Equals("修改")) { hi.HId = Convert.ToInt32(txtDId.Text); if (_hiBll.Edit(hi)) { UpdateHallEvent?.Invoke(); LoadList(); } else { MessageBox.Show("修改失败"); } } }
private void btnRemove_Click(object sender, EventArgs e) { var row = gv_HallInfoList.SelectedRows; if (row.Count > 0) { if (_hiBll.Remove(Convert.ToInt32(row[0].Cells[0].Value))) { UpdateHallEvent?.Invoke(); LoadList(); } else { MessageBox.Show("删除失败"); } } }