Package nu.lazy8.util.help

Examples of nu.lazy8.util.help.HelpedButton


   * @return            Description of the Return Value
   */
  public static boolean doesNumberExist(int intToTest) {
    boolean returnValue = false;
    try {
      DataConnection dc = DataConnection.getInstance(null);
      if (dc == null || !dc.bIsConnectionMade) {
        return false;
      }
      PreparedStatement stmt = dc.con.prepareStatement(
          "SELECT * FROM Company where CompId=?");
View Full Code Here


   * @param  iCompId    Description of the Parameter
   * @param  sCompName  Description of the Parameter
   */
  public static void quickAndDirtyAddCompany(int iCompId, String sCompName) {
    try {
      DataConnection dc = DataConnection.getInstance(null);
      if (dc == null || !dc.bIsConnectionMade) {
        return;
      }
      PreparedStatement stmt = dc.con.prepareStatement(dc.filterSQL(
          "INSERT INTO Company (CompId,Name) VALUES(?,?)"));
      stmt.setInt(1, iCompId);
      stmt.setString(2, sCompName);
      stmt.executeUpdate();
      stmt.close();
View Full Code Here

   * @param  iCompId    Description of the Parameter
   * @param  sCompName  Description of the Parameter
   */
  public static void quickAndDirtyChangeCompany(int iCompId, String sCompName) {
    try {
      DataConnection dc = DataConnection.getInstance(null);
      if (dc == null || !dc.bIsConnectionMade) {
        return;
      }
      PreparedStatement stmt = dc.con.prepareStatement(dc.filterSQL(
          "UPDATE Company set Name=? where CompId=?"));
      stmt.setString(1, sCompName);
      stmt.setInt(2, iCompId);
      stmt.executeUpdate();
      stmt.close();
View Full Code Here

    rightButton.addActionListener(
      new java.awt.event.ActionListener() {
        //{{{ +actionPerformed(java.awt.event.ActionEvent) : void
        public void actionPerformed(java.awt.event.ActionEvent evt) {
          //create the test company
          DataConnection dc = DataConnection.getInstance(null);
          if (dc == null || !dc.bIsConnectionMade) {
            return;
          }
          File ff = new File("");
          boolean bFoundFile = true;
View Full Code Here

   *
   * @return    Description of the Return Value
   */
  public boolean IsDeleteOK() {
    try {
      DataConnection dc = DataConnection.getInstance(view);
      if (dc == null || !dc.bIsConnectionMade) {
        return false;
      }
      PreparedStatement stmt = dc.con.prepareStatement(dc.filterSQL(
          "SELECT * FROM Amount where CompId=? and Customer=?"));
      stmt.setInt(1, ((Integer) cc.comboBox.getSelectedItemsKey()).intValue());
      stmt.setInt(2, textField1.getInteger().intValue());
      ResultSet rs = stmt.executeQuery();
      if (rs.next()) {
View Full Code Here

          Translator.getTranslation("Update not entered"),
          JOptionPane.PLAIN_MESSAGE);
      return false;
    }
    try {
      DataConnection dc = DataConnection.getInstance(view);
      if (dc == null || !dc.bIsConnectionMade) {
        return false;
      }
      PreparedStatement stmt = dc.con.prepareStatement(dc.filterSQL(
          "SELECT * FROM Customer2 where CompId=? and CustId=?"));
      stmt.setInt(1, ((Integer) cc.comboBox.getSelectedItemsKey()).intValue());
      stmt.setInt(2, textField1.getInteger().intValue());
      ResultSet rs = stmt.executeQuery();
      if (rs.next()) {
View Full Code Here

   */
  public void clearFields() {
    textField1.setText("");
    //Get the next available number for the customer
    try {
      DataConnection dc = DataConnection.getInstance(null);
      if (dc == null || !dc.bIsConnectionMade) {
        return;
      }
      Statement st = dc.con.createStatement();
      ResultSet rs = st.executeQuery(dc.filterSQL(
          "SELECT MAX(CustId) FROM Customer2 WHERE CompId=" + ((Integer) cc.comboBox.getSelectedItemsKey()).intValue()));
      if (rs.next()) {
        int highestId = rs.getInt(1);
        highestId++;
        textField1.setInteger(new Integer(highestId));
View Full Code Here

   * @param  iCompId  Description of the Parameter
   * @return          The defaultAccount value
   */
  public static int getDefaultAccount(int iCustId, int iCompId) {
    try {
      DataConnection dc = DataConnection.getInstance(null);
      if (dc == null || !dc.bIsConnectionMade) {
        return 0;
      }
      Statement stmt = dc.con.createStatement();
      ResultSet rs = stmt.executeQuery(dc.filterSQL("SELECT DefaultAcc FROM Customer2 where CompId=" + iCompId + " and CustId=" + iCustId));
      if (rs.next()) {
        return rs.getInt(1);
      }
      return 0;
    } catch (Exception ex) {
View Full Code Here

   *
   * @param  bIsAddOnly   Description of the Parameter
   * @param  sAccountNum  Description of the Parameter
   */
  private void initialize(boolean bIsAddOnly, String sAccountNum) {
    DataConnection dc = DataConnection.getInstance(view);
    if (dc == null || !dc.bIsConnectionMade) {
      Exit();
      return;
    }
    /*
 
View Full Code Here

    rightButton.addActionListener(
      new java.awt.event.ActionListener() {
        //{{{ +actionPerformed(java.awt.event.ActionEvent) : void
        public void actionPerformed(java.awt.event.ActionEvent evt) {
          DataConnection dc = DataConnection.getInstance(null);
          if (dc == null || !dc.bIsConnectionMade) {
            return;
          }
          File ff = new File("");
          boolean bFoundFile = true;
          try {
            ff = Fileio.getFile("AccountPlan." + SetupInfo.getProperty(SetupInfo.PRESENT_LANGUAGE) + ".bin",
                "testdata", false, false);
            if (ff == null || !ff.isFile()) {
              bFoundFile = false;
            }
          } catch (Exception ee) {
            bFoundFile = false;
          }
          if (!bFoundFile) {
            try {
              ff = Fileio.getFile("AccountPlan.en.bin",
                  "testdata", false, false);
            } catch (Exception eee) {
              SystemLog.ErrorPrint("Cant find test database : " + eee.getMessage());
              return;
            }
          }
          Lazy8LedgerPlugin.createRestoreFile(dc.con, true, ff.getAbsolutePath(), iCompId, frameParent);
          //name was destroyed in the last operation
          CompanyForm.quickAndDirtyChangeCompany(iCompId, sCompName);
          //period destroyed also...
          try {
            PreparedStatement stmt = dc.con.prepareStatement(dc.filterSQL(
                "INSERT INTO AccountingPeriods (CompId,StartPeriod,EndPeriod) VALUES(?,?,?)"));
            stmt.setInt(1, iCompId);
            stmt.setDate(2, new java.sql.Date(dateField1.getDate().getTime()));
            stmt.setDate(3, new java.sql.Date(dateField2.getDate().getTime()));
            stmt.executeUpdate();
View Full Code Here

TOP

Related Classes of nu.lazy8.util.help.HelpedButton

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.