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); }
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; } }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { string _strSQLValue = ExportDB.GetSQL(dataGridView1.CurrentRow.Cells["TABLE_NAME"].Value.ToString()); rtb_sql.Text = _strSQLValue; }