示例#1
0
        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);
        }
示例#2
0
文件: Sale.cs 项目: njmube/POSMicro
        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;
        }
示例#3
0
        public void CancelSaleLineItem(MenuProduct menuProduct)
        {
            SaleLineItem sli = SaleLineItems.Where(s => s.MenuProduct == menuProduct).FirstOrDefault();

            SaleLineItems.Remove(sli);
        }
示例#4
0
        public int DecrementQuantity(MenuProduct menuProduct)
        {
            SaleLineItem sli = SaleLineItems.Where(s => s.MenuProduct == menuProduct).FirstOrDefault();

            return(sli.DecrementQuantity());
        }