Пример #1
0
        public ActionResult Index(Guid? id)
        {
            PokemonService service = new Services.PokemonService();
            PokemonViewModel viewModel = new PokemonViewModel();

            if (id.HasValue)
            {
                Main main = service.GetPokemon(id.Value);
                List<PowerLevel> powerLevels = service.GetPowerLevels(main.Id);
                viewModel = new PokemonViewModel(main, powerLevels, service.GetCategories(), service.GetPokemon(), service.GetSpecialAttacks(), service.GetStandardAttacks(), service.GetUsers());
            }
            else
            {
                viewModel = new PokemonViewModel(service.GetCategories(), service.GetPokemon(), service.GetSpecialAttacks(), service.GetStandardAttacks(), service.GetUsers());
            }

            return View(viewModel);
        }
Пример #2
0
        public ActionResult Evolve(int mainId)
        {
            PokemonService service = new Services.PokemonService();

            Main ancestor = service.GetPokemon(mainId);

            PokemonViewModel viewModel = new PokemonViewModel(service.GetCategories(), service.GetPokemon(), service.GetSpecialAttacks(), service.GetStandardAttacks(), service.GetUsers());
            viewModel.EvolvedFrom = ancestor.XId;

            return View("Index", viewModel);
        }