예제 #1
0
        public Account CreateAccount(AccountType type, Customer customer)
        {
            IAccountFactory factory = new DefaultAccountFactory();
            Account         acc     = factory.CreateAccount(type, customer);

            if (acc != null)
            {
                _accounts.Add(acc.AccountNumber, acc);
                acc.Customer = customer;
                customer.AddAccount(acc);
            }
            return(acc);
        }
예제 #2
0
        public Account CreateAccount(AccountType type, Customer customer)
        {
            IAccountFactory factory = new DefaultAccountFactory();
            Account         acc     = factory.CreateAccount(type, customer);

            if (acc != null)
            {
                _accounts.Add(acc.AccountNumber, acc);
                acc.Customer = customer;
                customer.AddAccount(acc);
            }
            return(EnableLogging ? new TracingAccount(acc)
            {
                Logger = Console.Out
            } : acc);
        }