コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CastMusical castMusical = db.CastMusical.Find(id);

            db.CastMusical.Remove(castMusical);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "ID,MusicalFK,CastFK,Character")] CastMusical castMusical)
 {
     if (ModelState.IsValid)
     {
         db.Entry(castMusical).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CastFK    = new SelectList(db.Actor, "ID_Actor", "Name", castMusical.CastFK);
     ViewBag.MusicalFK = new SelectList(db.Musical, "ID_Musical", "Title", castMusical.MusicalFK);
     return(View(castMusical));
 }
コード例 #3
0
        // GET: CastMusicals/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CastMusical castMusical = db.CastMusical.Find(id);

            if (castMusical == null)
            {
                return(HttpNotFound());
            }
            return(View(castMusical));
        }
コード例 #4
0
        // GET: CastMusicals/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CastMusical castMusical = db.CastMusical.Find(id);

            if (castMusical == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CastFK    = new SelectList(db.Actor, "ID_Actor", "Name", castMusical.CastFK);
            ViewBag.MusicalFK = new SelectList(db.Musical, "ID_Musical", "Title", castMusical.MusicalFK);
            return(View(castMusical));
        }