private void ScanPreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { viewModel.ClearBasket(); inputText = string.Empty; e.Handled = true; } else if (e.Key == Key.Left) { viewModel.SetIsBasketPaidByCreditCard(!viewModel.IsBasketPaidByCreditCard); inputText = string.Empty; e.Handled = true; } else if (e.Key == Key.Right) { viewModel.SetIsBasketPrivate(!viewModel.IsBasketPrivate); inputText = string.Empty; e.Handled = true; } #if DEBUG //only for debug if (e.Key == Key.D) { viewModel.ScanProduct(inputText); inputText = string.Empty; e.Handled = true; } #endif BarcodeTextBox.Text = inputText; InvokersListBox.Focus(); }
private void RemoveSaleProduct(object sender, RoutedEventArgs e) { Button button = e.Source as Button; BasketItem basketItem = button.CommandParameter as BasketItem; viewModel.RemoveSaleProduct(basketItem); InvokersListBox.Focus(); }
private void RemoveSaleProduct(object sender, RoutedEventArgs e) { Button button = e.Source as Button; Invoker invoker = button.CommandParameter as Invoker; viewModel.RemoveSaleProduct(invoker); InvokersListBox.Focus(); }
private void PrintDailyAccounting(object sender, RoutedEventArgs e) { System.Windows.Forms.PrintDialog dialog = new System.Windows.Forms.PrintDialog(); dialog.Document = viewModel.CreateDailyAccounting(); if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { dialog.Document.Print(); } InvokersListBox.Focus(); }
private void PrintDailyAccounting(object sender, RoutedEventArgs e) { PrintDialog printDialog = new PrintDialog(); if (printDialog.ShowDialog() == true) { PrintQueue printQueue = printDialog.PrintQueue; XpsDocumentWriter xpsDocumentWriter = PrintQueue.CreateXpsDocumentWriter(printQueue); IDocumentPaginatorSource document = new SalePrintFlowDocument(viewModel.SaleToday.SaleProducts); xpsDocumentWriter.Write(document.DocumentPaginator); } InvokersListBox.Focus(); }
private void ClearBasket(object sender, RoutedEventArgs e) { viewModel.ClearBasket(); InvokersListBox.Focus(); }
private void ForGuestPublicSale(object sender, RoutedEventArgs e) { viewModel.SetIsBasketForGuest(!viewModel.IsBasketForGuest); InvokersListBox.Focus(); }
private void PrivatePublicSale(object sender, RoutedEventArgs e) { viewModel.SetIsBasketPrivate(!viewModel.IsBasketPrivate); InvokersListBox.Focus(); }
private void PayByCreditCardCash(object sender, RoutedEventArgs e) { viewModel.SetIsBasketPaidByCreditCard(!viewModel.IsBasketPaidByCreditCard); InvokersListBox.Focus(); }