예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Nemesi nemesi = db.Nemesis.Find(id);

            db.Nemesis.Remove(nemesi);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "NemisisID,NemisisName,NemesisInJail,NumberOfHenchman,HeroID")] Nemesi nemesi)
 {
     if (ModelState.IsValid)
     {
         db.Entry(nemesi).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.HeroID = new SelectList(db.Heroes, "HeroID", "HeroName", nemesi.HeroID);
     return(View(nemesi));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "NemesisID,NemesisName,InJail,NumberOfHenchmen,HeroID")] Nemesi nemesi)
        {
            if (ModelState.IsValid)
            {
                db.Nemesis.Add(nemesi);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.HeroID = new SelectList(db.Heroes, "HeroID", "SecretIdentity", nemesi.HeroID);
            return(View(nemesi));
        }
예제 #4
0
        // GET: Nemesis/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Nemesi nemesi = db.Nemesis.Find(id);

            if (nemesi == null)
            {
                return(HttpNotFound());
            }
            return(View(nemesi));
        }
예제 #5
0
        // GET: Nemesis/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Nemesi nemesi = db.Nemesis.Find(id);

            if (nemesi == null)
            {
                return(HttpNotFound());
            }
            ViewBag.HeroID = new SelectList(db.Heroes, "HeroID", "HeroName", nemesi.HeroID);
            return(View(nemesi));
        }