Beispiel #1
0
 public ActionResult ViewSingleReview(int id = 0)
 {
     var model = new ViewReviewModel { Reviews = _reviewService.GetById(id) };
     return View(model);
 }
Beispiel #2
0
        public ActionResult ViewSingleReview(ViewReviewModel model, string command)
        {
            if (ModelState.IsValid)
            {
                var entity = _reviewService.GetById(model.Reviews.Id);
                var approve = EnumApproveReview.Approved;
                var approveMessage = entity.UserName + "'s review Approved";
                if (command == "Deny")
                {
                    approve = EnumApproveReview.Denied;
                    approveMessage = entity.UserName + "'s review Denied";
                }

                entity.IsApproved = approve.ToString();
                _reviewService.Update(entity);
                this.SuccessNotification(approveMessage);
            }
            return RedirectToAction("ApproveReviews");
        }
Beispiel #3
0
 public ActionResult ViewSingleReview(ViewReviewModel model)
 {
     if (ModelState.IsValid)
     {
         var entity = _reviewService.GetById(model.Reviews.Id);
         entity.IsApproved = true;
         _reviewService.Update(entity);
     }
     return RedirectToAction("ApproveReviews");
 }