private void btDelete_Click(object sender, EventArgs e) //删除 { if (dgvPrize.Rows.Count == 0) { MessageBox.Show("没有数据,无法删除", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else if (dgvPrize.CurrentRow.Selected == false) { return; } else { string info = "您确定删除奖品【奖品级别:" + dgvPrize.CurrentRow.Cells[1].Value.ToString() + "】信息吗?"; DialogResult result = MessageBox.Show(info, "系统消息", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { objPrizeService.DeletePrize(dgvPrize.CurrentRow.Cells[0].Value.ToString(), Program.objListPrize); LoadPrizeInfo(Program.objListPrize); lbTotalPrize.Text = objPrizeService.GetPrizeSum(Program.objListPrize); MessageBox.Show("删除成功!", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }