예제 #1
0
        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();
            }
        }
예제 #2
0
        //UPDATE DETAILS
        private void ButtonUpdateTrainee_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
            UpdateTrainee upTrainee = new UpdateTrainee();

            upTrainee.receiveTrainee(currentTrainee);
            upTrainee.Show();
        }
예제 #3
0
        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);
            }
        }