/// <summary> /// 先清空所有控件的值 /// </summary> /// <param name="groupPanel"></param> private void ClearGroup(DevComponents.DotNetBar.Controls.GroupPanel groupPanel) { foreach (Control ctr in groupPanel.Controls) { ucOtherDiagnose uc = ctr as ucOtherDiagnose; if (uc != null) { uc.OtherDiagnose = ""; uc.ICD10 = ""; uc.InCondition = ""; } } }
/// <summary> /// 根据被点击的按钮不同来确定要修改病案首页哪些文本框 /// </summary> private void btnSubmit_Click(object sender, EventArgs e) { List <Row> rows = GetMuchRows(); switch (this.btn.Tag.ToString()) { case "门(急)诊诊断": if (rows.Count != 1) { MessageBox.Show("选择错误,必须选择一个诊断且只能选择一个诊断!"); return; } frmCaseFirst.txtEmergencyDiagnose.Text = rows[0][3].ToString(); frmCaseFirst.txtEmergencyCode.Text = rows[0][2].ToString(); if (rows[0][6].ToString() == "Y") { //if (rows[0][5].ToString().Length > 0) //{ // frmCaseFirst.txtEmergencyDiagnose.Text += "—" + rows[0][5].ToString(); //} frmCaseFirst.InitMZValidation(); frmCaseFirst.cboxMZ.Checked = true; } else { frmCaseFirst.InitMZValidation(); frmCaseFirst.cboxMZ.Checked = false; } break; case "病理诊断": if (rows.Count != 1) { MessageBox.Show("选择错误,必须选择一个诊断且只能选择一个诊断!"); return; } frmCaseFirst.txtPathology.Text = rows[0][3].ToString(); frmCaseFirst.txtPathologyCode.Text = rows[0][2].ToString(); break; case "主要诊断": if (rows.Count > 0) { frmCaseFirst.txtMajorDiagnose.Text = rows[0][3].ToString(); frmCaseFirst.txtMajorDiagnoseCode.Text = rows[0][2].ToString(); if (rows[0][6].ToString() == "Y") { //if (rows[0][5].ToString().Length > 0) //{ // frmCaseFirst.txtMajorDiagnose.Text += "—" + rows[0][5].ToString(); //} frmCaseFirst.InitZYValidation(); frmCaseFirst.cboxZY.Checked = true; } else { frmCaseFirst.InitZYValidation(); frmCaseFirst.cboxZY.Checked = false; } //string sTemp="";//= rows[0][4].ToString(); //if (sTemp.Length == 0) //{ // frmCaseFirst.cboMajorPatientCondition.SelectedIndex = -1; //} //else //{ // frmCaseFirst.cboMajorPatientCondition.Text = sTemp; //} //sTemp = rows[0][4].ToString(); //if (sTemp == "治愈" || sTemp == "好转" || sTemp == "未愈") //{ // frmCaseFirst.cboTurnTo.Text = sTemp; //} //else //{ // frmCaseFirst.cboTurnTo.SelectedIndex = -1; //} } else { frmCaseFirst.txtMajorDiagnose.Text = ""; frmCaseFirst.txtMajorDiagnoseCode.Text = ""; frmCaseFirst.cboMajorPatientCondition.SelectedIndex = -1; frmCaseFirst.cboTurnTo.SelectedIndex = -1; } break; case "其他诊断": // 最大仅支持18个其他诊断 if (rows.Count > 18) { MessageBox.Show("选择的诊断过多,目前最多可供选择18个其他诊断!"); return; } // 先清空所有控件的值 ClearGroup(this.frmCaseFirst.grpOtherDiagnose); // 按设定的排列顺序进行排序 //rows.Sort(CompareRow); // 遍历所有的选择行,对其他诊断分组中的用户控件赋值 int j = 0; for (int i = 0; i < rows.Count; i++) { ucOtherDiagnose uc = frmCaseFirst.grpOtherDiagnose.Controls[j] as ucOtherDiagnose; j++; if (uc == null) { i--; continue; } uc.OtherDiagnose = rows[i][3].ToString(); uc.ICD10 = rows[i][2].ToString(); if (rows[i][6].ToString() == "Y") { //if (rows[i][5].ToString().Length > 0) //{ // uc.OtherDiagnose += "—" + rows[i][5].ToString(); //} uc.SetCheckBox(true); } else { uc.SetCheckBox(false); } //uc.InCondition = true;// = rows[i][4].ToString(); } break; } this.Close(); }