Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            pokemons pokemons = db.pokemons.Find(id);

            db.pokemons.Remove(pokemons);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "pokemon_id,evolvefrom_pokemon_id,name,icon,image,url,height_avg,weight_avg,combatpower_max,attack_base,defense_base,stamina_base")] pokemons pokemons)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pokemons).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.evolvefrom_pokemon_id = new SelectList(db.pokemons, "pokemon_id", "name", pokemons.evolvefrom_pokemon_id);
     return(View(pokemons));
 }
Esempio n. 3
0
        // GET: pokemons/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            pokemons pokemons = db.pokemons.Find(id);

            if (pokemons == null)
            {
                return(HttpNotFound());
            }
            return(View(pokemons));
        }
Esempio n. 4
0
        // GET: pokemons/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            pokemons pokemons = db.pokemons.Find(id);

            if (pokemons == null)
            {
                return(HttpNotFound());
            }
            ViewBag.evolvefrom_pokemon_id = new SelectList(db.pokemons, "pokemon_id", "name", pokemons.evolvefrom_pokemon_id);
            return(View(pokemons));
        }