// On double click, the form is closed, which triggers automatic selection private void selectItem_Click(object sender, EventArgs e) { Employees cE = (Employees)employeeBox.SelectedItem; // if the password is null, they don't need to log in if (cE.password == null) { passwordCorrect = true; } // Otherwise, check to see if their password is correct else { PasswordForm aP = new PasswordForm(cE); aP.ShowDialog(); } // Only close if it is if (passwordCorrect) { this.Close(); } }
// When the enter button is clicked private void enterButton_Click(object sender, EventArgs e) { currentEmployee.password = PasswordForm.sha256(passwordBox.Text); employeeAdd.passwordCreated = true; this.Close(); }