Package mjg.spring.entities

Examples of mjg.spring.entities.Account.deposit()


        return account.getBalance();
    }

    public BigDecimal depositIntoAccount(int id, BigDecimal amount) {
        Account account = dao.findAccountById(id);
        account.deposit(amount);
        dao.updateAccount(account);
        return account.getBalance();
    }

    public BigDecimal withdrawFromAccount(int id, BigDecimal amount) {
View Full Code Here


    public boolean transferFunds(int fromId, int toId, BigDecimal amount) {
        Account from = dao.findAccountById(fromId);
        Account to = dao.findAccountById(toId);
        from.withdraw(amount);
        to.deposit(amount);
        dao.updateAccount(from);
        dao.updateAccount(to);
        return true;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.