Пример #1
0
 /// <summary>
 /// Attempts to return to the main screen
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BtnCancel_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         SelectedInvoice = null;
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Something Went Wrong!\n" + ex.ToString());
     }
 }
Пример #2
0
 /// <summary>
 /// Attempts to pass the selected data back to the main screen
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BtnSelect_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (dgInvoices.SelectedItem != null)
         {
             SelectedInvoice = (clsInvoice)dgInvoices.SelectedItem;
             this.Close();
         }
         else
         {
             MessageBox.Show("Please select an invoice", "Failed to Select Inovice", MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Something Went Wrong!\n" + ex.ToString());
     }
 }