Package br.com.procempa.modus.entity

Examples of br.com.procempa.modus.entity.Usuario


    }

    JPanel appPanel = Main.getInstance().getAppPanel();
    appPanel.removeAll();

    Usuario u = (Usuario) table.getValueAt(table.getSelectedRow(), -1);
    JComponent form = UsuarioForm.getInstance(u);
    appPanel.add(form);
    appPanel.validate();
    appPanel.repaint();
  }
View Full Code Here


  public void actionPerformed(ActionEvent e) {
    JXTable table = UsuarioSearch.getInstance().getTable();

    try {
      Usuario user = (Usuario) table.getValueAt(table.getSelectedRow(),
          -1);

      Integer action = ConfirmationView.showDeleteConfirmation("Excluir este usu�rio?");

      switch (action) {
      case ConfirmViewAction.YES:
        UsuarioDataServices.removeUsuario(user.getId());
        ((UsuarioTableModel) table.getModel()).removeItem(user);

        // Salva a lista atualizada no Cache
        ((UsuarioTableModel) UsuarioSearch.getInstance()
            .getTableModel()).saveCache(UsuarioSearch.getInstance()
View Full Code Here

    Inscricao inscricao  = new Inscricao();
   
    Turma turma = (Turma)pa.find(Turma.class, new Long(1));
    inscricao.setTurma(turma);
   
    Usuario usuario = UsuarioDataServices.getUsuario(new Long(1));
    inscricao.setUsuario(usuario);
   
    inscricao = (Inscricao) pa.persist(inscricao);
   
    assertEquals(inscricao.getTurma().getNome(),turma.getNome());
View Full Code Here

import br.com.procempa.modus.services.UsuarioDataServices;

public class InscricaoDataServicesTest extends TestCase {
 
  public void testInscreve() throws Exception {
    Usuario u = UsuarioDataServices.getUsuario(new Long(1));
    Turma turma = TurmaDataServices.getList().get(0);
    int vagas = turma.getVagas();
   
    InscricaoDataServices.inscreveUsuario(u,turma);
View Full Code Here

    mainPersistentAccess = (PersistentAccess) mainCtx
        .lookup("modus/PersistentAccessBean/remote");

    List<Persistent> list = mainPersistentAccess.search("FROM Usuario");
    for (Persistent persist : list) {
      Usuario u = (Usuario) persist;
      System.out.println("Nome: " + u.getNome());
    }

    assertNotNull(list);
  }
View Full Code Here

    super(connSource, connDestination);
  }

  public PreparedStatement prepareStatement(ResultSet rs,
      PreparedStatement statement, List<String> messages) throws Exception {
    Usuario user = (Usuario) getObject(rs);

    statement.setLong(1, user.getId());
    statement.setDate(2, new java.sql.Date(user.getTimestamp().getTime()));
    statement.setString(3, user.getNome());
    statement.setString(4, user.getEmail());

    statement.setString(5, user.getEndereco().getBairro());
    statement.setString(6, user.getEndereco().getCep());
    statement.setString(7, user.getEndereco().getCidade());
    statement.setString(8, user.getEndereco().getComplemento());
    statement.setString(9, user.getEndereco().getLogradouro());
    statement.setString(10, user.getEndereco().getNumero());
    statement.setString(11, user.getEndereco().getPais());
    statement.setString(12, user.getEndereco().getUf());

    statement.setString(13, user.getTelefone());
    statement.setString(14, user.getRg());

    statement.setString(15, user.getEmissor());

    statement.setDate(16, new java.sql.Date(user.getDataNascimento()
        .getTime()));

    statement.setBoolean(17, user.getEstudante());
    statement.setString(18, user.getOcupacao());

    statement.setBoolean(19, user.getTrabalha());
    statement.setInt(20, user.getSexo());
    statement.setInt(21, user.getEstadoCivil());
    statement.setInt(22, user.getRaca());

    statement.setInt(23, user.getEscolaridade().getNivel());
    statement.setString(24, user.getEscolaridade().getSerie());
    statement.setDate(25, new java.sql.Date(user.getDataCadastro()
        .getTime()));
    statement.setString(26, user.getSenha());

    statement.setInt(27, user.getPerfil());
    statement.setString(28, user.getObservacao());

    statement.setInt(29, user.getDeficiencia());
    statement.setNull(30, Types.NULL);

    return statement;
  }
View Full Code Here

    return statement;
  }

  public Persistent getObject(ResultSet rs) throws Exception {
    Usuario user = new Usuario();

    user.setId(rs.getLong(1));
    user.setTimestamp(new Timestamp(rs.getDate(2).getTime()));
    user.setNome(rs.getString(3));
    user.setEmail(rs.getString(13));
    user.setEndereco(new Endereco());
    user.getEndereco().setBairro(
        StringUtils.defaultIfEmpty(rs.getString(4), ""));
    user.getEndereco().setCep(
        StringUtils.defaultIfEmpty(rs.getString(5), ""));
    user.getEndereco().setCidade(
        StringUtils.defaultIfEmpty(rs.getString(6), ""));
    user.getEndereco().setComplemento(
        StringUtils.defaultIfEmpty(rs.getString(7), ""));
    user.getEndereco().setLogradouro(
        StringUtils.defaultIfEmpty(rs.getString(8), ""));
    user.getEndereco().setNumero(
        StringUtils.defaultIfEmpty(rs.getString(9), ""));
    user.getEndereco().setPais(
        StringUtils.defaultIfEmpty(rs.getString(10), ""));
    user.getEndereco().setUf(
        StringUtils.defaultIfEmpty(rs.getString(11), ""));

    user.setTelefone(rs.getString(12));
    user.setRg(rs.getString(14));
    user.setEmissor(StringUtils.defaultIfEmpty(rs.getString(15), ""));

    if (rs.getDate(16) == null) {
      user.setDataNascimento(new Date(new java.util.Date().getTime()));
    } else {
      user.setDataNascimento(rs.getDate(16));
    }

    user.setEstudante(rs.getBoolean(17));
    user.setOcupacao(rs.getString(18));

    user.setTrabalha(rs.getBoolean(19));
    user.setSexo(rs.getInt(20));
    user.setEstadoCivil(rs.getInt(21));
    user.setRaca(rs.getInt(22));

    user.setEscolaridade(new Escolaridade());
    user.getEscolaridade().setNivel(rs.getInt(25));
    user.getEscolaridade().setSerie(
        StringUtils.defaultIfEmpty(rs.getString(26), ""));

    if (rs.getDate(27) == null) {
      user.setDataCadastro(new Date(new java.util.Date().getTime()));
    } else {
      user.setDataCadastro(rs.getDate(27));
    }

    user.setSenha(StringUtils.defaultIfEmpty(rs.getString(28), ""));

    user.setPerfil(rs.getInt(29));
    user.setObservacao(StringUtils.defaultIfEmpty(rs.getString(30), ""));

    user.setDeficiencia(Deficiencia.NENHUMA);

    return user;
  }
View Full Code Here

   
    Action actionVisita = new AbstractAction("", IconFactory.createVisitaAtiva16()) {
      private static final long serialVersionUID = -2777494056951012296L;

      public void actionPerformed(ActionEvent e) {
        Usuario u = (Usuario) getTable().getValueAt(
            getTable().getSelectedRow(), -1);
        JComponent form = VisitaForm.getInstance(u);
        Main.getInstance().buildPanel(form);
      }
    };
   
    visitaButton.setAction(actionVisita);
    visitaButton.setText("Registrar Visita");
    visitaButton.setToolTipText("Registrar Visita");
    addToolBarButton(visitaButton);
    visitaButton.setEnabled(false);
   
    Action actionInscreveLista = new AbstractAction("", IconFactory.createInscricao16()) {

      private static final long serialVersionUID = 1092188857990595907L;

      public void actionPerformed(ActionEvent e) {
        Usuario u = (Usuario) getTable().getValueAt(
            getTable().getSelectedRow(), -1);
        JComponent form = FilaInscricaoCursoView.getInstance(u);
        Main.getInstance().buildPanel(form);
      }
    };
   
    listaEsperaButton.setAction(actionInscreveLista);
    listaEsperaButton.setText("Fila de Inscri��o");
    listaEsperaButton.setToolTipText("Insere o usu�rio na fila de inscri��o de um curso");
    listaEsperaButton.setEnabled(false);
    addToolBarButton(listaEsperaButton);
   
    Action actionInscreve = new AbstractAction("", IconFactory.createInscricao16()) {

      private static final long serialVersionUID = 1092188857990595907L;

      public void actionPerformed(ActionEvent e) {
        Usuario u = (Usuario) getTable().getValueAt(
            getTable().getSelectedRow(), -1);
        JComponent form = InscricaoView.getInstance(u);
        Main.getInstance().buildPanel(form);
      }
    };
View Full Code Here

    }

    if (rs.getString(4) == null) {
      i.setUsuario(null);
    } else {
      Usuario u = new Usuario();
      i.setUsuario(u);
      i.getUsuario().setId(rs.getLong(4));
    }

    return i;
View Full Code Here

   
    Action actionVisita = new AbstractAction("", IconFactory.createVisita16()) {
      private static final long serialVersionUID = -2777494056951012296L;

      public void actionPerformed(ActionEvent e) {
        Usuario u = (Usuario) getTable().getValueAt(
            getTable().getSelectedRow(), -1);
        JComponent form = VisitaForm.getInstance(u);
        Main.getInstance().buildPanel(form);
      }
    };
   
    visitaButton.setAction(actionVisita);
    visitaButton.setText("Registrar Visita");
    visitaButton.setToolTipText("Registrar Visita");
    addToolBarButton(visitaButton);
    visitaButton.setEnabled(false);
   
    Action actionInscreveLista = new AbstractAction("", IconFactory.createFilaEspera16()) {

      private static final long serialVersionUID = 1092188857990595907L;

      public void actionPerformed(ActionEvent e) {
        Usuario u = (Usuario) getTable().getValueAt(
            getTable().getSelectedRow(), -1);
        JComponent form = FilaInscricaoCursoView.getInstance(u);
        Main.getInstance().buildPanel(form);
      }
    };
   
    listaEsperaButton.setAction(actionInscreveLista);
    listaEsperaButton.setText("Fila de Inscri��o");
    listaEsperaButton.setToolTipText("Insere o usu�rio na fila de inscri��o de um curso");
    listaEsperaButton.setEnabled(false);
    addToolBarButton(listaEsperaButton);
   
    Action actionInscreve = new AbstractAction("", IconFactory.createInscreverCurso16()) {

      private static final long serialVersionUID = 1092188857990595907L;

      public void actionPerformed(ActionEvent e) {
        Usuario u = (Usuario) getTable().getValueAt(
            getTable().getSelectedRow(), -1);
        JComponent form = InscricaoView.getInstance(u);
        Main.getInstance().buildPanel(form);
      }
    };
View Full Code Here

TOP

Related Classes of br.com.procempa.modus.entity.Usuario

Copyright © 2018 www.massapicom. 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.