コード例 #1
0
        public ActionResult CommentRatingDetails(Guid id)
        {
            var model           = CommentProcessor.GetCommentRating(id);
            var reportedComment = CommentProcessor.GetUserComment(model.CommentId);

            ViewData["ReportedComment"] = reportedComment;

            return(View(model));
        }
コード例 #2
0
        public ActionResult RemoveComment(Guid Id)
        {
            string identity = User.Identity.Name;
            Guid   userId   = Guid.Parse(identity);

            var model = CommentProcessor.GetUserComment(Id);

            if (model == null)
            {
                return(RedirectToAction("AllProducts", "Products"));
            }

            if (userId != model.OwnerId)
            {
                return(RedirectToAction("Details", "Products", new { id = model.StoreItemId }));
            }

            CommentProcessor.RemoveComment(Id);

            return(RedirectToAction("Details", "Products", new { id = model.StoreItemId }));
        }