public IActionResult Number(int id) { Pokedex poke = PokedexMgr.GetPokemon(id); ViewData["Pokemon"] = poke; return(View()); }
public IActionResult Index() { ViewData["Title"] = "Pokedex Index"; List <Pokedex> modelList = PokedexMgr.GetAllPokedex(); return(View(modelList)); }
public IActionResult Number(int num) { ViewData["Title"] = "Pokedex Number"; Pokedex modelPoke = PokedexMgr.GetPokedex(num); if (modelPoke == null) { ViewData["Message"] = String.Format("No Pokedex found with #{0}", num.ToString()); return(View("Error")); } else { return(View(modelPoke)); } }
public IActionResult Number(int id) { Pokedex poke = PokedexMgr.GetPokemon(id); if (poke == null) { ViewData["Num"] = id.ToString(); return(View("NotFound")); } else { ViewData["Pokemon"] = poke; return(View()); } }
public IActionResult Type(string type1, string type2) { ViewData["Title"] = "Pokedex Type"; List <Pokedex> modelList = null; if (type1 != null && type2 != null) { modelList = PokedexMgr.FindPokedex(type1, type2); ViewData["PokeType"] = $"{type1} and {type2}"; } else if (type1 != null) { modelList = PokedexMgr.FindPokedex(type1); ViewData["PokeType"] = $"{type1}"; } return(View(modelList)); }