本文整理汇总了C#中ContentPost.update方法的典型用法代码示例。如果您正苦于以下问题:C# ContentPost.update方法的具体用法?C# ContentPost.update怎么用?C# ContentPost.update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentPost
的用法示例。
在下文中一共展示了ContentPost.update方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Delete
public virtual void Delete( ContentPost post )
{
post.SaveStatus = SaveStatus.Delete;
post.update();
ContentPostSection.updateBatch( "SaveStatus=" + SaveStatus.Delete, "PostId=" + post.Id );
}
示例2: UpdateAttachmentPermission
public virtual void UpdateAttachmentPermission( ContentPost post, int ischeck )
{
post.IsAttachmentLogin = ischeck;
post.update( "IsAttachmentLogin" );
}
示例3: UpdateTitleStyle
public virtual void UpdateTitleStyle( ContentPost post, string titleStyle )
{
post.Style = titleStyle;
post.update( "Style" );
}
示例4: UnDelete
public void UnDelete( ContentPost post )
{
post.SaveStatus = SaveStatus.Normal;
post.update();
}
示例5: transOne
private void transOne( ContentPost x, List<ContentSection> sections ) {
if (sections.Count == 0) return;
// 0. 先更新post
x.AppId = sections[0].AppId;
x.PageSection = sections[0];
x.update();
// 1. 删除旧有关系
ContentPostSection.deleteBatch( "PostId=" + x.Id );
// 2. 挪到新section中
foreach (ContentSection section in sections) {
// 多对多处理
ContentPostSection ps = new ContentPostSection();
ps.Post = x;
ps.Section = section;
ps.insert();
}
}
示例6: UpdateAtachments
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();
}
示例7: CreateByTemp
public virtual void CreateByTemp( String ids, ContentPost post ) {
int[] arrIds = cvt.ToIntArray( ids );
if (arrIds.Length == 0) return;
int attachmentCount = 0;
foreach (int id in arrIds) {
ContentAttachmentTemp at = ContentAttachmentTemp.findById( id );
if (at == null) continue;
ContentAttachment a = new ContentAttachment();
a.AppId = at.AppId;
a.Guid = at.Guid;
a.FileSize = at.FileSize;
a.Type = at.Type;
a.Name = at.Name;
a.Description = at.Description;
a.PostId = post.Id;
a.OwnerId = post.OwnerId;
a.OwnerType = post.OwnerType;
a.OwnerUrl = post.OwnerUrl;
a.Creator = post.Creator;
a.CreatorUrl = post.CreatorUrl;
a.insert();
at.delete();
attachmentCount++;
}
post.Attachments = attachmentCount;
post.update( "Attachments" );
}
示例8: Delete
public virtual void Delete( ContentPost post )
{
post.SaveStatus = SaveStatus.Delete;
post.update();
}
示例9: UpdateSection
public virtual void UpdateSection( ContentPost post, int sectionId )
{
ContentSection section = new ContentSection();
section.Id = sectionId;
post.PageSection = section;
post.update();
}
示例10: Update
public virtual void Update( ContentPost post, String sectionIds, String tagList )
{
if (db.update( post ).IsValid) {
post.Tag.Save( tagList );
}
List<ContentPostSection> oldPsList = ContentPostSection.find( "PostId=" + post.Id ).list();
// ��Զദ��
ContentPostSection.deleteBatch( "PostId=" + post.Id );
ContentPostSection ps = new ContentPostSection();
int[] ids = cvt.ToIntArray( sectionIds );
foreach (int sectionId in ids) {
ContentSection section = new ContentSection();
section.Id = sectionId;
ps.Post = post;
ps.Section = section;
ps.insert();
}
post.PageSection = new ContentSection(); // ����ʹ�þɰ�һ�Զ��ϵ
post.PageSection.Id = ids[0];
post.update();
// ���¾ɵ�section��ϵ
foreach (ContentPostSection p in oldPsList) {
updateCachePostIds( p.Section.Id );
}
// �����µ�section��ϵ
foreach (int sectionId in ids) {
updateCachePostIds( sectionId );
}
}