Пример #1
0
 private void addButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         bl.AddPrayer(prayer);
         prayer            = new BE.Prayer();
         Grid1.DataContext = prayer;
         prayersWindow.PrayerDataGrid.ItemsSource       = null;
         prayersWindow.PrayerDataGrid.ItemsSource       = bl.GetAllPrayers();
         prayersWindow.ChoosePrayerComboBox.ItemsSource = null;
         prayersWindow.ChoosePrayerComboBox.ItemsSource = bl.GetAllPrayers();
         string message = prayer.FirstName + " " + prayer.LastName + "נוסף לרשימת המתפללים";
         MessageBox.Show(message, "המתפלל נוסף לקהילה", MessageBoxButton.OK, MessageBoxImage.Information,
                         MessageBoxResult.OK, MessageBoxOptions.RightAlign);
         prayer            = new BE.Prayer();
         Grid1.DataContext = prayer;
         BMparashaComboBox.SelectedIndex        = -1;
         LastAliyaParashaComboBox.SelectedIndex = -1;
         TribeComboBox.SelectedIndex            = 2;
         FirstNameTextBox.Focus();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "אזהרה!", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }