public IActionResult AddAccount(AccountModel account)
        {
            var userId = _userService.GetUserId();

            var          isLoggedIn  = _userService.IsAuthenticated();
            IdentityUser user        = _userManager.FindByIdAsync(userId).Result;
            var          email       = user.Email;
            var          phonenumber = long.Parse(user.PhoneNumber);
            int          id          = _AccountRepository.AddNewAccount(account, email, phonenumber);

            if (id > 0)
            {
                return(RedirectToAction(nameof(AddAccount), new { isSuccess = true }));
            }

            return(View());
        }
Ejemplo n.º 2
0
 public void AddNewAccount(Account newAccount)
 {
     _accountRepository.AddNewAccount(newAccount);
 }