public void LoadRule(MDModel_QueryModel _model, MD_CheckRule _selectRule) { CurrentRule = _selectRule; _queryModel = _model; this.textEdit1.EditValue = CurrentRule.RuleName; this.textEdit1.Properties.ReadOnly = true; this.sinoSZUC_MD_Model_FieldList1.QueryModel = _queryModel; this.sinoSZUC_MD_Model_FieldList1.QueryViewName = _queryModel.FullQueryModelName; this.sinoSZUC_MD_Model_FieldList1.ShowSingleLineDefaultList(); MDQuery_Request _request = MC_CheckRule.RuleToQueryRequest(CurrentRule, _queryModel, null); this.sinoSZUC_ConditionPanel1.RefreshBySaveRequest(this._queryModel, _request); }
protected override bool SaveRule() { MC_QueryRequsetFactory _rf = new MC_QueryRequsetFactory(); _rf.QueryModelName = _queryModel.FullQueryModelName; this.sinoSZUC_ConditionPanel1.InsertConditions2QueryRequest(_rf); string _gzsf = MC_CheckRule.QueryRequestToRule(_rf.GetQueryRequest(), this._queryModel); using (SinoSZClientBase.MetaDataQueryService.MetaDataQueryServiceClient _rsc = new SinoSZClientBase.MetaDataQueryService.MetaDataQueryServiceClient()) { if (!_rsc.ChangeDataCheckRule(CurrentRule.ID, _gzsf)) { XtraMessageBox.Show("修改算法失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } return(true); } }
/// <summary> /// 检查规则 /// </summary> /// <param name="_rule"></param> private void CheckRule(MD_CheckRule _rule, MDModel_QueryModel _queryModel) { DataSet _lsdt; MDQuery_Request _request = MC_CheckRule.RuleToQueryRequest(_rule, _queryModel, this.CheckParam.Request); if (_request == null) { return; } using (SinoSZClientBase.MetaDataQueryService.MetaDataQueryServiceClient _rsc = new SinoSZClientBase.MetaDataQueryService.MetaDataQueryServiceClient()) { _lsdt = _rsc.QueryData(_request); } if (_lsdt != null && _lsdt.Tables.Count > 0) { DataTable _dt = _lsdt.Tables[0]; if (_dt.Rows.Count > 0) { writeRuleCheckRusult(_dt, _rule.RuleName); } } }