Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tblSongs tblSongs = db.tblSongs.Find(id);

            db.tblSongs.Remove(tblSongs);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 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));
 }
Exemple #3
0
        // 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));
        }
Exemple #4
0
        // 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));
        }