コード例 #1
0
  @Override
  public SGuiValidation validateForm() {
    SGuiValidation validation = moFields.validateFields();

    if (validation.isValid()) {
      if (moRadFilterTypePeriod.isSelected()) {
        if (moIntPeriodStart.getValue() > moIntPeriodEnd.getValue()) {
          validation.setMessage(
              SGuiConsts.ERR_MSG_FIELD_VAL_
                  + "'"
                  + SGuiUtils.getLabelName(jlPeriodEnd.getText())
                  + "'"
                  + SGuiConsts.ERR_MSG_FIELD_VAL_GREAT_EQUAL
                  + "'"
                  + SGuiUtils.getLabelName(jlPeriodStart.getText())
                  + "'.");
          validation.setComponent(moIntPeriodEnd);
        }
      } else if (moRadFilterTypeDate.isSelected() || moRadFilterTypeDatePay.isSelected()) {
        validation = SGuiUtils.validateDateRange(moDateDateStart, moDateDateEnd);
      }

      if (validation.isValid()) {
        validation = moPanelHrsDepartaments.validatePanel();
      }
    }

    return validation;
  }
コード例 #2
0
  private void initComponentsCustom() {
    SGuiUtils.setWindowBounds(this, 1024, 640);

    mnFilterEmpStatus = SLibConsts.UNDEFINED;
    moPanelHrsDepartaments = new SPanelHrsDepartaments(miClient);
    moPanelHrsFilterPayrollStatus = new SPanelHrsFilterPayrollStatus(miClient);

    moRadReportTypeEarDed.setBooleanSettings(
        SGuiUtils.getLabelName(moRadReportTypeEarDed.getText()), true);
    moRadReportTypeEmployee.setBooleanSettings(
        SGuiUtils.getLabelName(moRadReportTypeEmployee.getText()), false);
    moRadReportTypeEmployeeDep.setBooleanSettings(
        SGuiUtils.getLabelName(moRadReportTypeEmployeeDep.getText()), false);
    moRadReportTypeDepartament.setBooleanSettings(
        SGuiUtils.getLabelName(moRadReportTypeDepartament.getText()), false);
    moRadReportTypeDepartamentEmp.setBooleanSettings(
        SGuiUtils.getLabelName(moRadReportTypeDepartamentEmp.getText()), false);
    moRadShowEarDed.setBooleanSettings(SGuiUtils.getLabelName(moRadShowEarDed.getText()), true);
    moRadShowEar.setBooleanSettings(SGuiUtils.getLabelName(moRadShowEar.getText()), false);
    moKeyEarning.setKeySettings(miClient, SGuiUtils.getLabelName(moRadShowEar.getText()), false);
    moRadShowDed.setBooleanSettings(SGuiUtils.getLabelName(moRadShowDed.getText()), false);
    moKeyDeduction.setKeySettings(miClient, SGuiUtils.getLabelName(moRadShowDed.getText()), false);
    moKeyPaymentType.setKeySettings(
        miClient, SGuiUtils.getLabelName(jlPaymentType.getText()), false);
    moKeyEmployee.setKeySettings(miClient, SGuiUtils.getLabelName(jlEmployee.getText()), false);
    moRadIsSummary.setBooleanSettings(SGuiUtils.getLabelName(moRadIsSummary.getText()), true);
    moRadIsDetailPayroll.setBooleanSettings(
        SGuiUtils.getLabelName(moRadIsDetailPayroll.getText()), false);
    moRadFilterTypePeriod.setBooleanSettings(
        SGuiUtils.getLabelName(moRadFilterTypePeriod.getText()), true);
    moRadFilterTypeDate.setBooleanSettings(
        SGuiUtils.getLabelName(moRadFilterTypeDate.getText()), false);
    moIntPeriodYear.setCalendarSettings(SGuiUtils.getLabelName(jlYear.getText()));
    moIntPeriodStart.setCalendarSettings(SGuiUtils.getLabelName(jlPeriodStart.getText()));
    moIntPeriodEnd.setCalendarSettings(SGuiUtils.getLabelName(jlPeriodEnd.getText()));
    moDateDateStart.setDateSettings(miClient, SGuiUtils.getLabelName(jlDateStart.getText()), true);
    moDateDateEnd.setDateSettings(miClient, SGuiUtils.getLabelName(jlDateEnd.getText()), true);
    moRadOrderByNumEmployee.setBooleanSettings(
        SGuiUtils.getLabelName(moRadOrderByNumEmployee.getText()), false);
    moRadOrderByNameEmployee.setBooleanSettings(
        SGuiUtils.getLabelName(moRadOrderByNameEmployee.getText()), true);
    moRadOrderByNumDepartament.setBooleanSettings(
        SGuiUtils.getLabelName(moRadOrderByNumDepartament.getText()), false);
    moRadOrderByNameDepartament.setBooleanSettings(
        SGuiUtils.getLabelName(moRadOrderByNameDepartament.getText()), true);

    jPanel3.add(moPanelHrsDepartaments, BorderLayout.CENTER);
    jpFilterStatusPay.add(moPanelHrsFilterPayrollStatus, BorderLayout.CENTER);
    moPanelHrsFilterPayrollStatus.setSelectedAll();

    moFields.addField(moRadReportTypeEarDed);
    moFields.addField(moRadReportTypeEmployee);
    moFields.addField(moRadReportTypeEmployeeDep);
    moFields.addField(moRadReportTypeDepartament);
    moFields.addField(moRadReportTypeDepartamentEmp);
    moFields.addField(moRadShowEarDed);
    moFields.addField(moRadShowEar);
    moFields.addField(moKeyEarning);
    moFields.addField(moRadShowDed);
    moFields.addField(moKeyDeduction);
    moFields.addField(moKeyPaymentType);
    moFields.addField(moKeyEmployee);
    moFields.addField(moRadIsSummary);
    moFields.addField(moRadIsDetailPayroll);
    moFields.addField(moRadFilterTypePeriod);
    moFields.addField(moRadFilterTypeDate);
    moFields.addField(moIntPeriodYear);
    moFields.addField(moIntPeriodStart);
    moFields.addField(moIntPeriodEnd);
    moFields.addField(moDateDateStart);
    moFields.addField(moDateDateEnd);
    moFields.addField(moRadOrderByNumEmployee);
    moFields.addField(moRadOrderByNameEmployee);
    moFields.addField(moRadOrderByNumDepartament);
    moFields.addField(moRadOrderByNameDepartament);

    moFields.setFormButton(jbPrint);

    moRadReportTypeEmployee.addChangeListener(this);
    moRadReportTypeEarDed.addChangeListener(this);
    moRadFilterTypePeriod.addChangeListener(this);
    moRadFilterTypeDate.addChangeListener(this);
    moRadFilterTypeDatePay.addChangeListener(this);

    moRadShowEarDed.addChangeListener(this);
    moRadShowEar.addChangeListener(this);
    moRadShowDed.addChangeListener(this);

    jtbEmployeeActive.addItemListener(this);

    moRadReportTypeEarDed.setSelected(true);
    moRadShowEarDed.setSelected(true);
    moRadFilterTypePeriod.setSelected(true);
    moRadOrderByNameEmployee.setSelected(true);
    moRadOrderByNameDepartament.setSelected(true);

    jtbEmployeeActive.setSelected(false);
    moRadIsSummary.setSelected(true);

    moIntPeriodYear.setValue(miClient.getSession().getCurrentYear());
    moIntPeriodStart.setValue(SLibTimeUtils.digestMonth(miClient.getSession().getCurrentDate())[1]);
    moIntPeriodEnd.setValue(SLibTimeUtils.digestMonth(miClient.getSession().getCurrentDate())[1]);
    moDateDateStart.setValue(SLibTimeUtils.getBeginOfYear(miClient.getSession().getCurrentDate()));
    moDateDateEnd.setValue(SLibTimeUtils.getEndOfYear(miClient.getSession().getCurrentDate()));

    reloadCatalogues();
    actionEnableFieldsDates();
    actionEnableFieldsEarDed();
  }