public ActionResult _Menu_App(string spaceKey)
        {
            long groupId = GroupIdToGroupKeyDictionary.GetGroupId(spaceKey);
            GroupEntity group = groupService.Get(groupId);
            if (group == null)
                return Content(string.Empty);

            int currentNavigationId = RouteData.Values.Get<int>("CurrentNavigationId", 0);

            NavigationService navigationService = new NavigationService();
            Navigation navigation = navigationService.GetNavigation(PresentAreaKeysOfBuiltIn.GroupSpace, currentNavigationId, group.GroupId);

            IEnumerable<Navigation> navigations = new List<Navigation>();
            if (navigation != null)
            {
                if (navigation.Depth >= 1 && navigation.Parent != null)
                {
                    navigations = navigation.Parent.Children;
                }
                else if (navigation.Depth == 0)
                {
                    navigations = navigation.Children;
                }

                ManagementOperationService managementOperationService = new ManagementOperationService();
                IEnumerable<ApplicationManagementOperation> applicationManagementOperations = managementOperationService.GetShortcuts(PresentAreaKeysOfBuiltIn.GroupSpace, false);
                if (applicationManagementOperations != null)
                {
                    ViewData["ApplicationManagementOperations"] = applicationManagementOperations.Where(n => n.ApplicationId == navigation.ApplicationId);
                }
            }

            return View(navigations);
        }
        /// <summary>
        /// 侧边菜单
        /// </summary>
        /// <returns></returns>
        public ActionResult _AsideMenu()
        {
            NavigationService service = new NavigationService();
            int currentNavigationId = RouteData.Values.Get<int>("CurrentNavigationId", 0);

            IEnumerable<Navigation> navigations = null;
            if (currentNavigationId > 0)
            {
                IEnumerable<int> currentNavigationPath = service.GetCurrentNavigationPath(PresentAreaKeysOfBuiltIn.ControlPanel, 0, currentNavigationId);
                IEnumerable<Navigation> rootNavigations = service.GetRootNavigations(PresentAreaKeysOfBuiltIn.ControlPanel);

                Navigation parentNavigation = null;
                int parentNavigationId = 0;
                if (currentNavigationPath.Count() > 1)
                {
                    parentNavigationId = currentNavigationPath.ElementAt(currentNavigationPath.Count() - 2);
                }
                else if (currentNavigationPath.Count() == 1)
                {
                    parentNavigationId = currentNavigationPath.First();
                }

                parentNavigation = service.GetNavigation(PresentAreaKeysOfBuiltIn.ControlPanel, parentNavigationId);
                if (parentNavigation != null)
                {
                    if (parentNavigation.Depth > 0)
                    {
                        Navigation navigation = service.GetNavigation(PresentAreaKeysOfBuiltIn.ControlPanel, parentNavigation.ParentNavigationId);
                        navigations = navigation.Children;
                    }
                    else
                    {
                        navigations = parentNavigation.Children;
                    }
                }
            }

            return View(navigations);
        }
        public ActionResult _TopicMenu(string spaceKey)
        {
            long topicId = TopicIdToTopicKeyDictionary.GetTopicId(spaceKey);
            TopicEntity topic = topicService.Get(topicId);
            if (topic == null)
                return Content(string.Empty);

            int currentNavigationId = RouteData.Values.Get<int>("CurrentNavigationId", 0);
            IEnumerable<Navigation> navigations = new List<Navigation>();

            NavigationService navigationService = new NavigationService();
            Navigation navigation = navigationService.GetNavigation(PresentAreaKeysOfExtension.TopicSpace, currentNavigationId, topic.TopicId);

            if (navigation != null && navigation.Children.Count() > 0)
            {
                navigations = navigation.Children;
            }
            else
            {
                navigations = navigationService.GetRootNavigations(PresentAreaKeysOfExtension.TopicSpace, topic.TopicId);
            }

            return View(navigations);
        }
        public ActionResult _Menu_Manage(string spaceKey)
        {
            long groupId = GroupIdToGroupKeyDictionary.GetGroupId(spaceKey);
            GroupEntity group = groupService.Get(groupId);
            if (group == null)
                return Content(string.Empty);

            int currentNavigationId = RouteData.Values.Get<int>("CurrentNavigationId", 0);

            NavigationService navigationService = new NavigationService();
            Navigation navigation = navigationService.GetNavigation(PresentAreaKeysOfBuiltIn.GroupSpace, currentNavigationId, group.GroupId);

            IEnumerable<Navigation> navigations = new List<Navigation>();
            if (navigation != null)
            {
                if (navigation.Depth >= 1 && navigation.Parent != null)
                {
                    navigations = navigation.Parent.Children;
                }
                else if (navigation.Depth == 0)
                {
                    navigations = navigation.Children;
                }
            }

            ViewData["MemberApplyCount"] = groupService.GetMemberApplyCount(group.GroupId);

            return View(navigations);
        }
        //[HttpGet]
        public ActionResult _Menu_Manage(string spaceKey)
        {
            long topicId = TopicIdToTopicKeyDictionary.GetTopicId(spaceKey);
            TopicEntity topic = topicService.Get(topicId);
            if (topic == null)
                return Content(string.Empty);

            int currentNavigationId = RouteData.Values.Get<int>("CurrentNavigationId", 0);

            NavigationService navigationService = new NavigationService();
            Navigation navigation = navigationService.GetNavigation(PresentAreaKeysOfExtension.TopicSpace, currentNavigationId, topic.TopicId);

            IEnumerable<Navigation> navigations = new List<Navigation>();
            if (navigation != null)
            {
                if (navigation.Depth >= 1 && navigation.Parent != null)
                {
                    navigations = navigation.Parent.Children;
                }
                else if (navigation.Depth == 0)
                {
                    navigations = navigation.Children;
                }
            }

            ViewData["MemberApplyCount"] = topicService.GetMemberApplyCount(topic.TopicId);

            return View(navigations);
        }
Beispiel #6
0
        public ActionResult _GroupMenu(string spaceKey)
        {
            long groupId = GroupIdToGroupKeyDictionary.GetGroupId(spaceKey);
            GroupEntity group = groupService.Get(groupId);
            if (group == null)
                return Content(string.Empty);

            int currentNavigationId = RouteData.Values.Get<int>("CurrentNavigationId", 0);
            IEnumerable<Navigation> navigations = new List<Navigation>();

            NavigationService navigationService = new NavigationService();
            Navigation navigation = navigationService.GetNavigation(PresentAreaKeysOfBuiltIn.GroupSpace, currentNavigationId, group.GroupId);

            if (navigation != null && navigation.Children.Count() > 0)
            {
                navigations = navigation.Children;
            }
            else
            {
                navigations = navigationService.GetRootNavigations(PresentAreaKeysOfBuiltIn.GroupSpace, group.GroupId);
            }

            return View(navigations);
        }