Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }