//TODO: This is a stupid way of seeding data, refactor this later static BaseAccount FromCsv(string line) { string[] element = line.Split(','); BaseAccount accountValues = new BaseAccount( element[0], element[1], element[2], element[3], double.Parse(element[4])); return(accountValues); }
public BaseAccount FindAccount(AccountType type, string owner) { BaseAccount retval = null; foreach (BaseAccount acct in AccountList) { if (acct.AccType == type && acct.OwnerName == owner) { retval = acct; break; } } if (retval == null) { throw new BankAccountNotFound(); } return(retval); }
static void Main(string[] args) { var baseAccount1 = new BaseAccount("John", "Smith"); Account.PutBonus = 5; Account.WithdrawBonus = 3; baseAccount1.Open(); baseAccount1.Put(10); baseAccount1.Withdraw(20); baseAccount1.Withdraw(5); baseAccount1.CheckBalance(); baseAccount1.BonusInfo(); baseAccount1.Open(); var platinumAccount = new PlatinumAccount("Harry", "Potter"); platinumAccount.Open(); platinumAccount.Withdraw(2); platinumAccount.Put(5); platinumAccount.Put(10); Account.DoingStorage(); Console.ReadKey(); }
public virtual void Transfer(double amt, BaseAccount to) { this.Withdraw(amt); to.Deposit(amt); }