Ejemplo n.º 1
0
 // Load Purchase Header
 private void loadSrchRslt() {
   try {
     logger.info(
         "Company ID : " + companyid + " | User Name : " + username + " > " + "Loading Search...");
     tblMstScrSrchRslt.removeAllItems();
     List<SmsPurEnqHdrDM> listPurEnq = new ArrayList<SmsPurEnqHdrDM>();
     logger.info(
         "Company ID : "
             + companyid
             + " | User Name : "
             + username
             + " > "
             + "Search Parameters are "
             + companyid
             + ", "
             + cbBranch.getValue()
             + ", "
             + cbEnqStatus.getValue());
     listPurEnq =
         serviceSmsPurEnqHdr.getSmsPurEnqHdrList(
             companyid,
             null,
             tfEnqNo.getValue(),
             (Long) cbBranch.getValue(),
             (String) cbEnqStatus.getValue(),
             username);
     recordCnt = listPurEnq.size();
     beanPurEnqHdrDM = new BeanItemContainer<SmsPurEnqHdrDM>(SmsPurEnqHdrDM.class);
     beanPurEnqHdrDM.addAll(listPurEnq);
     logger.info(
         "Company ID : "
             + companyid
             + " | User Name : "
             + username
             + " > "
             + "Got the PurchaseEnquiry. result set");
     tblMstScrSrchRslt.setContainerDataSource(beanPurEnqHdrDM);
     tblMstScrSrchRslt.setVisibleColumns(
         new Object[] {
           "enquiryId",
           "branchName",
           "enquiryNo",
           "enquiryStatus",
           "lastUpdateddt",
           "lastUpdatedby"
         });
     tblMstScrSrchRslt.setColumnHeaders(
         new String[] {
           "Ref.Id", "Branch Name", "EnquiryNo.", "Status", "Last Updated Date", "Last Updated By"
         });
     tblMstScrSrchRslt.setColumnAlignment("enquiryId", Align.RIGHT);
     tblMstScrSrchRslt.setColumnFooter("lastUpdatedby", "No.of Records : " + recordCnt);
   } catch (Exception e) {
     logger.info(e.getMessage());
   }
 }
Ejemplo n.º 2
0
 protected Params getParams() {
   return new Params(
       params.getModuleId(),
       (String) testNameCombo.getValue(),
       params.getCommitId(),
       params.getRunNumber(),
       (Metric) metricCombo.getValue(),
       Integer.parseInt((String) percentileCombo.getValue()),
       (FailureType) failureCombo.getValue());
 }
Ejemplo n.º 3
0
  @Override
  public void buttonClick(ClickEvent event) {
    if (event.getButton().equals(btnCrearUsuario)) {
      Usuario object = new Usuario();
      object.setUsuario(txtUsuario.getValue().toString());
      object.setNombres(txtNombres.getValue().toString());
      object.setApePat(txtApellidoPaterno.getValue().toString());
      object.setApeMat(txtApellidoMaterno.getValue().toString());

      object.setRol((Rol) cmbRol.getValue());
      object.setCargo(
          txtCargo.getValue() != null ? txtCargo.getValue().toString() : StringUtils.EMPTY);
      object.setDescCargo(
          txtCargoDescripcion.getValue() != null
              ? txtCargoDescripcion.getValue().toString()
              : StringUtils.EMPTY);
      object.setOficina((Dependencia) cmbOficina.getValue());
      object.setPolicia((Policia) cmbPolicia.getValue());

      if (flagNuevoUsuario) {
        String randomPassword = RandomUtil.createWord(8);
        object.setClave(randomPassword);
        usuarioService.crear(object);
      } else {
        object.setClave(clave);
        Item item = tblUsuarios.getItem(tblUsuarios.getValue());
        object.setId((Long) item.getItemProperty("id").getValue());
        usuarioService.actualizar(object);
      }
      refrescar();
    } else if (event.getButton().equals(btnEliminarUsuario)) {
      ConfirmDialog.show(
          getApplication().getMainWindow(),
          "¿Seguro de Eliminar el Registro?",
          new ConfirmDialog.Listener() {
            private static final long serialVersionUID = 1L;

            public void onClose(ConfirmDialog dialog) {
              if (dialog.isConfirmed()) {
                Item item = tblUsuarios.getItem(tblUsuarios.getValue());
                usuarioService.eliminarXId((Long) item.getItemProperty("id").getValue());
                refrescar();
              }
            }
          });
    } else if (event.getButton().equals(btnAgregarPolicia)) {
      cargarWindowRegistroPolicia();
    }
  }
