public void rowEventListener(RowEditEvent e) {
    try {
      AnexosRespuestaDTO anexosRespuestaDTO = (AnexosRespuestaDTO) e.getObject();

      if (txtAdjuntoDocumento == null) {
        txtAdjuntoDocumento = new InputText();
      }

      txtAdjuntoDocumento.setValue(anexosRespuestaDTO.getAdjuntoDocumento());

      if (txtDocumentoReal == null) {
        txtDocumentoReal = new InputText();
      }

      txtDocumentoReal.setValue(anexosRespuestaDTO.getDocumentoReal());

      if (txtEstadoRegistro == null) {
        txtEstadoRegistro = new InputText();
      }

      txtEstadoRegistro.setValue(anexosRespuestaDTO.getEstadoRegistro());

      if (txtNombreAnexo == null) {
        txtNombreAnexo = new InputText();
      }

      txtNombreAnexo.setValue(anexosRespuestaDTO.getNombreAnexo());

      if (txtNombreBusqueda == null) {
        txtNombreBusqueda = new InputText();
      }

      txtNombreBusqueda.setValue(anexosRespuestaDTO.getNombreBusqueda());

      if (txtUsuarioCreador == null) {
        txtUsuarioCreador = new InputText();
      }

      txtUsuarioCreador.setValue(anexosRespuestaDTO.getUsuarioCreador());

      if (txtIdAnexoPqr_AnexosPqr == null) {
        txtIdAnexoPqr_AnexosPqr = new InputText();
      }

      txtIdAnexoPqr_AnexosPqr.setValue(anexosRespuestaDTO.getIdAnexoPqr_AnexosPqr());

      if (txtIdRespSol_RespuestaSol == null) {
        txtIdRespSol_RespuestaSol = new InputText();
      }

      txtIdRespSol_RespuestaSol.setValue(anexosRespuestaDTO.getIdRespSol_RespuestaSol());

      if (txtIdAnxResp == null) {
        txtIdAnxResp = new InputText();
      }

      txtIdAnxResp.setValue(anexosRespuestaDTO.getIdAnxResp());

      if (txtFechaCreacion == null) {
        txtFechaCreacion = new Calendar();
      }

      txtFechaCreacion.setValue(anexosRespuestaDTO.getFechaCreacion());

      Long idAnxResp = FacesUtils.checkLong(txtIdAnxResp);
      entity = businessDelegatorView.getAnexosRespuesta(idAnxResp);

      action_modify();
    } catch (Exception ex) {
    }
  }
Пример #2
0
  public void editar(RowEditEvent event) {
    cursos.get(curso).addAluno((Aluno) event.getObject());

    if (service.update((Aluno) event.getObject())) {
      FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Aluno atualizado"));
    } else {
      FacesContext.getCurrentInstance()
          .addMessage(null, new FacesMessage("Erro ao atualizar aluno", "Tente novamente"));
    }
  }
Пример #3
0
  public void onEdit(RowEditEvent event) {

    ObjectHelper<Roles> helper = new ObjectHelper<Roles>();
    try {
      helper.update((Roles) event.getObject());
    } catch (ObjectException ex) {
      Logger.getLogger(roleManager.class.getName()).log(Level.SEVERE, null, ex);
    }

    FacesMessage msg = new FacesMessage("Edit Comleted", ((Roles) event.getObject()).getRoleName());
    FacesContext.getCurrentInstance().addMessage(null, msg);
  }
  public void onEdit(RowEditEvent event) throws Exception {
    // Permet de modifier le client dans la base de donnée
    clientService.save((Client) event.getObject());

    // Internationalisation des messages d'erreur
    FacesContext context = FacesContext.getCurrentInstance();
    ResourceBundle bundle = ResourceBundle.getBundle("messages", context.getViewRoot().getLocale());
    String key = bundle.getString("bouton.client") + " " + bundle.getString("bouton.edit");
    FacesMessage msg = new FacesMessage(key, ((Client) event.getObject()).getNom());

    FacesContext.getCurrentInstance().addMessage(null, msg);
  }
