Exemplo n.º 1
0
 /// <summary>
 /// 编辑西医出院诊断
 /// add by ywk 2012年6月4日 13:57:11
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnEditOutDiag_Click(object sender, EventArgs e)
 {
     try
     {
         if (gridViewDiagnose.FocusedRowHandle < 0)
         {
             return;
         }
         DataRow dataRow = gridViewDiagnose.GetDataRow(gridViewDiagnose.FocusedRowHandle);
         if (dataRow == null)
         {
             return;
         }
         string diagcode  = dataRow["Diagnosis_Code"].ToString(); //诊断的ICD编码
         string diagname  = dataRow["Diagnosis_Name"].ToString();
         string statusid  = dataRow["Status_Id"].ToString();      //诊断结果(入院病情)
         string outstatus = dataRow["Outstatus_id"].ToString();   //出院情况
         string diagtype  = "xiyi";
         m_DiagInfoForm = new IemNewDiagInfoFormEn(m_App, "edit", diagcode, diagname, statusid, outstatus, diagtype);
         if (m_DiagInfoForm.ShowDialog() == DialogResult.OK)
         {
             m_DiagInfoForm.IemOperInfo = null;
             DataTable dataTable     = m_DiagInfoForm.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 (DataColumn item in dataRow.Table.Columns)
             {
                 DataRow rowOper = dataTable.Rows[0];
                 if (dataTable.Columns.Contains(item.ColumnName))
                 {
                     dataRow[item.ColumnName] = rowOper[item.ColumnName].ToString();
                 }
             }
             this.gridControl1.BeginUpdate();
             this.gridControl1.DataSource = dataTableOper;
             m_App.PublicMethod.ConvertGridDataSourceUpper(gridViewDiagnose);
             this.gridControl1.EndUpdate();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 新增出院诊断
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnNewOutDiag_Click(object sender, EventArgs e)
        {
            try
            {
                m_DiagInfoForm = new IemNewDiagInfoFormEn(m_App, "add", "", "", "", "", "");
                m_DiagInfoForm.ShowDialog();
                if (m_DiagInfoForm.DialogResult == DialogResult.OK)
                {
                    m_DiagInfoForm.IemOperInfo = null;
                    DataTable dataTable = m_DiagInfoForm.DataOper;

                    if (m_DiagInfoForm.DiagnosisType == "1")
                    {
                        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);
                        }
                        this.gridControl1.BeginUpdate();
                        this.gridControl1.DataSource = dataTableOper;
                        m_App.PublicMethod.ConvertGridDataSourceUpper(gridViewDiagnose);
                        this.gridControl1.EndUpdate();
                    }
                    else if (m_DiagInfoForm.DiagnosisType == "2")
                    {
                        DataTable dataTableOper = new DataTable();
                        if (dataTableOper.Rows.Count == 0)
                        {
                            dataTableOper = dataTable.Clone();
                        }
                        foreach (DataRow row in dataTable.Rows)
                        {
                            dataTableOper.ImportRow(row);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(ex.Message);
            }
        }