Ejemplo n.º 4
0
 /*
  * loadEmployeeList()-->this function is used for load the employee list
  */
 private void loadEmployeeList() {
   try {
     logger.info(
         "Company ID : " + companyId + " | User Name : " + userName + " > " + "Loading Search...");
     List<EmployeeDM> empList = new ArrayList<EmployeeDM>();
     empList.add(new EmployeeDM(-1L, "All"));
     empList.addAll(
         serviceEmployee.getEmployeeList(
             null,
             null,
             null,
             "Active",
             companyId,
             null,
             null,
             (Long) cbBranch.getValue(),
             null,
             "P"));
     BeanContainer<Long, EmployeeDM> beanLoadEmployee =
         new BeanContainer<Long, EmployeeDM>(EmployeeDM.class);
     beanLoadEmployee.setBeanIdProperty("employeeid");
     beanLoadEmployee.addAll(empList);
     cbEmployeeName.setContainerDataSource(beanLoadEmployee);
   } catch (Exception e) {
     logger.info(e.getMessage());
   }
 }
Ejemplo n.º 5
0
  public void buttonClick(ClickEvent event) {
    try {
      if (event.getButton().equals(saveBtn)) {
        save();
        close();
      } else if (event.getButton().equals(addBtn)) {
        LightProcessDefinition lpd = (LightProcessDefinition) processesComboBox.getValue();
        addTableRow(lpd);
        processesComboBox.removeItem(lpd);
      } else if (event.getButton().equals(deleteBtn)) {
        delete();
        close();
      } else if (event.getButton() instanceof TableLinkButton) {
        LightProcessDefinition lpd =
            (LightProcessDefinition) ((TableLinkButton) event.getButton()).getTableValue();
        table.removeItem(lpd);
        processesComboBox.addItem(lpd);
        processesComboBox.setItemCaption(
            lpd, lpd.getLabel() + " (version " + lpd.getVersion() + ")");
      } else {
        close();
      }

    } catch (Exception ex) {
      ex.printStackTrace();
      showError(ex.getMessage());
    }
  }
 @PostConstruct
 public void establecerEventos() {
   llenarDatos();
   botonCancelar.addClickListener(
       event -> {
         UI.getCurrent().getNavigator().navigateTo("menu");
       });
   botonAnadir.addClickListener(
       event -> {
         try {
           DemografiaCliente n = new DemografiaCliente();
           n.setCorreoElectronico(correoElectronico.getValue());
           n.setDireccion(direccion.getValue().toUpperCase());
           n.setRazonSocial(razonSocial.getValue().toUpperCase());
           n.setTipoIdentificacion((String) tipoIdentificacion.getValue());
           n.setIdentificacion(id.getValue());
           // beanItemC.addBean(n);
           gestorDemog.registrarActualizaCliente(n, userInfo.getRucEmisor());
           llenarDatos();
           id.clear();
           razonSocial.clear();
           correoElectronico.clear();
           direccion.clear();
         } catch (Exception e) {
           e.printStackTrace();
         }
       });
 }
  @Override
  public void buttonClick(ClickEvent event) {
    if (event.getButton().equals(btnGuardar)) {
      Notificacion notificacion = new Notificacion();
      notificacion.setInforme(informe);
      notificacion.setUnidad((Dependencia) cmbUnidadProcuraduria.getValue());
      notificacion.setTipoNotificacion(cmbTipoNotificacion.getValor());
      notificacion.setFechaRecepcion((Date) dtFechaRecepcion.getValue());
      notificacion.setFechaVencimiento((Date) dtFechaVencimiento.getValue());
      notificacion.setFechaPlazo((Date) dtFechaPlazo.getValue());
      notificacion.setEstado(cmbEstadoNotificacion.getValor());

      AlertDialog alertDialog = null;
      if (notificacion.esNuevo()) {
        notificacionService.crear(notificacion);
        alertDialog =
            new AlertDialog(
                "Registro de Notificación",
                "Se ha registrado la notificación correctamente",
                "Aceptar",
                "400");
      } else {
        notificacionService.actualizar(notificacion);
        alertDialog =
            new AlertDialog(
                "Registro de Notificación",
                "Se ha actualizado la notificación correctamente",
                "Aceptar",
                "400");
      }
      getApplication().getMainWindow().addWindow(alertDialog);
      limpiar();
      cargarDatos();
    }
  }
  private FormDeletion getFormData(FormDeletion form) {
    form.setDeletionDate(inputDeletionDate.getValue());
    form.setInformation(information.getValue());
    form.setQuantity(inputGoodsQuantity.getValue());
    form.setIdGoods((String) inputGoodsSelect.getValue());
    form.setDeletionId(this.deletionId);
    form.setPrice(inputGoodsPrice.getValue());

    return form;
  }
 @Override
 public FormDeletion getFormData() {
   FormDeletion form = new FormDeletion(function);
   form.setDeletionDate(inputDeletionDate.getValue());
   form.setInformation(information.getValue());
   form.setQuantity(inputGoodsQuantity.getValue());
   form.setIdGoods((String) inputGoodsSelect.getValue());
   form.setDeletionId(this.deletionId);
   form.setPrice(inputGoodsPrice.getValue());
   return form;
 }
  @Override
  public ReportData getReportData() {
    ReportData data = new ReportData(function);

    data.setAccepted((String) selectAcceptance.getValue());
    System.out.println(selectEndDate.getValidators().toString());
    data.setReportContent((ReportContent) selectContent.getValue());
    data.setDateEnd(selectEndDate.getValue());
    data.setDateStart(selectStartDate.getValue());
    data.setType(ReportType.EXPIRED_GOODS);

    return data;
  }
  @Override
  public void valueChange(ValueChangeEvent event) {
    if (event.getProperty() == selectContent) {
      ReportContent value = (ReportContent) selectContent.getValue();
      if (!(value == ReportContent.TABLE)) {
        buttonPrint.setEnabled(false);
      } else {
        buttonPrint.setEnabled(true);
      }
    }

    updateWindowOpener();
  }
 @Override
 public FormData getFormData() {
   FormData data = new FormData(function);
   data.setAddress(inputAddress.getValue());
   data.setEmployeeNum(inputEmployeeNum.getValue());
   data.setName(inputName.getValue());
   data.setPassword1(inputPassword1.getValue());
   data.setPassword2(inputPassword2.getValue());
   data.setPhoneNumber(inputPhoneNumber.getValue());
   data.setRole((String) selectRole.getValue());
   data.setSika(inputSika.getValue());
   data.setTitle(inputTitle.getValue());
   data.setUserName(inputUserName.getValue());
   data.setEditMode(editMode);
   return data;
 }
