示例#1
0
        public ActionResult Create(CreateReviewViewModel model)
        {
            // Get contact to tie to review
            string  email   = User.Identity.GetUserName();
            Contact contact = _contactService.GetContactByEmail(email);

            // Create and add Review to database
            Review review = new Review
            {
                IsGoogleReview = false,
                Timestamp      = DateTime.Now,
                Comments       = model.Comments,
                Rating         = model.Rating,
                VenueId        = model.VenueId,
                ContactId      = contact.ContactId
            };

            _venueService.CreateVenueReview(review);

            // Redirect user to Venue details page which shows all reviews
            return(RedirectToAction("Details", "Venue", new { id = model.VenueId }));
        }