public void CreateNewAcc(AccType acctype, 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 (acctype) { case AccType.Basic: AccountStorage.Add(new BaseAccount(name, lastname)); break; case AccType.Gold: AccountStorage.Add(new GoldAccount(name, lastname)); break; case AccType.Platinum: AccountStorage.Add(new PlatinumAccount(name, lastname)); break; } }
public void Load(string filename) { AccountStorage.LoadAccs(filename); }
public void Save(string filename) { AccountStorage.SaveAccs(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); }