Пример #1
0
        public string ValidateData(string p_strTableName)
        {
            ShowFixInfo.m_dtSource.Rows.Clear();
            string        _strSQLValue = ExportDB.GetSQL(p_strTableName);
            List <string> _listField   = GetFieldFromXmlObject(p_strTableName);
            string        _strSQL      = _strSQLValue.ToUpper().Trim().Replace("@PATIENT_ID", "1").Replace("@VISIT_ID", "1");
            DataTable     _dtLocal     = CommonFunction.OleExecuteBySQL(_strSQL, "", "EMR");

            if (_dtLocal == null)
            {
                throw new Exception("SQL语句有误" + _strSQL);
            }
            if (!_dtLocal.Columns.Contains("PATIENT_ID") || !_dtLocal.Columns.Contains("VISIT_ID"))
            {
                ShowFixInfo.m_strWarning = (" [PATIENT_ID][VISIT_ID] ");
            }
            string _strUnCmpareItems = string.Empty;

            foreach (string var in _listField)
            {
                string _strField = var.Replace("[", "").Replace("]", "");
                if (_dtLocal.Columns.Contains(_strField))
                {
                    ShowFixInfo.m_dtSource.Rows.Add(_strField, "TRUE");
                }
                else
                {
                    ShowFixInfo.m_dtSource.Rows.Add(_strField, "FALSE");
                    _strUnCmpareItems += "[" + _strField + "]";
                }
            }
            return(" 对象[" + p_strTableName.PadRight(30, '*') + "]未对照条目:" + _strUnCmpareItems);
        }
Пример #2
0
 /// <summary>
 /// ִ�е���
 /// </summary>
 public void ExeExport()
 {
     string _strOutPutType = string.Empty, _strExceltPath = string.Empty, _strDbfPath = string.Empty;
     _strOutPutType = m_strExportType;
     _strExceltPath = m_strExcelPath;
     _strDbfPath = m_strDbfPath;
     IExport ie = null;
     switch (_strOutPutType)
     {
         case PublicProperty.CExportDB:
             ie = new ExportDB();
             PublicProperty.ExportParam[0] = m_dsAllPatsInfo;
             break;
         case PublicProperty.CExportDBF:
             ie = new ExportDBF();
             PublicProperty.ExportParam[0] = _strDbfPath;
             PublicProperty.ExportParam[1] = m_dsAllPatsInfo;
             break;
         case PublicProperty.CExportExcel:
             ie = new ExportExcel();
             PublicProperty.ExcelPath = _strExceltPath;
             //PublicProperty.ExcelSource = m_dsAllPatsInfo;
             break;
         default:
             break;
     }
     ie.Export();
 }
Пример #3
0
 /// <summary>
 /// ִ�е���
 /// </summary>
 public static void ExeExport(DataSet p_dtOnePatInfo)
 {
     IExport ie = null;
     string _strExportType = uctlBaseConfig.GetConfig("ExportType");
     switch (_strExportType)
     {
         case "DB":
             ie = new ExportDB();
             PublicProperty.ExportParam[0] = p_dtOnePatInfo;
             break;
         case "DBF":
             ie = new ExportDBF();
             string _strDbfPath = uctlBaseConfig.GetConfig("DbfPath");
             PublicProperty.ExportParam[0] = _strDbfPath;
             PublicProperty.ExportParam[1] = p_dtOnePatInfo;
             break;
         case "EXCLE":
             ie = new ExportExcel();
             string _strExceltPath = uctlBaseConfig.GetConfig("ExceltPath");
             PublicProperty.ExcelPath = _strExceltPath;
             //PublicProperty.ExcelSource = p_dtOnePatInfo;
             break;
         case "XML":
             ie = new ExportXml();
             PublicProperty.ExportParam[0] = p_dtOnePatInfo;
             break;
         default:
             CommonFunction.WriteError("δ֪��������:" + _strExportType);
             break;
     }
     Thread t = new Thread(new ThreadStart(ie.Export));
     t.Start();
 }
