示例#1
0
        public IMenu[] Build()
        {
            this.GetUnVisibilityMenu(ApplicationService.Current().DataProvider);

            SystemSettingFacade facade = new SystemSettingFacade(ApplicationService.Current().DataProvider);
            bool   bIsAdmin            = false;
            string strUserCode         = ApplicationService.Current().UserCode;

            if (strUserCode.ToUpper() == "ADMIN")
            {
                bIsAdmin = true;
            }
            else
            {
                for (int i = 0; ApplicationService.Current().LoginInfo.UserGroups != null && i < ApplicationService.Current().LoginInfo.UserGroups.Length; i++)
                {
                    if (((UserGroup)ApplicationService.Current().LoginInfo.UserGroups[i]).UserGroupType == "ADMIN")
                    {
                        bIsAdmin = true;
                        break;
                    }
                }
            }
            if (bIsAdmin == true)
            {
                strUserCode = string.Empty;
            }

            ITreeObjectNode rootNode = facade.BuildMenuTreePDA(strUserCode);

            TreeObjectNodeSet set = rootNode.GetSubLevelChildrenNodes();

            ArrayList listMenu = new ArrayList();

            foreach (MenuTreeNode node in set)
            {
                if (node.MenuWithUrl.MenuType.ToUpper() == MenuType.MenuType_PDA.ToUpper())
                {
                    if (this.menuHT != null && this.menuHT.Contains(node.MenuWithUrl.ModuleCode))
                    {
                        continue;
                    }
                    if (this.htUnVisibilityMenu != null && this.htUnVisibilityMenu.Contains(node.MenuWithUrl.MenuCode))
                    {
                        continue;
                    }
                    listMenu.Add(BuildUltraMenuItem(node));
                }
            }

            if (listMenu.Count > 0)
            {
                MenuCommand[] menuList = new MenuCommand[listMenu.Count];
                listMenu.CopyTo(menuList);
                return(menuList);
            }
            return(null);
        }
示例#2
0
        private void AppendParentParameter(ITreeObjectNode node, string prefix)
        {
            drpParentParameter.Items.Add(new ListItem(prefix + node.Text, node.Text));
            TreeObjectNodeSet nodeSet = node.GetSubLevelChildrenNodes();

            for (int i = 0; i < nodeSet.Count; i++)
            {
                char nbsp = (char)0xA0;
                AppendParentParameter((ITreeObjectNode)nodeSet[i], prefix + (new string(nbsp, 4)));
            }
        }
示例#3
0
        private void InitDepartmentList()
        {
            this.drpDepartmentEdit.Items.Clear();
            BenQGuru.eMES.BaseSetting.SystemSettingFacade sysFacade = new BenQGuru.eMES.BaseSetting.SystemSettingFacade(this.DataProvider);
            ITreeObjectNode   node    = sysFacade.BuildParameterTree("DEPARTMENT");
            TreeObjectNodeSet nodeSet = node.GetSubLevelChildrenNodes();

            for (int i = 0; i < nodeSet.Count; i++)
            {
                AppendParentParameter((ITreeObjectNode)nodeSet[i], "");
            }
        }
示例#4
0
        public TreeObjectNodeSet GetAllNodes(ITreeObjectNode parent)
        {
            TreeObjectNodeSet nSet = new TreeObjectNodeSet();

            nSet.Add(parent);

            foreach (ITreeObjectNode node in parent.GetSubLevelChildrenNodes())
            {
                nSet.AddRange(node.GetAllNodes());
            }

            return(nSet);
        }
示例#5
0
        public void BuildRPT(WebDataMenu ultraMenu, ControlLibrary.Web.Language.LanguageComponent languageComponent, IDomainDataProvider _domainDataProvider)
        {
            this.GetXMLMenu();  //获取不要显示的模块
            this.GetUnVisibilityMenu(_domainDataProvider);

            if (ultraMenu == null)
            {
                return;
            }

            ultraMenu.Items.Clear();

            //BenQGuru.eMES.Common.Domain.IDomainDataProvider _domainDataProvider = BenQGuru.eMES.Common.DomainDataProvider.DomainDataProviderManager.DomainDataProvider();
            SystemSettingFacade facade   = new SystemSettingFacade(_domainDataProvider);
            ITreeObjectNode     rootNode = facade.BuildMenuTreeRPT();

            TreeObjectNodeSet set = rootNode.GetSubLevelChildrenNodes();

            foreach (MenuTreeNode node in set)
            {
                if (node.MenuWithUrl.MenuType.ToUpper() == MenuType.MenuType_RPT.ToUpper())
                {
                    if (this.menuHT != null && this.menuHT.Contains(node.MenuWithUrl.ModuleCode))
                    {
                        continue;
                    }
                    if (this.htUnVisibilityMenu != null && this.htUnVisibilityMenu.Contains(node.MenuWithUrl.MenuCode))
                    {
                        continue;
                    }

                    ultraMenu.Items.Add(BuildUltraMenuItemRPT(node, languageComponent));
                }
            }

            DataMenuItem item = new DataMenuItem();

            item.Text        = "";
            item.NavigateUrl = "#";

            ultraMenu.Items.Add(item);

            if (_domainDataProvider != null)
            {
                ((SQLDomainDataProvider)_domainDataProvider).PersistBroker.CloseConnection();
            }
        }
