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"); } }
/// <summary> /// main method /// </summary>s public abstract IBankAccount CreateAccount(AccountTypeEnum accountType , string accountNumber , AccountCatagoryEnum accountCatagory);