Пример #1
0
        public static List <MD_View2ViewGroup> GetView2ViewGroupOfQueryModel(string ViewID)
        {
            List <MD_View2ViewGroup> _ret = new List <MD_View2ViewGroup>();

            using (SqlConnection cn = SqlHelper.OpenConnection())
            {
                try
                {
                    SqlCommand _cmd = new SqlCommand(SQL_GetView2ViewGroupOfQueryModel, cn);
                    _cmd.Parameters.Add("@VIEWID", decimal.Parse(ViewID));
                    using (SqlDataReader _dr = _cmd.ExecuteReader())
                    {
                        while (_dr.Read())
                        {
                            MD_View2ViewGroup _g = new MD_View2ViewGroup();
                            _g.ID           = _dr.IsDBNull(0) ? "" : _dr.GetString(0);
                            _g.DisplayTitle = _dr.IsDBNull(2) ? "" : _dr.GetString(2);
                            _g.DisplayOrder = _dr.IsDBNull(3) ? 0 : Convert.ToInt32(_dr.GetDouble(3));
                            _ret.Add(_g);
                        }
                    }
                }
                catch (Exception e)
                {
                    LogWriter.WriteSystemLog(string.Format("在取查询模型{0}相关联模型分组信息时发生错误,错误信息:{1} ", ViewID, e.Message), "ERROR");
                    return(null);
                }
            }
            return(_ret);
        }
Пример #2
0
        private void ChangeView2ViewGroupID(MD_View2ViewGroup _group, MD_QueryModel _qv, SinoSZClientBase.MetaDataService.MetaDataServiceClient _mdc)
        {
            if (_group == null)
            {
                return;
            }
            _group.QueryModelID = _qv.QueryModelID;
            string _newid = GetNewID(_group.ID, "MD_VIEW2VIEWGROUP", "ID", _mdc);

            try
            {
                IDTable.Add(_group.ID, _newid);
            }
            catch (Exception e)
            {
                throw e;
            }
            _group.ID = _newid;
            if (_group.View2Views != null && _group.View2Views.Count > 0)
            {
                foreach (MD_View2View _v2v in _group.View2Views)
                {
                    ChangeView2ViewID(_v2v, _group, _mdc);
                }
            }
        }
