/// <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 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();
        }