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