Ejemplo n.º 1
0
        public ActionResult Rate(CenterRatingCreate model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var service = new RatingService(Guid.Parse(User.Identity.GetUserId()));

            if (service.CreateCenterRating(model))
            {
                TempData["SaveResult"] = "Your rating was added.";
                return(RedirectToAction("Index"));
            }
            ;

            ModelState.AddModelError("", "Rating could not be added.");
            return(View(model));
        }