/// <summary> /// 修改 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button2_Click(object sender, EventArgs e) { if (this.dataGridView1.SelectedRows.Count < 1) { MessageBox.Show("未选中任何行!"); return; } int row = dataGridView1.CurrentRow.Index; string code = dataGridView1["archive_no", row].Value.ToString(); string idnum = dataGridView1["id_number", row].Value.ToString(); string examid = dataGridView1["exam_id", row].Value.ToString(); string barcode = dataGridView1["bar_code", row].Value.ToString(); DataTable dtcode = null; if (examid == "") { dtcode = tcmHealthService.checkTcmHealthServicesByno1(code, idnum, barcode); } else { dtcode = tcmHealthService.checkTcmHealthServicesByExamID(examid); } if (dtcode.Rows.Count > 0) { addtcmHealthServices addtcm = new addtcmHealthServices(0, dataGridView1["name", row].Value.ToString(), dataGridView1["archive_no", row].Value.ToString(), dataGridView1["id_number", row].Value.ToString(), examid); addtcm.bar_code = barcode; addtcm.exam_id = examid; addtcm.StartPosition = FormStartPosition.CenterScreen; addtcm.ShowDialog(); querytcmHealthServices(); } else { MessageBox.Show("没有修改数据!"); } }
//添加 修改 高血压随访记录历史表 调此方法 private void button1_Click(object sender, EventArgs e) { if (this.dataGridView1.SelectedRows.Count < 1) { MessageBox.Show("未选中任何行!"); return; } int row = dataGridView1.CurrentRow.Index; string code = dataGridView1["archive_no", row].Value.ToString(); string idnum = dataGridView1["id_number", row].Value.ToString(); string examid = dataGridView1["exam_id", row].Value.ToString(); string barcode = dataGridView1["bar_code", row].Value.ToString(); DataTable dtcode = null; if (examid == "") { dtcode = tcmHealthService.checkTcmHealthServicesByno1(code, idnum, barcode); if (examid == "") { healthCheckupDao hd = new healthCheckupDao(); //获取exam_id examid = hd.GetExaminationRecord(code, idnum, barcode); } } else { dtcode = tcmHealthService.checkTcmHealthServicesByExamID(examid); } if (dtcode.Rows.Count > 0) { string _testdate = dtcode.Rows[0]["test_date"].ToString(); string _strDisplay = string.Format("此患者已参加过中医体质服务了,日期为{0} !", _testdate); MessageBox.Show(_strDisplay); return; } addtcmHealthServices addtcm = new addtcmHealthServices(1, dataGridView1["name", row].Value.ToString(), dataGridView1["archive_no", row].Value.ToString(), dataGridView1["id_number", row].Value.ToString(), examid); addtcm.bar_code = barcode; addtcm.exam_id = examid; addtcm.StartPosition = FormStartPosition.CenterScreen; if (addtcm.ShowDialog() == DialogResult.OK) { querytcmHealthServices(); } }