public ActionResult Approved(CommentAction commentAction, string cp)
        {
            const string approved = "approved";
            ManageCommentsView view = GetCommentView(_commentRepository.RetrieveCommentByStatusAndUserId(Owner.Id, CommentStatus.Approved), cp, approved);
            IDictionary<string, string> crumbs = GetBreadCrumbs(approved);

            return View("Index", view, crumbs);
        }
 public ActionResult All(CommentAction commentAction, string cp)
 {
     return IndexPost(commentAction, cp);
 }
        /// <summary>
        /// Ges the commentt view.
        /// </summary>
        /// <param name="commentAction">The comment action.</param>
        /// <param name="getCommentsMethod">The get comments method.</param>
        /// <param name="cp">The cp.</param>
        /// <param name="view">The view.</param>
        /// <returns></returns>
        private ManageCommentsView GeCommentView(CommentAction commentAction, Func<List<Comment>> getCommentsMethod, string cp, string view)
        {
            string message;
            if(commentAction.CommentActionType != "-1")
            {
                if (commentAction.CommentId != null && commentAction.CommentId.Length > 0)
                {
                    CommentStatus commentStatus = commentAction.CommentActionType.ParseEnum<CommentStatus>();
                    _commentRepository.UpdateCommentStatus(commentStatus, commentAction.CommentId, Owner.Id);
                    message = string.Format("Selected comments have been changed to {0}.", commentAction.CommentActionType);
                }
                else
                {
                    message = "Please select one or more comments.";
                }
            }
            else
            {
                message = "Please select an action.";
            }

            ManageCommentsView commentView = GetManageCommentView(getCommentsMethod, cp, view);
            commentView.UIMessage = message;
            return commentView;
        }
 /// <summary>
 /// Indexes the post.
 /// </summary>
 /// <param name="commentAction">The comment action.</param>
 /// <param name="cp">The cp.</param>
 /// <returns></returns>
 private ActionResult IndexPost(CommentAction commentAction, string cp)
 {
     IDictionary<string, string> crumbs = GetBreadCrumbs("all");
     ManageCommentsView view = GeCommentView(commentAction, () => _commentRepository.RetrieveCommentsByUserId(Owner.Id), cp, "all");
     // ReSharper disable Asp.NotResolved
     return View("Index", view, crumbs);
     // ReSharper restore Asp.NotResolved
 }
        public ActionResult Spam(CommentAction commentAction, string cp)
        {
            const string breadCrumbName = "spam";
            ManageCommentsView view = GetCommentView(_commentRepository.RetrieveCommentByStatusAndUserId(Owner.Id, CommentStatus.Spam), cp, breadCrumbName);
            IDictionary<string, string> crumbs = GetBreadCrumbs(breadCrumbName);

            return View("Index", view, crumbs);
        }