private void btnPwdChange_Click(object sender, EventArgs e) { bool actualIgual = Encryptor.CompararMD5(txtOld.Text, password); bool nuevaIgual = txtNew.Text.Equals(txtConfirm.Text); bool nuevaValida = txtNew.Text.Length > 0; if (actualIgual && nuevaIgual && nuevaValida) { try { AppUserDAO.passwordChange(username, Encryptor.CrearMD5(txtNew.Text)); MessageBox.Show("Password updated successfully!", "HUGO", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } catch (Exception) { MessageBox.Show("Error, try again please.", "HUGO", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Error, incorrect input.", "HUGO", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }