Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        private void RemoveSaleProduct(object sender, RoutedEventArgs e)
        {
            Button     button     = e.Source as Button;
            BasketItem basketItem = button.CommandParameter as BasketItem;

            viewModel.RemoveSaleProduct(basketItem);
            InvokersListBox.Focus();
        }
Esempio n. 3
0
        private void RemoveSaleProduct(object sender, RoutedEventArgs e)
        {
            Button  button  = e.Source as Button;
            Invoker invoker = button.CommandParameter as Invoker;

            viewModel.RemoveSaleProduct(invoker);
            InvokersListBox.Focus();
        }
Esempio n. 4
0
 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();
 }
Esempio n. 5
0
        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();
        }
Esempio n. 6
0
 private void ClearBasket(object sender, RoutedEventArgs e)
 {
     viewModel.ClearBasket();
     InvokersListBox.Focus();
 }
Esempio n. 7
0
 private void ForGuestPublicSale(object sender, RoutedEventArgs e)
 {
     viewModel.SetIsBasketForGuest(!viewModel.IsBasketForGuest);
     InvokersListBox.Focus();
 }
Esempio n. 8
0
 private void PrivatePublicSale(object sender, RoutedEventArgs e)
 {
     viewModel.SetIsBasketPrivate(!viewModel.IsBasketPrivate);
     InvokersListBox.Focus();
 }
Esempio n. 9
0
 private void PayByCreditCardCash(object sender, RoutedEventArgs e)
 {
     viewModel.SetIsBasketPaidByCreditCard(!viewModel.IsBasketPaidByCreditCard);
     InvokersListBox.Focus();
 }