Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
 private void addEntry(AccountEntry entry)
 {
     entryList.Add(entry);
 }