Пример #4
0
 /// <summary>
 /// ִ�е���
 /// </summary>
 public static void ExeExport(DataSet p_dsOnePatInfo,string p_strObjectName ,string p_strPatientId,string p_strVisitId)
 {
     IExport ie = null;
     string _strExportType = uctlBaseConfig.GetConfig("ExportType");
     switch (_strExportType)
     {
         case "DB":
             ie = new ExportDB();
             PublicVar.ExportParam[0] = p_dsOnePatInfo;
             break;
         case "DBF":
             string _strDbfPath = uctlBaseConfig.GetConfig("DbfPath");
             //PublicVar.ExportParam[0] = _strDbfPath;
             //PublicVar.ExportParam[1] = p_dsOnePatInfo;
             ie = new ExportDBF(p_dsOnePatInfo.Tables[0]);
             break;
         case "EXCLE":
             ie = new ExportExcel();
             string _strExceltPath = uctlBaseConfig.GetConfig("ExceltPath");
             PublicVar.ExcelPath = _strExceltPath;
             //PublicProperty.ExcelSource = p_dtOnePatInfo;
             break;
         case "XML":
             ie = new ExportXml(p_dsOnePatInfo, p_strObjectName, p_strPatientId, p_strVisitId);
             //PublicVar.ExportParam[0] = p_dsOnePatInfo;
             break;
         default:
             CommonFunction.WriteError("δ֪��������:" + _strExportType);
             break;
     }
     ie.Export();
     //Thread t = new Thread(new ThreadStart(ie.Export));
     //t.Start();
 }
Пример #5
0
        /// <summary>
        /// 执行导出
        /// </summary>
        public void ExeExport()
        {
            string _strOutPutType = string.Empty, _strExceltPath = string.Empty, _strDbfPath = string.Empty;

            _strOutPutType = m_strExportType;
            _strExceltPath = m_strExcelPath;
            _strDbfPath    = m_strDbfPath;
            IExport ie = null;

            switch (_strOutPutType)
            {
            case PublicVar.CExportDB:
                ie = new ExportDB();
                PublicVar.ExportParam[0] = m_dsAllPatsInfo;
                break;

            case PublicVar.CExportDBF:
                ie = new ExportDBF(m_dsAllPatsInfo.Tables[0]);
                break;

            case PublicVar.CExportExcel:
                ie = new ExportExcel();
                PublicVar.ExcelPath = _strExceltPath;
                //PublicProperty.ExcelSource = m_dsAllPatsInfo;
                break;

            default:
                break;
            }
            ie.Export();
        }
        private void button6_Click(object sender, EventArgs e)
        {
            DataGridViewRow var           = dataGridView1.CurrentRow;
            string          _strTableName = var.Cells["TABLE_NAME"].Value.ToString();
            string          _strSQLValue  = rtb_sql.Text.Trim();

            ExportDB.SaveSQL(_strSQLValue, _strTableName);
        }
Пример #7
0
        private void button7_Click(object sender, EventArgs e)
        {
            string          _strBandedSQL  = string.Empty;
            DataGridViewRow _drObject      = dataGridView1.CurrentRow;
            string          _strExportType = uctlBaseConfig.GetConfig("ExportType");
            string          _strObjectName = _drObject.Cells["TABLE_NAME"].Value.ToString();
            string          _strSQL        = string.Empty;

            if (DialogResult.OK == MessageBox.Show("确定生成抓取数据SQL?", "Message", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning))
            {
                _strBandedSQL = ExportDB.GetObjectBandedSQL(_strObjectName);
                rtb_sql.Text  = _strBandedSQL;
            }
        }
