//修改 private void btn_Modify_Click(object sender, EventArgs e) { if (varID == 0) { MessageBox.Show("请选中要修改的项!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { db_theExamNo theExam = new db_theExamNo(); theExam.ID = varID; theExam.kaochangName = cmbKaochang.Text; theExam.startNum = Convert.ToInt32(txtStart.Text.Trim()); theExam.endNum = Convert.ToInt32(txtEnd.Text.Trim()); theExam.remark = theExam.startNum + "-" + theExam.endNum; if (theExam.Update()) { MessageBox.Show("修改考场成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); //showAll(); //txtKCMC.Text = String.Empty; } else { MessageBox.Show("操作失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }