Example #1
0
        public virtual void UpdateFile(ContentAttachment a, String oldFilePath)
        {
            a.update();

            if (a.IsImage)
            {
                Img.DeleteImgAndThumb(oldFilePath);
            }
            else
            {
                Img.DeleteFile(oldFilePath);
            }
        }
Example #2
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);
        }