public void deposit(double amount) { String oldValue = this.getBalance().ToString(); AccountEntry entry = new AccountEntry(amount, "deposit", "", ""); entryList.Add(entry); String newValue = this.getBalance().ToString(); //this.setChanged(); this.NotifyObservers(new ChangedSender("Balance", oldValue, newValue)); }
public void interest() { String oldValue = this.getBalance().ToString(); AccountEntry entry = new AccountEntry(this.calcInterest(), "interest", "", ""); entryList.Add(entry); String newValue = this.getBalance().ToString(); //this.setChanged(); this.NotifyObservers(new ChangedSender("Balance", oldValue, newValue)); }
public void transferFunds(Account toAccount, double amount, String description) { String oldValue = this.getBalance().ToString(); AccountEntry fromEntry = new AccountEntry(-amount, description, toAccount.getAccountNumber(), toAccount.getCustomer().getName()); AccountEntry toEntry = new AccountEntry(amount, description, toAccount.getAccountNumber(), toAccount.getCustomer().getName()); entryList.Add(fromEntry); toAccount.addEntry(toEntry); String newValue = this.getBalance().ToString(); //this.setChanged(); this.NotifyObservers(new ChangedSender("Balance", oldValue, newValue)); }
private void addEntry(AccountEntry entry) { entryList.Add(entry); }