public ActionResult DeleteConfirmed(int id) { GigGenre gigGenre = db.GigGenres.Find(id); db.GigGenres.Remove(gigGenre); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "GigGenreID,GigID,GenreID")] GigGenre gigGenre) { if (ModelState.IsValid) { db.Entry(gigGenre).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GenreID = new SelectList(db.Genres, "GenreID", "Name", gigGenre.GenreID); ViewBag.GigID = new SelectList(db.Gigs, "GigID", "Name", gigGenre.GigID); return(View(gigGenre)); }
public ActionResult Create([Bind(Include = "GigGenreID,GigID,GenreID")] GigGenre gigGenre) { if (ModelState.IsValid) { db.GigGenres.Add(gigGenre); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GenreID = new SelectList(db.Genres, "GenreID", "Name", gigGenre.GenreID); ViewBag.GigID = new SelectList(db.Gigs, "GigID", "Name", gigGenre.GigID); return(View(gigGenre)); }
// GET: GigGenres/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GigGenre gigGenre = db.GigGenres.Find(id); if (gigGenre == null) { return(HttpNotFound()); } return(View(gigGenre)); }
// GET: GigGenres/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GigGenre gigGenre = db.GigGenres.Find(id); if (gigGenre == null) { return(HttpNotFound()); } ViewBag.GenreID = new SelectList(db.Genres, "GenreID", "Name", gigGenre.GenreID); ViewBag.GigID = new SelectList(db.Gigs, "GigID", "Name", gigGenre.GigID); return(View(gigGenre)); }