Ejemplo n.º 1
0
        private void ListViewInvoicesList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var index = ListViewInvoicesList.SelectedIndex;

            if (index != -1)
            {
                var showInvoiceWindow = new ShowInvoiceWindow(index);
                showInvoiceWindow.Show();
            }
        }
Ejemplo n.º 2
0
 private void ButtonExecute_OnClick(object sender, RoutedEventArgs e)
 {
     try
     {
         var result = MessageBox.Show("Czy dokonano zapłaty w wysokości " + newInvoice.BruttoSum + " zł?",
                                      "Płatność", MessageBoxButton.OKCancel);
         if (result == MessageBoxResult.OK)
         {
             newInvoice.DateTime = DatePickerDate.DisplayDate;
             newInvoice.Number   = TextBoxDocNumber.Text;
             Invoices.AddInvoice(newInvoice);
             Invoices.ExecuteInvoice(newInvoice.Number);
             MessageBox.Show("Dziękujemy za zakupy! Zapraszamy ponownie!", "Sukces!");
             Close();
             var showInvoiceWindow = new ShowInvoiceWindow(newInvoice.Number);
             showInvoiceWindow.Show();
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show("Sprawdź poprawność wprowadzonych danych.\nSzczegóły: " + exception.Message, "Błąd!");
     }
 }