public ActionResult Edit(int id, int id2, FormCollection collection) { if (ModelState.IsValid) { try { // TODO: Add update logic here Review temp = new Review { Id = id2, RestaurantID = id, ReviewerName = collection["reviewerName"], ReviewText = collection["reviewText"], ReviewScore = (float)Convert.ToDouble(collection["reviewScore"]) }; LibHelper.EditReview(temp); return(RedirectToAction("ListReviews/" + id)); } catch (Exception e) { return(View()); } } else { return(View("Model State is Invalid")); } }
//edit a resview public void UpdateReview(Review review) { _db.EditReview(ToDataRev(review)); }