//reset password private void btnFind_Click(object sender, EventArgs e) { FormPassValue.loginForm = this.Owner; CancelEventArgs cea = new CancelEventArgs(); txtPasswordConfirm_Validating(sender, cea); txtPassword_Validating(sender, cea); txtCode_Validating(sender, cea); //validate input pass if (cea.Cancel == false) { if (this.txtCode.Text.Trim().Equals(this.verificationCode)) { if (this.txtPasswordConfirm.Text.Trim().Equals(this.txtPassword.Text.Trim())) { UserService.UserServiceClient client = new UserService.UserServiceClient(); int userId = Convert.ToInt32(client.QueryUserIdByName(this.userName)); string encryptPassword = EncryptUtils.EncryptPassword(this.txtPassword.Text.Trim()); try { client.UpdatePassword(encryptPassword, userId); FormPassValue.isSendEmail = false; this.customTimer.GetTimer().Enabled = false; TipForm tipForm = new TipForm(); tipForm.SetMessage(ResourceCulture.GetString(CHANGE_PASSWORD_SUCCESS)); tipForm.SetIsShowCancel(false); tipForm.ShowDialog(); this.DialogResult = DialogResult.OK; this.Owner.Show(); } catch (Exception ex) { Log4NetHelper.WriteErrorLog(typeof(ResetPassword), ex); TipForm tipForm = new TipForm(); tipForm.SetMessage(ResourceCulture.GetString(CHANGE_PASSWORD_UNSUCCESS)); tipForm.SetIsShowCancel(false); tipForm.ShowDialog(); this.DialogResult = DialogResult.OK; } } else { this.lblErrorMessage.Text = ResourceCulture.GetString(NOT_CONSISTENT); this.lblErrorMessage.Show(); } } else { this.lblErrorMessage.Text = ResourceCulture.GetString(VALIDATION_CODE_ERROR); this.lblErrorMessage.Show(); currentTime++; if (currentTime == totalTime) { this.DialogResult = DialogResult.Cancel; this.Owner.Show(); } } } }