Exemple #1
0
        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;
            }
        }
Exemple #2
0
 public void Load(string filename)
 {
     AccountStorage.Load(filename);
 }
Exemple #3
0
 public void Save(string filename)
 {
     AccountStorage.Save(filename);
 }
Exemple #4
0
 public void Withdraw(string id, int amount)
 {
     CheckId(id);
     AccountStorage.GetByID(id).Withdraw(amount);
 }
Exemple #5
0
 public void Deposit(string id, int amount)
 {
     CheckId(id);
     AccountStorage.GetByID(id).Deposit(amount);
 }
Exemple #6
0
 public void Delete(string id)
 {
     CheckId(id);
     AccountStorage.Remove(id);
 }