Esempio n. 1
0
 public IActionResult ForgotPassword(string EmailId)
 {
     ViewBag.MailPasswordNotExist = "Exist";
     ViewBag.MailExist            = 0;
     ViewBag.PlayerNotActive      = 0;
     ViewBag.HomeForgetPassword   = "******";
     ViewBag.PlayerNotExistMsg    = "Exist";
     ViewBag.ResetPasswordMsg     = "NotResetPasswordMsg";
     if (iplayerBusiness.IsPlayerExist(EmailId))
     {
         var token = Guid.NewGuid();
         iplayerBusiness.UpdateToken(token, EmailId);
         var    lnkHref = "<a href='" + Url.Action("ResetPassword", "Account", new { email = EmailId, code = token }, "http") + "'>Reset Password</a>";
         string subject = "Reset Password";
         string body    = "<b>Please find the Password Reset Link. </b><br/>" + lnkHref;
         EmailHelper.SendEmail(EmailId, body, subject);
         ViewBag.HomeForgetPassword = "******";
         ViewBag.ResetPasswordMsg   = "ResetPasswordMsg";
         return(View());
     }
     else
     {
         ViewBag.PlayerNotExistMsg = "PlayerNotExist";
         return(View());
     }
 }