Ejemplo n.º 1
0
 //Remove calendar
 private void ButtonRemoveCalendar_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         ClassCalendar callendar = GetCalendarForSelectedCalendarInComboboxFromDataBase();
         if (callendar.Status.StatusId != sql.SelectStatusId(EnumStatus.New))
         {
             throw new Exception("To remove calendar status must be new");
         }
         sql.DeleteCalendarAndApropriateCalendarDays(callendar.CalendarId);
         MessageBox.Show("Calendar succesfully deleted");
         ComboBoxPickDate.ItemsSource = sql.CalendarList();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }