//编辑相册 public ActionResult Edit(string Id) { List <Articles> list = ArticleService.GetArticlesAll(); Photos pho = GalleryService.GetById(Id); ViewBag.A = list; ViewBag.B = pho; return(View()); }
public ActionResult Editalbum(int albumId) { try { var album = GalleryService.GetById(albumId); return(View(new EditAlbumViewModel(album))); } catch (Exception ex) { return(Content(ex.Message)); } }
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()); }