示例#1
0
 public static bool Add(CommentInfo commentInfo)
 {
     commentInfo.CommentId = MaxCommentId() + 1;
     if (dal.Add(commentInfo))
     {
         ContentManage.UpdateCommentAuditedAndUnaudited(commentInfo.GeneralId);
         return(true);
     }
     return(false);
 }
示例#2
0
        public static bool SetStatus(int commentId, bool status)
        {
            CommentInfo commentInfo = dal.GetCommentInfo(commentId);

            if (!commentInfo.IsNull && dal.SetStatus(commentId, status))
            {
                ContentManage.UpdateCommentAuditedAndUnaudited(commentInfo.GeneralId);
                return(true);
            }
            return(false);
        }
示例#3
0
        public static bool Delete(int commentId)
        {
            CommentInfo commentInfo = dal.GetCommentInfo(commentId);

            if (dal.Delete(commentId))
            {
                ContentManage.UpdateCommentAuditedAndUnaudited(commentInfo.GeneralId);
                CommentPKZone.DeleteByCommentId(commentId);
                return(true);
            }
            return(false);
        }
示例#4
0
        public static bool DeleteByUserName(int commentId)
        {
            string      userName    = PEContext.Current.User.UserName;
            CommentInfo commentInfo = dal.GetCommentInfo(commentId);

            if (((!commentInfo.IsNull && (commentInfo.UserName == userName)) && !commentInfo.Status) && dal.Delete(commentId, userName))
            {
                ContentManage.UpdateCommentAuditedAndUnaudited(commentInfo.GeneralId);
                CommentPKZone.DeleteByCommentId(commentId);
                return(true);
            }
            return(false);
        }