コード例 #1
0
ファイル: ServiceController.cs プロジェクト: shiyibin/wojilu
        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
ファイル: AttachmentService.cs プロジェクト: zhdwwf/wojilu
        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);
        }