Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tourPhoto tourPhoto = db.tourPhotoes.Find(id);

            db.tourPhotoes.Remove(tourPhoto);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 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));
 }
Exemple #3
0
        // 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));
        }
Exemple #4
0
        // 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));
        }