private void btnAccess_Click(object sender, EventArgs e) { if (txtUser.Text == "*****@*****.**") { Response response = employeeBLL.CheckPassword(txtUser.Text, txtPassword.Text); if (response.Success) { OpenForm(new FormMainMenu()); this.Visible = false; } else { MessageBox.Show(response.Message); } } else { Response response = employeeBLL.CheckPassword(txtUser.Text, employeeBLL.EncryptPassword(txtPassword.Text)); if (response.Success) { OpenForm(new FormMainMenu()); this.Visible = false; } else { MessageBox.Show(response.Message); } } }
private bool ValidateOldPassword() { bool bStatus = true; if (txtOldPassword.Text == "") { errorProvider1.SetError(txtOldPassword, "Please enter your Password"); bStatus = false; } else if (employeeBLL.CheckPassword(EmployeeID, txtOldPassword.Text) == false) { errorProvider1.SetError(txtOldPassword, "Your password was incorrect. You should enter your current password."); bStatus = false; } else { errorProvider1.SetError(txtOldPassword, ""); bStatus = true; } return(bStatus); }