示例#6
0
        private Infragistics.WebUI.UltraWebNavigator.Node BuildTreeNode(ITreeObjectNode treeNode)
        {
            Infragistics.WebUI.UltraWebNavigator.Node node = new Node();

            node.Text = treeNode.Text;
            node.Tag  = treeNode;

            if (treeNode.Text == this.txtDirNameEdit.Text)
            {
                this.treeDocument.SelectedNode = node;
            }

            foreach (ITreeObjectNode subNode in treeNode.GetSubLevelChildrenNodes())
            {
                node.Nodes.Add(BuildTreeNode(subNode));
            }

            return(node);
        }
示例#7
0
        private void InitParentParameterList()
        {
            this.drpParentParameter.Items.Clear();
            drpParentParameter.Items.Add("");
            if (drpParameterGroupCodeEdit.SelectedValue == string.Empty)
            {
                return;
            }
            if (_facade == null)
            {
                _facade = new SystemSettingFacade(base.DataProvider);
            }
            ITreeObjectNode   node    = _facade.BuildParameterTree(drpParameterGroupCodeEdit.SelectedValue);
            TreeObjectNodeSet nodeSet = node.GetSubLevelChildrenNodes();

            for (int i = 0; i < nodeSet.Count; i++)
            {
                AppendParentParameter((ITreeObjectNode)nodeSet[i], "");
            }
        }
示例#8
0
        public void Build(WebDataMenu ultraMenu, ControlLibrary.Web.Language.LanguageComponent languageComponent, IDomainDataProvider _domainDataProvider)
        {
            this.GetXMLMenu();  //获取不要显示的模块
            this.GetUnVisibilityMenu(_domainDataProvider);

            if (ultraMenu == null)
            {
                return;
            }

            ultraMenu.Items.Clear();

            //BenQGuru.eMES.Common.Domain.IDomainDataProvider _domainDataProvider = BenQGuru.eMES.Common.DomainDataProvider.DomainDataProviderManager.DomainDataProvider();
            SystemSettingFacade facade = new SystemSettingFacade(_domainDataProvider);

            #region 添加报表平台菜单入口

            //获得系统参数里面的报表平台菜单入口
            string reportViewMenuCode = string.Empty;
            Domain.BaseSetting.Parameter parameter = (Domain.BaseSetting.Parameter)facade.GetParameter("REPORTMENU", "REPORTMENU");
            if (parameter != null)
            {
                reportViewMenuCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(parameter.ParameterAlias));
            }

            //获得系统参数里面的报表平台菜单Item
            DataMenuItem reportViewMenuItem = GetReportViewMenuRoot(reportViewMenuCode, languageComponent, _domainDataProvider);

            #endregion

            ITreeObjectNode rootNode = facade.BuildMenuTree();

            TreeObjectNodeSet set = rootNode.GetSubLevelChildrenNodes();
            foreach (MenuTreeNode node in set)
            {
                if (node.MenuWithUrl.MenuType.ToUpper() == MenuType.MenuType_BS.ToUpper())
                {
                    if (this.menuHT != null && this.menuHT.Contains(node.MenuWithUrl.ModuleCode))
                    {
                        continue;
                    }
                    if (this.htUnVisibilityMenu != null && this.htUnVisibilityMenu.Contains(node.MenuWithUrl.MenuCode))
                    {
                        continue;
                    }
                    ultraMenu.Items.Add(BuildUltraMenuItem(node, languageComponent, reportViewMenuCode, reportViewMenuItem));
                }
            }

            DataMenuItem item = new DataMenuItem();

            item.Text        = "";
            item.NavigateUrl = "#";

            ultraMenu.Items.Add(item);

            if (_domainDataProvider != null)
            {
                ((SQLDomainDataProvider)_domainDataProvider).PersistBroker.CloseConnection();
            }
        }