Пример #5
0
 public void saveBranch(RowEditEvent event) {
   BranchBean object = (BranchBean) event.getObject();
   if (object != null) {
     bean = object;
     save();
   }
 }
Пример #6
0
  public void onRowEdit(RowEditEvent event) {

    Product pro = ((Product) event.getObject());
    System.out.println(
        "pro id :"
            + pro.getProductId()
            + "pro name: "
            + pro.getName()
            + " price:  "
            + pro.getCurrentPrice()
            + " desc: "
            + pro.getProDescription()
            + "isActive : "
            + pro.getIsActive()
            + " cat  "
            + pro.getCategory());
    try {
      productEJB.edit(pro);
    } catch (Exception e) {
      // logging
      onRowCancel(event);
    }
    FacesMessage msg = new FacesMessage("Product Edited", String.valueOf(pro.getProductId()));
    FacesContext.getCurrentInstance().addMessage(null, msg);
  }
Пример #7
0
  public String onEdit(RowEditEvent event) {
    System.out.println("eeeee");
    officeAdministratorService.updateFlight(
        ((Flights) event.getObject()).getId(),
        ((Flights) event.getObject()).getNumberFlight(),
        ((Flights) event.getObject()).getFromFlight(),
        ((Flights) event.getObject()).getToFlight(),
        ((Flights) event.getObject()).getFromDate(),
        ((Flights) event.getObject()).getToDate(),
        ((Flights) event.getObject()).getCount(),
        ((Flights) event.getObject()).getPrice());
    list = null;
    FacesMessage msg = new FacesMessage("Flight edited");

    FacesContext.getCurrentInstance().addMessage(null, msg);
    return null;
  }
Пример #8
0
 public void onRowEdit(RowEditEvent event) {
   update((CursoVO) event.getObject());
   try {
     FacesContext.getCurrentInstance().getExternalContext().redirect("");
   } catch (IOException e) {
     e.printStackTrace();
   }
 }
  public void onCancel(RowEditEvent event) {
    // Internationalisation des messages d'erreur
    FacesContext context = FacesContext.getCurrentInstance();
    ResourceBundle bundle = ResourceBundle.getBundle("messages", context.getViewRoot().getLocale());
    String key = bundle.getString("bouton.client") + " " + bundle.getString("bouton.annule");
    FacesMessage msg = new FacesMessage(key, ((Client) event.getObject()).getNom());

    FacesContext.getCurrentInstance().addMessage(null, msg);
  }
 public void onRowEdit(RowEditEvent event) {
   String nombreMetodo = Thread.currentThread().getStackTrace()[1].getMethodName() + "()";
   try {
     CexAgenda objAgen = (CexAgenda) event.getObject();
     adminObject.modificar(
         objAgen,
         (UsuarioAdmin)
             FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("user"));
   } catch (Exception e) {
     log.error("{}: {} ", nombreMetodo, e);
   }
 }
Пример #11
0
  public void onEditRow(RowEditEvent event) {
    WeldJob w = (WeldJob) event.getObject(); // gives me unedited value
    // w.setQuantityWelded(quantityWelded);
    projectSessionBean.conductWeldJobMerge(w);

    Project p = projectSessionBean.getProjectByProjectNo(w.getProjectNo()).get(0);
    double partialWeldJob = 0, totalWeldJob = 0;
    for (int i = 0; i < p.getWeldJobs().size(); i++) {
      partialWeldJob += w.getSurfaceArea() * w.getQuantityWelded();
      totalWeldJob += w.getSurfaceArea() * w.getTotalQuantity();
    }
    int percent = (int) ((partialWeldJob / totalWeldJob) * 100);
    p.setProjectProgress(percent);
    projectSessionBean.conductProjectMerge(p);
  }
  public String alterarNotas(RowEditEvent event) {
    AlunoDisciplina alunoDisciplina = new AlunoDisciplina();
    try {
      alunoDisciplina = (AlunoDisciplina) event.getObject();
      alunoDisciplina = calcularMediaDoAluno(alunoDisciplina);
      alunoDisciplina = adicionaSitaucaoDoAlunoNaDisciplina(alunoDisciplina);
      alunoDisciplinaService.atualizarDisciplinasParaAluno(alunoDisciplina);
    } catch (Exception e) {
      logger.error("Erro ao alterar alunoDisciplina");
      addErrorMessage("Não foi possível alterar os dados do aluno.");
      return null;
    }

    logger.info("ALunoDisciplina alterado com sucesso");
    addInfoMessage("Dados do aluno alterado com sucesso.");
    return null;
  }
