Esempio n. 1
0
 public ActionResult Edit([Bind(Include = "LocationID,Name")] Location location)
 {
     if (ModelState.IsValid)
     {
         db.Entry(location).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(location));
 }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "CategoryID,Name")] Category category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(category));
 }
 public ActionResult Edit([Bind(Include = "ReviewerID,Name,DateJoined,ReviewerImage,ReviewerBio")] Reviewer reviewer)
 {
     if (ModelState.IsValid)
     {
         reviewer.DateJoined      = DateTime.Today;
         db.Entry(reviewer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(reviewer));
 }
Esempio n. 4
0
 public ActionResult Edit([Bind(Include = "ReviewID,Title,Rating,Author,PublishedDate,Content,CategoryID")] Review review)
 {
     if (ModelState.IsValid)
     {
         db.Entry(review).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryID = new SelectList(db.Categories, "CategoryID", "Name", review.CategoryID);
     return(View(review));
 }
Esempio n. 5
0
 public ActionResult Edit([Bind(Include = "ReviewID,ArriveDate,DepartDate,Comment,Clean,PetFriendly,Pool,OnSiteDining,HouseKeeping,Concierge,NearBeach,BeachMiles,NearMountain,MountainMiles,BikesAvailable,ManyBikes,CategoryID")] Review review)
 {
     if (ModelState.IsValid)
     {
         db.Entry(review).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryID = new SelectList(db.Categories, "CategoryID", "Location", review.CategoryID);
     return(View(review));
 }
Esempio n. 6
0
 public ActionResult Edit([Bind(Include = "ID,Location,Details,VacationDate,CategoryID")] Review review)
 {
     if (ModelState.IsValid)
     {
         db.Entry(review).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryID = new SelectList(db.Categories, "CategoryID", "Name", review.CategoryID);
     return(View(review));
 }
Esempio n. 7
0
 public ActionResult Edit([Bind(Include = "ReviewID,Name,ReviewedDate,StarRating,Comments,LocationID,CategoryID")] Review review)
 {
     if (ModelState.IsValid)
     {
         db.Entry(review).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryID = new SelectList(db.Categories, "CategoryID", "Name", review.CategoryID);
     ViewBag.LocationID = new SelectList(db.Locations, "LocationID", "Name", review.LocationID);
     return(View(review));
 }
Esempio n. 8
0
 public ActionResult Edit([Bind(Include = "ReviewID,Title,Date,ReviewImage,ReviewContent,CategoryID")] Review review)
 {
     if (ModelState.IsValid)
     {
         review.Date            = DateTime.Today;
         db.Entry(review).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CategoryID = new SelectList(db.Categories, "CategoryID", "CategoryName", review.CategoryID);
     return(View(review));
 }