Exemple #1
0
 private void Button_Click(object sender, RoutedEventArgs e)
 //What happens in the program when you click the button (as is said when you start the Click event)
 {
     try
     {
         help   = textBoxForChange.Text;                              //Inputs the inserted text into the transformation panel and inserts it into an auxiliary variable
         mother = (((BE.Mother) this.motherIdComboBox.SelectedItem)); //Retrieve from the list of the appropriate mother for the selected ID in the panel
         bl.ChangeInfoMother(mother, help);                           //Send a "mother" object and a string to a function whose function is to insert the string into the comment field in the "mother"
         this.textBoxForChange.ClearValue(TextBox.TextProperty);      //Clean the panel to be ready for next use
     }
     catch (FormatException)                                          //If incorrect input is entered instead of ID
     {
         MessageBox.Show("check your input and try again");
     }
     catch (Exception ex2)
     {
         MessageBox.Show(ex2.Message);
     }
 }