private void rdbTester_Checked(object sender, RoutedEventArgs e)
        {
            TesterWindow tw = new TesterWindow(false);

            tw.Show();
            this.Close();
        }
Ejemplo n.º 2
0
        private void Button_login(object sender, RoutedEventArgs e)
        {
            try
            {
                string TypeOfUser = bl.getTypeOfUser(int.Parse(idInput.Text));
                switch (TypeOfUser)
                {
                case "Trainee":
                    TraineeWindow traineeWindow = new TraineeWindow(bl.getTrainee(int.Parse(idInput.Text)));
                    traineeWindow.Show();
                    Close();
                    break;

                case "Tester":
                    TesterWindow testerWindow = new TesterWindow(bl.getTester(int.Parse(idInput.Text)));
                    testerWindow.Show();
                    Close();
                    break;
                }
            }
            catch (Exception exception)
            {
                HandleExceptions.Handle(exception, this);
            }
        }
 /// <summary>
 /// Log in as one of the tester in the list
 /// </summary>
 private void Tester_list_view_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         BE.Tester        tester = Testers_list_view.SelectedItem as BE.Tester;
         MessageBoxResult result = MessageBox.Show("האם ברצונך להתחבר למערכת בתור " + tester.First_name + " " + tester.Last_name + "?", "התחברות כבוחן", MessageBoxButton.YesNo);
         if (result == MessageBoxResult.Yes)
         {
             TesterWindow testerWindow = new TesterWindow(tester);
             this.Close();
             testerWindow.ShowDialog();
         }
     }
     catch (Exception) { }
 }
        private void ListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            object dataContext = ((FrameworkElement)e.OriginalSource).DataContext;

            if (dataContext is Tester)
            {
                TesterWindow testerWindow = new TesterWindow((Tester)testersListView.SelectedItem);
                testerWindow.Show();
                testerWindow.Closed += ChildWindowClosed;
                IsEnabled            = false;
                return;
            }
            if (dataContext is Trainee)
            {
                TraineeWindow traineeWindow = new TraineeWindow((Trainee)traineesListView.SelectedItem);
                traineeWindow.Show();
                traineeWindow.Closed += ChildWindowClosed;
                IsEnabled             = false;
                return;
            }
        }
        private void LogInTester(object sender, RoutedEventArgs e)
        {
            try
            {
                // search for trainee with the wanted id
                List <BE.Tester> resualt = iBL_Imp.SearchTester(tester_id.Text, true, false, false);

                // if there is no resualt
                if (resualt.Count == 0)
                {
                    tester_error_message.Visibility = Visibility.Visible;
                    return;
                }

                // if the password is not correct
                if (resualt[0].Password != iBL_Imp.Encrypte(tester_password.Password))
                {
                    tester_error_message.Visibility = Visibility.Visible;
                    return;
                }

                ////////////////////////////////////////////////////////////
                tester_error_message.Visibility = Visibility.Collapsed;
                tester_password.Password        = "";
                tester_id.Text = "";

                TesterWindow testerWindow = new TesterWindow(resualt[0]);
                this.Visibility = Visibility.Hidden;
                testerWindow.ShowDialog();
                this.Visibility = Visibility.Visible;
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private void TesterButton_Click(object sender, RoutedEventArgs e)
        {
            TesterWindow testerWindow = new TesterWindow();

            testerWindow.ShowDialog();
        }