Пример #1
0
        private void InitView2GuideLine(TreeListNode _fnode, MD_QueryModel _qm)
        {
            IList <MD_View_GuideLine> _vgList;

            using (MetaDataServiceClient _mdc = new MetaDataServiceClient())
            {
                _vgList = _mdc.GetView2GuideLineList(_qm.QueryModelID);
            }
            foreach (MD_View_GuideLine _gl in _vgList)
            {
                TreeListNode _node = treeList1.AppendNode(null, _fnode);
                _node.ImageIndex       = 1;
                _node.SelectImageIndex = 0;
                _node.SetValue(this.treeListColumn1, _gl);
                _node.HasChildren = true;
            }
        }
Пример #2
0
        private bool ExportNameSpace()
        {
            using (MetaDataServiceClient _mdc = new MetaDataServiceClient())
            {
                //取表定义
                this.panelWait.Visible = true;
                SetProgress("正在读取数据表的元数据定义...", 0);

                IList <MD_Table> _tbList = _mdc.GetTablesAtNamespace(Namespace.NameSpace);
                SetProgressStep(10, 40, _tbList.Count);

                foreach (MD_Table _tb in _tbList)
                {
                    ShowProgressContinu(string.Format("正在读取{0}表的字段定义...", _tb.TableName));
                    _tb.Columns = _mdc.GetColumnsOfTable(_tb.TID);
                }

                //取查询模型定义
                SetProgress("正在读取查询模型的元数据定义...", 42);

                IList <MD_QueryModel> _qvList = _mdc.GetQueryModelAtNamespace(Namespace.NameSpace);
                SetProgressStep(45, 90, _qvList.Count);
                foreach (MD_QueryModel _qv in _qvList)
                {
                    ShowProgressContinu(string.Format("正在读取{0}的模型定义...", _qv.DisplayTitle));
                    _qv.MainTable      = _mdc.GetMainTableOfQueryModel(_qv.QueryModelID);
                    _qv.ChildTables    = _mdc.GetChildTableOfQueryModel(_qv.QueryModelID);
                    _qv.View2ViewGroup = _mdc.GetView2ViewGroupOfQueryModel(_qv.QueryModelID);

                    if (_qv.View2ViewGroup != null)
                    {
                        foreach (MD_View2ViewGroup _gr in _qv.View2ViewGroup)
                        {
                            _gr.View2Views = _mdc.GetView2ViewList(_gr.ID, _qv.QueryModelID);
                        }
                    }

                    try
                    {
                        _qv.View2GuideLines = _mdc.GetView2GuideLineList(_qv.QueryModelID);
                    }
                    catch (FaultException ex)
                    {
                        MessageBox.Show(ex.Message, "系统错误");
                    }
                    _qv.View2Application = _mdc.GetView2ApplicationList(_qv.QueryModelID);
                }

                //取代码表
                SetProgress("正在读取代码表的元数据定义...", 92);
                IList <MD_RefTable> _refList = _mdc.GetRefTableAtNamespace(Namespace.NameSpace);

                Namespace.RefTableList   = _refList;
                Namespace.QueryModelList = _qvList;
                Namespace.TableList      = _tbList;
                SetProgress("正在写入导出文件...", 92);
                WriteExportFile(Namespace);
                SetProgress("导出完成!", 100);
                return(true);
            }
        }