Exemplo n.º 1
0
        public ActionResult _Reviews(int beerId)
        {
            var reviewFacade = new ReviewFacade();

            var reviews = reviewFacade.GetByBeer(beerId);

            return View(reviews);
        }
Exemplo n.º 2
0
        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 });
        }
Exemplo n.º 3
0
        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");
            }
        }