public void Show(int id) { ForumPost post = ForumPost.findById(id); PostDetailVo x = new PostDetailVo { Id = id, Title = post.Title, User = post.Creator.Name, Created = post.Created, Content = strUtil.ParseHtml(post.Content) }; echoJson(x); }
public virtual ForumTopic GetByPost(int postId) { ForumPost post = ForumPost.findById(postId); if (post == null) { return(null); } ForumTopic topic = GetById(post.TopicId); if (topic.Status == (int)TopicStatus.Delete) { return(null); } return(topic); }
public virtual void UpdateFile(User user, Attachment a, String oldFilePath) { a.Created = DateTime.Now; a.update(); if (a.IsImage) { Img.DeleteImgAndThumb(oldFilePath); } else { Img.DeleteFile(oldFilePath); } ForumTopicService topicService = new ForumTopicService(); ForumPost post = ForumPost.findById(a.PostId); topicService.UpdateLastEditInfo(user, post); }