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 ); }
public virtual void UpdateFile(ContentAttachment a, String oldFilePath) { a.update(); if (a.IsImage) { Img.DeleteImgAndThumb(oldFilePath); } else { Img.DeleteFile(oldFilePath); } }
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" ); }