private void Button_Click_1(object sender, RoutedEventArgs e) { string password = Trainee_Password.Password.ToString(); bool traineeFound = true; BE.Trainee trainee; try { trainee = bl.findTrainee(password); } catch (Exception ex) { if (ex.Message == "This trainee does not exists") { MessageBox.Show("תלמיד יקר, אינך רשום במערכת", "", MessageBoxButton.OK, MessageBoxImage.Information); traineeFound = false; } } if (traineeFound) { UpdateTrainee updateTrainee = new UpdateTrainee(); updateTrainee.password = password; //העברת המידע לחלון הבא updateTrainee.Show(); // Window updateTraineeWindow = new UpdateTrainee(); //updateTrainee.func(); // updateTraineeWindow.Show(); } }
//UPDATE DETAILS private void ButtonUpdateTrainee_Click(object sender, RoutedEventArgs e) { this.Close(); UpdateTrainee upTrainee = new UpdateTrainee(); upTrainee.receiveTrainee(currentTrainee); upTrainee.Show(); }
private void Button_Click(object sender, RoutedEventArgs e) { try { //This is special to the password box, because it not depency property //And I dont have to worry about htis because password we just do one time. trainee._password = passwordBox.Password; bl.addTrainee(trainee); //The continue if there isnt excemption this.Close(); UpdateTrainee upTrainee = new UpdateTrainee(); upTrainee.receiveTrainee(trainee); upTrainee.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }