Package br.com.procempa.modus.entity

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


  private UsuarioNewAction() {
    super("Usu�rio", IconFactory.createUser24());
  }

  public void actionPerformed(ActionEvent e) {
    Usuario usuario = new Usuario();
    JComponent form = UsuarioForm.getInstance(usuario);
    Main.getInstance().buildPanel(form);
  }
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 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

public class UsuarioDataServices implements DataServices {

  public static Usuario getUsuario(Long id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Usuario u = (Usuario) pa.find(Usuario.class, id);
    return u;
  }
View Full Code Here

    Usuario u = (Usuario) pa.find(Usuario.class, id);
    return u;
  }

  public static Usuario getUsuarioByRg(String rg) throws UsuarioException {
    Usuario u = null;
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      HashMap<String, Object> params = new HashMap<String, Object>();
      params.put("rg", rg);
      List<Persistent> l = pa.search("from Usuario where rg = :rg", params);
View Full Code Here

    HashMap<String, Object> params = new HashMap<String, Object>();
    params.put("id", id);
    List<Persistent> users = pa.search("from Usuario as u left join fetch u.visitaList where u.id = :id", params);

    if (!users.isEmpty()) {
      Usuario u = (Usuario) users.get(0);
      if (u.getVisitaList().isEmpty()) {
        pa.remove(u);
      } else {
        throw new BusinessException(
            "Desculpe, mas n�o � poss�vel remover um usu�rio com visitas registradas.");
      }
View Full Code Here

  private UsuarioNewAction() {
    super("Usu�rio", IconFactory.createUser16());
  }

  public void actionPerformed(ActionEvent e) {
    Usuario usuario = new Usuario();
    JComponent form = UsuarioForm.getInstance(usuario);
    Main.getInstance().buildPanel(form);
  }
View Full Code Here

    }

    if (rs.getString(15).equals(null)) {
      v.setUsuario(null);
    } else {
      Usuario u = new Usuario();
      v.setUsuario(u);
      v.getUsuario().setId(rs.getLong(15));
    }

    if (rs.getString(16) == null) {
View Full Code Here

    }

    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);
      UsuarioDataServices.removeUsuario(user.getId());
      ((UsuarioTableModel) table.getModel()).removeItem(user);

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

        .search(
            "FROM Usuario AS u LEFT JOIN FETCH u.visitaList WHERE u.id = :id",
            params);

    if (!users.isEmpty()) {
      Usuario u = (Usuario) users.get(0);

      if (!u.getVisitaList().isEmpty()) {
        throw new ExclusaoUsuarioComVisitasException(
            "O usu�rio possui visitas registradas.");
      }

      if (!InscricaoDataServices.getList(u).isEmpty()) {
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.