Beispiel #1
0
 private void Edit_Click(object sender, RoutedEventArgs e)
 {
     if (this.datagrid.SelectedItem == null)
     {
         System.Windows.MessageBox.Show("Please select the event which you want to edit");
     }
     else
     {
         edit_event subform = new edit_event(this.datagrid.SelectedIndex);
         subform.ShowDialog();
         Parser objectParser = new Parser(subform.getCommand());
         this.dataGrid1.Visibility = Visibility.Collapsed;
         this.datagrid.Visibility  = Visibility.Visible;
         this.datagrid.ItemsSource = objectParser.taskToBePerformed();
         subform.Close();
     }
 }
 private void Edit_Click(object sender, MouseButtonEventArgs e)
 {
     if (datagrid.SelectedItem == null)
     {
         ToastMsg.Text = "Please select the event which you want to edit";
     }
     else
     {
         int        eventid = datagrid.SelectedIndex;
         edit_event subform = new edit_event(eventid);
         string     command;
         subform.ShowDialog();
         command = subform.getCommand();
         Parser objectParser = new Parser(command);
         dataGrid1.Visibility = Visibility.Collapsed;
         datagrid.Visibility  = Visibility.Visible;
         datagrid.ItemsSource = objectParser.taskToBePerformed();
         ToastMsg.Text        = "Edited!";
     }
 }