Examples of IefInfoTela


Examples of org.ita.capes.ief.IefInfoTela

           });

    botaoInsereLinha = new JActButton("Inserir Linha",
           new ApplicationAction() {
              public void execute() {
                iefInfoTelaAtual=new IefInfoTela();
                panelFormulario.populateBean(iefInfoTelaAtual);
                try {                 
                  iefInfoTelaDAO.insert(iefInfoTelaAtual);
                  model.setBeanList(iefInfoTelaDAO.getList());
                  panelFormulario.cleanForm();
                } catch (ApplicationException e) {
                  JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
                }
                botaoLimpa.setEnabled(true);
              botaoInsereLinha.setEnabled(true);
              botaoAtualizaLinha.setEnabled(false);
              botaoExcluiLinha.setEnabled(false);
              botaoQuery.setEnabled(true);
              }
           });
   
    botaoExcluiLinha = new JActButton("Excluir Linha",
           new ApplicationAction() {
              public void execute() {
                iefInfoTelaAtual= model.getBeanAt(table.getSelectedRow());
                panelFormulario.populateBean(iefInfoTelaAtual);
                try {
              iefInfoTelaDAO.delete(iefInfoTelaAtual);
              model.setBeanList(iefInfoTelaDAO.getList());
              panelFormulario.cleanForm();
            } catch (ApplicationException e) {
              JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
            }
            botaoLimpa.setEnabled(true);
            botaoInsereLinha.setEnabled(true);
              botaoAtualizaLinha.setEnabled(false);
              botaoExcluiLinha.setEnabled(false);
              botaoQuery.setEnabled(true);
              }
           });
   
    botaoAtualizaLinha = new JActButton("Atualizar Linha",
           new ApplicationAction() {
              public void execute() {
              //Popula um objeto com as informa��es do form
                iefInfoTelaAtual=model.getBeanAt(table.getSelectedRow());
                panelFormulario.populateBean(iefInfoTelaAtual);
                //System.out.println(iefInfoTelaAtual.getNome()+iefInfoTelaAtual.getSigla()+iefInfoTelaAtual.getCidade()+iefInfoTelaAtual.getEstado());
                if(iefInfoTelaAtual.isValid()){
                  try {
                    iefInfoTelaDAO.update(iefInfoTelaAtual);
                    model.setBeanList(iefInfoTelaDAO.getList());
                    panelFormulario.cleanForm();
                  } catch (ApplicationException e) {
                    JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
                  }
                  botaoLimpa.setEnabled(true);
                  botaoInsereLinha.setEnabled(true);
                  botaoAtualizaLinha.setEnabled(false);
                botaoExcluiLinha.setEnabled(false);
                botaoQuery.setEnabled(true);
                }
                else {
                  System.out.println("Algum campo ainda eh nulo\n");
                }
              }
           });
   
    botaoQuery = new JActButton("I'm Feeling Lucky",
        new ApplicationAction() {
            public void execute() {
              iefInfoTelaAtual=new IefInfoTela();
              panelFormulario.populateBean(iefInfoTelaAtual);
              iefInfoTelaAtual.setInsertWildcards(true);
              try {
                model.setBeanList(iefInfoTelaDAO.query(iefInfoTelaAtual));
              } catch (ApplicationException e) {
View Full Code Here

Examples of org.ita.capes.ief.IefInfoTela

        parser.setContentHandler(handler);
        InputSource input = new InputSource(is);
       
        parser.parse(input);
        if(!handler.isErrorPageFromSite()) {
          IefInfoTela aux = new IefInfoTela();
          aux.setNum(handler.getCorrente().getNum());
          aux.setNome("");
          aux.setSigla("");
          aux.setOrganizacaoAcademica("");
          aux.setCategoriaAdministrativa("");
          aux.setInfo("");
          aux.setCep("");
          aux.setCidade("");
          aux.setEstado("");
          aux.setHomepage("");
          List<IefInfoTela> auxLista = iefInfoTelaDAO.query(aux);
          if(auxLista.size()>1) throw new ApplicationException("Mais de um IefInfoTela com num "+aux.getNum());
          else if(auxLista.size()==0) throw new ApplicationException("Sem elemento IefInfoTela com num "+aux.getNum());
          else {
            //todas informacoes que nao sao setadas em corrente
            handler.getCorrente().setIdIef(auxLista.get(0).getIdIef());
            handler.getCorrente().setLatitude(auxLista.get(0).getLatitude());
            handler.getCorrente().setLongitude(auxLista.get(0).getLongitude());
View Full Code Here

Examples of org.ita.capes.ief.IefInfoTela

  @Override
  public void delete(int id) {
    EntityManager em = JPAUtil.getEntityManager();
    EntityTransaction t = em.getTransaction();
    t.begin();
    IefInfoTela c =em.find(IefInfoTela.class, id);
    em.remove(c);
    t.commit();
    em.close();
  }
View Full Code Here

Examples of org.ita.capes.ief.IefInfoTela

  }

  @Override
  public IefInfoTela getById(int id) {
    EntityManager em = JPAUtil.getEntityManager();
    IefInfoTela c = em.find(IefInfoTela.class, id);
    em.close();
    return c;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.