Package org.ldv.sio.getap.app

Examples of org.ldv.sio.getap.app.DemandeValidationConsoTempsAccPers


    }
  }

  @RequestMapping(value = "refuse/{id}", method = RequestMethod.GET)
  public String refuseDCTAPById(@PathVariable String id, Model model) {
    DemandeValidationConsoTempsAccPers dctap = manager.getDVCTAPById(Long
        .valueOf(id));

    // Test que la DCTAP appartient à la bonne personne
    if (dctap.getProf().equals(UtilSession.getUserInSession())
        && (dctap.getEtat() == 0 || dctap.getEtat() == 4 || dctap
            .getEtat() > 1023)) {
      dctap.setDctapRefuse();
      manager.updateDVCTAP(dctap);
    }

    return "redirect:/app/prof-intervenant/index";
  }
View Full Code Here


    return "redirect:/app/prof-intervenant/index";
  }

  @RequestMapping(value = "valid/{id}", method = RequestMethod.GET)
  public String validDCTAPById(@PathVariable String id, Model model) {
    DemandeValidationConsoTempsAccPers dctap = manager.getDVCTAPById(Long
        .valueOf(id));

    // Test que la DCTAP appartient à la bonne personne
    if (dctap.getProf().equals(UtilSession.getUserInSession())
        && (dctap.getEtat() == 0 || dctap.getEtat() == 4)) {
      dctap.setDctapValide();
      manager.updateDVCTAP(dctap);
    }

    return "redirect:/app/prof-intervenant/index";
  }
View Full Code Here

    return "eleve/mesdctap";
  }

  @RequestMapping(value = "delete/{id}", method = RequestMethod.GET)
  public String deleteDCTAPById(@PathVariable String id, Model model) {
    DemandeValidationConsoTempsAccPers currentDctap = manager
        .getDVCTAPById(Long.valueOf(id));
    // Test que la DCTAP appartient à la bonne personne
    if (currentDctap.getEleve().equals(UtilSession.getUserInSession())) {
      currentDctap.setDctapAnnule();
      manager.updateDVCTAP(currentDctap);
    }

    return "redirect:/app/eleve/mesdctap";
  }
View Full Code Here

  public String editDCTAPById(@RequestParam("id") String id,
      FormDemandeConsoTempsAccPers formDctap, Model model) {

    // System.out.println("TEST id recu :" + formDctap.getId());

    DemandeValidationConsoTempsAccPers currentDctap = manager
        .getDVCTAPById(Long.valueOf(id));

    System.out.println("DCTAP : " + currentDctap);

    // valorise le bean de vue avec le dctap courant
    formDctap.setId(currentDctap.getId()); // en provenance d'un champ caché
    formDctap.setDateAction(currentDctap.getDateAction());
    formDctap.setProfId(currentDctap.getProf().getId());
    // formDctap.setProfNom(currentDctap.getProf().getNom());
    formDctap.setIdEleve(currentDctap.getEleve().getId());
    formDctap.setAccPersId(currentDctap.getAccPers().getId());
    formDctap.setMinutes(currentDctap.getMinutes());
    model.addAttribute("minute", currentDctap.getMinutes());
    model.addAttribute("lesProfs", manager.getAllProf());
    model.addAttribute("etat", manager.getDVCTAPById(formDctap.getId())
        .getEtat());
    model.addAttribute("lesAP", manager.getAllAPForEleve());
    return "eleve/edit";
View Full Code Here

    if (bindResult.hasErrors()) {
      model.addAttribute("lesProfs", manager.getAllProf());
      return "eleve/edit";
    } else {
      User user = UtilSession.getUserInSession();
      DemandeValidationConsoTempsAccPers dctapForUpdate = manager
          .getDVCTAPById(Long.valueOf(formDctap.getId()));
      if (dctapForUpdate.getEtat() == 0 || dctapForUpdate.getEtat() == 4) {

        AccPersonalise acc = new AccPersonalise(null,
            formDctap.getAccPersNom(), 1, user.getId());
        if (manager.getAPById(formDctap.getAccPersId()) != null) {
          acc = manager.getAPById(formDctap.getAccPersId());
          dctapForUpdate
              .setAccPers(manager.getAPById(formDctap.getAccPersId()));
        } else {
          manager.addAP(acc);
          dctapForUpdate.setAccPers(manager.getAPByNom(formDctap
              .getAccPersNom()));
        }

        dctapForUpdate.setDateAction(formDctap.getDateAction());
        dctapForUpdate.setMinutes(formDctap.getMinutes());

        dctapForUpdate.setProf(manager.getUserById(formDctap.getProfId()));
        dctapForUpdate.setDctapModifEleve();
        manager.updateDVCTAP(dctapForUpdate);
      }

      return "redirect:/app/eleve/mesdctap";
    }
View Full Code Here

      if (manager.getAPById(formAjout.getAccPersId()) != null) {
        acc = manager.getAPById(formAjout.getAccPersId());
      } else {
        manager.addAP(acc);
      }
      DemandeValidationConsoTempsAccPers dctap = new DemandeValidationConsoTempsAccPers(
          formAjout.getId(), manager.getCurrentAnneeScolaire(),
          formAjout.getDate(), formAjout.getMinutes(),
          manager.getUserById(formAjout.getProfId()), acc,
          manager.getUserById(formAjout.getEleveId()), formAjout.getEtat());

      if (dctap.getMinutes() % 10 == 0 && dctap.getMinutes() <= 300
          && dctap.getMinutes() != 0) {
        manager.addDVCTAP(dctap);
      } else {
        bindResult.rejectValue("date", "required",
            "La durée de l'AP est invalide !");
        return "eleve/doajout";
View Full Code Here

    }
  }

  @RequestMapping(value = "refuse/{id}", method = RequestMethod.GET)
  public String refuseDCTAPById(@PathVariable String id, Model model) {
    DemandeValidationConsoTempsAccPers dctap = manager.getDVCTAPById(Long
        .valueOf(id));

    // Test que la DCTAP appartient à la bonne personne
    if (dctap.getEleve().equals(UtilSession.getUserInSession())
        && dctap.getEtat() > 1023) {
      try {
        dctap.transitionRejeteeParEleve();
        manager.updateDVCTAP(dctap);
      } catch (DVCTAPException e) {
        // TODO redirect error view
      }
    }
View Full Code Here

    return "redirect:/app/eleve/mesdctap";
  }

  @RequestMapping(value = "valid/{id}", method = RequestMethod.GET)
  public String validDCTAPById(@PathVariable String id, Model model) {
    DemandeValidationConsoTempsAccPers dctap = manager.getDVCTAPById(Long
        .valueOf(id));

    // Test que la DCTAP appartient à la bonne personne
    if (dctap.getEleve().equals(UtilSession.getUserInSession())
        && dctap.getEtat() > 1023) {
      dctap.setDctapConfirme();
      manager.updateDVCTAP(dctap);
    }

    return "redirect:/app/eleve/mesdctap";
  }
