Пример #1
0
        public async Task <IActionResult> Register(AccountUser shelter, String submitAction)
        {
            if (submitAction.Equals("Register"))
            {
                if (shelter.AccountUserId.Equals(Guid.Empty))
                {
                    AccountUserHandler.AddCmd addCmd = new AccountUserHandler.AddCmd
                    {
                        FirstName            = shelter.FirstName,
                        AccountUserId        = shelter.AccountUserId,
                        UserTypeCode         = shelter.UserTypeCode,
                        LastName             = shelter.LastName,
                        LoginEmail           = shelter.LoginEmail,
                        RecoveryPhone        = shelter.RecoveryPhone,
                        PasswordHash         = passhash.GetNewPassHash(shelter.PasswordHash),
                        CanLogin             = shelter.CanLogin,
                        IsLockedDateTime     = shelter.IsLockedDateTime,
                        ResetToken           = shelter.ResetToken,
                        ResetTokenExpiration = shelter.ResetTokenExpiration
                    };
                    await _mediatr.Send(addCmd);
                }
                else
                {
                    await _accountUserRepo.Update(shelter);
                }

                return(RedirectToAction("Login"));
            }
            else
            {
                return(RedirectToAction("Login"));
            }
        }
Пример #2
0
 protected override async Task HandleCore(UpdateCmd cmd)
 {
     await _repo.Update(cmd);
 }