Beispiel #1
0
        private void Delete_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Are you sure?", "", MessageBoxButton.YesNo);

            switch (result)
            {
            case MessageBoxResult.Yes:
                if (HoursListView.SelectedItem == null)
                {
                    MessageBox.Show("No Event Selected");
                }
                else
                {
                    Hours h = (Hours)HoursListView.SelectedItem;
                    pep.RemoveHours(h);
                    Database.Update(pep);
                    HoursListView.ItemsSource = pep.AllHours;
                    HoursListView.Items.Refresh();
                    ImageRank();
                }
                break;

            case MessageBoxResult.No:
                break;
            }
        }
Beispiel #2
0
 private void Delete_Click(object sender, RoutedEventArgs e)
 {
     MessageBoxResult result = MessageBox.Show("Are you sure?", "", MessageBoxButton.YesNo);
     switch (result)
     {
         case MessageBoxResult.Yes:
             Hours h = (Hours)HoursListBox.SelectedItem;
             pep.RemoveHours(h);
             Database.Update(pep);
             HoursListBox.ItemsSource = pep.AllHours;
             HoursListBox.Items.Refresh();
             break;
         case MessageBoxResult.No:
             //MessageBox.Show("ok");
             break;
     }
     //Hours h = (Hours)HourListBox.SelectedItem;
     //pep.AllHours.Remove(h);
 }