Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            LocationReview locationReview = db.LocationReviews.Find(id);

            db.LocationReviews.Remove(locationReview);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,LocationRating,LocationDate,LocationPro,LocationCon,LocationReviewDetails,LocationId")] LocationReview locationReview)
 {
     if (ModelState.IsValid)
     {
         db.Entry(locationReview).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.LocationId = new SelectList(db.Locations, "Id", "LocationName", locationReview.LocationId);
     return(View(locationReview));
 }
        internal void Persist(ApplicationDbContext context)
        {
            LocationReview review = new LocationReview
            {
                LocationId     = this.LocationId,
                ReviewHeadline = this.ReviewHeadline,
                Rating         = this.Rating,
                Review         = this.Review
            };

            context.Add(review);
            context.SaveChanges();
        }
Ejemplo n.º 4
0
        // GET: LocationReview/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LocationReview locationReview = db.LocationReviews.Find(id);

            if (locationReview == null)
            {
                return(HttpNotFound());
            }
            return(View(locationReview));
        }
Ejemplo n.º 5
0
        // GET: LocationReview/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LocationReview locationReview = db.LocationReviews.Find(id);

            if (locationReview == null)
            {
                return(HttpNotFound());
            }
            ViewBag.LocationId = new SelectList(db.Locations, "Id", "LocationName", locationReview.LocationId);
            //SelectList regions = new SelectList(db.Regions, "Id", "RegionName");
            //ViewData["regions"] = regions;
            return(View(locationReview));
        }