Exemplo n.º 1
0
 public ActionResult Index(string id = "0")
 {
     if (!(Convert.ToInt32(id) > 0)) { RedirectToAction("Index/"); }
     ChampionViewModel selectedChampion = new ChampionViewModel();
     ViewBag.ChampionSelectList = CreateChampionSelectList();
     selectedChampion = GetChampionByID(Convert.ToInt32(id));
     ViewBag.SelectedChampion = selectedChampion.ID;
     return View(selectedChampion);
 }
Exemplo n.º 2
0
        public ChampionViewModel GetChampionByID(int id)
        {
            Champion champion = new Champion();
            ChampionViewModel championVM = new ChampionViewModel();
            ChampionBLL cBLL = new ChampionBLL();

            champion = cBLL.GetChampionByID(id);
            championVM = AutoMapper.Mapper.Map<Champion, ChampionViewModel>(champion);

            return championVM;
        }