Ejemplo n.º 13
0
 public LinkedList<Object> getValores() {
   LinkedList<Object> caracteristicas = new LinkedList<Object>();
   if (validar()) {
     caracteristicas.add(Integer.parseInt(txtNoRiego.getValue()));
     caracteristicas.add(txtTipoPrueba.getValue());
     caracteristicas.add(cmbEtapa.getValue());
     caracteristicas.add(Double.parseDouble(txtSupRegada.getValue()));
     caracteristicas.add(Double.parseDouble(txtProfRaices.getValue()));
     caracteristicas.add(Double.parseDouble(txtHumIni.getValue()));
     caracteristicas.add(Double.parseDouble(txtHumSat.getValue()));
     caracteristicas.add(Double.parseDouble(txtTirante.getValue()));
     caracteristicas.add(Double.parseDouble(txtGasto.getValue()));
     caracteristicas.add(Double.parseDouble(txtLamApl.getValue()));
     caracteristicas.add(Double.parseDouble(txtLamCalc.getValue()));
     caracteristicas.add(getAvances());
   }
   return caracteristicas;
 }
Ejemplo n.º 14
0
  private boolean validar() {
    if (txtNoRiego.getValue().isEmpty() || !txtNoRiego.isValid())
      return notificar(
          "Se requiere especificar un valor estríctamente numérico para el número de riego",
          txtNoRiego);
    if (txtTipoPrueba.getValue().isEmpty())
      return notificar("Se requiere especificar el tipo de prueba", txtTipoPrueba);
    if (cmbEtapa.getValue() == null)
      return notificar("Se requiere especificar la etapa fenológica", cmbEtapa);
    if (txtSupRegada.getValue().isEmpty() || !txtSupRegada.isValid())
      return notificar(
          "Se requiere especificar un valor estríctamente numérico para la superficie regada",
          txtSupRegada);
    if (txtProfRaices.getValue().isEmpty() || !txtProfRaices.isValid())
      return notificar(
          "Se requiere especificar un valor estríctamente numérico para la profundidad de raíces",
          txtProfRaices);
    if (txtHumIni.getValue().isEmpty() || !txtHumIni.isValid())
      return notificar(
          "Se requiere especificar un valor estríctamente numérico para el contenido de humedad inicial",
          txtHumIni);
    if (txtHumSat.getValue().isEmpty() || !txtHumSat.isValid())
      return notificar(
          "Se requiere especificar un valor estríctamente numérico para el contenido de humedad a saturación",
          txtHumSat);
    if (txtTirante.getValue().isEmpty() || !txtTirante.isValid())
      return notificar(
          "Se requiere especificar un valor estríctamente numérico para el tirante del surco o melga",
          txtTirante);
    if (txtGasto.getValue().isEmpty() || !txtGasto.isValid())
      return notificar(
          "Se requiere especificar un valor estríctamente numérico para el gasto en surco o melga",
          txtGasto);
    if (txtLamApl.getValue().isEmpty() || !txtLamApl.isValid())
      return notificar(
          "Se requiere especificar un valor estríctamente numérico para la lámina aplicada",
          txtLamApl);
    if (txtLamCalc.getValue().isEmpty() || !txtLamCalc.isValid())
      return notificar(
          "Se requiere especificar un valor estríctamente numérico para la lámina calculada",
          txtLamCalc);

    return true;
  }
