public ActionResult Problem(String pid, Int32 id = 1) { if (String.IsNullOrEmpty(pid)) { throw new InvalidRequstException(RequestType.Problem); } PagedList <TreeNode <ForumPostEntity> > list = ForumPostManager.GetPostTreeList(id, pid); ViewBag.ProblemID = pid; return(ViewWithPager("Main", list, id)); }
/// <summary> /// 讨论版回复页面 /// </summary> /// <param name="id">帖子ID</param> /// <param name="tid">主题ID</param> /// <returns>操作后的结果</returns> public ActionResult Reply(Int32 id = -1, String tid = "") { ForumPostEntity post = (String.IsNullOrEmpty(tid) ? ForumPostManager.GetForumPost(id) : ForumPostManager.GetForumPostByTopicID(tid)); ForumTopicEntity topic = ForumTopicManager.GetForumTopic(post.TopicID); if (topic.Type == ForumTopicType.Contest) { return(RedirectToErrorMessagePage("This topic is not in the main disscus board!")); } post.RelativeType = (topic.Type == ForumTopicType.Problem ? topic.Type : ForumTopicType.Default); post.RelativeID = (topic.Type == ForumTopicType.Problem ? topic.RelativeID : -1); List <TreeNode <ForumPostEntity> > listTreeNode = ForumPostManager.GetPostTreeList(topic, post.PostID); ViewBag.IsLocked = topic.IsLocked; return(View(new Tuple <ForumPostEntity, List <TreeNode <ForumPostEntity> > >(post, listTreeNode))); }
public ActionResult Main(Int32 id = 1) { PagedList <TreeNode <ForumPostEntity> > list = ForumPostManager.GetPostTreeList(id, String.Empty); return(ViewWithPager("Main", list, id)); }