Esempio n. 1
0
        //编辑相册
        public ActionResult Edit(string Id)
        {
            List <Articles> list = ArticleService.GetArticlesAll();
            Photos          pho  = GalleryService.GetById(Id);

            ViewBag.A = list;
            ViewBag.B = pho;
            return(View());
        }
Esempio n. 2
0
 public ActionResult Editalbum(int albumId)
 {
     try
     {
         var album = GalleryService.GetById(albumId);
         return(View(new EditAlbumViewModel(album)));
     }
     catch (Exception ex)
     {
         return(Content(ex.Message));
     }
 }
Esempio n. 3
0
        public ActionResult DeleteAlbum(int albumId)
        {
            var album = GalleryService.GetById(albumId);

            if (album != null)
            {
                foreach (var photo in album.Photos)
                {
                    DeletePhotoFromServer(photo.Path);
                }
                if (GalleryService.DeleteAlbum(albumId))
                {
                    return(RedirectToAction("index", "gallery"));
                }
            }
            return(View());
        }