// // GET: /StoreManager/Edit/5 public ActionResult Edit(int id) { var GenresAllList = servicemethodref.GetAllGenreList(); var ArtistsAllList = servicemethodref2.GetAllArtistList(); MusicStore.Web.MusicAlbumMgr.Album album = servicemethodref1.FindAlbum(id); ViewBag.GenreId = new SelectList(GenresAllList, "GenreId", "Name", album.GenreId); ViewBag.ArtistId = new SelectList(ArtistsAllList, "ArtistId", "Name", album.ArtistId); return(View(album)); }
public ActionResult Edit(MusicStore.Web.MusicAlbumMgr.Album album) { var GenresAllList = servicemethodref.GetAllGenreList(); var ArtistsAllList = servicemethodref2.GetAllArtistList(); if (ModelState.IsValid) { servicemethodref1.EditAlbum(album); return(RedirectToAction("Index")); } ViewBag.GenreId = new SelectList(GenresAllList, "GenreId", "Name", album.GenreId); ViewBag.ArtistId = new SelectList(ArtistsAllList, "ArtistId", "Name", album.ArtistId); return(View(album)); }