示例#1
0
        public IActionResult Number(int id)
        {
            Pokedex poke = PokedexMgr.GetPokemon(id);

            ViewData["Pokemon"] = poke;
            return(View());
        }
示例#2
0
        public IActionResult Index()
        {
            ViewData["Title"] = "Pokedex Index";
            List <Pokedex> modelList = PokedexMgr.GetAllPokedex();

            return(View(modelList));
        }
示例#3
0
        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));
            }
        }
示例#4
0
        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());
            }
        }
示例#5
0
        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));
        }