Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(long id)
        {
            tblPokemon tblPokemon = db.tblPokemons.Find(id);

            db.tblPokemons.Remove(tblPokemon);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit(tblPokemon tblPokemon)
 {
     if (ModelState.IsValid)
     {
         tblPokemon.UploadDate      = DateTime.Now;
         db.Entry(tblPokemon).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tblPokemon));
 }
Exemplo n.º 3
0
        public ActionResult Create(tblPokemon tblPokemon)
        {
            if (ModelState.IsValid)
            {
                tblPokemon.UploadDate = DateTime.Now;
                db.tblPokemons.Add(tblPokemon);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tblPokemon));
        }
Exemplo n.º 4
0
        // GET: Pokemon/Delete/5
        public ActionResult Delete(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblPokemon tblPokemon = db.tblPokemons.Find(id);

            if (tblPokemon == null)
            {
                return(HttpNotFound());
            }
            return(View(tblPokemon));
        }
Exemplo n.º 5
0
 public ActionResult PokemonDetails(tblPokemon pokemon)
 {
     //Testing
     return(View(pokemon));
 }