public ActionResult _Reviews(int beerId) { var reviewFacade = new ReviewFacade(); var reviews = reviewFacade.GetByBeer(beerId); return View(reviews); }
public ActionResult _Review(int beerId) { var reviewFacade = new ReviewFacade(); var rating = reviewFacade.GetReview(beerId, WebSecurity.CurrentUserId); if (rating != null) { return View(rating.Review); } return View(new Review() { BeerID = beerId }); }
public ActionResult _Review(Review review) { if (ModelState.IsValid) { var reviewFacade = new ReviewFacade(); review.UserID = WebSecurity.CurrentUserId; reviewFacade.Review(review); return View(); } else { throw new Exception("Invalid Model State"); } }