Package net.sourceforge.wampum.finance.entities

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


      }
      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();
View Full Code Here


    }
  }
 
  private void updateParentList() {
    DAOFactory factory = new DAOFactory();
    AccountDAO accountDAO = (AccountDAO)factory.getDAO("account");
    String whereClause = null;
    if (this.currentAccount.getAccountID() != null && !this.currentAccount.getAccountID().equals("")) {
      whereClause = "WHERE ACCOUNT_ID NOT IN ('" + this.currentAccount.getAccountID() + "')";
    }
    List accountList = accountDAO.load(whereClause, "ORDER BY TITLE", true);
    TreeAccount account = null;
    parentAccount.removeAllItems();
    parentAccount.addItem("None");
    int parentIndex = 0;
    for (int i=0; i<accountList.size(); i++) {
View Full Code Here

public class AccountTreeDAO {
 
  public static List loadAccountTree() {
    DAOFactory daoFactory = new DAOFactory();
    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;
View Full Code Here

  public AccountEditor() {
    super();
    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

        else if (col == 1) {
          if (transSplit.getAccount() == null) {
            return null;
          }
          else {
            AccountDAO accountDao = (AccountDAO)daoFactory.getDAO("account");
            List accountList = accountDao.load("WHERE ACCOUNT_ID = '" + transSplit.getAccountAccountID() + "'", null, true);
            return accountList.get(0);
          }
        }
        else if (col == 2) {
          if (amount == null)
View Full Code Here

    if (name == null || name.length() == 0)
      throw new RuntimeException("Invalid name");
    DAOSQLImpl dao = null;
   
    if (name.equalsIgnoreCase("account"))
      dao = new AccountDAO();
    else if (name.equalsIgnoreCase("budget"))
      dao = new BudgetDAO();
    else if (name.equalsIgnoreCase("transaction"))
      dao = new TransactionDAO();
    else if (name.equalsIgnoreCase("transSplit"))
View Full Code Here

              }
              if (!createTrans)
                return;
            }
           
            AccountDAO accountDAO = (AccountDAO)factory.getDAO("account");
            Account newAccount = (Account)accountDAO.load("WHERE TITLE = 'Imbalance-USD'", null, true).get(0);
            TransSplit transSplit = new TransSplit();
            transSplit.setParentTransaction(trans);
            Account account = new Account();
            account.setAccountID(accountID);
            transSplit.setAccount(account);
View Full Code Here

              }
              trans.appendTransSplit(newSplit);
            }
          }
          else {
            AccountDAO accountDAO = (AccountDAO)factory.getDAO("account");
            Account newAccount = (Account)accountDAO.load("WHERE TITLE = 'Imbalance-USD'", null, true).get(0);
            TransSplit transSplit = new TransSplit();
            transSplit.setParentTransaction(trans);
            Account account = new Account();
            account.setAccountID(accountID);
            transSplit.setAccount(account);
View Full Code Here

  public void endElement(String uri, String localName, String qName)
    throws SAXException {
    tagData = tagData.trim();
    if (qName.equalsIgnoreCase("gnc:account")) {
      recordType = "";
      AccountDAO accountDAO = (AccountDAO)daoFactory.getDAO("account");
      try {
        if (this.eventListener != null)
          this.eventListener.GNUCashEvent(new GNUCashEvent("Acocunt: " + currentAccount.getTitle()));
        String where = "where ACCOUNT_ID = '" + currentAccount.getAccountID() + "'";
        if (accountDAO.load(where, null, true).size() == 0)
          accountDAO.create(currentAccount, false);
        else
          accountDAO.update(currentAccount, false);
      }
      catch (Exception ex) {
        System.out.println("Error with account:\n" +
          currentAccount.getTitle() + "\n" +
          currentAccount.getAccountID());
View Full Code Here

            payee = (Payee)payees.get(i);
            XMLUtil.appendChildNode(payeesElement, PayeeXML.createXMLDocument(payee).getDocumentElement());
          }
         
          Element accountsElement = XMLUtil.newChildElement(doc.getDocumentElement(), "Accounts", null);
          AccountDAO accountDAO = (AccountDAO)daoFactory.getDAO("account");
          List accounts = accountDAO.load(null, "ORDER BY TITLE", false);
          Account account = null;
          for (int i=0; i<accounts.size(); i++) {
            account = (Account)accounts.get(i);
            account.setAccountList(new ArrayList());
            XMLUtil.appendChildNode(accountsElement, AccountXML.createXMLDocument(account).getDocumentElement());
View Full Code Here

TOP

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

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.