Beispiel #1
0
        private void OnCashClick(object sender, RoutedEventArgs e)
        {
            var screen       = new CashControl();
            var orderControl = this.FindAncestor <OrderControl>();

            orderControl?.SwapScreen(screen);
        }
        private void CashSelection(object sender, RoutedEventArgs e)
        {
            var         o       = this.FindAncestor <OrderControl>();
            CashControl control = new CashControl(o);

            o.LeftContainer.Child = control;
        }
        /// <summary>
        /// Handles Cash payments
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CashPayment(object sender, RoutedEventArgs e)
        {
            current.payment = TypeOfPayment.Cash;
            Window          = this.FindAncestor <MainWindow>();
            FrameworkElement screen = new CashControl(current.Total, control);

            Window.SwapScreen(screen);
        }
 /// <summary>
 /// Completes a cash transaction on click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="arg"></param>
 private void CashButton_Click(object sender, RoutedEventArgs arg)
 {
     if (DataContext is Order order)
     {
         var screen = new CashControl(order);
         this.Content = screen;
     }
 }
Beispiel #5
0
        /// <summary>
        /// Handles the cash button clicked the container is then swapped to the CashControl.
        /// </summary>
        /// <param name="sender">The cash button clicked</param>
        /// <param name="e">Event arguments</param>
        private void CashButtonClicked(object sender, RoutedEventArgs e)
        {
            var screen = new CashControl();

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

            if (orderControl == null)
            {
                throw new Exception("An ancestor of OrderControl expected be an OrderControl instead of null");
            }

            screen.DataContext     = this.DataContext;
            screen.drawer          = drawer;
            screen.list            = OrderList.ItemsSource as IOrderItem[];
            screen.TotalLabel.Text = TotalLabel.Text;
            orderControl.SwapScreen(screen);
        }