示例#1
0
        public virtual void UpdateAtachments(long[] arrAttachmentIds, ContentPost post)
        {
            if (post == null || arrAttachmentIds.Length == 0)
            {
                return;
            }

            foreach (int id in arrAttachmentIds)
            {
                ContentAttachment a = ContentAttachment.findById(id);
                if (a == null)
                {
                    continue;
                }

                a.OwnerId    = post.OwnerId;
                a.OwnerType  = post.OwnerType;
                a.OwnerUrl   = post.OwnerUrl;
                a.Creator    = post.Creator;
                a.CreatorUrl = post.CreatorUrl;

                a.PostId = post.Id;
                a.AppId  = post.AppId;

                a.update();
            }

            int count = ContentAttachment.count("PostId=" + post.Id);

            post.Attachments = count;
            post.update();
        }
        public virtual void UpdateFile( ContentAttachment a, String oldFilePath ) {

            a.update();

            if (a.IsImage)
                Img.DeleteImgAndThumb( oldFilePath );
            else
                Img.DeleteFile( oldFilePath );

        }
示例#3
0
        public virtual void UpdateFile(ContentAttachment a, String oldFilePath)
        {
            a.update();

            if (a.IsImage)
            {
                Img.DeleteImgAndThumb(oldFilePath);
            }
            else
            {
                Img.DeleteFile(oldFilePath);
            }
        }
示例#4
0
 public virtual void UpdateName(ContentAttachment attachment, string name)
 {
     attachment.Description = name;
     attachment.update("Description");
 }
 public virtual void UpdateName( ContentAttachment attachment, string name ) {
     attachment.Description = name;
     attachment.update( "Description" );
 }