Package br.com.procempa.modus.entity

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


    return null;
  }

  @Override
  public Filter[] getFilters() {
    Turma turma = (Turma) filtroCombo.getSelectedItem();
    if (turma != null && !turma.getNome().equals("TODAS")){
    return new Filter[] { new PatternFilter(turma.getNome(),
        Pattern.CASE_INSENSITIVE, 0) };
    }
    return null;
  }
View Full Code Here


  protected void initComponents() {
    removeInscricaoButton = new JButton();
    addEnabledButtons(removeInscricaoButton);
    filtroCombo = new JComboBox();
    try {
      Turma t = new Turma();
      t.setNome("TODAS");
     
      List<Turma> list = TurmaDataServices.getList(curso);

      filtroCombo = new JComboBox();
      filtroCombo.addItem(t);
View Full Code Here

 
  class TurmaRenderer implements ListCellRenderer {

    public Component getListCellRendererComponent(JList arg0, Object value,
        int arg2, boolean arg3, boolean arg4) {
      Turma t = (Turma) value;
      JLabel label = new JLabel();
      label.setText(t.getNome());

      return label;
    }
View Full Code Here

    return status;
  }

  public static Turma getTurma(String id) {
    Turma turma = null;
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      turma = (Turma) pa.find(Turma.class, id);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

  }
 
  public static void remove(String id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      Turma turma = (Turma) pa.find(Turma.class, id);
     
      List<Inscricao> inscritos = InscricaoDataServices.getList(turma);
      if (inscritos.isEmpty()){
        for (Inscricao inscrito : inscritos) {
          InscricaoDataServices.remove(inscrito.getId());
          }
       
        List<Encontro> encontros = EncontroDataServices.getList(turma);
        for (Encontro encontro : encontros) {
          EncontroDataServices.remove(encontro.getId());
        }
        turma.setStatus(Status.EXCLUIDO);
        pa.persist(turma);
      }
      else{
        JOptionPane.showMessageDialog(null, "N�o � poss�vel excluir! \nA turma possui usu�rios inscritos.", "Aten��o!", JOptionPane.WARNING_MESSAGE);
      }
View Full Code Here

  class TurmaRenderer implements ListCellRenderer {

    public Component getListCellRendererComponent(JList arg0, Object value,
        int arg2, boolean arg3, boolean arg4) {
      Turma t = (Turma) value;
      JLabel label = new JLabel();
      String text = t.getNome();
      if(t.getHorario() != null && !t.getHorario().equals("")){
        text = text + " (" + t.getHorario() + ")";
     
      label.setText(text);

      return label;
    }
View Full Code Here

      List<Presenca> presencas = PresencaDataServices.getList(inscrito);
      for (Presenca presenca : presencas) {
        PresencaDataServices.remove(presenca.getId());
      }   
           
      Turma turma = inscrito.getTurma();
      turma = TurmaDataServices.getTurma(turma.getId());
      turma.setVagas(turma.getVagas() + 1);
     
      List<String> messages = new ArrayList<String>();
      turma = TurmaDataServices.persist(turma,messages);
     
      inscrito.setStatus(Status.EXCLUIDO);
View Full Code Here

      List<Presenca> presencas = PresencaDataServices.getList(inscrito);
      for (Presenca presenca : presencas) {
        PresencaDataServices.remove(presenca.getId());
      }   
           
      Turma turma = inscrito.getTurma();
      turma = TurmaDataServices.getTurma(turma.getId());
      turma.setVagas(turma.getVagas() + 1);
     
      turma = TurmaDataServices.persist(turma);
     
      pa.remove(inscrito);     
    } catch (Exception e) {
View Full Code Here

    Action actionEncontro = new AbstractAction("", IconFactory.createEncontro16()) {

      private static final long serialVersionUID = 6896377001233184388L;

      public void actionPerformed(ActionEvent e) {
        Turma turma = (Turma) getSelectedData();
        JComponent form = EncontroView.getInstance(turma);
        Main.getInstance().buildPanel(form);
      }
    };
         
    encontroButton.setAction(actionEncontro);
    encontroButton.setText("Encontros");
    encontroButton.setToolTipText("Mostra a lista de encontros da turma");
    encontroButton.setEnabled(false);
    addToolBarButton(encontroButton);
   
    Action actionPresenca = new AbstractAction("", IconFactory.createPresenca16()) {

      private static final long serialVersionUID = -7824001094065007868L;

      public void actionPerformed(ActionEvent e) {
        Turma turma = (Turma) getTable().getValueAt(
            getTable().getSelectedRow(), -1);
        JComponent form = PresencaView.getInstance(turma);
        Main.getInstance().buildPanel(form);
      }
    };
         
    presencaButton.setAction(actionPresenca);
    presencaButton.setText("Lista de Presen�a");
    presencaButton.setToolTipText("Mostra a lista de presen�a de uma turma");
    presencaButton.setEnabled(false);
    addToolBarButton(presencaButton);
     
    Action actionCertificado = new AbstractAction("", IconFactory.createCertificado16()) {

      private static final long serialVersionUID = -5455054487822890519L;

      public void actionPerformed(ActionEvent e) {
        Turma turma = (Turma) getTable().getValueAt(
            getTable().getSelectedRows()[0], -1);
        try {
              Main.getInstance().buildPanel(CertificadoView.getInstance(turma));
             
        } catch (Exception e1) {
View Full Code Here

      value = "";
      try {
        FilaInscricao listaEspera = FilaInscricaoDataServices.getList(curso).get(row);
       
        if(null != listaEspera.getTurma()){
          Turma t = listaEspera.getTurma();
          value = t.getNome();
          if(t.getHorario() != null && !t.getHorario().equals("")){
            value = value + " (" + t.getHorario() + ")";
          }         
        }
      } catch (Exception e) {
        e.printStackTrace();
     
View Full Code Here

TOP

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

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.