public void InsertConditions2QueryRequest(MC_CompareRequsetFactory _compareRequestFactory) { string _filterExp = (this.textEdit1.EditValue == null) ? "" : this.textEdit1.EditValue.ToString(); _compareRequestFactory.AddExpression(_filterExp); foreach (SinoSZUC_ConditionItem _c in this.xtraScrollableControl1.Controls) { MDQuery_ConditionItem _cItem = _c.GetConditionItem(); _compareRequestFactory.AddConditonItem(_cItem); } string _compareExp = (this.textEdit2.EditValue == null) ? "" : this.textEdit2.EditValue.ToString(); _compareRequestFactory.AddCompareExpression(_compareExp); foreach (SinoSZUC_CompareConditionItem _c in this.xtraScrollableControl2.Controls) { MDCompare_ConditionItem _cItem = _c.GetCompareConditionItem(); _compareRequestFactory.AddCompareConditonItem(_cItem); } }
private void DoCompare() { //开始数据比对 string _errorMsg = ""; if (_excelReader == null) { MessageBox.Show("未打开EXCEL文件!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //取结果集字段 if (!this.sinoSZUC_MD_Model_FieldList1.CheckItems(ref _errorMsg)) { XtraMessageBox.Show(string.Format("选择比对结果不正确:{0}", _errorMsg), "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!this.sinoSZUC_CompareConditionPanel1.CheckInput(ref _errorMsg)) { XtraMessageBox.Show(string.Format("筛选条件或比对条件不正确:{0}", _errorMsg), "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } MC_CompareRequsetFactory _rf = new MC_CompareRequsetFactory(); _rf.QueryModelName = this.QueryModelName; this.sinoSZUC_CompareConditionPanel1.InsertConditions2QueryRequest(_rf); this.sinoSZUC_MD_Model_FieldList1.InsertResultFields2QueryRequest(_rf); MDCompare_Request _compareRequest = _rf.GetCompareQueryRequest(); //if (_queryResult._resultItems.Count < 1) //{ // MessageBox.Show("未选择结果字段!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; //} //SinoProgressControler.BeginProgress(); ////SinoProgressControler.ShowMessage = "正在加载比对目标数据...."; ////1.将需要比对的目标文件的数据加载入DataTable //ArrayList _usedExcelRowList = GetUsedExcelRows(); ////ArrayList _usedExcelRowList = this._ExcelColumnNames; ////2.设置别名 //ReBuildAlias(ref _usedExcelRowList); ////2.将表达式进行处理 //CompareConditionClass _CompareCon = new CompareConditionClass(); //_CompareCon.Express = textEdit1.EditValue.ToString(); //foreach (UC_CompareConditionItem _uc in this.panel14.Controls) //{ // if (!_uc.CheckInput()) // { // MessageBox.Show("比对条件错误!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; // } // CompareConditionItemClass _item = _uc.GetCondition(); // _CompareCon.AddItem(_item); //} //_CompareCon.QueryView = (QueryView_Class)comboBoxEdit1.SelectedItem; //QueryCondition_Class _qcc = this.uC_RelationConditionPanel1.GetConditions(); //foreach (Meta_ConditionItem_Class _mcc in _qcc.ConditionItems) //{ // _mcc.Column.Table_Meta.AliasName = _mcc.Column.Table_Meta.TableName; //} ////3.导入数据到DataTable //DataTable _importdt = SessionClass.IMetaData.GetImportTableTemp(); //if (this._excelReader != null) //{ // _excelReader.OpenReportTempalte(); // _excelReader.InsertExcelData(_usedExcelRowList, ref _importdt); // _excelReader.CloseReportTemplate(); //} ////3.调用后台服务进行比对,并返回结果的DataSet //QueryResult_Class _mainRes = this.uC_CompareResultPanl1.GetMainTableResults(); //ArrayList _childRes = this.uC_CompareResultPanl1.GetChildResults(); //DataSet _CompareResult = SessionClass.IMetaData.CompareData2(_CompareCon, _importdt, _mainRes, _childRes, _qcc, _usedExcelRowList); ////4.将结果显示出来 //SinoProgressControler.EndProgress(); //CompareResultForm_D2E _f = new CompareResultForm_D2E(_CompareCon.QueryView, _mainRes, _childRes, _importdt, _CompareResult, _usedExcelRowList); //SessionClass.mainForm.AddPage("比对结果", 0, _f); _compareRequest.ExcelData = _excelReader.GetData(); _compareRequest.ColumnDictionary = _excelReader.CreateColumnDictionary(); frmDataCompareResult _frmResult = MenuFunctions.AddPage <frmDataCompareResult>(Guid.NewGuid().ToString(), Application); if (_frmResult != null) { _frmResult.Init("数据比对结果", "", _compareRequest, _excelReader.GetColumns()); } }