Ejemplo n.º 15
0
 @Override
 protected void validateDetails() throws ValidationException {
   logger.info(
       "Company ID : " + companyid + " | User Name : " + username + " > " + "Validating Data ");
   Boolean errorFlag = false;
   if (cbBranch.getValue() == null) {
     cbBranch.setComponentError(new UserError(GERPErrorCodes.NULL_BRACH_NAME));
     errorFlag = true;
   } else {
     cbBranch.setComponentError(null);
     errorFlag = false;
   }
   if (lsVendorName.getValue() == null || lsVendorName.getValue().toString() == "[]") {
     lsVendorName.setComponentError(new UserError(GERPErrorCodes.NULL_VENDOR_NAME));
     errorFlag = true;
   } else {
     lsVendorName.setComponentError(null);
     errorFlag = false;
   }
   if (tblSmsEnqDtl.size() == 0) {
     cbUom.setComponentError(new UserError(GERPErrorCodes.NULL_MATERIAL_UOM));
     tfEnqQty.setComponentError(new UserError(GERPErrorCodes.NULL_ENQUIRY_QTY));
     lsProduct.setComponentError(new UserError(GERPErrorCodes.NULL_PRODUCT_NAME));
     errorFlag = true;
   }
   if ((dfEnqDate.getValue() != null) || (dfDueDate.getValue() != null)) {
     if (dfEnqDate.getValue().after(dfDueDate.getValue())) {
       dfDueDate.setComponentError(new UserError(GERPErrorCodes.MMS_DATE_OUTOFRANGE));
       logger.warn(
           "Company ID : "
               + companyid
               + " | User Name : "
               + username
               + " > "
               + "Throwing ValidationException. User data is > "
               + dfEnqDate.getValue());
       errorFlag = true;
     }
   }
   if (errorFlag) {
     throw new ERPException.ValidationException();
   }
 }
  @Override
  protected void setup() {

    Button b = new Button("Swap data provider");
    b.addClickListener(
        event -> {
          if (biggerData) {
            combo.setItems("Item 3");
          } else {
            combo.setItems("Item 1", "Item 2", "Item 3", "Item 4");
          }
          biggerData = !biggerData;
        });

    combo = new ComboBox<>();
    combo.setItems("Item 1", "Item 2", "Item 3", "Item 4");
    combo.addValueChangeListener(event -> log.log("Value is now: " + combo.getValue()));
    addComponent(log);
    addComponent(b);
    addComponent(combo);
    addComponent(new Button("Dummy for TestBench"));
  }
