public ActionResult Edit([Bind(Include = "ArtistID, ArtistName, ArtistBio, ImageSrc, ImageAlt")] tblArtist artist)
 {
     if (ModelState.IsValid)
     {
         context.Entry(artist).State = EntityState.Modified;
         context.SaveChanges();
         return(RedirectToAction("AdminIndex"));
     }
     else
     {
         return(View(artist));
     }
 }
예제 #2
0
 public ActionResult Edit([Bind(Include = "GenreID, GenreName, GenreBio, ImageSrc, ImageAlt")] tblGenre genre)
 {
     if (ModelState.IsValid)
     {
         context.Entry(genre).State = EntityState.Modified;
         context.SaveChanges();
         return(RedirectToAction("AdminIndex"));
     }
     else
     {
         return(View());
     }
 }
예제 #3
0
 public ActionResult Edit([Bind(Include = "RecordID, RecordName, RecordBio, ReleaseDate, ArtistSelected, GenreSelected, ImageSrc, ImageAlt")] tblRecord record, EditViewModel view)
 {
     if (ModelState.IsValid)
     {
         record.ArtistID             = int.Parse(view.ArtistSelected);
         record.GenreID              = int.Parse(view.GenreSelected);
         context.Entry(record).State = EntityState.Modified;
         context.SaveChanges();
         return(RedirectToAction("AdminIndex"));
     }
     else
     {
         return(View());
     }
 }