private void btnOK_Click(object sender, EventArgs e) { Interface.DbLink dbLink = new Interface.DbLink(); if (dbLink.userValidate(StaffNumber, txtOldPass.Text)) { dbLink.ChangePassword(StaffNumber, txtNewPass0.Text); this.DialogResult = DialogResult.OK; } else { MessageBox.Show("Please enter the valid old password for this account.", "Access Denied", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void btnLogin_Click(object sender, EventArgs e) { Interface.DbLink DbLink = new Interface.DbLink(); if (DbLink.userValidate(txtBStaffNumber.Text, txtPassword.Text)) { this.DialogResult = DialogResult.OK; } else { MessageBox.Show( "User credentials do not match. Please try again.", "Access Denied", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); txtPassword.Clear(); } }