private void RefreshData() { TE_ID.EditValue = _guideLine.ID; TE_Name.EditValue = _guideLine.GuideLineName; TE_ORDER.EditValue = _guideLine.DisplayOrder; TE_SF.EditValue = _guideLine.GuideLineMethod; _fgList = MC_GuideLine.GetFieldGroupsFromMeta(_guideLine.GuideLineMeta); this.te_Description.EditValue = _guideLine.Description; _treeData = new TreeObj_GuideLineFieldList(); foreach (MD_GuideLineFieldGroup _glg in _fgList) { TreeObj_GuideLineFieldGroup _group = new TreeObj_GuideLineFieldGroup(_glg); TreeObj_GuidelLineFieldItem _item = _group as TreeObj_GuidelLineFieldItem; foreach (MD_GuideLineFieldName _fname in _glg.Fields) { TreeObj_GuidelLineFieldItem _fitem = new TreeObj_GuidelLineFieldItem(_fname); _item.Children.Add(_fitem); } _treeData.Add(_item); } this.treeList1.DataSource = _treeData; _pList = MC_GuideLine.GetParametersFromMeta(_guideLine.GuideLineMeta); this.gridParameter.DataSource = _pList; _dList = MC_GuideLine.GetDetaiDefinelFromMeta(_guideLine.GuideLineMeta); this.gridDetail.DataSource = _dList; this._haveChange = false; }
private void RefreshParams(string strParams) { string id = this.buttonEdit1.EditValue.ToString(); if (id != null && id != string.Empty) { Dictionary <string, string> _psdict = new Dictionary <string, string>(); foreach (string _s in strParams.Split(';')) { if (_s != null && _s.Trim() != "") { string[] _vs = _s.Split('='); _psdict.Add(_vs[0], _vs[1]); } } glid = id; List <MD_GuideLineDetailParameter> _ret = new List <MD_GuideLineDetailParameter>(); MetaDataServiceClient _mdc = new MetaDataServiceClient(); MD_GuideLine _gl = _mdc.GetGuideLineDefine(id); List <MD_GuideLineParameter> _gParam = MC_GuideLine.GetParametersFromMeta(_gl.GuideLineMeta); foreach (MD_GuideLineParameter _p in _gParam) { if (_psdict.ContainsKey(_p.ParameterName)) { _ret.Add(new MD_GuideLineDetailParameter(_p.ParameterName, _p.DisplayTitle, _p.ParameterType, _psdict[_p.ParameterName])); } else { _ret.Add(new MD_GuideLineDetailParameter(_p.ParameterName, _p.DisplayTitle, _p.ParameterType, "")); } } this.sinoCommonGrid1.DataSource = _ret; } }
public void WriteParamValue(string _Params) { List <MDQuery_GuideLineParameter> _pList = MC_GuideLine.CreateQueryParameter(guideLineDefine, _Params); foreach (MDQuery_GuideLineParameter _pa in _pList) { SetParamValue(_pa); } }
public void InitForm(MD_GuideLine _guideLine, string _paramValueSetting) { guideLineDefine = _guideLine; ParameterDefines = MC_GuideLine.GetParametersFromMeta(_guideLine.GuideLineMeta); this.InputPanel.Controls.Clear(); foreach (MD_GuideLineParameter _glp in ParameterDefines) { string _paramValue = GetValueOfParam(_glp.ParameterName, _paramValueSetting); switch (_glp.ParameterType) { case "逻辑型": break; case "代码表": SinoSZUC_GLQ_InputRefTable _refitem = new SinoSZUC_GLQ_InputRefTable(_glp); _refitem.InputChanged += new EventHandler(_dateitem_InputChanged); _refitem.Dock = DockStyle.Top; _refitem.SetValueByXml(_paramValue); this.InputPanel.Controls.Add(_refitem); _refitem.BringToFront(); break; case "日期型": SinoSZUC_GLQ_InputDate _dateitem = new SinoSZUC_GLQ_InputDate(_glp); _dateitem.SetValueByXml(_paramValue); _dateitem.InputChanged += new EventHandler(_dateitem_InputChanged); _dateitem.Dock = DockStyle.Top; this.InputPanel.Controls.Add(_dateitem); _dateitem.BringToFront(); break; case "单位型(全部)": case "单位型(权限范围)": case "单位ID型(缉私局权限)": case "单位ID型(全部)": case "单位ID型(权限范围)": case "单位代码型(全部)": case "单位代码型(权限范围)": SinoSZUC_GLQ_InputOrg _orgItem = new SinoSZUC_GLQ_InputOrg(_glp, _glp.ParameterType); _orgItem.SetValueByXml(_paramValue); _orgItem.Dock = DockStyle.Top; _orgItem.InputChanged += new EventHandler(_dateitem_InputChanged); this.InputPanel.Controls.Add(_orgItem); _orgItem.BringToFront(); break; default: SinoSZUC_GLQ_InputItem _item = new SinoSZUC_GLQ_InputItem(_glp); _item.SetValueByXml(_paramValue); _item.Dock = DockStyle.Top; _item.InputChanged += new EventHandler(_dateitem_InputChanged); this.InputPanel.Controls.Add(_item); _item.BringToFront(); break; } } }
public void InitForm(MD_GuideLine _guideLine) { if (_guideLine == null) { this.Controls.Clear(); this.Height = 5; return; } guideLineDefine = _guideLine; ParameterDefines = MC_GuideLine.GetParametersFromMeta(_guideLine.GuideLineMeta); this.Controls.Clear(); this.Height = this.ParameterDefines.Count * 24 + 5; foreach (MD_GuideLineParameter _glp in ParameterDefines) { switch (_glp.ParameterType) { case "逻辑型": break; case "代码表": break; case "日期型": SinoSZUC_GLQ_InputDate _dateitem = new SinoSZUC_GLQ_InputDate(_glp); _dateitem.InputChanged += new EventHandler(_dateitem_InputChanged); _dateitem.Dock = DockStyle.Top; this.Controls.Add(_dateitem); _dateitem.BringToFront(); break; case "单位型(全部)": case "单位型(权限范围)": case "单位ID型(缉私局权限)": case "单位ID型(全部)": case "单位ID型(权限范围)": case "单位代码型(全部)": case "单位代码型(权限范围)": SinoSZUC_GLQ_InputOrg _orgItem = new SinoSZUC_GLQ_InputOrg(_glp, _glp.ParameterType); _orgItem.Dock = DockStyle.Top; _orgItem.InputChanged += new EventHandler(_dateitem_InputChanged); this.Controls.Add(_orgItem); _orgItem.BringToFront(); break; default: SinoSZUC_GLQ_InputItem _item = new SinoSZUC_GLQ_InputItem(_glp); _item.Dock = DockStyle.Top; _item.InputChanged += new EventHandler(_dateitem_InputChanged); this.Controls.Add(_item); _item.BringToFront(); break; } } }
/// <summary> /// 显示查询模型方式的详细信息 /// </summary> /// <param name="_df"></param> /// <param name="_dr"></param> private void ShowDetailByQueryModel(MD_GuideLineDetailDefine _df, DataRow _dr) { //取链接明细参数定义 List <MD_GuideLineDetailParameter> _detailParamList = MC_GuideLine.GetGuideLineDetailParam(_df.DetailParameterMeta); MD_GuideLineDetailParameter _param = _detailParamList[0]; string _data = ReplaceVerByRowData(_dr, _param.DataValue); ShowDetailDataArgs _args = new ShowDetailDataArgs(_df.DetailMethodID, _param.Name, _data); RaiseShowDetailDatal(_args); }
virtual protected void ShowASNormalGrid() { this.gridView1.Columns.Clear(); FieldsDict.Clear(); List <MD_GuideLineFieldName> _fList = MC_GuideLine.GetFieldNamesFromMeta(_guideLineDefine.GuideLineMeta); _fList.Sort((g1, g2) => { return(g1.DisplayOrder.CompareTo(g2.DisplayOrder)); }); foreach (MD_GuideLineFieldName _fn in _fList) { GridColumn _gc = this.gridView1.Columns.Add(); _gc.Caption = _fn.DisplayTitle; _gc.FieldName = _fn.FieldName; _gc.Width = _fn.DisplayWidth; _gc.OptionsColumn.ReadOnly = true; _gc.Visible = true; _gc.VisibleIndex = gridView1.Columns.Count; SetColumnTextAlign(_gc, _fn); SetColumnDisplayFormat(_gc, _fn); if (!FieldsDict.ContainsKey(_fn.FieldName)) { FieldsDict.Add(_fn.FieldName, _fn.DisplayTitle); } if (MergeColumns.Contains(_fn.FieldName)) { _gc.OptionsColumn.AllowMerge = DefaultBoolean.True; } else { _gc.OptionsColumn.AllowMerge = DefaultBoolean.False; } } this.sinoCommonGrid1.Visible = true; this.sinoCommonGrid2.Visible = false; if (this.MergeColumns.Count > 0) { this.gridView1.OptionsView.AllowCellMerge = true; } else { this.gridView1.OptionsView.AllowCellMerge = false; } this.sinoCommonGrid1.DataSource = _ResultTable; if (_fList.Count == 0) { foreach (DataColumn _dc in _ResultTable.Columns) { FieldsDict.Add(_dc.ColumnName, _dc.Caption); } } this.gridView1.IndicatorWidth = _ResultTable.Rows.Count.ToString().Length * 10 + 15; }
public void InitForm(string paramStrings) { if (paramStrings == null || paramStrings == "") { this.Controls.Clear(); this.Height = 5; return; } ParameterDefines = MC_GuideLine.GetParametersFromMeta(paramStrings); ShowItems(); }
public frmGuideLineQueryWithoutInput(string _title, string _guideLineID, string _params, bool _canGroup) { InitializeComponent(); using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { GuideLineDefine = _msc.GetGuideLineByID(_guideLineID); } QueryParameter = MC_GuideLine.CreateQueryParameter(GuideLineDefine, _params); this.sinoSZUC_GuideLineQueryResult1.CanGrouped = _canGroup; this.Text = _title; _initFinished = true; }
/// <summary> /// 取指标定义 /// </summary> /// <param name="guideLineId"></param> /// <returns></returns> public async static Task <MD_GuideLine> GetGuidelineDefine(string guideLineId) { MD_GuideLine define = null; if (!string.IsNullOrEmpty(guideLineId)) { if (GuidelineDefine.ContainsKey(guideLineId)) { define = GuidelineDefine[guideLineId]; } else { using (MySqlConnection cn = MysqlDBHelper.OpenConnection()) { try { MySqlCommand cmd = new MySqlCommand(SqlGetGuidelineDefine, cn); cmd.Parameters.Add(new MySqlParameter("@Id", Convert.ToInt64(guideLineId))); using (MySqlDataReader dr = cmd.ExecuteReader()) { while (await dr.ReadAsync()) { string id = dr.IsDBNull(0) ? "" : dr.GetInt64(0).ToString(); string name = dr.IsDBNull(1) ? "" : dr.GetString(1); string groupname = dr.IsDBNull(2) ? "" : dr.GetString(2); string zbmeta1 = dr.IsDBNull(3) ? "" : dr.GetString(3); string fatherid = dr.IsDBNull(4) ? "0" : dr.GetInt64(4).ToString(); string zbmeta2 = dr.IsDBNull(5) ? "" : dr.GetString(5); int displayorder = dr.IsDBNull(6) ? 0 : Convert.ToInt32(dr.GetInt32(6)); string descript = dr.IsDBNull(7) ? "" : dr.GetString(7); string fullMeta = zbmeta1 + zbmeta2; define = new MD_GuideLine(id, name, groupname, fatherid, displayorder, descript); define.Parameters = MC_GuideLine.GetParametersFromMeta(fullMeta); define.ResultGroups = MC_GuideLine.GetFieldGroupsFromMeta(fullMeta); define.DetailDefines = MC_GuideLine.GetDetaiDefinelFromMeta(fullMeta); GuidelineDefine.Add(guideLineId, define); } } } catch (Exception exception) { string errorMessage = string.Format("取指标[{0}]的定义出错,错误信息为{1}", guideLineId, exception.Message); MysqlLogWriter.WriteSystemLog(errorMessage, "ERROR"); } } } } return(define); }
public void InitForm(MD_GuideLine _guideLine) { if (_guideLine == null) { this.Controls.Clear(); this.Height = 5; return; } guideLineDefine = _guideLine; ParameterDefines = MC_GuideLine.GetParametersFromMeta(_guideLine.GuideLineMeta); ShowItems(); }
public void ShowData() { List <MD_GuideLineFieldGroup> _gList = MC_GuideLine.GetFieldGroupsFromMeta(_guideLineDefine.GuideLineMeta); _detailDict = MC_GuideLine.GetDetailDefineDict(_guideLineDefine.GuideLineMeta); if (_gList.Count < 2) { ShowASNormalGrid(); } else { ShowASBandGrid(_gList); } }
/// <summary> /// 以指标方式显示详细信息 /// </summary> /// <param name="_df"></param> /// <param name="_dr"></param> private void ShowDetailByGuideLine(MD_GuideLineDetailDefine _df, DataRow _dr) { MDQuery_GuideLineParameter _param; List <MD_GuideLine> _gls; string _guideLineID = _df.DetailMethodID; using (MetaDataQueryServiceClient _msc = new MetaDataQueryServiceClient()) { _gls = _msc.GetRootGuideLineList(_guideLineID).ToList <MD_GuideLine>(); } //取链接明细参数定义 List <MD_GuideLineDetailParameter> _detailParamList = MC_GuideLine.GetGuideLineDetailParam(_df.DetailParameterMeta); Dictionary <string, string> _detailParamDict = new Dictionary <string, string>(); foreach (MD_GuideLineDetailParameter _dparam in _detailParamList) { _detailParamDict.Add(_dparam.Name, _dparam.DataValue); } if (_gls.Count > 0) { //取指标 MD_GuideLine _guideLine = _gls[0]; //建立查询参数 List <MDQuery_GuideLineParameter> _queryParams = new List <MDQuery_GuideLineParameter>(); //建立指标参数字典 List <MD_GuideLineParameter> _gParam = MC_GuideLine.GetParametersFromMeta(_guideLine.GuideLineMeta); foreach (MD_GuideLineParameter _p in _gParam) { if (_detailParamDict.ContainsKey(_p.ParameterName)) { string _dataDefine = _detailParamDict[_p.ParameterName]; string _data = ReplaceVerByRowData(_dr, _dataDefine); _param = new MDQuery_GuideLineParameter(_p, _data); _queryParams.Add(_param); } else { XtraMessageBox.Show("缺少参数定义!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } RaiseShowDetailDatal(new ShowDetailDataArgs(_guideLine, _queryParams)); } }
private void SaveData() { this._guideLine.GuideLineName = this.TE_Name.EditValue.ToString(); this._guideLine.GuideLineMethod = this.TE_SF.EditValue.ToString(); this._guideLine.DisplayOrder = int.Parse(this.TE_ORDER.EditValue.ToString()); this._guideLine.Description = (this.te_Description.EditValue == null) ? "" : this.te_Description.EditValue.ToString(); this.treeList1.PostEditor(); this.gridView2.PostEditor(); this.gridView3.PostEditor(); _fgList = new List <MD_GuideLineFieldGroup>(); foreach (TreeObj_GuidelLineFieldItem _item in _treeData) { TreeObj_GuideLineFieldGroup _group = _item as TreeObj_GuideLineFieldGroup; MD_GuideLineFieldGroup _fg = _group.GroupData; GetChildData(_fg, _group); _fgList.Add(_fg); } //注:对于老系统的strYN参数的特殊处理 foreach (MD_GuideLineParameter _p in this.gridParameter.DataSource as IList <MD_GuideLineParameter> ) { if (_p.ParameterName == "strYN") { XtraMessageBox.Show("为了与旧系统的兼容需要,参数名称不可以是strYN!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } // ------------------------------------------ this._guideLine.GuideLineMeta = MC_GuideLine.CreateMeta(_fgList, this.gridParameter.DataSource as IList <MD_GuideLineParameter>, this.gridDetail.DataSource as IList <MD_GuideLineDetailDefine>); using (MetaDataServiceClient _mdc = new MetaDataServiceClient()) { if (_mdc.SaveGuideLine(MC_GuideLine.GetGuideLineDefineData(this._guideLine))) { XtraMessageBox.Show("保存成功!"); _haveChange = false; this.RaiseMenuChanged(); } } }
private void RefreshParams() { string id = this.buttonEdit1.EditValue.ToString(); if (id != null && id != string.Empty) { glid = id; List <MD_GuideLineDetailParameter> _ret = new List <MD_GuideLineDetailParameter>(); using (MetaDataServiceClient _mdc = new MetaDataServiceClient()) { MD_GuideLine _gl = _mdc.GetGuideLineDefine(id); List <MD_GuideLineParameter> _gParam = MC_GuideLine.GetParametersFromMeta(_gl.GuideLineMeta); foreach (MD_GuideLineParameter _p in _gParam) { _ret.Add(new MD_GuideLineDetailParameter(_p.ParameterName, _p.DisplayTitle, _p.ParameterType, "")); } this.sinoCommonGrid1.DataSource = _ret; } } }
private List <MD_GuideLineDetailParameter> InitDetailParm(MD_GuideLineDetailDefine _detailDefine) { using (MetaDataServiceClient _mdc = new MetaDataServiceClient()) { List <MD_GuideLineDetailParameter> _ret = new List <MD_GuideLineDetailParameter>(); switch (_detailDefine.QueryDetailType) { case "查询模型": MD_QueryModel _model = _mdc.GetQueryModelByName(_detailDefine.DetailMethodID); MD_ViewTable _viewTable = _mdc.GetMainTableOfQueryModel(_model.QueryModelID); this.comboBoxEdit1.Properties.Items.Clear(); this.comboBoxEdit1.EditValue = null; foreach (MD_ViewTableColumn _col in _viewTable.Columns) { SelectTableColumn _item = new SelectTableColumn(_col); if (_col.TableColumn.ColumnName == _viewTable.Table.MainKey) { _item.Title += " [主键] "; } this.comboBoxEdit1.Properties.Items.Add(_item); } this.te_Type.EditValue = ""; this.te_Title.EditValue = ""; this.te_Value.EditValue = ""; break; case "指标定义": MD_GuideLine _gl = _mdc.GetGuideLineDefine(_detailDefine.DetailMethodID); List <MD_GuideLineParameter> _gParam = MC_GuideLine.GetParametersFromMeta(_gl.GuideLineMeta); foreach (MD_GuideLineParameter _p in _gParam) { _ret.Add(new MD_GuideLineDetailParameter(_p.ParameterName, _p.DisplayTitle, _p.ParameterType, "")); } break; } return(_ret); } }
public Dialog_EditGuideLineDetailParam(MD_GuideLineDetailDefine _detailDefine) { InitializeComponent(); if (_detailDefine.DetailMethodID == "" && _detailDefine.QueryDetailType != "其它") { return; } DetailDefine = _detailDefine; switch (_detailDefine.QueryDetailType) { case "查询模型": this.panelQueryModel.Visible = true; this.panelGuideLine.Visible = false; this.panelOther.Visible = false; this.panelQueryModel.BringToFront(); InitDetailParm(_detailDefine); if (_detailDefine.DetailParameterMeta != null && _detailDefine.DetailParameterMeta != "") { DetailParam = MC_GuideLine.GetGuideLineDetailParam(_detailDefine.DetailParameterMeta); MD_GuideLineDetailParameter _p = DetailParam[0]; int _selectedIndex = -1; for (int i = 0; i < this.comboBoxEdit1.Properties.Items.Count; i++) { SelectTableColumn _stc = this.comboBoxEdit1.Properties.Items[i] as SelectTableColumn; if (_stc.Column.TableColumn.ColumnName == _p.Name) { _selectedIndex = i; break; } } if (_selectedIndex >= 0) { this.comboBoxEdit1.SelectedIndex = _selectedIndex; } this.te_Value.EditValue = _p.DataValue; } break; case "指标定义": this.panelQueryModel.Visible = false; this.panelGuideLine.Visible = true; this.panelOther.Visible = false; this.panelGuideLine.BringToFront(); if (_detailDefine.DetailParameterMeta != null && _detailDefine.DetailParameterMeta != "") { DetailParam = MC_GuideLine.GetGuideLineDetailParam(_detailDefine.DetailParameterMeta); } else { DetailParam = InitDetailParm(_detailDefine); } this.sinoCommonGrid1.DataSource = DetailParam; break; case "其它": this.panelGuideLine.Visible = false; this.panelQueryModel.Visible = false; this.panelOther.Visible = true; this.panelOther.BringToFront(); if (_detailDefine.DetailParameterMeta != null && _detailDefine.DetailParameterMeta != "") { this.memoEdit1.EditValue = _detailDefine.DetailParameterMeta; } break; } }