Пример #8
0
        private void button6_Click(object sender, EventArgs e)
        {
            DataGridViewRow var           = dataGridView1.CurrentRow;
            string          _strTableName = var.Cells["TABLE_NAME"].Value.ToString();
            string          _strSQLValue  = rtb_sql.Text.Trim();

            if (ExportDB.SaveSQL(_strSQLValue, _strTableName))
            {
                uctlMessageBox.frmDisappearShow("保存成功!");
            }
            else
            {
                uctlMessageBox.frmDisappearShow("保存失败,详见错误日志。");
            }
        }
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridView1.CurrentCell.ColumnIndex == 0)
     {
         string _strSQLValue = ExportDB.GetSQL(dataGridView1.CurrentRow.Cells["TABLE_NAME"].Value.ToString());
         rtb_sql.Text = _strSQLValue;
     }
     if (dataGridView1.CurrentCell.ColumnIndex == 1)
     {
         openFileDialog1.ShowDialog();
         string _strSourceFile = openFileDialog1.FileName;
         string _strTargetFile = Application.StartupPath + "\\dbf\\" + openFileDialog1.SafeFileName;
         CommonFunction.CopyFile(_strSourceFile, _strTargetFile, true);
         dataGridView1.CurrentCell.Value = _strTargetFile;
     }
 }
Пример #10
0
        /// <summary>
        /// 执行导出
        /// </summary>
        public static void ExeExport(DataSet p_dsOnePatInfo, string p_strObjectName, string p_strPatientId, string p_strVisitId)
        {
            IExport ie             = null;
            string  _strExportType = uctlBaseConfig.GetConfig("ExportType");

            switch (_strExportType)
            {
            case "DB":
                ie = new ExportDB();
                PublicVar.ExportParam[0] = p_dsOnePatInfo;
                break;

            case "DBF":
                string _strDbfPath = uctlBaseConfig.GetConfig("DbfPath");
                //PublicVar.ExportParam[0] = _strDbfPath;
                //PublicVar.ExportParam[1] = p_dsOnePatInfo;
                ie = new ExportDBF(p_dsOnePatInfo.Tables[0]);
                break;

            case "EXCLE":
                ie = new ExportExcel();
                string _strExceltPath = uctlBaseConfig.GetConfig("ExceltPath");
                PublicVar.ExcelPath = _strExceltPath;
                //PublicProperty.ExcelSource = p_dtOnePatInfo;
                break;

            case "XML":
                ie = new ExportXml(p_dsOnePatInfo, p_strObjectName, p_strPatientId, p_strVisitId);
                //PublicVar.ExportParam[0] = p_dsOnePatInfo;
                break;

            default:
                CommonFunction.WriteError("未知导出类型:" + _strExportType);
                break;
            }
            ie.Export();
            //Thread t = new Thread(new ThreadStart(ie.Export));
            //t.Start();
        }
        private void button7_Click(object sender, EventArgs e)
        {
            string          _strBandedSQL  = string.Empty;
            DataGridViewRow _drObject      = dataGridView1.CurrentRow;
            string          _strExportType = uctlBaseConfig.GetConfig("ExportType");
            string          _strObjectName = _drObject.Cells["TABLE_NAME"].Value.ToString();
            string          _strSQL        = string.Empty;// string.Format(@"delete pt_chapter_dict where table_name = '{0}'", _strObjectName);
            DataTable       _dtObject      = null;

            if (DialogResult.OK == MessageBox.Show("确定同步[章节]数据?", "Message", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning))
            {
                //CommonFunction.OleExecuteNonQuery(_strSQL, "EMR");
                switch (_strExportType)
                {
                case "DB":
                    _strBandedSQL = ExportDB.GetObjectBandedSQL(_strObjectName);
                    break;

                case "XML":
                    _dtObject = ExportXml.GetObject(_strObjectName);
                    break;

                case "EXCEL":
                    break;

                case "DBF":
                    break;

                default:
                    break;
                }
                rtb_sql.Text = _strBandedSQL;
                //SycnChapterData(_strObjectName, _dtObject);
                InitData();
            }
        }
Пример #12
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string _strSQLValue = ExportDB.GetSQL(dataGridView1.CurrentRow.Cells["TABLE_NAME"].Value.ToString());

            rtb_sql.Text = _strSQLValue;
        }