public ActionResult DeleteConfirmed(int id) { tourPhoto tourPhoto = db.tourPhotoes.Find(id); db.tourPhotoes.Remove(tourPhoto); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PhotoID,FileName,GalleryID")] tourPhoto tourPhoto) { if (ModelState.IsValid) { db.Entry(tourPhoto).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GalleryID = new SelectList(db.tourGalleries, "GalleryID", "GalleryName", tourPhoto.GalleryID); return(View(tourPhoto)); }
// GET: tourPhotos/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tourPhoto tourPhoto = db.tourPhotoes.Find(id); if (tourPhoto == null) { return(HttpNotFound()); } return(View(tourPhoto)); }
// GET: tourPhotos/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tourPhoto tourPhoto = db.tourPhotoes.Find(id); if (tourPhoto == null) { return(HttpNotFound()); } ViewBag.GalleryID = new SelectList(db.tourGalleries, "GalleryID", "GalleryName", tourPhoto.GalleryID); return(View(tourPhoto)); }