private void btnSave_Click(object sender, EventArgs e) { if (ValidateChildren(ValidationConstraints.Enabled) && userIdentity.ChangePassword(UserIdentity.SessionUser.UserName, txbUsername.Text, textEdit1.Text)) { XtraMessageBox.Show("Change password successfully!", "Success"); this.DialogResult = DialogResult.OK; this.Close(); } else { XtraMessageBox.Show("Wrong password", "ERROR"); } }