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)); }
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)); }
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)); }
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)); }
public virtual ActionResult FirstNewPostInTopic(string topicId) { TopicPageRoutedata topicPage = this.forumStorageReader.GetRouteDataForFirstNewPost(topicId, this.User.Identity.Name); return(this.RedirectToPost(topicPage)); }