Ejemplo n.º 1
0
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (txtPerformanceName.Text == "")
         {
             throw new ApplicationException("Performance must have a name.");
         }
         if (dtpDate.SelectedDate <= DateTime.Now)
         {
             throw new ApplicationException("The performance date must be after today.");
         }
         if (manager.EditPerformance(new Performance(performanceID, txtPerformanceName.Text, (DateTime)dtpDate.SelectedDate, txtDescription.Text)) == 1)
         {
             DialogResult = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }