Beispiel #1
0
        /// <summary>
        /// Create an actionresult to target a specific template
        /// in this case the 'Home' template on the 'Home' Doctype
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public override ActionResult Index(RenderModel model)
        {
            // This is how we log out
            var logOff = Request.QueryString[AppConstants.LogOut];

            if (!string.IsNullOrEmpty(logOff))
            {
                MemberService.LogOff();
                return(Redirect(Settings.ForumRootUrl));
            }

            var forumRoot = DialogueMapper.MapRootForum(model.Content);

            // Return the model to the current template
            return(View(PathHelper.GetThemeViewPath("Dialogue"), forumRoot));
        }
        /// <summary>
        /// Create an actionresult to target a specific template
        /// in this case the 'Home' template on the 'Home' Doctype
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public override ActionResult Index(RenderModel model)
        {
            // This is how we log out
            var logOff = Request.QueryString[AppConstants.LogOut];

            if (!string.IsNullOrEmpty(logOff))
            {
                ServiceFactory.MemberService.LogOff();
                return(Redirect(Settings.ForumRootUrl));
            }

            var forumRoot = DialogueMapper.MapRootForum(model.Content);


            foreach (var category in forumRoot.MainCategories)
            {
                var topicCount = ServiceFactory.TopicService.GetTopicCountByCategory(category.Id);
                category.TopicCount = topicCount;

                category.LatestTopic = ServiceFactory.TopicService.GetPagedTopicsByCategory(1, Settings.TopicsPerPage, int.MaxValue, category.Id).FirstOrDefault();
            }
            // Return the model to the current template
            return(View(PathHelper.GetThemeViewPath("Dialogue"), forumRoot));
        }