当前位置: 首页>>代码示例>>C#>>正文


C# ContentPost.update方法代码示例

本文整理汇总了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 );
 }
开发者ID:Boshin,项目名称:wojilu,代码行数:6,代码来源:ContentPostService.cs

示例2: UpdateAttachmentPermission

 public virtual void UpdateAttachmentPermission( ContentPost post, int ischeck )
 {
     post.IsAttachmentLogin = ischeck;
     post.update( "IsAttachmentLogin" );
 }
开发者ID:Boshin,项目名称:wojilu,代码行数:5,代码来源:ContentPostService.cs

示例3: UpdateTitleStyle

 public virtual void UpdateTitleStyle( ContentPost post, string titleStyle )
 {
     post.Style = titleStyle;
     post.update( "Style" );
 }
开发者ID:Boshin,项目名称:wojilu,代码行数:5,代码来源:ContentPostService.cs

示例4: UnDelete

 public void UnDelete( ContentPost post )
 {
     post.SaveStatus = SaveStatus.Normal;
     post.update();
 }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:5,代码来源:SysPostService.cs

示例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();

            }
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:23,代码来源:ContentPostService.cs

示例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();

        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:26,代码来源:AttachmentService.cs

示例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" );

        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:39,代码来源:AttachmentService.cs

示例8: Delete

 public virtual void Delete( ContentPost post )
 {
     post.SaveStatus = SaveStatus.Delete;
     post.update();
 }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:5,代码来源:ContentPostService.cs

示例9: UpdateSection

 public virtual void UpdateSection( ContentPost post, int sectionId )
 {
     ContentSection section = new ContentSection();
     section.Id = sectionId;
     post.PageSection = section;
     post.update();
 }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:7,代码来源:ContentPostService.cs

示例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 );
            }
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:36,代码来源:ContentPostService.cs


注:本文中的ContentPost.update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。