Пример #3
0
 public bool SaveView2ViewGroup(MD_View2ViewGroup View2ViewGroup)
 {
     try
     {
         return(MetaDataFactroy.SaveView2ViewGroup(View2ViewGroup));
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Пример #4
0
 public bool SaveView2ViewGroup(MD_View2ViewGroup View2ViewGroup)
 {
     try
     {
         OraMetaDataFactroy _of = new OraMetaDataFactroy();
         return(_of.SaveView2ViewGroup(View2ViewGroup));
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message);
     }
 }
Пример #5
0
        private void ChangeView2ViewID(MD_View2View _v2v, MD_View2ViewGroup _group, MetaDataServiceClient _mdc)
        {
            if (_v2v == null)
            {
                return;
            }
            _v2v.QueryModelID = _group.QueryModelID;
            string _newid = GetNewID(_v2v.ID, "MD_VIEW2VIEW", "ID", _mdc);

            try
            {
                IDTable.Add(_v2v.ID, _newid);
            }
            catch (Exception e)
            {
                throw e;
            }
            _v2v.ID = _newid;
        }
Пример #6
0
 public static bool SaveView2ViewGroup(MD_View2ViewGroup View2ViewGroup)
 {
     using (SqlConnection cn = SqlHelper.OpenConnection())
     {
         try
         {
             SqlCommand _cmd = new SqlCommand(SQL_SaveView2ViewGroup, cn);
             _cmd.Parameters.Add("@DISPLAYORDER", Convert.ToDecimal(View2ViewGroup.DisplayOrder));
             _cmd.Parameters.Add("@DISPLAYTITLE", View2ViewGroup.DisplayTitle);
             _cmd.Parameters.Add("@ID", View2ViewGroup.ID);
             _cmd.ExecuteNonQuery();
             return(true);
         }
         catch (Exception e)
         {
             string _msg = string.Format("在保存查询模型{0}相关联模型分组信息时发生错误,错误信息:{1} ", View2ViewGroup.QueryModelID, e.Message);
             LogWriter.WriteSystemLog(_msg, "ERROR");
             return(false);
         }
     }
 }
Пример #7
0
 public View2ViewGroupInfo(MD_View2ViewGroup _groupData)
 {
     InitializeComponent();
     this.Data = _groupData;
     RefreshData();
 }
Пример #8
0
        private void LoadChildData(TreeListNode _fnode, object _value)
        {
            using (MetaDataServiceClient _mdc = new MetaDataServiceClient())
            {
                MD_Title     _mt;
                MD_Namespace _ns;
                if (_value is MD_Nodes)
                {
                    _fnode.Nodes.Clear();
                    MD_Nodes _node = _value as MD_Nodes;

                    IList <MD_Namespace> _namespaces = _mdc.GetNameSpaceAtNode(_node.DWDM);
                    if (_node.NameSpaces == null)
                    {
                        _node.NameSpaces = new List <MD_Namespace>();
                    }
                    foreach (MD_Namespace _space in _namespaces)
                    {
                        TreeListNode _newnode = treeList1.AppendNode(null, _fnode);
                        _newnode.SetValue(this.treeListColumn1, _space);
                        _newnode.ImageIndex       = 1;
                        _newnode.SelectImageIndex = 0;
                        _newnode.HasChildren      = true;
                        _node.NameSpaces.Add(_space);
                    }

                    _mt = new MD_Title("菜单定义", "MD_MENU", _node);
                    TreeListNode _newnode2 = treeList1.AppendNode(null, _fnode);
                    _newnode2.SetValue(this.treeListColumn1, _mt);
                    _newnode2.ImageIndex       = 1;
                    _newnode2.SelectImageIndex = 0;
                    _newnode2.HasChildren      = true;
                }

                if (_value is MD_Namespace)
                {
                    _fnode.Nodes.Clear();
                    _ns = _value as MD_Namespace;
                    _mt = new MD_Title("数据表", "MD_TABLE", _ns);
                    TreeListNode _newnode = treeList1.AppendNode(null, _fnode);
                    _newnode.SetValue(this.treeListColumn1, _mt);
                    _newnode.ImageIndex       = 1;
                    _newnode.SelectImageIndex = 0;
                    _newnode.HasChildren      = true;

                    _mt                       = new MD_Title("查询模型", "MD_QUERYMODEL", _ns);
                    _newnode                  = treeList1.AppendNode(null, _fnode);
                    _newnode.ImageIndex       = 1;
                    _newnode.SelectImageIndex = 0;
                    _newnode.SetValue(this.treeListColumn1, _mt);
                    _newnode.HasChildren = true;

                    _mt                       = new MD_Title("代码表", "MD_REFTABLE", _ns);
                    _newnode                  = treeList1.AppendNode(null, _fnode);
                    _newnode.ImageIndex       = 1;
                    _newnode.SelectImageIndex = 0;
                    _newnode.SetValue(this.treeListColumn1, _mt);
                    _newnode.HasChildren = true;
                }

                if (_value is MD_Title)
                {
                    _fnode.Nodes.Clear();
                    MD_Title _mdtitle = _value as MD_Title;

                    switch (_mdtitle.TitleType)
                    {
                    case "MD_TABLE":
                        _ns = (MD_Namespace)_mdtitle.FatherObj;
                        IList <MD_Table> _tables = _mdc.GetTablesAtNamespace(_ns.NameSpace);
                        if (_ns.TableList == null)
                        {
                            _ns.TableList = new List <MD_Table>();
                        }

                        foreach (MD_Table _tb in _tables)
                        {
                            TreeListNode _newnode = treeList1.AppendNode(null, _fnode);
                            _newnode.SetValue(this.treeListColumn1, _tb);
                            _newnode.HasChildren      = true;
                            _newnode.ImageIndex       = 2;
                            _newnode.SelectImageIndex = 0;
                            _ns.TableList.Add(_tb);
                            _tb.NamespaceName = _ns.NameSpace;
                        }
                        break;

                    case "MD_QUERYMODEL":
                        _ns = (MD_Namespace)_mdtitle.FatherObj;
                        IList <MD_QueryModel> _models = _mdc.GetQueryModelAtNamespace(_ns.NameSpace);
                        if (_ns.QueryModelList == null)
                        {
                            _ns.QueryModelList = new List <MD_QueryModel>();
                        }
                        foreach (MD_QueryModel _model in _models)
                        {
                            TreeListNode _newnode = treeList1.AppendNode(null, _fnode);
                            _newnode.SetValue(this.treeListColumn1, _model);
                            _newnode.ImageIndex       = 1;
                            _newnode.SelectImageIndex = 0;
                            _newnode.HasChildren      = true;
                            _ns.QueryModelList.Add(_model);
                            _model.Namespace = _ns;
                        }
                        break;

                    case "MD_REFTABLE":
                        _ns = (MD_Namespace)_mdtitle.FatherObj;
                        IList <MD_RefTable> _refTables = _mdc.GetRefTableAtNamespace(_ns.NameSpace);
                        if (_ns.RefTableList == null)
                        {
                            _ns.RefTableList = new List <MD_RefTable>();
                        }
                        foreach (MD_RefTable _rt in _refTables)
                        {
                            TreeListNode _newnode = treeList1.AppendNode(null, _fnode);
                            _newnode.SetValue(this.treeListColumn1, _rt);
                            _newnode.ImageIndex       = 2;
                            _newnode.SelectImageIndex = 0;
                            _newnode.HasChildren      = false;
                            _ns.RefTableList.Add(_rt);
                            _rt.Namespace = _ns;
                        }
                        break;

                    case "MD_MENU":
                        MD_Nodes        _node      = (MD_Nodes)_mdtitle.FatherObj;
                        IList <MD_Menu> _menuTable = _mdc.GetMenuDefineOfNode(_node.DWDM);
                        foreach (MD_Menu _menu in _menuTable)
                        {
                            TreeListNode _newnode = treeList1.AppendNode(null, _fnode);
                            _newnode.SetValue(this.treeListColumn1, _menu);

                            if (_menu.MenuType.Length > 3 && _menu.MenuType.Substring(0, 3) == "WEB")
                            {
                                _newnode.ImageIndex       = 4;
                                _newnode.SelectImageIndex = 0;
                            }
                            else if (_menu.MenuType.Length > 3 && _menu.MenuType.Substring(0, 3) == "SL_")
                            {
                                _newnode.ImageIndex       = 5;
                                _newnode.SelectImageIndex = 0;
                            }
                            else
                            {
                                _newnode.ImageIndex       = 2;
                                _newnode.SelectImageIndex = 0;
                            }
                            _newnode.HasChildren = true;
                            _menu.NodeID         = _node.ID;
                            _menu.MD_Nodes       = _node;
                        }
                        break;

                    case "MD_CONCEPTGROUP":
                        InitConceptGroup(_fnode);
                        break;

                    case "MD_VIEW_GUIDELINE":
                        InitView2GuideLine(_fnode, (MD_QueryModel)_mdtitle.FatherObj);
                        break;

                    case "MD_VIEW_APPLICATION":
                        InitView2Application(_fnode, (MD_QueryModel)_mdtitle.FatherObj);
                        break;

                    case "MD_VIEW_EXRIGHT":
                        InitViewExRight(_fnode, (MD_QueryModel)_mdtitle.FatherObj);
                        break;
                    }
                }

                if (_value is MD_QueryModel_ExRight)
                {
                    _fnode.Nodes.Clear();
                    MD_QueryModel_ExRight         _fright = _value as MD_QueryModel_ExRight;
                    IList <MD_QueryModel_ExRight> _erList = _mdc.GetQueryModelExRights(_fright.ModelID, _fright.ID);
                    foreach (MD_QueryModel_ExRight _right in _erList)
                    {
                        TreeListNode _node = treeList1.AppendNode(null, _fnode);
                        _node.ImageIndex       = 1;
                        _node.SelectImageIndex = 0;
                        _node.SetValue(this.treeListColumn1, _right);
                        _node.HasChildren = true;
                    }
                }

                if (_value is MD_QueryModel)
                {
                    _fnode.Nodes.Clear();
                    MD_QueryModel _qm        = _value as MD_QueryModel;
                    MD_ViewTable  _mainTable = _mdc.GetMainTableOfQueryModel(_qm.QueryModelID);
                    if (_mainTable != null)
                    {
                        TreeListNode _newnode = treeList1.AppendNode(null, _fnode);
                        _newnode.SetValue(this.treeListColumn1, _mainTable);
                        _newnode.ImageIndex       = 2;
                        _newnode.SelectImageIndex = 0;
                        _newnode.HasChildren      = true;
                        _mainTable.QueryModelID   = _qm.QueryModelID;
                        _qm.MainTable             = _mainTable;
                    }
                    List <MD_View2ViewGroup> _v2vGroup = _mdc.GetView2ViewGroupOfQueryModel(_qm.QueryModelID).ToList <MD_View2ViewGroup>();
                    if (_v2vGroup != null && _v2vGroup.Count > 0)
                    {
                        foreach (MD_View2ViewGroup _g in _v2vGroup)
                        {
                            TreeListNode _newnode = treeList1.AppendNode(null, _fnode);
                            _newnode.SetValue(this.treeListColumn1, _g);
                            _newnode.ImageIndex       = 3;
                            _newnode.SelectImageIndex = 0;
                            _newnode.HasChildren      = true;
                            _g.QueryModelID           = _qm.QueryModelID;
                        }
                    }
                    _mt = new MD_Title("关联数据指标", "MD_VIEW_GUIDELINE", _qm);
                    TreeListNode _newqxnode2 = treeList1.AppendNode(null, _fnode);
                    _newqxnode2.ImageIndex       = 8;
                    _newqxnode2.SelectImageIndex = 0;
                    _newqxnode2.SetValue(this.treeListColumn1, _mt);
                    _newqxnode2.HasChildren = true;

                    _mt = new MD_Title("集成应用展示", "MD_VIEW_APPLICATION", _qm);
                    TreeListNode _newAppnode = treeList1.AppendNode(null, _fnode);
                    _newAppnode.ImageIndex       = 8;
                    _newAppnode.SelectImageIndex = 0;
                    _newAppnode.SetValue(this.treeListColumn1, _mt);
                    _newAppnode.HasChildren = true;

                    _mt = new MD_Title("扩展权限定义", "MD_VIEW_EXRIGHT", _qm);
                    TreeListNode _newqxnode = treeList1.AppendNode(null, _fnode);
                    _newqxnode.ImageIndex       = 6;
                    _newqxnode.SelectImageIndex = 0;
                    _newqxnode.SetValue(this.treeListColumn1, _mt);
                    _newqxnode.HasChildren = true;
                }



                if (_value is MD_View2ViewGroup)
                {
                    _fnode.Nodes.Clear();
                    MD_View2ViewGroup   _v2vg = _value as MD_View2ViewGroup;
                    List <MD_View2View> _v2vs = _mdc.GetView2ViewList(_v2vg.ID, _v2vg.QueryModelID).ToList <MD_View2View>();
                    if (_v2vs != null)
                    {
                        foreach (MD_View2View _v in _v2vs)
                        {
                            TreeListNode _newnode = treeList1.AppendNode(null, _fnode);
                            _v.QueryModelID = _v2vg.QueryModelID;
                            _v.ViewGroupID  = _v2vg.ID;
                            _newnode.SetValue(this.treeListColumn1, _v);
                            _newnode.ImageIndex       = 2;
                            _newnode.SelectImageIndex = 0;
                            _newnode.HasChildren      = true;
                        }
                    }
                }



                if (_value is MD_Table)
                {
                    _fnode.Nodes.Clear();
                    MD_Table             _tb   = _value as MD_Table;
                    List <MD_Table2View> _t2vs = _mdc.GetTable2ViewList(_tb.TID).ToList <MD_Table2View>();
                    if (_t2vs != null)
                    {
                        foreach (MD_Table2View _t2v in _t2vs)
                        {
                            TreeListNode _newnode = treeList1.AppendNode(null, _fnode);
                            _newnode.SetValue(this.treeListColumn1, _t2v);
                            _newnode.ImageIndex       = 2;
                            _newnode.SelectImageIndex = 0;
                            _newnode.HasChildren      = true;
                        }
                    }
                }

                if (_value is MD_ViewTable)
                {
                    _fnode.Nodes.Clear();
                    MD_ViewTable _vt = _value as MD_ViewTable;
                    if (_vt.ViewTableType == MDType_ViewTable.MainTable)
                    {
                        MetaDataServiceClient _msc         = new MetaDataServiceClient();
                        IList <MD_ViewTable>  _childTables = _msc.GetChildTableOfQueryModel(_vt.QueryModelID);


                        foreach (MD_ViewTable _cvt in _childTables)
                        {
                            TreeListNode _newnode = treeList1.AppendNode(null, _fnode);
                            _newnode.SetValue(this.treeListColumn1, _cvt);
                            _newnode.ImageIndex       = 2;
                            _newnode.SelectImageIndex = 0;
                            _newnode.HasChildren      = true;
                            _cvt.QueryModelID         = _vt.QueryModelID;
                        }
                    }
                }

                if (_value is MD_Menu)
                {
                    MD_Menu         _fmenu     = _value as MD_Menu;
                    IList <MD_Menu> _menuTable = _mdc.GetSubMenuDefine(_fmenu.MenuID);
                    foreach (MD_Menu _menu in _menuTable)
                    {
                        TreeListNode _newnode = treeList1.AppendNode(null, _fnode);
                        _newnode.SetValue(this.treeListColumn1, _menu);
                        if (_menu.MenuType.Length > 3 && _menu.MenuType.Substring(0, 3) == "WEB")
                        {
                            _newnode.ImageIndex       = 4;
                            _newnode.SelectImageIndex = 0;
                        }
                        else if (_menu.MenuType.Length > 3 && _menu.MenuType.Substring(0, 3) == "SL_")
                        {
                            _newnode.ImageIndex       = 5;
                            _newnode.SelectImageIndex = 0;
                        }
                        else
                        {
                            _newnode.ImageIndex       = 2;
                            _newnode.SelectImageIndex = 0;
                        }
                        _newnode.HasChildren = true;
                        _menu.NodeID         = _fmenu.MD_Nodes.ID;
                        _menu.MD_Nodes       = _fmenu.MD_Nodes;
                    }
                }

                if (_value is MD_ConceptGroup)
                {
                    MD_ConceptGroup       _cGroup      = _value as MD_ConceptGroup;
                    List <MD_ConceptItem> _itemDefines = _mdc.GetSubConceptTagDefine(_cGroup.Name).ToList <MD_ConceptItem>();
                    _cGroup.Items = _itemDefines;
                    _fnode.Nodes.Clear();
                    foreach (MD_ConceptItem _item in _itemDefines)
                    {
                        TreeListNode _newnode = treeList1.AppendNode(null, _fnode);
                        _newnode.SetValue(this.treeListColumn1, _item);
                        _newnode.HasChildren = false;
                    }
                }
            }
        }