コード例 #1
0
ファイル: OpenCommentService.cs プロジェクト: zhdwwf/wojilu
        private void updateTargetReplies(OpenComment c, int replies)
        {
            ICommentTarget target = GetTarget(c) as ICommentTarget;

            if (target != null)
            {
                target.Replies = replies;
                db.update(target);
            }

            // feed replies
            Microblog mblog = getFeed(c);

            if (mblog != null)
            {
                mblog.Replies = replies;
                mblog.update();
            }

            if (c.AppId > 0 && target != null)
            {
                Type appType = target.GetAppType();
                if (appType != null)
                {
                    ICommentApp app = ndb.findById(appType, c.AppId) as ICommentApp;
                    if (app != null)
                    {
                        int appCount = OpenComment.count("AppId=" + c.AppId + " and TargetDataType='" + c.TargetDataType + "'");
                        app.CommentCount = appCount;
                        db.update(app);
                    }
                }
            }
        }
コード例 #2
0
ファイル: OpenCommentService.cs プロジェクト: youmuyou/wojilu
        private static void updateTargetReplies(OpenComment c, int replies)
        {
            Type           targetType = Entity.GetType(c.TargetDataType);
            ICommentTarget target     = ndb.findById(targetType, c.TargetDataId) as ICommentTarget;

            if (target == null)
            {
                return;
            }
            target.Replies = replies;
            db.update(target);

            if (c.AppId <= 0)
            {
                return;
            }
            Type appType = target.GetAppType();

            if (appType == null)
            {
                return;
            }

            ICommentApp app = ndb.findById(appType, c.AppId) as ICommentApp;

            if (app == null)
            {
                return;
            }
            int appCount = OpenComment.count("AppId=" + c.AppId + " and TargetDataType='" + c.TargetDataType + "'");

            app.CommentCount = appCount;
            db.update(app);
        }
コード例 #3
0
        private static void updateTargetReplies(OpenComment c, int replies)
        {
            Type           targetType = Entity.GetType(c.TargetDataType);
            ICommentTarget target     = ndb.findById(targetType, c.TargetDataId) as ICommentTarget;

            if (target == null)
            {
                return;
            }
            target.Replies = replies;
            db.update(target);
        }