Esempio n. 1
0
        /// <summary>
        /// Approves the comment, and removes it from the SPAM folder or from the 
        /// Trash folder.
        /// </summary>
        /// <param name="feedback"></param>
        /// <param name="spamService"></param>
        /// <returns></returns>
        public static void Approve(this ObjectRepository repository, FeedbackItem feedback, ICommentSpamService spamService)
        {
            if (feedback == null)
            {
                throw new ArgumentNullException("feedback");
            }

            feedback.SetStatus(FeedbackStatusFlag.Approved, true);
            feedback.SetStatus(FeedbackStatusFlag.Deleted, false);
            if (spamService != null)
            {
                spamService.SubmitGoodFeedback(feedback);
            }

            repository.Update(feedback);
        }
        /// <summary>
        /// Approves the comment, and removes it from the SPAM folder or from the
        /// Trash folder.
        /// </summary>
        /// <param name="feedback"></param>
        /// <param name="spamService"></param>
        /// <returns></returns>
        public static void Approve(FeedbackItem feedback, ICommentSpamService spamService)
        {
            if (feedback == null)
            {
                throw new ArgumentNullException("feedback");
            }

            feedback.SetStatus(FeedbackStatusFlag.Approved, true);
            feedback.SetStatus(FeedbackStatusFlag.Deleted, false);
            if (spamService != null)
            {
                spamService.SubmitGoodFeedback(feedback);
            }

            Update(feedback);
        }
Esempio n. 3
0
        /// <summary>
        /// Confirms the feedback as spam and moves it to the trash.
        /// </summary>
        /// <param name="feedback">The feedback.</param>
        /// <param name="spamService"></param>
        public static void ConfirmSpam(this ObjectRepository repository, FeedbackItem feedback, ICommentSpamService spamService)
        {
            if (feedback == null)
            {
                throw new ArgumentNullException("feedback");
            }

            feedback.SetStatus(FeedbackStatusFlag.Approved, false);
            feedback.SetStatus(FeedbackStatusFlag.ConfirmedSpam, true);

            if (spamService != null)
            {
                spamService.SubmitGoodFeedback(feedback);
            }

            repository.Update(feedback);
        }
Esempio n. 4
0
        /// <summary>
        /// Confirms the feedback as spam and moves it to the trash.
        /// </summary>
        /// <param name="feedback">The feedback.</param>
        /// <param name="spamService"></param>
        public static void ConfirmSpam(FeedbackItem feedback, ICommentSpamService spamService)
        {
            if(feedback == null)
            {
                throw new ArgumentNullException("feedback");
            }

            feedback.SetStatus(FeedbackStatusFlag.Approved, false);
            feedback.SetStatus(FeedbackStatusFlag.ConfirmedSpam, true);

            if(spamService != null)
            {
                spamService.SubmitGoodFeedback(feedback);
            }

            Update(feedback);
        }