Package org.ldv.sio.getap.app

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


      }

      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"));
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"));
View Full Code Here

      Model model) {

    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());
View Full Code Here

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

    Classe classe = new Classe();
    classe.setNom(formAjout.getNom());
    manager.addClasse(classe);

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

  }

  @RequestMapping(value = "editClasse", method = RequestMethod.GET)
  public String editClasse(@RequestParam("id") String id,
      FormAjoutClasse formAjout, Model model) {
    Classe classe = manager.getClasseById(Integer.valueOf(id));
    formAjout.setNom(classe.getNom());
    return "admin/editClasse";
  }
View Full Code Here

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

      Classe classe = manager.getClasseById(Integer.valueOf(formEdit
          .getId()));
      classe.setNom(formEdit.getNom());
      manager.upDateClasse(classe);

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

  }

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

    Classe classe = manager.getClasseById(Integer.valueOf(id));

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

  }
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"));
View Full Code Here

        .query("select * from classe where libelle != 'null' order by libelle",
            new ClasseMapper());
  }

  public Classe getClasseById(int id) {
    Classe classe;
    try {
      classe = this.jdbcTemplate.queryForObject(
          "select * from classe where id = ?", new Object[] { id },
          new ClasseMapper());
    } catch (EmptyResultDataAccessException e) {
View Full Code Here

    this.jdbcTemplate = new JdbcTemplate(dataSource);
  }

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

TOP

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

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.