public ActionResult Recover(RecoverModel model, string returnUrl) { if (!ModelState.IsValid) { return(View(model)); } ApplicationUser user = UserManager.FindByNameAsync(model.UserName).Result; if (user == null || !(UserManager.IsEmailConfirmedAsync(user.Id).Result)) { ViewBag.Message = "¡Error al restablecer su contraseña!"; return(View(model)); } var token = UserManager.GeneratePasswordResetTokenAsync(user.Id).Result; var resetLink = Url.Action("ResetPassword", "Account", new { token = token }, protocol: HttpContext.Request.Url.Scheme); // Enviar Url para cambiar la contraseña EParameters parameter = new EParameters() { IdUnique = 1, FullName = $"{user.Profiles.FirstName} {user.Profiles.MiddleName} {user.Profiles.LastName}", Email = user.Email, Link = resetLink, currentTime = DateTime.Now }; IRepositoryEmail service = new Email(new Templates(1), parameter); service.Submit(); ViewBag.Message = "¡Se ha enviado un enlace para restablecer su contraseña a su dirección de correo electrónico¡"; return(View(model)); }
public void computeAttributes() { this.EParameters = new List <EParameter>(); this.returnType = EaMethod.ReturnType; foreach (SQLParameter parameter in EaMethod.Parameters) { EParameter eParameter = new EParameter(parameter, Repository); EParameters.Add(eParameter); } if (this.EaMethod.ClassifierID != "0" && this.EaMethod.ClassifierID != "") { try { SQLElement classifier = Repository.GetElementByID(int.Parse(this.EaMethod.ClassifierID)); this.typeGuid = classifier.ElementGUID; } catch { } } }