Package nu.lazy8.util.gen

Examples of nu.lazy8.util.gen.WorkingDialog


   */
  public final static java.sql.Date GetLatestDate(int CompId) {
    java.sql.Date returnDate =
        new java.sql.Date(Calendar.getInstance().getTime().getTime());
    try {
      DataConnection dc = DataConnection.getInstance(null);
      if (dc == null || !dc.bIsConnectionMade) {
        return new java.sql.Date(Calendar.getInstance().getTime().getTime());
      }
      Statement st = dc.con.createStatement();
      ResultSet rss = st.executeQuery(dc.filterSQL("SELECT MAX(Activity2.InvDate) FROM Activity2 WHERE CompId=" + CompId));
      if (rss.next()) {
        returnDate = rss.getDate(1);
      }
      rss.close();
    } catch (Exception e) {}
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 APP.Account where CompId=? and IsAsset=?"));
      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

   * @param  viewStatic        Description of the Parameter
   * @param  deleteCompanyDef  Description of the Parameter
   */
  public static void RemoveCompanyFromDatabase(int companyId, JFrame viewStatic, boolean deleteCompanyDef) {
    try {
      DataConnection dcc = DataConnection.getInstance(viewStatic);
      if (dcc == null || !dcc.bIsConnectionMade) {
        return;
      }
      Statement st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM Activity2 WHERE CompId=" + companyId));
      st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM Amount WHERE CompId=" + companyId));
      st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM APP.Account WHERE CompId=" + companyId));
      st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM Customer2 WHERE CompId=" + companyId));
      st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM UniqNum WHERE CompId=" + companyId));
      st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM AccountingPeriods WHERE CompId=" + companyId));
      st = dcc.con.createStatement();
      st.executeUpdate(dcc.filterSQL("DELETE FROM AccountType WHERE CompId=" + companyId));
      if (deleteCompanyDef) {
        st = dcc.con.createStatement();
        st.executeUpdate(dcc.filterSQL("DELETE FROM Company WHERE CompId=" + companyId));
      }
      EditBus.send(new CompanyListChanged(null, "no parameters"));
    } catch (Exception e) {
      Log.log(Log.DEBUG, null, "Error in RemoveCompanyFromDatabase= " + e);
    }
View Full Code Here

  //{{{ +showFirstScreen() : void
  /**
   *  Description of the Method
   */
  public void showFirstScreen() {
    DataConnection dc = DataConnection.getInstance(frameParent);
    if (dc == null || !dc.bIsConnectionMade) {
      setVisible(false);
      return;
    }

View Full Code Here

   * @param  CompId        Description of the Parameter
   */
  public static void FillHashTablesWithAccountTypes(Hashtable NumToName,
      Hashtable NumToBalance, Hashtable NameToNum, ArrayList AccNums, int CompId) {
    try {
      DataConnection dc = new DataConnection(null);
      Statement st = dc.con.createStatement();
      ResultSet rs = st.executeQuery(dc.filterSQL(
          "SELECT AccTypeId,TypeName,IsInBalanceReport FROM AccountType " +
          "WHERE CompId=" + CompId + " ORDER BY IsInBalanceReport DESC,SortOrder"));
      boolean isInBalance = false;
      while (rs.next()) {
        if (AccNums != null) {
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 Account=?"));
      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 APP.Account where CompId=? and Account=?"));
      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

   *
   * @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

   *
   * @param  view  Description of the Parameter
   */
  public CompanyForm(JFrame view) {
    super("company", view, "lazy8ledger-company");
    DataConnection dc = DataConnection.getInstance(view);
    if (dc == null || !dc.bIsConnectionMade) {
      Exit();
      return;
    }
    /*
 
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 Activity2 where CompId=?"));
      stmt.setInt(1, textField1.getInteger().intValue());
      ResultSet rs = stmt.executeQuery();
      if (rs.next()) {
        CannotUpdateMessage();
        return false;
      }
      stmt.close();
      rs.close();
      stmt = dc.con.prepareStatement(dc.filterSQL(
          "SELECT * FROM Account where CompId=?"));
      stmt.setInt(1, textField1.getInteger().intValue());
      rs = stmt.executeQuery();
      if (rs.next()) {
        CannotUpdateMessage();
        return false;
      }
      stmt.close();
      rs.close();
      stmt = dc.con.prepareStatement(dc.filterSQL(
          "SELECT * FROM Customer2 where CompId=?"));
      stmt.setInt(1, textField1.getInteger().intValue());
      rs = stmt.executeQuery();
      if (rs.next()) {
        CannotUpdateMessage();
View Full Code Here

TOP

Related Classes of nu.lazy8.util.gen.WorkingDialog

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.