public ActionResult DeleteConfirmed(int id) { RPG_HeroContext context = new RPG_HeroContext(); context.DeleteHero(id); return(RedirectToAction("Index")); }
// GET: Hero/Delete/5 public ActionResult Delete(int id) { RPG_HeroContext context = new RPG_HeroContext(); Hero hero = context.GetHeroById(id); return(View(hero)); }
public ActionResult Edit([Bind(Include = "Id,Health,Lvl,AttackPower,CurrentExp")] Hero hero) { RPG_HeroContext context = new RPG_HeroContext(); context.EditById(hero); return(RedirectToAction("Index")); }
// GET: Hero public ActionResult Index() { RPG_HeroContext context = new RPG_HeroContext(); List <Hero> heroes = context.getAllHeroes(); return(View(heroes)); }
public ActionResult Create(Hero hero) { hero.Health = Int32.Parse(Request.Form["Health"].ToString()); hero.Lvl = Int32.Parse(Request.Form["Lvl"].ToString()); hero.AttackPower = Int32.Parse(Request.Form["AttackPower"].ToString()); hero.CurrentExp = hero.Lvl = Int32.Parse(Request.Form["CurrentExp"].ToString()); RPG_HeroContext context = new RPG_HeroContext(); context.Create(hero); return(RedirectToAction("Index")); }