Examples of Visita


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

  }

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

    statement.setLong(1, v.getId());
    statement.setDate(2, new java.sql.Date(v.getTimestamp().getTime()));
    statement.setString(3, v.getObservacao());
    statement.setDate(4, new java.sql.Date(v.getDataInicio().getTime()));

    if (v.getDataFim() == null) {
      statement.setNull(5, Types.NULL);
    } else {
      statement.setDate(5, new java.sql.Date(v.getDataFim().getTime()));
    }

    statement.setBoolean(6, v.getMotivo().getCurso());
    statement.setBoolean(7, v.getMotivo().getChat());
    statement.setBoolean(8, v.getMotivo().getEmail());
    statement.setBoolean(9, v.getMotivo().getEscolar());
    statement.setBoolean(10, v.getMotivo().getJogo());
    statement.setBoolean(11, v.getMotivo().getOficina());
    statement.setBoolean(12, v.getMotivo().getOutro());
    statement.setBoolean(13, v.getMotivo().getWeb());
    statement.setNull(14, Types.NULL);

    if (!(v.getEquipamento() == null)) {
      statement.setLong(17, v.getEquipamento().getId());
    } else {
      statement.setNull(17, Types.NULL);
    }

    if (!(v.getTelecentro() == null)) {
      statement.setLong(15, v.getTelecentro().getId());
    } else {
      statement.setNull(15, Types.NULL);
      messages.add("Registro de VISITA (id: " + v.getId()
          + ") com chave estrangeira de Telecentro = NULL");
    }
    if (!(v.getUsuario() == null)) {
      statement.setLong(16, v.getUsuario().getId());
    } else {
      statement.setNull(16, Types.NULL);
      messages.add("Registro de VISITA (id: " + v.getId()
          + ") com chave estrangeira de Usuario = NULL");
    }
    return statement;
  }
View Full Code Here

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

    }
    return statement;
  }

  public Persistent getObject(ResultSet rs) throws Exception {
    Visita v = new Visita();

    v.setId(rs.getLong(1));
    v.setTimestamp(new Timestamp(rs.getDate(2).getTime()));
    v.setDataInicio(new Timestamp(rs.getDate(3).getTime()));
    if (rs.getString(4) == null) {
      v.setDataFim(null);
    } else {
      v.setDataFim(new Timestamp(rs.getDate(4).getTime()));
    }
    v.getMotivo().setEmail(rs.getBoolean(5));
    v.getMotivo().setChat(rs.getBoolean(6));
    v.getMotivo().setCurso(rs.getBoolean(7));
    v.getMotivo().setEscolar(rs.getBoolean(8));
    v.getMotivo().setJogo(rs.getBoolean(9));
    v.getMotivo().setOficina(rs.getBoolean(10));
    v.getMotivo().setOutro(rs.getBoolean(11));
    v.getMotivo().setWeb(rs.getBoolean(12));
    v.setObservacao(rs.getString(13));

    if (rs.getString(14).equals(null)) {
      v.setTelecentro(null);
    } else {
      Telecentro t = new Telecentro();
      v.setTelecentro(t);
      v.getTelecentro().setId(rs.getLong(14));
    }

    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) {
      v.setEquipamento(null);
    } else {
      Equipamento e = new Equipamento();
      v.setEquipamento(e);
      v.getEquipamento().setId(rs.getLong(16));
    }

    return v;
  }
View Full Code Here

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

  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

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

  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

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

public class VisitaDataServices implements DataServices {

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

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

    return true;
  }

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

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

    pa.remove(v);
  }

  public static Visita terminate(Long 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

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

public class VisitaDataServices implements DataServices {

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

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

    return true;
  }

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

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

    pa.remove(v);
  }

  public static void terminate(Long id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Visita v = (Visita) pa.find(Visita.class, id);
    v.setDataFim(new Date());
    pa.persist(v);
  }
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.