Package net.octal.supinbank.entity

Examples of net.octal.supinbank.entity.Operation


        Preconditions.checkNotNull(to);
        Preconditions.checkArgument(amount <= from.getTotalAmount());
       
        final Calendar cal = Calendar.getInstance();
       
        Operation operationTo = new Operation();
        operationTo.setAmount(amount);
        operationTo.setDate(cal.getTime());
        operationTo.setWording(description);
        to.addOperation(operationTo);

        Operation operationFrom = new Operation();
        operationFrom.setAmount(-amount);
        operationFrom.setDate(cal.getTime());
        operationFrom.setWording(description);
        from.addOperation(operationFrom);

        operationDao.addOperation(operationFrom);
        operationDao.addOperation(operationTo);
View Full Code Here


       
        final StringBuilder sb = new StringBuilder();
        sb.append(description);
        sb.append(String.format(" [INT TRANSFERT - %s]", bban));

        Operation operationFrom = new Operation();
        operationFrom.setAmount(-amount);
        operationFrom.setDate(cal.getTime());
        operationFrom.setWording(sb.toString());
        from.addOperation(operationFrom);

        Operation operationTo = new Operation();
        operationTo.setAmount(amount);
        operationTo.setDate(cal.getTime());
        operationTo.setWording(sb.toString());
        to.addOperation(operationTo);

        accountService.withDrawAndCredit(from.getId(), to.getId(), amount);
        operationDao.addOperation(operationFrom);
        operationDao.addOperation(operationTo);
View Full Code Here

            final StringBuilder sb = new StringBuilder();
            sb.append(description);
            sb.append(String.format(" [EXT TRANSFERT - %s]", bban));

            Operation operation = new Operation();
            operation.setAmount(-amount);
            operation.setWording(sb.toString());
            operation.setDate(cal.getTime());
            from.addOperation(operation);

            accountService.withDrawAccount(from.getId(), amount);
            operationDao.addOperation(operation);
View Full Code Here

        final Account account = accountService.findAccountById(accountId);
        final Double amount = Double.parseDouble(request.getParameter("amount"));
        final String wording = request.getParameter("wording");
        final Calendar cal = Calendar.getInstance();
       
        Operation operation = new Operation();
        operation.setDate(cal.getTime());
        operation.setAmount(amount);
        operation.setWording(wording);
        account.addOperation(operation);
       
        operationDao.addOperation(operation);
        accountService.creditAccount(accountId, amount);
       
View Full Code Here

TOP

Related Classes of net.octal.supinbank.entity.Operation

Copyright © 2018 www.massapicom. 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.