Exemplo n.º 1
0
 private void btnProcess_Click(object sender, EventArgs e)
 {
     try {
         if (dgResult.Rows.Count > 0)
         {
             if (AddFunc.MsgQuesYESNO("Are you sure want to process this invoices ?"))
             {
                 _obj.CustomerName = txtCustomer.Text;
                 Invoices.AddInvoice(_obj);
                 AddFunc.MsgInfo("Thank For You Order");
             }
         }
         else
         {
             AddFunc.MsgError("No Package added !");
         }
     }
     catch (Exception ex)
     {
         AddFunc.MsgError(ex.Message);
     }
 }
Exemplo 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!");
     }
 }