public static bool Add(CommentInfo commentInfo) { commentInfo.CommentId = MaxCommentId() + 1; if (dal.Add(commentInfo)) { ContentManage.UpdateCommentAuditedAndUnaudited(commentInfo.GeneralId); return(true); } return(false); }
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); }
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); }
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); }