Пример #13
0
 @Override
 public void onRowEdit(RowEditEvent ree) {
   Feature property = (Feature) ree.getObject();
   if (property.getOptionOnDb().equals(property.getOption())) {
     return;
   }
   property.setName(property.getName().trim());
   property.setOption(property.getOption().trim());
   for (String option : propertyRepository.getOptions(property.getName().trim())) {
     if (option != null && option.trim().equals(property.getOption())) {
       super.addFacesMessage(
           FacesMessage.SEVERITY_ERROR, "Opzione gia' presente", "", "featuresList");
       property.setOption(property.getOptionOnDb());
       return;
     }
   }
   super.onRowEdit(ree);
 }
  public void onEdit(RowEditEvent event) {
    FacesMessage message = null;

    try {
      AdditionalCost edited = (AdditionalCost) event.getObject();
      boolean updated = this.additionalCostService.updateAdditionalCost(edited);
      String messageString;
      if (updated) {
        messageString = resourceBundleBean.get(ResourceBundleBean.SUCCESS_ADDITIONAL_COST_UPDATED);
        message = new FacesMessage(FacesMessage.SEVERITY_INFO, messageString, "");
      } else {
        messageString = resourceBundleBean.get(ResourceBundleBean.ERROR_ADDITIONAL_COST_UPDATE);
        message = new FacesMessage(FacesMessage.SEVERITY_ERROR, messageString, "");
      }
    } catch (Exception e) {
      message = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
    } finally {
      FacesContext.getCurrentInstance().addMessage(null, message);
    }
  }
  /**
   * * Row Edit
   *
   * @param event
   */
  @Override
  public void onEdit(RowEditEvent event) {

    Report014Detail editRow = ((Report014Detail) event.getObject());

    logger.trace("Edit Row : {}", editRow);

    for (int i = 0; i < report014Details.size(); i++) {

      if (report014Details.get(i).getKey() == editRow.getKey()) {

        report014Details.remove(i);
        report014Details.add(i, editRow);

        logger.trace("After Edit Row : {}", editRow);
      }

      break;
    }

    JsfUtil.addSuccessMessage("แก้ใขข้อมูลสำเร็จ!!");
  }
Пример #16
0
 public void editBank(org.primefaces.event.RowEditEvent e) {
   fbsBankFacade.edit((FbsBank) e.getObject());
   bankList = em.createNamedQuery("FbsBank.findAll").getResultList();
 }
 public void onRowCancel(RowEditEvent event) {
   FacesMessage msg =
       new FacesMessage("Edit Cancelled", ((CexAgenda) event.getObject()).getCagObservacion());
   FacesContext.getCurrentInstance().addMessage(null, msg);
 }
Пример #18
0
 public void onCancel(RowEditEvent event) {
   FacesMessage msg =
       new FacesMessage("Edit Cancelled", ((Roles) event.getObject()).getRoleName());
   FacesContext.getCurrentInstance().addMessage(null, msg);
 }
Пример #19
0
 public void onEdit(RowEditEvent event) {
   System.out.println("entro a edit");
   Proyecto c = (Proyecto) event.getObject();
   getFacade().edit(c);
 }
