public List <Item> GetItem(Int16 ID) { try { ItemDal objdal = new ItemDal(); return(objdal.Read(ID)); } catch { throw; } }
public bool Buy(int itemId, int quantity) { if (!eqService.HaveEmptySpace(myHero)) { return(false); } var item = itemDal.Read(itemId); if (myHero.Money < item.Price) { return(false); } if (myHero.Level < item.RequiredLevel) { return(false); } heroService.RemoveMoney(item.Price, myHero); heroDal.Update(myHero); eqService.AddItem(itemId, myHero, quantity); return(true); }