示例#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());
        }
示例#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));
     }
 }
示例#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());
        }