/// <summary> /// button for add a nanny /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void add_nanny_Click(object sender, RoutedEventArgs e) { if (errorMwsagges.Any()) { string err = "Exaption:"; foreach (var item in errorMwsagges) { err += "\n" + item; } MessageBox.Show(err); return; } try { bl.addNanny(nanny); this.Close(); } catch (FormatException) { MessageBox.Show("cheak your input.."); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void addNannyButton_Click(object sender, RoutedEventArgs e) { try { bl.addNanny(nny); this.Close(); } catch (Exception r) { MessageBox.Show(r.Message); } }