Ejemplo n.º 17
0
 @Override
 protected void saveDetails() throws SaveException, FileNotFoundException, IOException {
   logger.info(
       "Company ID : " + companyid + " | User Name : " + username + " > " + "Saving Data... ");
   try {
     SmsPurEnqHdrDM purEnqobj = new SmsPurEnqHdrDM();
     if (tblMstScrSrchRslt.getValue() != null) {
       purEnqobj = beanPurEnqHdrDM.getItem(tblMstScrSrchRslt.getValue()).getBean();
       purEnqobj.setEnquiryNo(tfEnqNo.getValue());
     }
     purEnqobj.setEnquiryNo(tfEnqNo.getValue());
     purEnqobj.setCompanyId(companyid);
     purEnqobj.setEnqRemark(taEnqRem.getValue().toString());
     purEnqobj.setBranchId((Long) cbBranch.getValue());
     purEnqobj.setDueDate((Date) dfDueDate.getValue());
     purEnqobj.setEnquiryDate((Date) dfEnqDate.getValue());
     purEnqobj.setEnquiryStatus(((String) cbEnqStatus.getValue()));
     purEnqobj.setPreparedBy(employeeId);
     purEnqobj.setReviewedBy(null);
     purEnqobj.setActionedBy(null);
     purEnqobj.setLastUpdateddt(DateUtils.getcurrentdate());
     purEnqobj.setLastUpdatedby(username);
     serviceSmsPurEnqHdr.saveorUpdateSmsPurEnqHdrDetails(purEnqobj);
     enquiryId = purEnqobj.getEnquiryId();
     String[] split =
         lsVendorName.getValue().toString().replaceAll("\\[", "").replaceAll("\\]", "").split(",");
     for (String obj : split) {
       if (obj.trim().length() > 0) {
         EnquiryVendorDtlDM enqvendtl = new EnquiryVendorDtlDM();
         enqvendtl.setEnqid(purEnqobj.getEnquiryId());
         System.out.println("vendid" + Long.valueOf(obj.trim()));
         enqvendtl.setVendorid(Long.valueOf(obj.trim()));
         serviceEnquiryVendorDtl.save(enqvendtl);
       }
     }
     @SuppressWarnings("unchecked")
     Collection<SmsPurEnqDtlDM> itemIds =
         (Collection<SmsPurEnqDtlDM>) tblSmsEnqDtl.getVisibleItemIds();
     for (SmsPurEnqDtlDM save : (Collection<SmsPurEnqDtlDM>) itemIds) {
       save.setEnquiryId(Long.valueOf(purEnqobj.getEnquiryId().toString()));
       serviceSmsPurEnqDtl.saveorUpdateSmsPurEnqDtlDetails(save);
     }
     comments.resetfields();
     if (tblMstScrSrchRslt.getValue() == null) {
       try {
         SlnoGenDM slnoObj =
             serviceSlnogen.getSequenceNumber(companyid, branchId, moduleId, "SM_ENQRYNO").get(0);
         if (slnoObj.getAutoGenYN().equals("Y")) {
           serviceSlnogen.updateNextSequenceNumber(companyid, branchId, moduleId, "SM_ENQRYNO");
         }
       } catch (Exception e) {
       }
     }
     tfEnqNo.setReadOnly(false);
     tfEnqNo.setValue(purEnqobj.getEnquiryNo());
     tfEnqNo.setReadOnly(true);
     comments.saveEnquiry(purEnqobj.getEnquiryId(), purEnqobj.getEnquiryStatus());
     loadSrchRslt();
     enqDtlresetFields();
   } catch (Exception e) {
     logger.info(e.getMessage());
   }
 }
