Package net.sourceforge.wampum.finance.entities

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


     
      swix = new SwingEngine( this );
      swix.getTaglib().registerTag("xdatepicker", JXDatePicker.class);
      transPanel = (JPanel)swix.render( reader );
     
        PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
        List payeeList = payeeDao.load(null, "ORDER BY NAME", true);
        GUIPayee tempPayee = null;
        for (int i=0; i<payeeList.size(); i++) {
          tempPayee = new GUIPayee((Payee)payeeList.get(i));
          payee.addItem(tempPayee);
        }
View Full Code Here


    else if (name.equalsIgnoreCase("transaction"))
      dao = new TransactionDAO();
    else if (name.equalsIgnoreCase("transSplit"))
      dao = new TransSplitDAO();
    else if (name.equalsIgnoreCase("payee"))
      dao = new PayeeDAO();
    else if (name.equalsIgnoreCase("register"))
      dao = new RegisterDAO();
   
    dao.setConnection(this.conn);
    dao.setDAOFactory(this);
View Full Code Here

     
      FileInputStream fis = new FileInputStream("./data/payees.csv");
      BufferedReader in = new BufferedReader(new InputStreamReader(fis));
     
      DAOFactory daoFactory = new DAOFactory();
      PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
     
      String textLine = null;
      String[] payeeStr = null;
      Payee payee = null;
      while ((textLine = in.readLine()) != null) {
        payeeStr = textLine.split(",");
        payee = new Payee();
        payee.setName(payeeStr[0]);
        payee.setFilters(payeeStr[1]);
        payeeDao.create(payee, false);
      }
      daoFactory.commit();
    }
    catch (Exception ex) {
      throw new RuntimeException(ex);
View Full Code Here

  private void buildPayeesTree() {
      DefaultMutableTreeNode root = new DefaultMutableTreeNode("Payees");
    DefaultTreeModel treeModel = new DefaultTreeModel(root);
   
    DAOFactory daoFactory = new DAOFactory();
    PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
    payeeList = payeeDao.load(null, "ORDER BY NAME", true);

    GUIPayee treePayee = null;
    DefaultMutableTreeNode treeNode = null;
    for (int i=0; i<payeeList.size(); i++) {
      treePayee = new GUIPayee((Payee)payeeList.get(i));
View Full Code Here

    if ("saveButton".equals(e.getActionCommand())) {
      currentPayee.setName(name.getText());
      currentPayee.setFilters(filters.getText());
      currentPayee.setActive(new Boolean(true));
      DAOFactory daoFactory = new DAOFactory();
      PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
      payeeDao.store(currentPayee, false);
      buildPayeesTree();
      buildPayeeDropDown();
      checkButtonStatus();
    }
    else if ("clearButton".equals(e.getActionCommand())) {
        currentPayee = new Payee();
        name.setText(currentPayee.getName());
        filters.setText(currentPayee.getFilters());
        updateRegisterTableData();
        checkButtonStatus();
    }
    else if ("deleteButton".equals(e.getActionCommand())) {
      DAOFactory daoFactory = new DAOFactory();
      PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
      currentPayee.setActive(new Boolean(false));
      payeeDao.delete(currentPayee);
     
        currentPayee = new Payee();
        name.setText(currentPayee.getName());
        filters.setText(currentPayee.getFilters());
        updateRegisterTableData();
View Full Code Here

    if (name == null)
      throw new RuntimeException("Payee name is null!");
    Payee payee = null;
    if (payeeList == null) {
      DAOFactory daoFactory = new DAOFactory();
      PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
      payeeList = payeeDao.load(null, null, true);
    }
   
    boolean found = false;
    int count = 0;
    Payee currentPayee = null;
    while (!found && count<payeeList.size()) {
      currentPayee = (Payee)payeeList.get(count);
      if (name.equalsIgnoreCase(currentPayee.getName()) ||
          (currentPayee.getFilters() != null &&
          Pattern.matches(currentPayee.getFilters(), name))) {
        found = true;
        payee = currentPayee;
      }
      count++;
    }
   
    if (!found) {
      payee = new Payee();
      payee.setName(name);
     
      DAOFactory daoFactory = new DAOFactory();
      PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
      payeeDao.create(payee, false);
    }
   
    return payee;
  }
View Full Code Here

      if (ps != null) { try {ps.close(); } catch (Throwable th) {}}
      if (conn != null) { try {conn.close(); } catch (Throwable th) {}}
    }
   
    DAOFactory daoFactory = new DAOFactory();
    PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
    payeeDao.delete(mergePayee);
  }
View Full Code Here

      chooser.setFileFilter(filter);
      int returnVal = chooser.showSaveDialog(Main.mainFrame);
      if(returnVal == JFileChooser.APPROVE_OPTION) {
        try {
          DAOFactory daoFactory = new DAOFactory();
          PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
          List payeeList = payeeDao.load(null, "ORDER BY NAME", true);
         
          File file = chooser.getSelectedFile();
          FileWriter fileWriter = new FileWriter(file);
         
          Payee payee = null;
View Full Code Here

          // build xml
          Document doc = XMLUtil.newDocument("Wampum");
          Element payeesElement = XMLUtil.newChildElement(doc.getDocumentElement(), "Payees", null);
         
          DAOFactory daoFactory = new DAOFactory();
          PayeeDAO payeeDAO = (PayeeDAO)daoFactory.getDAO("payee");
          List payees = payeeDAO.load("", "ORDER BY NAME", true);
          Payee payee = null;
          for (int i=0; i<payees.size(); i++) {
            payee = (Payee)payees.get(i);
            XMLUtil.appendChildNode(payeesElement, PayeeXML.createXMLDocument(payee).getDocumentElement());
          }
View Full Code Here

     
      int returnVal = chooser.showOpenDialog(Main.mainFrame);
      if(returnVal == JFileChooser.APPROVE_OPTION) {
        try {
          DAOFactory daoFactory = new DAOFactory();
          PayeeDAO payeeDao = (PayeeDAO)daoFactory.getDAO("payee");
          List payeeList = payeeDao.load(null, "ORDER BY NAME", true);
         
          File file = chooser.getSelectedFile();
          BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
          String line = null;
          String[] payeeStr = null;
          Payee payee = null;
          while ((line = reader.readLine()) != null) {
            payeeStr = line.split(",");
            boolean found = false;
            int count = 0;
            while (!found && count<payeeList.size()) {
              payee = (Payee)payeeList.get(count);
              if (payee.getName().equalsIgnoreCase(payeeStr[0])) {
                found = true;
                if (payeeStr.length>1)
                  payee.setFilters(payeeStr[1]);
                payeeDao.update(payee, false);
              }
            }
            if (!found) {
              payee = new Payee();
              payee.setName(payeeStr[0]);
              if (payeeStr.length>1)
                payee.setFilters(payeeStr[1]);
              payeeDao.create(payee, false);
            }
          }
        }
        catch (Exception ex) {
          throw new RuntimeException(ex);
View Full Code Here

TOP

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

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.