Package org.ldv.sio.getap.app

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


      }

      DisciplineDAOJdbc disciplineDao = new DisciplineDAOJdbc();
      ClasseDAOJdbc classeDao = new ClasseDAOJdbc();
      Classe classe = classeDao.getClasseById(rs.getInt("idClasse"));
      Discipline dis = disciplineDao.getDisciplineById(rs
          .getInt("idDiscipline"));
      user.setDiscipline(dis);
      user.setClasse(classe);
      user.setLogin(rs.getString("login"));
      user.setPass(rs.getString("mdp"));
View Full Code Here


      }

      DisciplineDAOJdbc disciplineDao = new DisciplineDAOJdbc();
      ClasseDAOJdbc classeDao = new ClasseDAOJdbc();
      Classe classe = classeDao.getClasseById(rs.getInt("idClasse"));
      Discipline dis = disciplineDao.getDisciplineById(rs
          .getInt("idDiscipline"));
      user.setDiscipline(dis);
      user.setClasse(classe);
      user.setLogin(rs.getString("login"));
      user.setPass(rs.getString("mdp"));
View Full Code Here

        "select * from discipline order by libelle",
        new DisciplineMapper());
  }

  public Discipline getDisciplineById(int id) {
    Discipline dis;
    try {
      dis = this.jdbcTemplate.queryForObject(
          "select * from discipline where id = ?",
          new Object[] { id }, new DisciplineMapper());

View Full Code Here

  }

  private static final class DisciplineMapper implements
      RowMapper<Discipline> {
    public Discipline mapRow(ResultSet rs, int rowNum) throws SQLException {
      Discipline dis = new Discipline();
      dis.setId(rs.getInt("id"));
      dis.setNom(rs.getString("libelle"));
      return dis;
    }
View Full Code Here

    if (bindResult.hasErrors())
      return "admin/ajoutUser";
    else {
      Classe classe = manager.getClasseById(formAjout.getClasseId());
      User user = null;
      Discipline dis = null;
      if (formAjout.getRoleNom().startsWith("prof")) {
        dis = new Discipline(formAjout.getDisciplineId(),
            formAjout.getDisciplineNom());
      }
      if (formAjout.getRoleNom().equals("prof-intervenant")
          || formAjout.getRoleNom().equals("admin"))
        classe = null;
View Full Code Here

  @RequestMapping(value = "doajoutDiscipline", method = RequestMethod.POST)
  public String doajoutDiscipline(FormAjoutDiscipline formAjout,
      BindingResult bindResult, Model model) {

    Discipline dis = new Discipline();
    dis.setNom(formAjout.getNom());

    manager.addDiscipline(dis);

    return "redirect:/app/admin/logiciel";
  }
View Full Code Here

  }

  @RequestMapping(value = "editDiscipline", method = RequestMethod.GET)
  public String editDiscipline(@RequestParam("id") String id,
      FormAjoutDiscipline formAjout, Model model) {
    Discipline dis = manager.getDisciplineById(Integer.valueOf(id));
    formAjout.setNom(dis.getNom());
    return "admin/editDiscipline";
  }
View Full Code Here

    if (bindResult.hasErrors()) {
      System.out.println("ERROR");
      return "redirect:/app/admin/logiciel";
    } else {

      Discipline dis = manager.getDisciplineById(Integer.valueOf(formEdit
          .getId()));
      dis.setNom(formEdit.getNom());
      manager.upDateDiscipline(dis);

      return "redirect:/app/admin/logiciel";
    }
  }
View Full Code Here

  }

  @RequestMapping(value = "deleteDiscipline/{id}", method = RequestMethod.GET)
  public String deleteDisciplineById(@PathVariable String id, Model model) {

    Discipline dis = manager.getDisciplineById(Integer.valueOf(id));

    if (!dis.getNom().equals(null)) {
      manager.deleteDiscipline(dis);
    }
    return "redirect:/app/admin/logiciel";

  }
View Full Code Here

      return "admin/editUser";
    } else {

      User userForUpdate = manager.getUserById(Long.valueOf(formUser
          .getId()));
      Discipline dis = null;
      if (formUser.getRoleNom().startsWith("prof")) {
        dis = new Discipline(formUser.getDisciplineId(),
            formUser.getDisciplineNom());
      }
      userForUpdate.setNom(formUser.getNom());
      userForUpdate.setPrenom(formUser.getPrenom());
      userForUpdate.setRole(formUser.getRoleNom());
View Full Code Here

TOP

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

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.