Ejemplo n.º 18
0
 public String getActivo() {
   if (txt_codigoActivo.getValue() != null && !txt_codigoActivo.getValue().equals("")) {
     return this.txt_codigoActivo.getValue().toString();
   }
   return cb_Activos.getValue().toString();
 }
Ejemplo n.º 19
0
 // Method to edit the values from table into fields to update process
 private void editPurHdr() {
   logger.info(
       "Company ID : "
           + companyid
           + " | User Name : "
           + username
           + " > "
           + "Editing the selected record");
   try {
     hlUserInputLayout.setVisible(true);
     if (tblMstScrSrchRslt.getValue() != null) {
       SmsPurEnqHdrDM enqHdrDM = beanPurEnqHdrDM.getItem(tblMstScrSrchRslt.getValue()).getBean();
       enquiryId = enqHdrDM.getEnquiryId();
       logger.info(
           "Company ID : "
               + companyid
               + " | User Name : "
               + username
               + " > "
               + "Selected enquiryId. Id -> "
               + enquiryId);
       logger.info(
           "Company ID : "
               + companyid
               + " | User Name : "
               + username
               + " > "
               + "Selected enquiryId. Id -> "
               + enquiryId);
       cbBranch.setValue(enqHdrDM.getBranchId());
       tfEnqNo.setReadOnly(false);
       tfEnqNo.setValue(enqHdrDM.getEnquiryNo());
       tfEnqNo.setReadOnly(true);
       dfEnqDate.setValue(enqHdrDM.getEnquiryDate());
       dfDueDate.setValue(enqHdrDM.getDueDate());
       for (EnquiryVendorDtlDM enquiryVendorDtlDM :
           serviceEnquiryVendorDtl.getpurchasevdrdtl(null, enquiryId, null)) {
         lsVendorName.select(enquiryVendorDtlDM.getVendorid().toString());
       }
       if (enqHdrDM.getEnquiryStatus() != null) {
         cbEnqStatus.setValue(enqHdrDM.getEnquiryStatus());
       }
       if (enqHdrDM.getEnqRemark() != null) {
         taEnqRem.setValue(enqHdrDM.getEnqRemark().toString());
       }
       listEnqDtls =
           serviceSmsPurEnqDtl.getSmsPurEnqDtlList(
               null, enquiryId, null, (String) cbEnqDtlStatus.getValue());
     }
     loadPurDtl();
     comments =
         new SmsComments(
             vlTableForm,
             null,
             companyid,
             enquiryId,
             null,
             null,
             null,
             null,
             null,
             null,
             null,
             null,
             status,
             null);
     comments.loadsrch(
         true, null, null, enquiryId, null, null, null, null, null, null, null, null, null, null);
   } catch (Exception e) {
     logger.info(e.getMessage());
   }
 }
