Esempio n. 1
0
        public virtual ActionResult AnswerPoll(PollUserAnswerInput answer)
        {
            this.forumStorageWriter.SavePollAnswer(answer, this.User.Identity.Name);

            TopicPageRoutedata topicPage = this.forumStorageReader.GetRouteDataForLastTopicPage(answer.TopicId);

            return(this.RedirectToPost(topicPage));
        }
Esempio n. 2
0
        private ActionResult RedirectToPost(TopicPageRoutedata topicPage)
        {
            string url = this.Url.Action(MVC.Forum.Topic().AddRouteValues(new { id = topicPage.TopicId, name = UrlEncoder.ToFriendlyUrl(topicPage.TopicTitle), topicPage = topicPage.PageNumber }));

            url += $"#{topicPage.PostIndex}";

            return(this.Redirect(url));
        }
Esempio n. 3
0
        public virtual ActionResult Reply(ReplyViewModel viewModel)
        {
            if (this.ModelState.IsValid)
            {
                this.forumStorageWriter.AddReply(viewModel, this.User.Identity.Name);
            }

            TopicPageRoutedata topicPage = this.forumStorageReader.GetRouteDataForLastTopicPage(viewModel.TopicId);

            this.forumNotificationSender.SendNewReplyNotifications(viewModel.TopicId, topicPage.PostIndex);

            return(this.RedirectToPost(topicPage));
        }
Esempio n. 4
0
        public virtual ActionResult EditPost(EditPostViewModel viewModel)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(viewModel));
            }

            this.forumStorageWriter.UpdatePost(viewModel);

            TopicPageRoutedata topicPage = this.forumStorageReader.GetRouteDataForPost(viewModel.TopicId, viewModel.PostIndex);

            return(this.RedirectToPost(topicPage));
        }
Esempio n. 5
0
        public virtual ActionResult FirstNewPostInTopic(string topicId)
        {
            TopicPageRoutedata topicPage = this.forumStorageReader.GetRouteDataForFirstNewPost(topicId, this.User.Identity.Name);

            return(this.RedirectToPost(topicPage));
        }