Example #1
0
        //
        public ActionResult CompanyPasswordRecoveryConfirm(string token, string email)
        {
            PasswordRecoveryConfirm passwordRecoveryConfirm = new PasswordRecoveryConfirm();
            Customer customerService = new Customer();


            passwordRecoveryConfirm.DisablePasswordChanging = false;
            DataTable objDt = customerService.CompanyPasswordRecoveryCheck(token, email);

            if (objDt != null && objDt.Rows.Count > 0)
            {
                if (Convert.ToDateTime(objDt.Rows[0]["PasswordRecoverExpiry"]) < DateTime.Now)
                {
                    passwordRecoveryConfirm.Message = "Password Recovery Link has been Expired";
                    passwordRecoveryConfirm.DisablePasswordChanging = true;
                }
            }
            else
            {
                passwordRecoveryConfirm.Message = "Incorrect Recovery Url";
                passwordRecoveryConfirm.DisablePasswordChanging = true;
            }

            return(View(passwordRecoveryConfirm));
        }
Example #2
0
 public ActionResult PasswordRecoveryConfirm(string token, string email, PasswordRecoveryConfirm passwordRecoveryConfirm)
 {
     if (ModelState.IsValid)
     {
         Customer customerService = new Customer();
         passwordRecoveryConfirm.DisablePasswordChanging = false;
         if (customerService.PasswordReset(email, passwordRecoveryConfirm.Password))
         {
             passwordRecoveryConfirm.Message = "Successfully ..! Password has been changed";
             passwordRecoveryConfirm.DisablePasswordChanging = true;
         }
     }
     return(View(passwordRecoveryConfirm));
 }