Ejemplo n.º 20
0
 private void saveEnqDtl() {
   logger.info(
       "Company ID : " + companyid + " | User Name : " + username + " > " + "Saving Data... ");
   try {
     int count = 0;
     String[] split =
         lsProduct.getValue().toString().replaceAll("\\[", "").replaceAll("\\]", "").split(",");
     for (String obj : split) {
       if (obj.trim().length() > 0) {
         for (SmsPurEnqDtlDM smsPurEnqDtlDM : listEnqDtls) {
           if (smsPurEnqDtlDM.getProductId().equals(Long.valueOf(obj.trim()))) {
             count++;
             break;
           }
         }
         if (tblSmsEnqDtl.getValue() != null) {
           count = 0;
         }
         if (count == 0) {
           SmsPurEnqDtlDM enqDtlObj = new SmsPurEnqDtlDM();
           if (tblSmsEnqDtl.getValue() != null) {
             enqDtlObj = beanPurEnqDtlDM.getItem(tblSmsEnqDtl.getValue()).getBean();
             listEnqDtls.remove(enqDtlObj);
           }
           if (lsProduct.getValue() != null) {
             enqDtlObj.setProductId(Long.valueOf(obj.trim()));
             enqDtlObj.setPordName(
                 serviceProduct
                     .getProductList(
                         null, Long.valueOf(obj.trim()), null, null, null, null, null, "P")
                     .get(0)
                     .getProdname());
           }
           if (cbUom.getValue() != null) {
             cbUom.setReadOnly(false);
             enqDtlObj.setProductUom(cbUom.getValue().toString());
             cbUom.setReadOnly(true);
           }
           enqDtlObj.setRemarks(taEnqDtlRem.getValue().toString());
           if (tfEnqQty.getValue() != null && tfEnqQty.getValue().trim().length() > 0) {
             enqDtlObj.setEnquiryQty(Long.valueOf(tfEnqQty.getValue()));
           }
           if (cbEnqDtlStatus.getValue() != null) {
             enqDtlObj.setEnqDtlStaus((cbEnqDtlStatus.getValue().toString()));
           }
           enqDtlObj.setLastUpdateddt(DateUtils.getcurrentdate());
           enqDtlObj.setLastUpdatedby(username);
           listEnqDtls.add(enqDtlObj);
           loadPurDtl();
           btnaddSpec.setCaption("Add");
           count = 0;
         } else {
           lsProduct.setComponentError(new UserError("Product Already Exist.."));
         }
       }
     }
     enqDtlresetFields();
   } catch (Exception e) {
     logger.info(e.getMessage());
   }
 }
Ejemplo n.º 21
0
    @Override
    public void valueChange(ValueChangeEvent event) {
      rm = (ReportModel) box.getValue();
      if (rm != null) {
        columnLayout.setVisible(true);
        columnLayout.setImmediate(true);
        reportColumnStepDesc.setVisible(true);
        List<ReportColumn> columnFields = rm.getReportTables().iterator().next().getReportColumns();
        gridLayout.removeAllComponents();
        gridLayout.requestRepaintAll();
        gridLayout.setRows(columnFields.size());
        gridLayout.setSpacing(true);

        for (final ReportColumn columnField : columnFields) {
          if (columnField.getColumnLabel() != null) {
            ReportColumnCard reportColumnCard =
                new ReportColumnCard(columnField) {
                  @Override
                  public void layoutClick(LayoutClickEvent event) {
                    if (clearDuplicateRelateColumnResult(columnField)) {
                      System.out.println(
                          "User click related column: " + columnField.getColumnLabel());
                      ReportColumn reportColumn = new ReportColumn();
                      reportColumn.setColumnName(columnField.getColumnName());
                      reportColumn.setColumnLabel(columnField.getColumnLabel());
                      reportColumn.setColumnUseMode(
                          ReportConfiguration.ReportColumnType.OutputColumn.toString());
                      if (ReportModelPool.findReportModelByCurrentUser(user)
                              .getSubTableSelectedColumns()
                          == null) {
                        HashSet<ReportColumn> reportColumns = new HashSet<ReportColumn>();
                        reportColumns.add(reportColumn);
                        ReportModelPool.findReportModelByCurrentUser(user)
                            .setSubTableSelectedColumns(reportColumns);
                      } else {
                        ReportModelPool.findReportModelByCurrentUser(user)
                            .getSubTableSelectedColumns()
                            .add(reportColumn);
                      }
                    }
                  }
                };
            gridLayout.addComponent(reportColumnCard);
          }
        }
        this.addComponent(columnLayout);
        ReportTable selectSubReportTable = rm.getReportTables().iterator().next();
        ReportModelPool.findReportModelByCurrentUser(user)
            .getReportTables()
            .add(selectSubReportTable);
        boolean removeStepflg = false;
        for (WizardStep step : w.getSteps()) {
          if (step.getCaption() != null) {
            if (step.getCaption().equals("Report Filter Step")) {
              removeStepflg = true;
            }
          }
        }
        if (removeStepflg) {
          w.removeStep("Report Filter Step");
        }
        w.removeStep("Preview Step");
        w.addStep(new ReportFilterStep(w, user), "Report Filter Step");
        w.addStep(new PreviewStep(w, user), "Preview Step");
      }
    }
