Examples of ProfessorTela


Examples of org.ita.capes.professor.ProfessorTela

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

Examples of org.ita.capes.professor.ProfessorTela

  }

  @Override
  public ProfessorTela getById(int id) {
    EntityManager em = JPAUtil.getEntityManager();
    ProfessorTela c = em.find(ProfessorTela.class, id);
    em.close();
    return c;
  }
View Full Code Here

Examples of org.ita.capes.professor.ProfessorTela

           });

    botaoInsereLinha = new JActButton("Inserir Linha",
           new ApplicationAction() {
              public void execute() {
                professorTelaAtual=new ProfessorTela();
                panelFormulario.populateBean(professorTelaAtual);
                try {                 
                  ProfessorTelaDAO.insert(professorTelaAtual);
                  model.setBeanList(ProfessorTelaDAO.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() {
                professorTelaAtual= model.getBeanAt(table.getSelectedRow());
                panelFormulario.populateBean(professorTelaAtual);
                if(professorTelaAtual==null) System.out.println("Fudeu");
                else System.out.println("bizu");
                try {
              ProfessorTelaDAO.delete(professorTelaAtual);
              model.setBeanList(ProfessorTelaDAO.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
                professorTelaAtual=model.getBeanAt(table.getSelectedRow());
                panelFormulario.populateBean(professorTelaAtual);
                //System.out.println(ProfessorTelaAtual.getNome()+ProfessorTelaAtual.getSigla()+ProfessorTelaAtual.getCidade()+ProfessorTelaAtual.getEstado());
                if(professorTelaAtual.isValid()){
                  try {
                    ProfessorTelaDAO.update(professorTelaAtual);
                    model.setBeanList(ProfessorTelaDAO.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() {
              professorTelaAtual=new ProfessorTela();
              panelFormulario.populateBean(professorTelaAtual);
              try {
                model.setBeanList(ProfessorTelaDAO.query(professorTelaAtual));
              } catch (ApplicationException e) {
                JOptionPane.showMessageDialog(panelFormulario, e.getMessage());
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.