예제 #1
0
        public bool CreateAccountHolder(string firstName, string lastName, string middleName, DateTime dateOfBirth, string email, string phoneNumber, string address, string password, string checkPassword)
        {
            if (password.Equals(checkPassword))
            {
                AccountHolder newAccountHolder = new AccountHolder
                {
                    FirstName   = firstName,
                    LastName    = lastName,
                    MiddleName  = middleName,
                    DateOfBirth = dateOfBirth,
                    Email       = email,
                    PhoneNumber = phoneNumber,
                    Address     = address,
                    Password    = password
                };
                int accountHolderId = _accountHolderRepository.CreateAccountHolder(newAccountHolder);

                if (accountHolderId != 0)
                {
                    return(CreateAccount(accountHolderId));
                }
                else
                {
                    return(false);
                }
            }

            else
            {
                return(false);
            }
        }
        public AccountHolder CreateAccountHolder(AccountHolder newAccountHolder)
        {
            int accountHolderId = _accountHolderRepository.CreateAccountHolder(newAccountHolder);

            if (accountHolderId != 0)
            {
                if (CreateAccount(accountHolderId))
                {
                    return(newAccountHolder);
                }
            }

            return(newAccountHolder);
        }