Package nu.lazy8.util.gen

Examples of nu.lazy8.util.gen.WorkingDialog


            Locale.setDefault(lc);
          } catch (Exception eee) {}

          //Ask the user to choose a company/period...
          myInstance.jd = new JDialog(view, Translator.getTranslation("Select the company and period for this session"), true);
          myInstance.companyComponents = new CompanyComponents(myInstance.jd.getContentPane(),
              Translator.getTranslation("Default Company"), true, "setup", view);
          myInstance.companyComponents.AddPeriod(myInstance.jd.getContentPane(),
              Translator.getTranslation("Period"), true);
          if (myInstance.companyComponents.comboBox.getItemCount() > 1 ||
              myInstance.companyComponents.comboBoxPeriod.getItemCount() > 1) {
View Full Code Here


      return;
    }
    Lazy8Ledger.ShowHelp(view, "sie", "");

    //this next component is not added to any real pane
    cc = new CompanyComponents(new JPanel(),
        Translator.getTranslation("Company"), true, "sie", view);
    cc.AddPeriod(new JPanel(), "", false);
    JFileChooser fileDialog = getFileSaveChooser();
    boolean showResult = false;
    try {
View Full Code Here

        }
      }
        );

    cc =
      new CompanyComponents(null, Translator.getTranslation("Company"),
          false, "allreports", view) {
        public void periodChange() {
          try {
            nowSelectedReport.resetDate((java.util.Date) cc.comboBoxPeriod.getSelectedItemsKey(),
                (java.util.Date) cc.comboBoxPeriod.getSelectedItemsSecondaryKey());
View Full Code Here

        stringPass))) {
      JOptionPane.showMessageDialog(view,
          Translator.getTranslation("Unable to connect to the database.  Perhaps wrong password"),
          Translator.getTranslation("Lazy 8 ledger"),
          JOptionPane.PLAIN_MESSAGE);
      DataConnectDialog ds = ShowDataConnectDialog(view);
      if (ds.isAbort) {
        break;
      }
      stringPass = SetupInfo.getProperty(SetupInfo.CONNECT_PASSWORD);
      stringUser = SetupInfo.getProperty(SetupInfo.CONNECT_USERNAME);
View Full Code Here

   *
   * @param  frame  Description of the Parameter
   * @return        Description of the Return Value
   */
  public static DataConnectDialog ShowDataConnectDialog(JFrame frame) {
    return new DataConnectDialog(frame, createTables);
  }//}}}
View Full Code Here

    label1 = new HelpedLabel(sLabelText, "company", helpFile, view);
    if (jPanel1 != null) {
      jPanel1.add(label1);
    }

    comboBox = new DataComboBox(new JdbcTable("Company", 1, view), false, "company", helpFile, view);
    comboBox.setMaximumSize(new Dimension(accountNameFieldSize, accountNameFieldSize));
    comboBox.setMinimumSize(new Dimension(accountNameFieldSize / 2, 1));
    ActionListener lsel =
      new ActionListener() {
        //{{{ +actionPerformed(ActionEvent) : void
View Full Code Here

    if (jPanel1 != null) {
      jPanel1.add(label2);
    }

    comboBoxPeriod = new DataComboBox(new JdbcTable("AccountingPeriods", 1, view), false, "period", sHelpFile, view);
    ActionListener lsel =
      new ActionListener() {

        //{{{ +actionPerformed(ActionEvent) : void
        public void actionPerformed(ActionEvent e) {
View Full Code Here

    jPanel1.add(label3);
    jPanel1.add(textField3);

    jPanel1.add(new HelpedLabel(Translator.getTranslation("Default account"),
        "DefaultAccount", "customer", view));
    accountCombo = new DataComboBox(new JdbcTable("APP.Account", 2, view), true, "Account", "transaction", view);
    accountCombo.loadComboBox("AccDesc", "Account", (Integer) cc.comboBox.getSelectedItemsKey());
    accountCombo.setMaximumSize(new Dimension(accountNameFieldSize, accountNameFieldSize));
    accountCombo.setMinimumSize(new Dimension(accountNameFieldSize / 2, 1));

    jPanel1.add(accountCombo);
View Full Code Here

   * @param  useCustomer  Description of the Parameter
   */
  public AccountPeriodTable(JFrame view, int CompId, java.util.Date periodStart,
      java.util.Date periodStop, int periodType, int numPeriods, boolean useCustomer) {
//Log.log(Log.DEBUG,this,"AccountPeriodTable="+periodType + ";"+periodStart + ";" +periodStop);
    DataConnection dc = DataConnection.getInstance(view);
    if (dc == null || !dc.bIsConnectionMade) {
      return;
    }
    Calendar cPeriodStart = Calendar.getInstance();
    cPeriodStart.setTime(periodStart);
    String periodDescription = "";
    Calendar selectStartDate = Calendar.getInstance();
    Calendar selectStopDate = Calendar.getInstance();
    SimpleDateFormat sd;

    if (periodType == PERIOD_ALL || periodType == PERIOD_GIVEN) {
      numPeriods = 1;
    }

    for (int i = 0; i < numPeriods; i++) {
      selectStartDate.setTime(periodStart);
      selectStopDate.setTime(periodStart);
      switch (periodType) {
        case PERIOD_DAY:
          selectStartDate.add(Calendar.DATE, i);
          selectStopDate.add(Calendar.DATE, i);
          periodDescription = DateField.ConvertDateToLocalizedString(selectStartDate.getTime());
          break;
        case PERIOD_WEEK:
          selectStartDate.add(Calendar.DATE, i * 7);
          selectStopDate.add(Calendar.DATE, ((i + 1) * 7) - 1);
          periodDescription = DateField.ConvertDateToLocalizedString(selectStartDate.getTime());
          break;
        case PERIOD_BIWEEK:
          selectStartDate.add(Calendar.DATE, i * 14);
          selectStopDate.add(Calendar.DATE, ((i + 1) * 14) - 1);
          periodDescription = DateField.ConvertDateToLocalizedString(selectStartDate.getTime());
          break;
        case PERIOD_MONTH:
          selectStartDate.add(Calendar.MONTH, i);
          selectStopDate.add(Calendar.MONTH, i + 1);
          selectStopDate.add(Calendar.DATE, -1);
          sd = new SimpleDateFormat("yyyy.MMM");
          periodDescription = sd.format(selectStartDate.getTime());
          break;
        case PERIOD_BIMONTH:
          selectStartDate.add(Calendar.MONTH, i * 2);
          selectStopDate.add(Calendar.MONTH, (i * 2) + 2);
          selectStopDate.add(Calendar.DATE, -1);
          sd = new SimpleDateFormat("yyyy.MMM");
          periodDescription = sd.format(selectStartDate.getTime());
          break;
        case PERIOD_QUARTER:
          selectStartDate.add(Calendar.MONTH, i * 3);
          selectStopDate.add(Calendar.MONTH, (i * 3) + 3);
          selectStopDate.add(Calendar.DATE, -1);
          sd = new SimpleDateFormat("yyyy.MMM");
          periodDescription = sd.format(selectStartDate.getTime());
          break;
        case PERIOD_HALFYEAR:
          selectStartDate.add(Calendar.MONTH, i * 6);
          selectStopDate.add(Calendar.MONTH, (i * 6) + 6);
          selectStopDate.add(Calendar.DATE, -1);
          sd = new SimpleDateFormat("yyyy.MMM");
          periodDescription = sd.format(selectStartDate.getTime());
          break;
        case PERIOD_YEAR:
          selectStartDate.add(Calendar.YEAR, i);
          selectStopDate.add(Calendar.YEAR, i + 1);
          selectStopDate.add(Calendar.DATE, -1);
          sd = new SimpleDateFormat("yyyy");
          periodDescription = sd.format(selectStartDate.getTime());
          break;
        case PERIOD_ALL:
          java.sql.Date startDate = GetEarliestDate(CompId);
          selectStartDate.setTime(startDate);
          java.sql.Date stopDate = GetLatestDate(CompId);
          selectStopDate.setTime(stopDate);
          periodDescription = DateField.ConvertDateToLocalizedString(selectStartDate.getTime())
               + "<->" + DateField.ConvertDateToLocalizedString(selectStopDate.getTime());
          break;
        case PERIOD_GIVEN:
          selectStartDate.setTime(periodStart);
          selectStopDate.setTime(periodStop);
          periodDescription = DateField.ConvertDateToLocalizedString(selectStartDate.getTime())
               + "<->" + DateField.ConvertDateToLocalizedString(selectStopDate.getTime());
          break;
      }
      try {
        java.sql.Date start = new java.sql.Date(selectStartDate.getTime().getTime());
        java.sql.Date stop = new java.sql.Date(selectStopDate.getTime().getTime());

        PreparedStatement st = dc.con.prepareStatement(dc.filterSQL(getSelectStatement(CompId, useCustomer)));
        st.setDate(1, start);
        st.setDate(2, stop);
        ResultSet rs = st.executeQuery();

        int numRows = 0;
View Full Code Here

   */
  public final static java.sql.Date GetEarliestDate(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 MIN(Activity2.InvDate) FROM Activity2 WHERE CompId=" + CompId));
      if (rss.next()) {
        returnDate = rss.getDate(1);
      }
      rss.close();
    } catch (Exception e) {}
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.