Ejemplo n.º 1
0
 public static AccountBase CreateAccount(AccountType type)
 {
     AccountBase account = null;
     switch(type)
     {
         case AccountType.Silver:
             account = new SilverAccount();
             break;
         case AccountType.Gold:
             account = new GoldAccount();
             break;
         case AccountType.Platinum:
             account = new PlatinumAccount();
             break;
     }
     return account;
 }
Ejemplo n.º 2
0
        public static AccountBase CreateAccount(AccountType type)
        {
            AccountBase account = null;

            switch (type)
            {
            case AccountType.Silver:
                account = new SilverAccount();
                break;

            case AccountType.Gold:
                account = new GoldAccount();
                break;

            case AccountType.Platinum:
                account = new PlatinumAccount();
                break;
            }
            return(account);
        }