Example #1
0
        /// <summary>
        /// Creates the order.
        /// </summary>
        public void CreateOrder()
        {
            //Get rid of any prior pending orders, before creating a new one
            DeletePendingOrder();
            POSOrder order = new POSOrder();

            order.ID     = "" + (++orderNumber);
            CurrentOrder = order;
            AddOrder(order);
        }
Example #2
0
 /// <summary>
 /// Values the specified order.
 /// </summary>
 /// <param name="order">The order.</param>
 /// <returns>System.Int64.</returns>
 public long Value(POSOrder order)
 {
     if (AmountOff > 0)
     {
         return(AmountOff);
     }
     else
     {
         return((int)(order.PreTaxSubTotal * PercentageOff));
     }
 }
Example #3
0
 /// <summary>
 /// Ons the order change.
 /// </summary>
 /// <param name="order">The order.</param>
 /// <param name="target">The target.</param>
 protected void onOrderChange(POSOrder order, OrderChangeTarget target)
 {
     if (order.status == OrderStatus.PENDING &&
         order.Items.Count > 0)
     {
         order.status = OrderStatus.OPEN;
     }
     if (OrderChange != null)
     {
         OrderChange(order, target);
     }
 }
Example #4
0
        /*  This will remove any other PENDING order before creating a new one. */
        /// <summary>
        /// Deletes the pending order.
        /// </summary>
        private void DeletePendingOrder()
        {
            POSOrder delOrder = null;

            foreach (POSOrder order in Orders)
            {
                if (order.Status == POSOrder.OrderStatus.PENDING)
                {
                    delOrder = order;
                    break;
                }
            }
            if (delOrder != null)
            {
                Orders.Remove(delOrder); //This shouldn't trigger a onOrderListChange, as PENDING orders aren't displayed
                delOrder = null;
            }
        }
Example #5
0
 /// <summary>
 /// Adds the order.
 /// </summary>
 /// <param name="order">The order.</param>
 public void AddOrder(POSOrder order)
 {
     Orders.Add(order);
     onOrderListChange(this, OrderListAction.ADDED);
 }