public void SetInventory(PizzaComponent p, int amt) { InventoryItem i = GetInventoryItem(p.Name); if (!(i is null)) { i.quantity += amt; i.item.Cost = p.Cost; }
public Domain.Inventory GetInventory(ICollection <Data.Entities.InventoryItem> invEntity) { Inventory res = new Domain.Inventory(); foreach (var i in invEntity) { PizzaComponent pc = GenerateComponent(i.C.Name, i.C.Cost, i.C.Kind); res.SetInventory(pc, i.Quantity); if (i.C.Kind.ToLower() == "size") { res.AddSize((Size)pc); } else { res.SetInventory(pc, i.Quantity); } } return(res); }
public InventoryItem(PizzaComponent i, int q) { item = i; quantity = q; }