Package br.com.procempa.modus.entity

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


   * @throws Exception
   */
  public static void remove(Long id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      Equipamento eq = (Equipamento) pa.find(Equipamento.class, id);
      pa.remove(eq);
    } catch (Exception e) {
      throw new Exception(e.getClass().getName() + ": " + e.getMessage());
    }
  }
View Full Code Here


    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

    try {
      Telecentro telecentro = UserContext.getInstance().getTelecentro();
      List<Equipamento> eqs = EquipamentoDataServices
          .getLivres(telecentro);
      if (!eqs.isEmpty()) {
        Equipamento eq = eqs.get(0);
        if (visita.isListaEspera()) {
          visita.setEquipamento(eq);
          visita.setDataInicio(new Date());
          persist(visita, new ArrayList<String>());
          EquipamentoDataServices.openStation(eq);
View Full Code Here

   * @param id
   *            identificador do equipamento
   * @return inst�ncia de Equipamento
   */
  public static Equipamento getEquipamento(Long id) {
    Equipamento eq = null;
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      eq = (Equipamento) pa.find(Equipamento.class, id);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

   * @throws Exception
   */
  public static void remove(Long id) throws Exception {
    // try {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Equipamento eq = (Equipamento) pa.find(Equipamento.class, id);
    if (!EquipamentoDataServices.temVisita(eq)) {
      pa.remove(eq);
    } else {
      throw new ExclusaoEquipamentoComVisitaException(
          "O equipamento possui visitas registradas.");
View Full Code Here

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

    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

          //Seta o telecentro do monitor
          visita.setTelecentro(UserContext.getInstance().getTelecentro());
         
          //Se n�o for lista de espera, seta o equipamento,
          //sen�o, seta null no equipamento
          Equipamento eq = (Equipamento) equipamentoCombo.getSelectedItem();
          if (eq.getId() != -1) {
            visita.setEquipamento(eq);
          } else {
            visita.setEquipamento(null);
          }
           
View Full Code Here

    try {
      Telecentro telecentro = UserContext.getInstance().getTelecentro();
      List<Equipamento> eqs = EquipamentoDataServices
          .getLivres(telecentro);
      if (!eqs.isEmpty()) {
        Equipamento eq = eqs.get(0);
        List<Visita> visitaAtivas = VisitaDataServices
            .getVisitasAtivas(telecentro);
        for (Visita visita : visitaAtivas) {
          if (visita.isListaEspera()) {
            visita.setEquipamento(eq);
View Full Code Here

  public EquipamentoLivreComboBoxModel(Telecentro t) {
    this.telecentro = t;
    try {
      items = EquipamentoDataServices.getLivres(UserContext.getInstance().getTelecentro());
      if (items.isEmpty()) {
        Equipamento e = new Equipamento();
        e.setRotulo("Lista de Espera");
        e.setId(new Long(-1));
        items.add(e);
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

TOP

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

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.