Ejemplo n.º 1
0
        string IAccountService.ForgotUserName(ForgotUserNameModel model)
        {
            var username = this.GetUserName(model.Email);

            if (username != null)
            {
                this.emailHelper.SendUserNameMail(model.Email, username);
                return username;
            }
            return null;
        }
Ejemplo n.º 2
0
        public virtual ActionResult ForgotUserName(ForgotUserNameModel model)
        {
            try
            {
                var username = this.accountService.ForgotUserName(model);

                if (username != null)
                {
                    return PartialView(Views.UserName._ForgotUserNameSuccess, model);
                }
            }
            catch (Exception x)
            {
                ModelState.AddModelError("", "We had a problem sending your user name. Please contact us through the help page.");
                this.emailHelper.SendErrorEmail(x as Exception);
            }
            return PartialView(Views.UserName._ForgotUserName, model);
        }