private void UpdateTester_Click(object sender, RoutedEventArgs e) { int id = (((Button)sender).DataContext as BE.Tester).ID; Window UpTester = new UpTester(bl.FindTesterByID(id)); UpTester.Show(); this.Hide(); }
private void Button_Click(object sender, RoutedEventArgs e) { try { iDTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); if (bl.FindTesterByID(tester.ID) == null) { throw new Exception("not exist"); } else { Window UpTester = new UpTester(bl.FindTesterByID(tester.ID)); UpTester.Show(); this.Hide(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }