public void Create(AccountType type, string name, string lastname) { if (name == null || lastname == null) { throw new ArgumentNullException("Parametrs can't be null"); } if (name.Length <= 1 || lastname.Length <= 1) { throw new ArgumentNullException("Parametrs can't be empty or less then 1"); } switch (type) { case AccountType.Base: AccountStorage.Add(new BaseAccount(name, lastname)); break; case AccountType.Gold: AccountStorage.Add(new GoldAccount(name, lastname)); break; case AccountType.Platinum: AccountStorage.Add(new PlatinumAccount(name, lastname)); break; } }
public void Load(string filename) { AccountStorage.Load(filename); }
public void Save(string filename) { AccountStorage.Save(filename); }
public void Withdraw(string id, int amount) { CheckId(id); AccountStorage.GetByID(id).Withdraw(amount); }
public void Deposit(string id, int amount) { CheckId(id); AccountStorage.GetByID(id).Deposit(amount); }
public void Delete(string id) { CheckId(id); AccountStorage.Remove(id); }