View Full Code Here

  private static final class DemandeMapper implements
      RowMapper<DemandeValidationConsoTempsAccPers> {
    public DemandeValidationConsoTempsAccPers mapRow(ResultSet rs,
        int rowNum) throws SQLException {
      DemandeValidationConsoTempsAccPers dctap = new DemandeValidationConsoTempsAccPers();
      dctap.setId(rs.getLong("id"));
      dctap.setAnneeScolaire(rs.getString("anneeScolaire"));
      dctap.setDateAction(rs.getDate("dateAction"));
      dctap.setMinutes(rs.getInt("dureeAP"));
      dctap.setEtat(rs.getInt("Etat"));

      Long idProf = rs.getLong("idProf");
      Long idEleve = rs.getLong("idEleve");
      int idAP = rs.getInt("idAP");

      UserDAOJdbc userDao = new UserDAOJdbc();
      AccPersonnaliseDAOJdbc accPersonnalise = new AccPersonnaliseDAOJdbc();
      User prof = userDao.getUserById(idProf);
      User eleve = userDao.getUserById(idEleve);
      AccPersonalise ap = accPersonnalise.getAPById(idAP);

      dctap.setProf(prof);
      dctap.setEleve(eleve);
      dctap.setAccPers(ap);

      return dctap;
    }
View Full Code Here

  public String editDCTAPById(@RequestParam("id") String id,
      FormListConsoForProfInter dctap, Model model) {

    model.addAttribute("lesAP", manager.getAllAPForProf());

    DemandeValidationConsoTempsAccPers currentDctap = manager
        .getDVCTAPById(Long.valueOf(id));
    if (currentDctap.getEtat() == 0 || currentDctap.getEtat() == 4
        || currentDctap.getEtat() > 1023) {
      // valorise le bean de vue avec le dctap courant
      dctap.setId(currentDctap.getId()); // en provenance d'un champ caché
      dctap.setDateAction(currentDctap.getDateAction());
      dctap.setMinutes(currentDctap.getMinutes());
      model.addAttribute("minute", currentDctap.getMinutes());
      dctap.setAccPersId(currentDctap.getAccPers().getId());

      return "prof-intervenant/edit";
    }
    return "prof-intervenant/index";
  }
View Full Code Here

TOP

Related Classes of org.ldv.sio.getap.app.DemandeValidationConsoTempsAccPers

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.