Exemple #1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="juActivityID"></param>
        /// <returns></returns>
        public bool DelReview(string ReviewMainId)
        {
            var result = Delete(new ReviewInfo(), string.Format(" ReviewMainId={0} ", ReviewMainId)) > 0;

            BLLRedis.ClearReviewList(WebsiteOwner);
            return(result);
        }
Exemple #2
0
        public bool BatchAudit(AuditStatus status, string[] ids)
        {
            try
            {
                ReviewInfo rInfo    = new ReviewInfo();
                string     setPms   = string.Format("AuditStatus = {0}", (int)status);
                string     strWhere = string.Format("AutoId in ({0})", string.Join(",", ids));

                var result = this.Update(rInfo, setPms, strWhere) > 0;
                BLLRedis.ClearReviewList(WebsiteOwner);
                return(result);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Exemple #3
0
        /// <summary>
        /// 添加评论或评论回复
        /// </summary>
        /// <param name="type">类型</param>
        /// <param name="foreignkeyId">外键id</param>
        /// <param name="preReviewId">所属评论id</param>
        /// <param name="reviewerId">提交者id</param>
        /// <param name="title">标题</param>
        /// <param name="content">内容</param>
        /// <param name="websiteOwner">站点所有者</param>
        /// <param name="reviewMainId">主id</param>
        /// <returns></returns>
        public bool AddReview(Enums.ReviewTypeKey type, string foreignkeyId, int preReviewId, string reviewerId, string title, string content, string websiteOwner, out int reviewMainId, int isHideUserName)
        {
            reviewMainId = int.Parse(GetGUID(TransacType.CommAdd));

            var typeKey = CommonPlatform.Helper.EnumStringHelper.ToString(type);

            //保存基本信息
            Model.ReviewInfo data = new ReviewInfo()
            {
                ReviewMainId   = reviewMainId,
                ReviewType     = typeKey,
                ForeignkeyId   = foreignkeyId,
                ParentId       = preReviewId,
                ReviewTitle    = title,
                ReviewContent  = content,
                WebsiteOwner   = websiteOwner,
                IsHideUserName = isHideUserName,
                InsertDate     = DateTime.Now,
                UserId         = reviewerId
            };


            if (type != Enums.ReviewTypeKey.CommentReply)
            {
                data.Expand1 = foreignkeyId;

                bllJuActivity.PlusNumericalCol("CommentCount", int.Parse(foreignkeyId));
                bllJuActivity.PlusNumericalCol("CommentAndReplayCount", int.Parse(foreignkeyId));
            }
            else if (type == Enums.ReviewTypeKey.CommentReply)
            {
                int pre = 0;
                int.TryParse(foreignkeyId, out pre);
                var preData = GetReviewInfo(pre);
                if (preData != null)
                {
                    data.Expand1 = preData.ForeignkeyId;
                    bllJuActivity.PlusNumericalCol("CommentAndReplayCount", int.Parse(preData.ForeignkeyId));
                }
            }
            var result = Add(data);

            BLLRedis.ClearReviewList(websiteOwner);
            return(result);
        }