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

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