Package net.sourceforge.wampum.finance.entities

Examples of net.sourceforge.wampum.finance.entities.Account


            }
            resultSet.close();
            preparedStatement.close();
           
            TransSplit transSplit = null;
            Account account = null;
            for (int i=0; i<retVal.size(); i++) {
              transaction = (RegisterTrans)retVal.get(i);
                preparedStatement = conn.prepareStatement(LOAD_TRANSACTION);
                preparedStatement.setString(1, transaction.getTransactionID());
                resultSet = preparedStatement.executeQuery();
                while (resultSet.next()) {
                  transSplit = new TransSplit();
                  transSplit.setAmount(new Double(resultSet.getDouble("AMOUNT")));
                  account = new Account();
                  account.setTitle(resultSet.getString("TITLE"));
                  transSplit.setAccount(account);
                  transaction.appendTransSplit(transSplit);
                }
                resultSet.close();
                preparedStatement.close();
View Full Code Here


        }
        resultSet.close();
        preparedStatement.close();
       
        TransSplit transSplit = null;
        Account account = null;
        for (int i=0; i<retVal.size(); i++) {
          transaction = (RegisterTrans)retVal.get(i);
          preparedStatement = conn.prepareStatement(LOAD_TRANSACTION);
          preparedStatement.setString(1, transaction.getTransactionID());
          resultSet = preparedStatement.executeQuery();
          while (resultSet.next()) {
            transSplit = new TransSplit();
            transSplit.setAmount(new Double(resultSet.getDouble("AMOUNT")));
            account = new Account();
            account.setTitle(resultSet.getString("TITLE"));
            transSplit.setAccount(account);
            transaction.appendTransSplit(transSplit);
          }
          resultSet.close();
          preparedStatement.close();
View Full Code Here

   
  public AccountsController(JPanel contentPanel) {
    super();
    this.contentPanel = contentPanel;
    transactionList = new ArrayList();
    this.currentAccount = new Account();
    initGUI();
  }
View Full Code Here

  private void buildAccountTree() {
      DefaultMutableTreeNode root = new DefaultMutableTreeNode("Accounts");
    DefaultTreeModel treeModel = new DefaultTreeModel(root);
   
    List accountList = AccountTreeDAO.loadAccountTree();
    Account account = null;
    for (int i=0; i<accountList.size(); i++) {
      account = (Account)accountList.get(i);
      buildBranch(account, root);
    }
    accountsTree.setModel(treeModel);
View Full Code Here

                    budget.setBudgetID(null);

                resultSet.getString("ACCOUNT_ID");
                if (!resultSet.wasNull()) {
                    if (lazyLoad) {
                        Account parentAccount = new Account();
                        parentAccount.setAccountID(new String(resultSet.getString("ACCOUNT_ID")));
                        budget.setAccountID(parentAccount);
                    }
                    else {
                        String accountID = new String(resultSet.getString("ACCOUNT_ID"));
                        if (!resultSet.wasNull()) {
                            String accountWhere = "WHERE ACCOUNT_ID = '" + accountID.toString() + "' ";
                            DAO dao = daoFactory.getDAO("account");
                            List accountList = dao.load(accountWhere, null, true);
                            if (accountList.size()>0) {
                                Account parentAccount = (Account)accountList.get(0);
                                budget.setAccountID(parentAccount);
                            }
                       }
                    }
                }
View Full Code Here

    TreeAccount treeAccount = new TreeAccount(parent);
    DefaultMutableTreeNode treeNode = new DefaultMutableTreeNode(treeAccount);
    parentNode.add(treeNode);
   
    List childList = parent.getAccountList();
    Account account = null;
    for (int i=0; i<childList.size(); i++) {
      account = (Account)childList.get(i);
      buildBranch(account, treeNode);
    }
  }
View Full Code Here

            throw new RuntimeException(ex);
          }
        }
    }
    else if ("clearButton".equals(event.getActionCommand())) {
      this.currentAccount = new Account();
      this.title.setText("");
      this.description.setText("");
      updateParentList();
      checkButtonStatus();
      tabbedPane.setEnabledAt(1, false);
    }
    else if ("saveButton".equals(event.getActionCommand())) {
      this.currentAccount.setTitle(this.title.getText());
      this.currentAccount.setDescription(this.description.getText());
      if (parentAccount.getSelectedItem() instanceof TreeAccount) {
        this.currentAccount.setParentAccount((Account)parentAccount.getSelectedItem());
      }
      else {
        this.currentAccount.setParentAccount(null);
      }
     
      AccountDAO accountDAO = (AccountDAO)this.daoFactory.getDAO("account");
      accountDAO.store(this.currentAccount, false);
      buildAccountTree();
      updateRegisterTableData();
      tabbedPane.setEnabledAt(1, true);
    }
    else if ("deleteButton".equals(event.getActionCommand())) {
      AccountDAO accountDAO = (AccountDAO)this.daoFactory.getDAO("account");
      accountDAO.delete(this.currentAccount);
     
      this.currentAccount = new Account();
      this.title.setText("");
      this.description.setText("");
      updateParentList();
      buildAccountTree();
      updateRegisterTableData();
View Full Code Here

    AccountDAO accountDao = (AccountDAO)daoFactory.getDAO("account");
    List accountList = accountDao.load(null, "ORDER BY TITLE", true);
   
    // get root list
    List rootList = new ArrayList();
    Account account = null;
    int count = 0;
    while (count<accountList.size()) {
      account = (Account)accountList.get(count);
      if (account.getParentAccount() == null) {
        rootList.add(account);
        accountList.remove(count);
      }
      else
        count++;
View Full Code Here

    return rootList;
  }
 
  private static void loadChildAccounts(Account parent, List accountList) {
    int count = 0;
    Account account = null;
    while (count<accountList.size()) {
      account = (Account)accountList.get(count);
      if (account.getParentAccountAccountID() != null &&
          account.getParentAccountAccountID().equals(parent.getAccountID())) {
        parent.appendAccount(account);
        accountList.remove(count);
        loadChildAccounts(account, accountList);
      }
      else
View Full Code Here

    this.setRenderer(new AccountRenderer());
   
    DAOFactory factory = new DAOFactory();
    AccountDAO accountDAO = (AccountDAO)factory.getDAO("account");
    accountList = accountDAO.load(null, "ORDER BY TITLE", true);
    Account account = null;
    for (int i=0; i<accountList.size(); i++) {
      account = (Account)accountList.get(i);
      this.addItem(account);
    }
   
View Full Code Here

TOP

Related Classes of net.sourceforge.wampum.finance.entities.Account

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.