コード例 #1
0
        /// <summary>
        /// Opens new account.
        /// </summary>
        /// <param name="holderName">
        /// Holder's name.
        /// </param>
        /// <param name="holderPhone">
        /// Holder's phone.
        /// </param>
        /// <param name="holderEmail">
        /// Holder's email.
        /// </param>
        /// <param name="holderHomeAddress">
        /// Holder's home address.
        /// </param>
        /// <param name="bankAccountFactory">
        /// Factory that creates bank account.
        /// </param>
        /// <param name="accountNumberFactory">
        /// Account number factory that will generate new account number.
        /// </param>
        public override void OpenAccount(
            string holderName,
            string holderPhone,
            string holderEmail,
            string holderHomeAddress,
            AbstractBankAccountFactory bankAccountFactory)
        {
            AbstractBankAccount bankAccount = bankAccountFactory.GetNewBankAccount();

            bankAccount.Holder = HolderService.GetHolder(holderName, holderPhone, holderHomeAddress, holderEmail);
            bankAccount.Holder.AddBankAccount(bankAccount);

            this.Repository.Save(bankAccount);
        }