public ActionResult ManageItemInUse(int itemInBagId) { ItemInBag itemInBag = ItemInBagDAO.Get(itemInBagId); itemInBag.Equipped = !itemInBag.Equipped; ItemInBagDAO.Update(itemInBag); return(RedirectToAction("Index", "Home", null)); }
public ActionResult SellItem(int characterId, int itemInBagId) { Character character = CharacterDAO.GetAllInformations(characterId); ItemInBag itemInBag = ItemInBagDAO.Get(itemInBagId); character.Coins += itemInBag.Item.Price; CharacterDAO.Update(character); itemInBag.Equipped = false; itemInBag.Item = null; ItemInBagDAO.Update(itemInBag); return(RedirectToAction("Index", "Home", null)); }