public SaleLineItem AddSaleLineItem(MenuProduct menuProduct) { SaleLineItem newLineItem = (SaleLineItems.Where(sli => sli.MenuProduct == menuProduct)).SingleOrDefault(); if (newLineItem == null) { newLineItem = new SaleLineItem(this, menuProduct); this.SaleLineItems.Add(newLineItem); } else { newLineItem.IncrementQuantity(); } return(newLineItem); }
public void CancelSaleLineItem(MenuProduct menuProduct) { SaleLineItem sli = SaleLineItems.Where(s => s.MenuProduct == menuProduct).FirstOrDefault(); SaleLineItems.Remove(sli); }
public int DecrementQuantity(MenuProduct menuProduct) { SaleLineItem sli = SaleLineItems.Where(s => s.MenuProduct == menuProduct).FirstOrDefault(); return(sli.DecrementQuantity()); }