Example #1
0
 private void backButton_Click(object sender, EventArgs e)
 {
     //Resets index, and returns to either the Admin Main Screen or Employee Main Screen based on login information.
     this.Hide();
     DsUtil.selectedIndex = -1;
     if (loginScreenForm.username == "admin")
     {
         mainScreenFormAdmin mainScreenAdmin = new mainScreenFormAdmin();
         mainScreenAdmin.Show();
     }
     else
     {
         mainScreenFormEmployee mainScreenEmp = new mainScreenFormEmployee();
         mainScreenEmp.Show();
     }
 }
Example #2
0
 private void loginButton_Click(object sender, EventArgs e)
 {
     //"Login System" with simple validation.
     if (usernameTextBox.Text == "admin" && passwordTextBox.Text == "12345")
     {
         username = "******";
         mainScreenFormAdmin mainScreenAdmin = new mainScreenFormAdmin();
         mainScreenAdmin.Show();
         this.Hide();
     }
     else if (usernameTextBox.Text == "employee" && passwordTextBox.Text == "12345")
     {
         username = "******";
         mainScreenFormEmployee mainScreenEmployee = new mainScreenFormEmployee();
         mainScreenEmployee.Show();
         this.Hide();
     }
     else
     {
         errorLabel.Text = "Incorrect login information provided.";
     }
 }