Exemplo n.º 1
0
 public Login()
 {
   this.candidate = null;
   InitializeComponent();
   InitializeBackgroundImage();
   this.username.Focus();
 }
Exemplo n.º 2
0
    private Candidate candidate; //candidate which is using the window

    public Candidate6(Candidate candidate)
    {
      this.candidate = candidate;

      InitializeComponent();
      setWindowProperties();
    }
Exemplo n.º 3
0
    private TestSolver solver;   //test solve logic, holds test and submitted answers 

    public Candidate5(Candidate candidate, TestSolver solver)
    {
      this.candidate = candidate;
      this.solver = solver;
      this.solver.setToStart();
      InitializeComponent();
      setWindowProperties();
    }
Exemplo n.º 4
0
    private Test test; //selected test

    public Candidate3(Candidate candidate, Subject subject, Freshness freshness, bool[] seen)
    {
      this.candidate = candidate;
      this.subject = subject;
      this.freshness = freshness;
      this.seen = seen;

      InitializeComponent();
      setWindowProperties();
    }
Exemplo n.º 5
0
    public Candidate4(Candidate candidate, Test test, Freshness freshness)
    {
      this.candidate = candidate;
      this.freshness = freshness;

      InitializeComponent();
      InitializeAnswerGrids();
      setWindowProperties();

      InitializeTestSolver(test);
    }
Exemplo n.º 6
0
    private bool[] seen; //boolean seen array of windows to speak different messages on windows

    public Candidate1(Candidate candidate, Subject subject, Freshness freshness, bool[] seen)
    {
      this.candidate = candidate;
      this.subject = subject;
      this.freshness = freshness;
      this.seen = seen;

      InitializeComponent();
      setWindowProperties();

      checkCheckBoxes();
      this.welcomeLabel.Content = "WELCOME " + candidate.UserName;
    }
Exemplo n.º 7
0
    /// <summary>
    ///     Window Events won't be explained since you can see their effects on the QUI
    /// </summary>
    #region Window Events
    private void submit_Click(object sender, RoutedEventArgs e)
    {
      try
      {
        User user = SQLManager.authenticateUser(username.Text, 
          Security.getMd5Hash(password.Password));

        if (user == null)
        {
          MessageBox.Show("There is not any user with these credentials", 
            "Error", MessageBoxButton.OK, MessageBoxImage.Error);
          username.Focus();
          username.SelectAll();
        }
        else if (user is Candidate)
        {
          mainGrid.Children.Remove(loginGrid);
          mainGrid.RowDefinitions.Clear();

          candidate = (Candidate)user;

          Dispatcher.BeginInvoke((ThreadStart)delegate{
            Speech.speakPurge("Welcome " + candidate.UserName);
            Speech.speakNormal("Press M to listen user manual");
            Speech.speakNormal("Press N to skip or interrupt while listening");
            Speech.speakNormal("Press H to listen this message again"); 
          }, DispatcherPriority.Normal);
        }
        else
        {
            Dispatcher.BeginInvoke((ThreadStart)delegate
            {
                new AdminMain((Admin)user).Show();
            }, DispatcherPriority.Normal);
            Dispatcher.BeginInvoke((ThreadStart)delegate { this.Close(); }, DispatcherPriority.Normal);
        }
      }
      catch (Exception ex)
      {
          MessageBox.Show("Login is failed\n" + ex.Message, 
              "Login Error", MessageBoxButton.OK, MessageBoxImage.Error);
      }
    }
Exemplo n.º 8
0
 /// <summary>
 ///   Used to get information of all users
 /// </summary>
 /// <returns>
 ///   Arraylist of user objects
 /// </returns>
 public static ArrayList getAllUsers()
 {
   CTVIATBankDataSet.UsersDataTable allUsersTable = usersAdapter.GetAllUsers();
   ArrayList users = new ArrayList();
   foreach (DataRow row in allUsersTable)
   {
     if (row["userType"].ToString() == "1")
     {
       Admin temp = new Admin(Convert.ToInt32(row["userID"]), 
         Convert.ToString(row["userName"]), Convert.ToString(row["userPassword"]));
       users.Add(temp);
     }
     else
     {
       Candidate temp = new Candidate(Convert.ToInt32(row["userID"]), 
         Convert.ToString(row["userName"]), Convert.ToString(row["userPassword"]));
       users.Add(temp);
     }
   }
   return users;
 }