Esempio n. 1
0
        /// <summary>
        /// takes user to cash control where they can caryy out payment in cash
        /// </summary>
        /// <param name="sender">button</param>
        /// <param name="e">event args</param>
        private void CashButton_Click(object sender, RoutedEventArgs e)
        {
            var orderControl            = this.FindAncestor <OrderControl>();
            CashRegisterControl control = new CashRegisterControl(orderControl);

            orderControl.Container.Child = control;
        }
Esempio n. 2
0
        /// <summary>
        /// Swaps screens to the drawer to add and remove cash.
        /// </summary>
        private void CashButton_Click(object sender, RoutedEventArgs e)
        {
            var orderControl           = this.FindAncestor <OrderControl>();
            CashRegisterControl screen = new CashRegisterControl();

            orderControl?.SwapScreen(screen);
        }
        private void OnCashSelect(object sender, RoutedEventArgs e)
        {
            PrintRecipt(true);
            var orderControl        = this.FindAncestor <OrderControl>();
            FrameworkElement screen = new CashRegisterControl();

            orderControl.SwapScreen(screen);
        }
Esempio n. 4
0
 /// <summary>
 /// Button event swaps back to the MenuItemSelectionControl
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void OnPayWithCashClicked(object sender, RoutedEventArgs e)
 {
     if (DataContext is Order order)
     {
         var screen = new CashRegisterControl(order);
         screen.DataContext = new UsersMoneyGivenModelView();
         this.Content       = screen;
     }
 }
 /// <summary>
 /// Click event for the option to pay with cash
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void PayWithCashClicked(object sender, RoutedEventArgs e)
 {
     if (DataContext is Order order)
     {
         var screen = new CashRegisterControl();
         screen.DataContext = new CashRegisterModelView(order.Total, order.OrderNumber);
         this.Content       = screen;
     }
 }
 private void OnCash_Click(object sender, RoutedEventArgs e)
 {
     if (DataContext is OrderControl oc)
     {
         CashRegisterControl registerControl = new CashRegisterControl(subtotal, this);
         registerControl.DataContext = new CashRegisterModelView();
         oc.SwapScreen(registerControl);
     }
 }
        //Click handle for when the Cash payment option is clicked.
        void CashClickHandle(object sender, EventArgs e)
        {
            var screen = this.mainWindow.SwitchScreen("cashRegister");

            if (mainWindow.DataContext is Order order)
            {
                CashRegisterControl crc = new CashRegisterControl(order.Total);
                screen.DataContext = crc;
            }
        }
 /// <summary>
 /// CLick event for cash button
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void OnCashButtonClicked(object sender, RoutedEventArgs e)
 {
     UsedCash = true;
     if (DataContext is Order data)
     {
         var screen = new CashRegisterControl(drawer, data);
         MainTransactionControl.Child = screen;
         PrintReciept(data);
     }
 }
        void CashPayment(object sender, RoutedEventArgs e)
        {
            var cashScreen = new CashRegisterControl(DataContext as Order);

            // var inputScreen = new UserCashInput(DataContext as Order);
            //new control to handle user input and then
            //SwapToInput(inputScreen);
            SwapToDrawer(cashScreen);
            //how to implement the rest with add bill and add coin methods//////////////////
            //what do i do and where do i do the cash drawer instace///////////////////
            //SwapScreenToOrderControl();
        }
        /// <summary>
        /// Proccesses Cash Transaction
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnCashClicked(object sender, RoutedEventArgs e)
        {
            CashDrawer          cash     = CashRegisterModelView.drawer;
            CashRegisterControl register = new CashRegisterControl(this);

            register.DataContext = new CashRegisterModelView();
            ReceiptPrinter printer      = new ReceiptPrinter();
            var            orderControl = this.FindAncestor <OrderControl>();
            MainWindow     mw           = this.FindAncestor <MainWindow>();

            mw.Container.Child = register;
            paymentMethod      = true;
        }
Esempio n. 11
0
 /// <summary>
 /// Event handler for when the Cash Payment Button is clicked
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void CashPaymentButton_Click(object sender, RoutedEventArgs e)
 {
     credit = false;
     if (DataContext is Order order)
     {
         var mainWindow            = this.FindAncestor <MainWindow>();
         var cashRegisterControl   = new CashRegisterControl(this);
         var cashRegisterModelView = new CashRegisterModelView();
         cashRegisterModelView.RunningTotal = Math.Round(order.Total, 2);
         cashRegisterControl.DataContext    = cashRegisterModelView;
         mainWindow.WindowContainer.Child   = cashRegisterControl;
     }
 }
Esempio n. 12
0
        /// <summary>
        /// Event handler for pay with cash button
        /// </summary>
        /// <param name="sender">sender</param>
        /// <param name="e">e</param>
        public void PayWithCash(object sender, RoutedEventArgs e)
        {
            //PrintReciept(false);

            var orderControl        = this.FindAncestor <OrderControl>();
            FrameworkElement screen = new CashRegisterControl();

            orderControl.SwapScreen(screen);
            // orderControl.CancelOrderButton_Click(this, e);

            //var orderControl = this.FindAncestor<OrderControl>();
            //FrameworkElement screen = new MenuItemSelectionControl();
            //orderControl.SwapScreen(screen);
            //orderControl.CancelOrderButton_Click(this, e);
        }
        /// <summary>
        /// When customer pays with cash, generates cash register UI and controls the amounts in the cashdrawer
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void OnPayWithCashButtonClicked(object sender, RoutedEventArgs e)
        {
            string cash = "Cash";

            Order o = (Order)DataContext;

            var orderInfo = this.FindAncestor <OrderControl>();

            CashRegisterControl crc = new CashRegisterControl();

            CashPaymentDetails.orderTotal = o.TotalWithTax;
            CashPaymentDetails.orderNum   = o.OrderNumber;

            CashRegisterModelView cashreg = new CashRegisterModelView();

            crc.DataContext = cashreg;

            orderInfo.SwapOrderSum(crc); // swaps whole screen to cash register

            PrintTheReceipt(o, cash);
        }