Exemplo n.º 1
0
        public ActionResult Delete(int id)
        {
            Track_Genre track_Genre = db.DBTrack_Genre.Find(id);

            db.Delete(track_Genre);
            return(RedirectToAction("Index", new { id = track_Genre.TrackId }));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,TrackId,GenreID")] Track_Genre track_Genre)
 {
     if (ModelState.IsValid)
     {
         db.Update(track_Genre);
         return(RedirectToAction("Index", new { id = track_Genre.TrackId }));
     }
     ViewBag.GenreID = new SelectList(db.DBGenre, "Id", "genreName", track_Genre.GenreID);
     return(View(track_Genre));
 }
Exemplo n.º 3
0
        // GET: Track_Genre/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Track_Genre track_Genre = db.DBTrack_Genre.Find(id);

            if (track_Genre == null)
            {
                return(HttpNotFound());
            }
            ViewBag.GenreID = new SelectList(db.DBGenre, "Id", "genreName", track_Genre.GenreID);
            return(View(track_Genre));
        }