Package br.com.procempa.modus.entity

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


  public static JComponent getInstance(Usuario u) {
    panel = new VisitaForm(IconFactory.createVisita16(),
        "Registrar Visita");
    panel.usuario = u;
    panel.visita = new Visita();
    panel.visita.setDataInicio(new Date());
   
    panel.isInsert = true;
    panel.buildPanel();
    return panel;
View Full Code Here


  public static JComponent getInstance(Usuario u) {
    panel = new VisitaForm(IconFactory.createVisitaAtiva16(),
        "Registrar Visita");
    panel.usuario = u;
    panel.visita = new Visita();
    panel.isInsert = true;
    panel.buildPanel();
    return panel;
  }
View Full Code Here

public class VisitaDataServices implements DataServices {

  public static Visita getVisita(String id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Visita v = (Visita) pa.find(Visita.class, id);
    return v;
  }
View Full Code Here

    return true;
  }

  public static void remove(String id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Visita v = (Visita) pa.find(Visita.class, id);
    v.setStatus(Status.EXCLUIDO);
    pa.persist(v);
  }
View Full Code Here

    pa.persist(v);
  }

  public static Visita terminate(String id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Visita v = (Visita) pa.find(Visita.class, id);
    v.setDataFim(new Date());
    v = (Visita) pa.persist(v);
    if (!v.isListaEspera()) {
      Equipamento eq = v.getEquipamento();
      EquipamentoDataServices.closeStation(eq);
    }
    return v;
  }
View Full Code Here

        .search(
            "FROM Visita WHERE dataInicio >= :dataInicio AND dataFim <= :dataFim AND telecentro=:telecentro ORDER BY dataInicio",
            params);
   
    for (Persistent persistent : list) {     
      Visita visita = (Visita) persistent;     
      items.add(visita);
    }
   
    return items;
  }
View Full Code Here

   
    Integer numVisitas = new Integer(0);
   
    if (!list.isEmpty()){
      Persistent persistent = list.get(0);
      Visita v = (Visita) persistent;
      idAnterior = v.getUsuario().getId();
   
       
    for (Persistent persistent : list) {     
      Visita visita = (Visita) persistent;     
      if (visita.getUsuario().getId() == idAnterior){
        numVisitas++;
        totalHoras += visita.getDataFim().getTime() - visita.getDataInicio().getTime();
      }
      else{
        RelatorioVisitaVO relatorio = new RelatorioVisitaVO();
        relatorio.setNome(UsuarioDataServices.getUsuario(idAnterior).getNome());
        relatorio.setNumeroVisitas(numVisitas);      
        relatorio.setTotalHoras(totalHoras);
        items.add(relatorio);
        idAnterior = visita.getUsuario().getId();
        numVisitas = 1;
        totalHoras = visita.getDataFim().getTime() - visita.getDataInicio().getTime();
      }
     
    }
   
    if (!list.isEmpty()) {
View Full Code Here

  public void actionPerformed(ActionEvent e) {
    JPanel appPanel = Main.getInstance().getAppPanel();
    appPanel.removeAll();
    JXTable table = VisitaSearch.getInstance().getTable();
    Visita t = (Visita) table.getValueAt(table.getSelectedRows()[0], -1);
    JComponent form = VisitaForm.getInstance(t);
    appPanel.add(form);
    appPanel.validate();
    appPanel.repaint();
  }
View Full Code Here

   
    public void actionPerformed(ActionEvent e) {
        JPanel appPanel = Main.getInstance().getAppPanel();
        appPanel.removeAll();
        JXTable table = VisitaSearch.getInstance().getTable();
        Visita t = (Visita) table.getValueAt(
                table.getSelectedRows()[0], -1);
        JComponent form = VisitaForm.getInstance(t);
        appPanel.add(form);
        appPanel.validate();
        appPanel.repaint();
View Full Code Here

    Equipamento eq = EquipamentoDataServices.getList(telecentro).get(0);

    UserContext.createInstance(user, telecentro);
    ArrayList<Visita> visitas = new ArrayList<Visita>();

    Visita v = new Visita();
    for (int i = 0; i < 20; i++) {
      v = new Visita();
      v.setUsuario(user);
      v.setTelecentro(telecentro);
      v.setEquipamento(eq);
      Motivo m = new Motivo();
      m.setEmail(true);
      v.setMotivo(m);      v.setDataInicio(new Date());
      v = VisitaDataServices.persist(v);
      visitas.add(v);
    }
   
    VisitaDataServices.terminate(visitas);
   
    v = VisitaDataServices.getVisita(v.getId());
   
    assertNotNull(v.getDataFim());
  }
View Full Code Here

TOP

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

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.