/// <summary> /// When the customer has provided enough funds and change can be made, the order /// is finalized, and a new order is started. /// </summary> /// <param name="sender">The button that was clicked.</param> /// <param name="e">The event arguments.</param> private void FinalizeOrder(object sender, RoutedEventArgs e) { if (DataContext is RegisterViewModel rvm) { if (OrderComponent.DataContext is Order order) { order.PrintReciept(false, rvm.ChangeOwed); } rvm.FinalizeOrder(); Cleanup(); OrderComponent.CollapseButtons(false); OrderComponent.ChangeScreen(new MenuSelectionScreen()); OrderComponent.DataContext = new Order(); } }
/// <summary> /// Cancels the sale but does not cancel the order. In effect, it just returns /// the POS back to the selection screen while keeping the same order. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CancelSale(object sender, RoutedEventArgs e) { OrderComponent.CollapseButtons(false); OrderComponent.ChangeScreen(new MenuSelectionScreen()); Cleanup(); }