Package net.fqsc.inscriptions.model.evenements

Examples of net.fqsc.inscriptions.model.evenements.Saison


    if (!categorie.getNom().equals("Hardtail"))
    {
      for (final Iterator iter = this.utils.getSaisons().iterator(); iter
          .hasNext();)
      {
        final Saison saison = (Saison) iter.next();
        final CategoriesParticipantes categoriesParticipantes = saison
            .getCategoriesParticipantes();
        categoriesParticipantes.createCategorieParticipante(plaqueMin,
            plaqueMax, plaqueGeleMin, plaqueGeleMax, saison,
            categorie);
View Full Code Here


  private void createTestInscriptions() throws ActionException,
      SelectionException
  {
    final Saisons saisons = this.utils.getSaisons();
    final Saison saison = saisons.getByAnnee(2007).iterator().next();

    final Evenement evenement = saison.getEvenements().getByNo(2)
        .iterator().next();

    Personne personne = this.utils.getPersonnes().getAuthenticatedPersonne(
        "jdoe", "123");
    final Club club = this.utils.getClubs().getByNom("Subway/Genetik")
        .iterator().next();

    final Course course = evenement.getCourses().getByNom("Cross-Country")
        .iterator().next();
    Categorie categorie = this.utils.getCategories().getByCode("XSE", "M");

    final InfoSaison infoSaison = saison.getInfoSaison(personne, categorie);

    final Inscriptions inscriptions = course.getInscriptions();
    inscriptions.createInscription("Commenditaire", "ABC123", "12", course, personne,
        club, categorie);
View Full Code Here

      final String noLicence, final String plaqueUnique,
      final Categorie categorie) throws ActionException,
      SelectionException
  {

    final Saison saison = this.utils.getSaisons().getByAnnee(2007)
        .iterator().next();
    final Evenement evenement = (Evenement) saison.getEvenements().getByNo(
        2).iterator().next();
    final InfosSaison infosSaison = saison.getInfosSaison();
    infosSaison.createInfoSaison(noLicence, plaqueUnique, saison, personne,
        categorie, evenement);

    this.outputErrors(infosSaison);
  }
View Full Code Here

      throw new UniqueException(
          "Il doit y avoir seulement une saison par année. ");
    }

    final Saisons saisons = (Saisons) this.domainModel.getEntry("Saisons");
    final Saison saisonDb = new Saison(this.domainModel);

    saisonDb.setAnnee(saison.getAnnee());
    saisonDb.setActive(saison.getActive());
    saisonDb.setNom(saison.getNom());

    try
    {
      if (!saisons.add(saisonDb))
      {
View Full Code Here

    final Saisons saisons = (Saisons) this.domainModel.getEntry("Saisons");

    try
    {
      final Collection<Saison> coll = saisons.getByAnnee(annee);
      final Saison resultat = Validate.elementUnique(coll);

      return resultat;
    }
    catch (final SelectionException e)
    {
View Full Code Here

    try
    {
      final Saisons saisons = (Saisons) this.domainModel
          .getEntry("Saisons");

      final Saison beforeSaison = (Saison) saisons.retrieveByOid(saison
          .getOid());
      if (!saisons.update(beforeSaison, saison))
      {
        throw new ValidationException(
            "La validation de dmLite à échoué. ");
View Full Code Here

  public ListePlaquePanel(final String id,
      final Map<Parameters, Object> parameters)
  {
    super(id, parameters);

    final Saison saison = (Saison) parameters.get(Parameters.SAISON);

    final WebResource export = new WebResource()
    {
      /**
       *
       */
      private static final long serialVersionUID = -479972350710704177L;

      @Override
      public IResourceStream getResourceStream()
      {
        Collection<PlaqueAttribueeLine> plaques = new Vector<PlaqueAttribueeLine>();

        plaques = CollectionUtils.collect(saison.getInfosSaison()
            .getList(), PlaqueAttribueeLine.TR_INFO_SAISON);

        final SelectionStrategy selectStr = new PlaqueFixeSelectionStrategy(
            saison);
        final OrderingStrategy orderStr = new ComparatorOrderingStrategy(
            PlaqueAttribueeLine.COMP_NOM_PRENOM);

        final HSSFWorkbook wb = new HSSFWorkbook();
        int page = -1;

        final HSSFFont font = wb.createFont();
        font.setFontHeightInPoints((short) 12);
        font.setFontName("Arial");

        final HSSFCellStyle style = wb.createCellStyle();
        style.setFont(font);

        for (final Iterator iter = saison.getCategoriesParticipantes()
            .iterator(); iter.hasNext();)
        {
          final CategorieParticipante catPart = (CategorieParticipante) iter
              .next();

          Collection<PlaqueAttribueeLine> plaquesCategorie = selectStr
              .getResult(catPart.getCategorie(), plaques);
          plaquesCategorie = orderStr.getResult(plaquesCategorie);

          final Iterator<PlaqueAttribueeLine> itLine = plaquesCategorie
              .iterator();

          while (itLine.hasNext())
          {
            final HSSFSheet sheet = this.newSheet(wb, catPart
                .getCategorie(), ++page);
            sheet.getPrintSetup().setLandscape(true);

            for (short j = 0; j < ListePlaquePanel.COLONNES_PAR_PAGE; j++)
            {
              for (short k = 0; k < ListePlaquePanel.LIGNES_PAR_PAGE; k++)
              {
                if (itLine.hasNext())
                {
                  final PlaqueAttribueeLine line = itLine
                      .next();

                  final HSSFRow row = sheet.createRow(this
                      .getIndexLigne(k));

                  HSSFCell cell = row
                      .createCell(this
                          .getIndexColonne(
                              j,
                              ListePlaquePanel.INDEX_PLAQUE));
                  cell.setCellValue(line.getPlaque());
                  cell.setCellStyle(style);

                  cell = row.createCell(this.getIndexColonne(
                      j, ListePlaquePanel.INDEX_NOM));
                  cell.setCellValue(line.getNomPrenom());
                  cell.setCellStyle(style);

                  cell = row
                      .createCell(this
                          .getIndexColonne(
                              j,
                              ListePlaquePanel.INDEX_COMMENTAIRE));
                  cell.setCellValue(line.getCommentaire());
                  cell.setCellStyle(style);
                }
                else
                {
                  break;
                }
              }
            }
          }

          page = -1;
        }

        try
        {
          FileOutputStream fileOut = new FileOutputStream("temp.xls");
          wb.write(fileOut);
          fileOut.close();
        }
        catch (FileNotFoundException e)
        {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
        catch (IOException e)
        {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }

        return new FileResourceStream(new File("temp.xls"));
      }

      @Override
      protected void setHeaders(WebResponse response)
      {
        super.setHeaders(response);
        response.setAttachmentHeader("Plaques - "
            + saison.getAnnee().toString() + ".xls");
      }

      private HSSFSheet newSheet(final HSSFWorkbook wb,
          final Categorie categorie, final int page)
      {
View Full Code Here

    this.course = course; 
  }
 
  @Override
  protected void populateItem(final ListItem item) {
    final Saison saison = (Saison) item.getModelObject();
   
    //Construction du lien sélectionner.
    final Map map = new HashMap();
    map.put( ChoixCourse.TypeParameters.COURSE, this.course);
    map.put( ChoixCourse.TypeParameters.SAISON, saison);
View Full Code Here

TOP

Related Classes of net.fqsc.inscriptions.model.evenements.Saison

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.