Esempio n. 1
0
 private void LoggedInBtn2_Click(object sender, EventArgs e)
 {
     LoggedInForm logIn = new LoggedInForm();
     logIn.Show();
 }
Esempio n. 2
0
 private void Login(string barcode)
 {
     User user = UnitOfWork.UserService.GetUserByBarcode(barcode);
     IdleTextBox.Text = "";
     if (user != null)
     {
         if (user.Active)
         {
             logIn = new LoggedInForm(UnitOfWork, user, this);
             logIn.Show();
             IdleLogInLabel.Text = "Please scan your barcode";
         }
         else
         {
             Color originalColor = IdleLogInLabel.BackColor;
             IdleTextBox.Enabled = false;
             IdleLogInLabel.BackColor = Color.Red;
             IdleLogInLabel.Text = "This user has been deactivated\nContact an admin!";
             IdleLogInLabel.Refresh();
             Thread.Sleep(5000);
             IdleLogInLabel.BackColor = originalColor;
             IdleLogInLabel.Text = "Please scan your barcode";
             IdleTextBox.Enabled = true;
             IdleTextBox.Focus();
         }
     }
     else
     {
         IdleLogInLabel.Text = "Could not find a user with that barcode";
         IdleLogInLabel.Refresh();
         Thread.Sleep(1000);
         IdleLogInLabel.Text = "Please scan your barcode";
     }
 }