public ActionResult EditReview(ReviewRowModel model) { var updatedReview = _reviewRepository.GetById(model.Id); updatedReview.UserId = _submitterRepository.CheckExistingNamesAdd(model.SubmitterName); updatedReview.Detail = model.DetailedReview; updatedReview.Rating = model.Rating; _reviewRepository.Update(updatedReview); return Redirect("/Admin/ReportedReviews"); }
public ActionResult ProductDetails(ReviewRowModel model, int id) { var review = new Review {ProductId = id, Rating = model.Rating, Detail = model.DetailedReview, UserId= _submitterRepository.CheckExistingNamesAdd(model.SubmitterName)}; _reviewRepository.Add(review); return Redirect("/Product/ProductDetails/" + id); }
public ActionResult EditReview(int id) { var review = _reviewRepository.GetById(id); var reviewViewModel = new ReviewRowModel { Id = review.Id, SubmitterName = _submitterRepository.GetByUserId(review.UserId).Name, Rating = review.Rating, DetailedReview = review.Detail, Flagged = review.Flagged, Product = _productRepository.GetByProductId(review.ProductId).Name, Manafacturer =_manafacturerRepository.GetByManafacturerId(_productRepository.GetByProductId(review.ProductId).ManafacturerId).Name }; return View(reviewViewModel); }