예제 #1
0
        public IActionResult Add(ReviewModel review)
        {
            int newReviewId = reviewDAO.SaveReview(review);

            //return Redirect($"/city/ConfirmAdd/{newCityId}");
            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult NewReview(Review newReview)
        {
            newReview.ReviewDate = DateTime.Now;

            _reviewDAO.SaveReview(newReview);

            return(RedirectToAction("Index", "Home"));
        }
예제 #3
0
        public IActionResult AddReview(Review review)

        {
            try
            {
                reviewDAO.SaveReview(review);
            }
            catch (Exception)
            {
                TempData["Error"] = "Something went wrong, try again!";
                return(RedirectToAction("Index", "Home"));
            }
            TempData["UserName"] = review.UserName;
            return(RedirectToAction("Confirmation", "Reviews", new { UserName = review.UserName, Rating = review.Rating, Title = review.Title, Text = review.Text }));
        }
        public IActionResult NewReview(Review review)
        {
            IActionResult result = null;

            try
            {
                _db.SaveReview(review);
                result = RedirectToAction("Index", new { Name = review.ReviewTitle });
            }
            catch (Exception)
            {
                result = RedirectToAction("Results", new { Name = review.ReviewTitle, Error = "Failed" });
            }

            return(result);
        }
        public IActionResult NewReview(Review review)
        {
            reviewDAO.SaveReview(review);

            return(RedirectToAction("Index"));
        }
예제 #6
0
 public ActionResult NewReview(Review newReview)
 {
     dao.SaveReview(newReview);
     return(RedirectToAction("Index", "Home"));
 }