Ejemplo n.º 22
0
 private void loadAttendenceProcess() {
   try {
     SessionFactory sf = serviceAttendanceProcess.getConnection();
     Session session = sf.openSession();
     session.beginTransaction();
     session.doWork(
         new Work() {
           @Override
           public void execute(Connection connection) throws SQLException {
             // TODO Auto-generated method stub
             try {
               SimpleDateFormat format1 = new SimpleDateFormat("dd-MM-yy");
               SimpleDateFormat format2 = new SimpleDateFormat("dd-MMM-yyyy");
               Date date = null;
               Date enddt = null;
               try {
                 date = format2.parse(startDate);
                 enddt = format2.parse(endDate);
               } catch (java.text.ParseException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
               }
               statement =
                   connection.prepareCall(
                       "{ ? = call pkg_hcm_core.fn_calc_staff_attend (?,?,?,?,?,?,?,?) }");
               statement.registerOutParameter(1, Types.VARCHAR);
               statement.setLong(2, payPeriodId);
               statement.setLong(3, (Long) cbEmployeeName.getValue());
               statement.setLong(4, (Long) cbBranch.getValue());
               statement.setString(5, format1.format(date));
               statement.setString(6, format1.format(enddt));
               statement.setLong(7, companyId);
               statement.setString(8, userName);
               statement.registerOutParameter(9, Types.VARCHAR);
               statement.execute();
               funationStatus = statement.getString(1);
               errorMsg = statement.getString(9);
               System.out.println("funationStatus-->" + funationStatus);
               System.out.println("errorMsg-->" + errorMsg);
               connection.close();
             } catch (Exception e) {
               SimpleDateFormat format1 = new SimpleDateFormat("dd-MMM-yy");
               SimpleDateFormat format2 = new SimpleDateFormat("dd-MMM-yyyy");
               Date date = null;
               Date enddt = null;
               try {
                 date = format2.parse(startDate);
                 enddt = format2.parse(endDate);
               } catch (java.text.ParseException e1) {
                 // TODO Auto-generated catch block
                 e1.printStackTrace();
               }
               statement =
                   connection.prepareCall(
                       "{ ? = call pkg_hcm_core.fn_calc_staff_attend (?,?,?,?,?,?,?,?) }");
               statement.registerOutParameter(1, Types.VARCHAR);
               statement.setLong(2, payPeriodId);
               statement.setLong(3, (Long) cbEmployeeName.getValue());
               statement.setLong(4, (Long) cbBranch.getValue());
               statement.setString(5, format1.format(date));
               statement.setString(6, format1.format(enddt));
               statement.setLong(7, companyId);
               statement.setString(8, userName);
               statement.registerOutParameter(9, Types.VARCHAR);
               statement.execute();
               funationStatus = statement.getString(1);
               errorMsg = statement.getString(9);
               System.out.println("funationStatus-->" + funationStatus);
               System.out.println("errorMsg-->" + errorMsg);
               connection.close();
               e.printStackTrace();
               logger.info(e.getMessage());
             }
           }
         });
     cbPayPeried.setComponentError(null);
     cbBranch.setComponentError(null);
     loadSrchRslt();
     resetFields();
   } catch (Exception e) {
     if (payPeriodId == null) {
       cbPayPeried.setComponentError(new UserError("Please Select Pay Period"));
     }
     if (cbBranch.getValue() == null) {
       cbBranch.setComponentError(new UserError("Please Select Branch "));
     }
     logger.info("Employee Attendance Process Function call" + e);
   } finally {
     try {
       statement.close();
     } catch (SQLException e) {
       // TODO Auto-generated catch block
       logger.info("Employee Attendance Process Function call" + e);
     }
   }
 }