//update child private void update_Click(object sender, RoutedEventArgs e) { try { if (errorMessages.Any()) //errorMessages.Count > 0 { string err = "Exception:"; foreach (var item in errorMessages) { err += "\n" + item; } MessageBox.Show(err); return; } else { bl.reChild(child); MessageBox.Show(child.ToString(), "successfully update!", MessageBoxButton.OK, MessageBoxImage.Information); refreshData(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void DeleteChild_Button_Click(object sender, RoutedEventArgs e) { try { if (child != null) { bl.deleteChild(child); MessageBox.Show(child.ToString()); refreshData(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void idCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { string id = childIDComboBox.SelectedValue.ToString(); child = this.bl.GetChildByID(id); MessageBox.Show(child.ToString()); } catch (FormatException) { MessageBox.Show("Incorrect input"); } catch (Exception ex) { MessageBox.Show(ex.Message, "", MessageBoxButton.OK, MessageBoxImage.Error); } }