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