Пример #20
0
  @Override
  public String alterar(RowEditEvent event) {
    try {
      Firewall firewall = (Firewall) event.getObject();
      firewall.setDistribuicao(
          distribuicoes.get(distribuicoes.indexOf(firewall.getDistribuicao())));

      firewallFacade.alterarFirewall(firewall);
      showMessageInfo(Mensagens.getInstance().REGISTRO_ALTERADO_SUCESSO);
      return LISTAR_FIREWALL;
    } catch (NomeNaoInformadoException e) {
      LOGGER.error(e);
      showMessageError(Mensagens.getInstance().NOME_NAO_INFORMADO);
      setFirewalls(firewallFacade.listarFirewall(null));
      setFirewallFiltrados(getFirewalls());
      return LISTAR_FIREWALL;
    } catch (IpNaoInformadoException e) {
      LOGGER.error(e);
      showMessageError(Mensagens.getInstance().IP_NAO_INFORMADO);
      setFirewalls(firewallFacade.listarFirewall(null));
      setFirewallFiltrados(getFirewalls());
      return LISTAR_FIREWALL;
    } catch (PortaSshNaoInformadaException e) {
      LOGGER.error(e);
      showMessageError(Mensagens.getInstance().PORTASSH_NAO_INFORMADA);
      setFirewalls(firewallFacade.listarFirewall(null));
      setFirewallFiltrados(getFirewalls());
      return LISTAR_FIREWALL;
    } catch (RootNaoInformadoException e) {
      LOGGER.error(e);
      showMessageError(Mensagens.getInstance().ROOT_NAO_INFORMADO);
      setFirewalls(firewallFacade.listarFirewall(null));
      setFirewallFiltrados(getFirewalls());
      return LISTAR_FIREWALL;
    } catch (SenhaNaoInformadaException e) {
      LOGGER.error(e);
      showMessageError(Mensagens.getInstance().SENHA_NAO_INFORMADO);
      setFirewalls(firewallFacade.listarFirewall(null));
      setFirewallFiltrados(getFirewalls());
      return LISTAR_FIREWALL;
    } catch (DistribuicaoNaoInformadaException e) {
      LOGGER.error(e);
      showMessageError(Mensagens.getInstance().DISTRIBUICAO_NAO_INFORMADO);
      setFirewalls(firewallFacade.listarFirewall(null));
      setFirewallFiltrados(getFirewalls());
      return LISTAR_FIREWALL;
    } catch (ClienteNaoInformadoException e) {
      LOGGER.error(e);
      showMessageError(Mensagens.getInstance().CLIENTE_NAO_INFORMADO);
      setFirewalls(firewallFacade.listarFirewall(null));
      setFirewallFiltrados(getFirewalls());
      return LISTAR_FIREWALL;
    } catch (FirewallJaCadastradoException e) {
      LOGGER.error(e);
      showMessageError(Mensagens.getInstance().FIREWALL_JA_CADASTRADO);
      setFirewalls(firewallFacade.listarFirewall(null));
      setFirewallFiltrados(getFirewalls());
      return LISTAR_FIREWALL;
    } catch (IntegrationException e) {
      LOGGER.error(e);
      showMessageErrorCustom(e.getDescricao());
      setFirewalls(firewallFacade.listarFirewall(null));
      setFirewallFiltrados(getFirewalls());
      return LISTAR_FIREWALL;
    }
  }
 public void guncelle(RowEditEvent event) {
   telefonSantrali = ((TelefonSantrali) event.getObject());
   dao.merge(telefonSantrali);
   telefonSantrali = new TelefonSantrali();
 }
Пример #22
0
 public void onRowCancel(RowEditEvent event) {
   FacesMessage msg =
       new FacesMessage(
           "Product Cancelled", String.valueOf(((Product) event.getObject()).getProductId()));
   FacesContext.getCurrentInstance().addMessage(null, msg);
 }