示例#1
0
        private void Log_in_Button_Click(object sender, RoutedEventArgs e)
        {
            if (IsAdmin(Tb_User_name.Text, Pb_Password.Password))
            {
                Login_grid.Visibility = Visibility.Hidden;
                Menu_1.Visibility     = Visibility.Visible;
                return;
            }
            if (IsTrainee(Tb_User_name.Text, Pb_Password.Password))
            {
                Login_grid.Visibility  = Visibility.Hidden;
                TraineeGrid.Visibility = Visibility.Visible;
                My_Tests.ItemsSource   = myBL.Get_all_tests(t => t.Trainee_ID.ToString() == Pb_Password.Password);
                return;
            }
            if (IsTester(Tb_User_name.Text, Pb_Password.Password))
            {
                Login_grid.Visibility = Visibility.Hidden;
                TesterGrid.Visibility = Visibility.Visible;
                Tests.ItemsSource     = myBL.Get_all_tests(t => t.Tester_ID.ToString() == Pb_Password.Password);
                return;
            }
            else
            {
                MessageBox.Show("The User Name or Password are incorrect", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);

                Tb_User_name.Clear();
                Pb_Password.Clear();
            }
        }
示例#2
0
 private void Bt_logOut_Click(object sender, RoutedEventArgs e)
 {
     Tb_User_name.Clear();
     Pb_Password.Clear();
     Menu_1.Visibility     = Visibility.Hidden;
     Menu_2.Visibility     = Visibility.Hidden;
     Login_grid.Visibility = Visibility.Visible;
 }