예제 #1
0
 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;
 }
예제 #2
0
        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 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;
                }
            }
        }
예제 #4
0
        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;
                }
            }
        }
 public void InitForm(string paramStrings)
 {
     if (paramStrings == null || paramStrings == "")
     {
         this.Controls.Clear();
         this.Height = 5;
         return;
     }
     ParameterDefines = MC_GuideLine.GetParametersFromMeta(paramStrings);
     ShowItems();
 }
예제 #6
0
        /// <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();
        }
예제 #8
0
        /// <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));
            }
        }
예제 #9
0
        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;
                }
            }
        }
예제 #10
0
        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);
            }
        }