private void ChangeBTN_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(OldTE.Text) && !string.IsNullOrWhiteSpace(NewTE.Text) && !string.IsNullOrWhiteSpace(ReTE.Text)) { if (CalculateMD5Hash(OldTE.Text) == dr.Password && NewTE.Text == ReTE.Text) { if (_DB.ChangePassword(doctor, NewTE.Text)) { XtraMessageBox.Show("The password has been changed!"); OldTE.Text = string.Empty; NewTE.Text = string.Empty; ReTE.Text = string.Empty; } else { XtraMessageBox.Show("The password has been changed!"); } } else { XtraMessageBox.Show("Old password is invalid or new ones are not the same!"); } } else { XtraMessageBox.Show("All fields should be filled!"); } }