예제 #1
0
 public ActionResult Edit([Bind(Include = "GenreId,Name,Description")] Genre genre)
 {
     if (ModelState.IsValid)
     {
         db.Entry(genre).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(genre));
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Artist,Year,Rating, ImgUrl")] Albums albums)
 {
     if (ModelState.IsValid)
     {
         db.Entry(albums).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(albums));
 }
예제 #3
0
 public ActionResult Edit([Bind(Include = "ArtistId,Name")] Artist artist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(artist).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(artist));
 }
예제 #4
0
 public ActionResult Edit([Bind(Include = "AlbumInfoId,GenreId,ArtistId,Title,Price,AlbumArtUrl")] AlbumInfo albuminfo)
 {
     if (ModelState.IsValid)
     {
         _db.Entry(albuminfo).State = EntityState.Modified;
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ArtistId = new SelectList(_db.Artists, "ArtistId", "Name", albuminfo.ArtistId);
     ViewBag.GenreId  = new SelectList(_db.Genres, "GenreId", "Name", albuminfo.GenreId);
     return(View(albuminfo));
 }
예제 #5
0
 public ActionResult Edit([Bind(Include = "AlbumId,GenreId,ArtistId,Titel,Price")] Album album)
 {
     if (ModelState.IsValid)
     {
         db.Entry(album).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ArtistId = new SelectList(db.Artists, "ArtistId", "Name", album.ArtistId);
     ViewBag.GenreId  = new SelectList(db.Genres, "GenreId", "Name", album.GenreId);
     return(View(album));
 }