示例#1
0
        public override IBankAccount CreateAccount(AccountTypeEnum accountType, string accountNumber, AccountCatagoryEnum accountCatagory)
        {
            switch (accountCatagory)
            {
            case AccountCatagoryEnum.Loaning:
                return(this.CreateLoaningAccount(accountType, accountNumber));

            case AccountCatagoryEnum.Saving:
                return(this.CreateSavingAccount(accountType, accountNumber));

            default:
                throw new Exception("The account can only be Saving or Loaning account, Please specify valid acount account category");
            }
        }
示例#2
0
 /// <summary>
 /// main method
 /// </summary>s
 public abstract IBankAccount CreateAccount(AccountTypeEnum accountType
                                            , string accountNumber
                                            , AccountCatagoryEnum accountCatagory);