Esempio n. 1
0
        ////////////////// UI Events and UI Management //////////////////////

        private void StoreItems_DiscountSelected(object sender, EventArgs e)
        {
            POSDiscount discount = ((StoreDiscount)((Control)sender).Parent).Discount;

            Store.CurrentOrder.Discount = discount;

            DisplayDiscount DisplayDiscount = new DisplayDiscount();

            DisplayDiscount.name = discount.Name;
            // our business rules say only 1 order discount
            while (DisplayOrder.discounts.elements.Count > 0)
            {
                DisplayDiscount RemovedDisplayDiscount = (DisplayDiscount)DisplayOrder.discounts.elements[0];
                DisplayOrder.discounts.Remove(RemovedDisplayDiscount);
                UpdateDisplayOrderTotals();
                cloverConnector.DisplayOrderDiscountRemoved(DisplayOrder, RemovedDisplayDiscount);
            }

            if (discount.Value(1000) != 0)
            {
                DisplayOrder.addDisplayDiscount(DisplayDiscount);
                UpdateDisplayOrderTotals();
                cloverConnector.DisplayOrderDiscountAdded(DisplayOrder, DisplayDiscount);
            }

            UpdateUI();
        }
Esempio n. 2
0
 public POSOrder()
 {
     Status   = OrderStatus.PENDING;
     Items    = new List <POSLineItem>();
     Payments = new List <POSExchange>();
     Discount = new POSDiscount("None", 0);
     Date     = new DateTime();
 }
        private void ReapplyOrderDiscount(POSDiscount discount)
        {
            DisplayDiscount DisplayDiscount = new DisplayDiscount();
            DisplayDiscount.name = discount.Name;
            DisplayDiscount.amount = Decimal.Divide(discount.Value(Store.CurrentOrder.PreDiscountSubTotal), 100).ToString("C2");
            DisplayDiscount.percentage = (discount.PercentageOff * 100).ToString("###");

            // our example POS business rules say only 1 order discount
            while (DisplayOrder.discounts.elements.Count > 0)
            {
                DisplayDiscount RemovedDisplayDiscount = (DisplayDiscount)DisplayOrder.discounts.elements[0];
                DisplayOrder.discounts.Remove(RemovedDisplayDiscount);
                cloverConnector.DiscountRemovedFromDisplayOrder(DisplayOrder, RemovedDisplayDiscount);
            }

            if (discount.Value(1000) != 0)
            {
                DisplayOrder.addDisplayDiscount(DisplayDiscount);
                cloverConnector.DiscountAddedToDisplayOrder(DisplayOrder, DisplayDiscount);
            }
        }
Esempio n. 4
0
 public POSOrder()
 {
     Status = OrderStatus.OPEN;
     Items = new List<POSLineItem>();
     Payments = new List<POSExchange>();
     Discount = new POSDiscount("None", 0);
     Date = new DateTime();
 }