private void btnAddDiagnose_Click(object sender, EventArgs e) { if (m_OperInfoFrom == null) { m_OperInfoFrom = new IemNewOperInfo(m_App); } m_OperInfoFrom.ShowDialog(); if (m_OperInfoFrom.DialogResult == DialogResult.OK) { m_OperInfoFrom.IemOperInfo = null; DataTable dataTable = m_OperInfoFrom.DataOper; DataTable dataTableOper = new DataTable(); if (this.gridControl1.DataSource != null) { dataTableOper = this.gridControl1.DataSource as DataTable; } if (dataTableOper.Rows.Count == 0) { dataTableOper = dataTable.Clone(); } foreach (DataRow row in dataTable.Rows) { dataTableOper.ImportRow(row); } gridControl1.BeginUpdate(); this.gridControl1.DataSource = dataTableOper; gridControl1.EndUpdate(); m_App.PublicMethod.ConvertGridDataSourceUpper(gridViewOper); } }
/// <summary> /// GET UI /// </summary> private void GetUI() { //手术 IemNewOperInfo m_OperInfoFrom = null; DataTable dataTableOper = new DataTable(); foreach (Iem_MainPage_Operation im in m_IemInfo.IemOperInfo) { if (m_OperInfoFrom == null) { m_OperInfoFrom = new IemNewOperInfo(m_App); } m_OperInfoFrom.IemOperInfo = im; DataTable dataTable = m_OperInfoFrom.DataOper; if (dataTableOper.Rows.Count == 0) { dataTableOper = dataTable.Clone(); } foreach (DataRow row in dataTable.Rows) { dataTableOper.ImportRow(row); } dataTableOper.AcceptChanges(); } int i = 0; //循环加载4行手术信息,多余手术信息不加载 foreach (DataRow dr in dataTableOper.Rows) { if (i == 0) { labOperation_Code1.Text = dr["Operation_Code"].ToString(); labOperation_Date1.Text = dr["Operation_Date"].ToString(); labOperation_Name1.Text = dr["Operation_Name"].ToString(); labExecute_User1_Name1.Text = dr["Execute_User1_Name"].ToString(); labExecute_User2_Name1.Text = dr["Execute_User2_Name"].ToString(); labExecute_User3_Name1.Text = dr["Execute_User3_Name"].ToString(); labAnaesthesia_Type_Name1.Text = dr["Anaesthesia_Type_Name"].ToString(); labClose_Level_Name1.Text = dr["Close_Level_Name"].ToString(); labAnaesthesia_User_Name1.Text = dr["Anaesthesia_User_Name"].ToString(); labOperation_Code1.Visible = true; labOperation_Date1.Visible = true; labOperation_Name1.Visible = true; labExecute_User1_Name1.Visible = true; labExecute_User2_Name1.Visible = true; labExecute_User3_Name1.Visible = true; labAnaesthesia_Type_Name1.Visible = true; labClose_Level_Name1.Visible = true; labAnaesthesia_User_Name1.Visible = true; } else if (i == 1) { labOperation_Code2.Text = dr["Operation_Code"].ToString(); labOperation_Date2.Text = dr["Operation_Date"].ToString(); labOperation_Name2.Text = dr["Operation_Name"].ToString(); labExecute_User1_Name2.Text = dr["Execute_User1_Name"].ToString(); labExecute_User2_Name2.Text = dr["Execute_User2_Name"].ToString(); labExecute_User3_Name2.Text = dr["Execute_User3_Name"].ToString(); labAnaesthesia_Type_Name2.Text = dr["Anaesthesia_Type_Name"].ToString(); labClose_Level_Name2.Text = dr["Close_Level_Name"].ToString(); labAnaesthesia_User_Name2.Text = dr["Anaesthesia_User_Name"].ToString(); labOperation_Code2.Visible = true; labOperation_Date2.Visible = true; labOperation_Name2.Visible = true; labExecute_User1_Name2.Visible = true; labExecute_User2_Name2.Visible = true; labExecute_User3_Name2.Visible = true; labAnaesthesia_Type_Name2.Visible = true; labClose_Level_Name2.Visible = true; labAnaesthesia_User_Name2.Visible = true; } else if (i == 2) { labOperation_Code3.Text = dr["Operation_Code"].ToString(); labOperation_Date3.Text = dr["Operation_Date"].ToString(); labOperation_Name3.Text = dr["Operation_Name"].ToString(); labExecute_User1_Name3.Text = dr["Execute_User1_Name"].ToString(); labExecute_User2_Name3.Text = dr["Execute_User2_Name"].ToString(); labExecute_User3_Name3.Text = dr["Execute_User3_Name"].ToString(); labAnaesthesia_Type_Name3.Text = dr["Anaesthesia_Type_Name"].ToString(); labClose_Level_Name3.Text = dr["Close_Level_Name"].ToString(); labAnaesthesia_User_Name3.Text = dr["Anaesthesia_User_Name"].ToString(); labOperation_Code3.Visible = true; labOperation_Date3.Visible = true; labOperation_Name3.Visible = true; labExecute_User1_Name3.Visible = true; labExecute_User2_Name3.Visible = true; labExecute_User3_Name3.Visible = true; labAnaesthesia_Type_Name3.Visible = true; labClose_Level_Name3.Visible = true; labAnaesthesia_User_Name3.Visible = true; } else if (i == 3) { labOperation_Code4.Text = dr["Operation_Code"].ToString(); labOperation_Date4.Text = dr["Operation_Date"].ToString(); labOperation_Name4.Text = dr["Operation_Name"].ToString(); labExecute_User1_Name4.Text = dr["Execute_User1_Name"].ToString(); labExecute_User2_Name4.Text = dr["Execute_User2_Name"].ToString(); labExecute_User3_Name4.Text = dr["Execute_User3_Name"].ToString(); labAnaesthesia_Type_Name4.Text = dr["Anaesthesia_Type_Name"].ToString(); labClose_Level_Name4.Text = dr["Close_Level_Name"].ToString(); labAnaesthesia_User_Name4.Text = dr["Anaesthesia_User_Name"].ToString(); labOperation_Code4.Visible = true; labOperation_Date4.Visible = true; labOperation_Name4.Visible = true; labExecute_User1_Name4.Visible = true; labExecute_User2_Name4.Visible = true; labExecute_User3_Name4.Visible = true; labAnaesthesia_Type_Name4.Visible = true; labClose_Level_Name4.Visible = true; labAnaesthesia_User_Name4.Visible = true; } else { return; } i = i + 1; } //foreach (Iem_MainPage_Operation oper in m_IemInfo.IemOperInfo ) //{ // labOperation_Code1.Text = oper.Operation_Code; // labOperation_Date1.Text = oper.Operation_Date; // labOperation_Name1.Text = oper.Operation_Name; // labExecute_User1_Name1.Text = oper.Execute_User1; // labExecute_User2_Name1.Text = oper.Execute_User2; // labExecute_User3_Name1.Text = oper.Execute_User3; // labAnaesthesia_Type_Name1.Text = oper.Anaesthesia_Type_Id.; // labClose_Level_Name1.Text = oper.Close_Level. // labAnaesthesia_User_Name1 //} //foreach (DataRow row in dataTable.Rows) //{ // Iem_MainPage_Operation imOut = new Iem_MainPage_Operation(); // imOut.Operation_Code = row["Operation_Code"].ToString(); // imOut.Operation_Name = row["Operation_Name"].ToString(); // imOut.Operation_Date = row["Operation_Date"].ToString(); // imOut.Execute_User1 = row["Execute_User1"].ToString(); // //imOut.Execute_User1_Name = row["Execute_User1_Name"]; // imOut.Execute_User2 = row["Execute_User2"].ToString(); // //imOut.Execute_User2_Name = row["Execute_User2_Name"]; // imOut.Execute_User3 = row["Execute_User3"].ToString(); // //imOut.Execute_User3_Name = row["Execute_User3_Name"]; // imOut.Anaesthesia_Type_Id = Convertmy.ToDecimal(row["Anaesthesia_Type_Id"]); // //imOut.Anaesthesia_Type_Name = row["Anaesthesia_Type_Name"]; // imOut.Close_Level = Convertmy.ToDecimal(row["Close_Level"]); // //imOut.Close_Level_Name = row["Close_Level_Name"]; // imOut.Anaesthesia_User = row["Anaesthesia_User"].ToString(); // //imOut.Anaesthesia_User_Name = row["Anaesthesia_User_Name"]; // m_IemInfo.IemOperInfo.Add(imOut); //} //} //if (this.gridControl2.DataSource != null) //{ // //术前诊断 // DataTable dataTable = this.gridControl2.DataSource as DataTable; // foreach (DataRow row in dataTable.Rows) // { // Iem_Mainpage_Diagnosis imOut = new Iem_Mainpage_Diagnosis(); // imOut.Diagnosis_Code = row["Diagnosis_Type_Id"].ToString(); // imOut.Diagnosis_Name = row["Diagnosis_Type_Name"].ToString(); // imOut.Diagnosis_Type_Id = 9; // m_IemInfo.IemDiagInfo.Add(imOut); // } //} //if (this.gridControl3.DataSource != null) //{ // //术后诊断 // DataTable dataTable = this.gridControl3.DataSource as DataTable; // foreach (DataRow row in dataTable.Rows) // { // Iem_Mainpage_Diagnosis imOut = new Iem_Mainpage_Diagnosis(); // imOut.Diagnosis_Code = row["Diagnosis_Type_Id"].ToString(); // imOut.Diagnosis_Name = row["Diagnosis_Type_Name"].ToString(); // imOut.Diagnosis_Type_Id = 10; // m_IemInfo.IemDiagInfo.Add(imOut); // } //} //m_IemInfo.IemBasicInfo.Xay_Sn = txtXRay.Text; //m_IemInfo.IemBasicInfo.Ct_Sn = txtCT.Text; //m_IemInfo.IemBasicInfo.Mri_Sn = txtMri.Text; //m_IemInfo.IemBasicInfo.Dsa_Sn = txtDsa.Text; }