public ActionResult DeleteConfirmed(int id) { tblSongs tblSongs = db.tblSongs.Find(id); db.tblSongs.Remove(tblSongs); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "SongID,ArtistID,SongName,SongYear")] tblSongs tblSongs) { if (ModelState.IsValid) { db.Entry(tblSongs).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ArtistID = new SelectList(db.tblArtist, "ArtistID", "ArtistName", tblSongs.ArtistID); return(View(tblSongs)); }
// GET: Songs/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblSongs tblSongs = db.tblSongs.Find(id); if (tblSongs == null) { return(HttpNotFound()); } return(View(tblSongs)); }
// GET: Songs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblSongs tblSongs = db.tblSongs.Find(id); if (tblSongs == null) { return(HttpNotFound()); } ViewBag.ArtistID = new SelectList(db.tblArtist, "ArtistID", "ArtistName", tblSongs.ArtistID); return(View(tblSongs)); }