コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ImagesAlbum imagesalbum = db.ImagesAlbum.Find(id);

            db.ImagesAlbum.Remove(imagesalbum);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult Delete(int id = 0)
        {
            ImagesAlbum imagesalbum = db.ImagesAlbum.Find(id);

            if (imagesalbum == null)
            {
                return(HttpNotFound());
            }
            return(View(imagesalbum));
        }
コード例 #3
0
 public ActionResult Edit(ImagesAlbum imagesalbum)
 {
     if (ModelState.IsValid)
     {
         db.Entry(imagesalbum).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(imagesalbum));
 }
コード例 #4
0
        public ActionResult Create(ImagesAlbum imagesalbum)
        {
            if (ModelState.IsValid)
            {
                db.ImagesAlbum.Add(imagesalbum);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(imagesalbum));
        }