Package modele.chauffeur

Examples of modele.chauffeur.PeriodeDeTravail


            smt = connection
                .prepareStatement(GET_PERIODE_TRAVAIL_BY_ID);
            smt.setInt(1, id);
            res = smt.executeQuery();
            if (res.next()) {
              result[0] = new PeriodeDeTravail(res.getInt(1));
              result[0].setDescriptionPeriodeTravail(res
                  .getString(2));

              Chauffeur chauffeur = new Chauffeur(res.getInt(3));
              chauffeur.setNom(res.getString(4));
View Full Code Here


          try {
            smt = connection
                .prepareStatement(GET_ALL_PERIODE_TRAVAIL);
            res = smt.executeQuery();
            while (res.next()) {
              PeriodeDeTravail periodeDeTravail = new PeriodeDeTravail(
                  res.getInt(1));
              periodeDeTravail.setDescriptionPeriodeTravail(res
                  .getString(2));

              Chauffeur chauffeur = new Chauffeur(res.getInt(3));
              chauffeur.setNom(res.getString(4));
              periodeDeTravail.setChauffeur(chauffeur);

              Contrat contrat = new Contrat(res.getInt(5));
              contrat.setStatut(res.getString(6));
              periodeDeTravail.setContrat(contrat);

              MotifFinContrat motifFinContrat = new MotifFinContrat(
                  res.getInt(7));
              motifFinContrat.setLibelle(res.getString(8));
              periodeDeTravail
                  .setMotifFinContrat(motifFinContrat);

              Date dateDeb = new Date(res.getDate(9).getTime());
              periodeDeTravail.setDateDebut(dateDeb);

              java.sql.Date sqlDateFin = res.getDate(10);
              Date dateFin = sqlDateFin == null ? null : new Date(sqlDateFin.getTime());
              periodeDeTravail.setDateFin(dateFin);

              Etat etat = new Etat(res.getInt(11));
              etat.setDescrip(res.getString(12));
              periodeDeTravail.setEtat(etat);

              listePeriodeDeTravail.add(periodeDeTravail);
            }
          } finally {
            try {
View Full Code Here

            smt = connection
                .prepareStatement(GET_PERIODE_TRAVAIL_BY_CHAUFFEUR);
            smt.setInt(1, chauffeur.getId());
            res = smt.executeQuery();
            while (res.next()) {
              PeriodeDeTravail periodeDeTravail = new PeriodeDeTravail(
                  res.getInt(1));
              periodeDeTravail.setDescriptionPeriodeTravail(res
                  .getString(2));

              Chauffeur chauffeur = new Chauffeur(res.getInt(3));
              chauffeur.setNom(res.getString(4));
              periodeDeTravail.setChauffeur(chauffeur);

              Contrat contrat = new Contrat(res.getInt(5));
              contrat.setStatut(res.getString(6));
              periodeDeTravail.setContrat(contrat);

              MotifFinContrat motifFinContrat = new MotifFinContrat(
                  res.getInt(7));
              motifFinContrat.setLibelle(res.getString(8));
              periodeDeTravail
                  .setMotifFinContrat(motifFinContrat);

              Date dateDeb = new Date(res.getDate(9).getTime());
              periodeDeTravail.setDateDebut(dateDeb);

              java.sql.Date sqlDateFin = res.getDate(10);
              final Date dateFin;
              if (sqlDateFin != null) {
                dateFin = new Date(sqlDateFin.getTime());
              } else {
                dateFin = null;
              }
              periodeDeTravail.setDateFin(dateFin);

              Etat etat = new Etat(res.getInt(11));
              etat.setDescrip(res.getString(12));
              periodeDeTravail.setEtat(etat);

              periodesDeTravail.add(periodeDeTravail);
            }
          } finally {
            try {
View Full Code Here

            smt = connection
                .prepareStatement(GET_PERIODE_TRAVAIL_BY_CODE);
            smt.setString(1, codePeriode);
            res = smt.executeQuery();
            if (res.next()) {
              result[0] = new PeriodeDeTravail(res.getInt(2));
            }
          } finally {
            try {
              if (res != null) {
                res.close();
View Full Code Here

    try {
      dlgDialog = new PeriodeTravailEditionFenetre();
      dlgDialog.affiche();

      if (dlgDialog.OK_Button()) {
        PeriodeDeTravail periodeTravail = dlgDialog.renvoiPeriodeTravail();
        getPeriodeTravailDao().insert(periodeTravail);
      }
    } catch (PrjException e) {
      throw new PrjException(e.RetourMessage());
    }
View Full Code Here

    public int getRowCount() {
      return periodesDeTravail.size();
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
      PeriodeDeTravail periodeDeTravailAtRow = periodesDeTravail.get(rowIndex);
      switch (columnIndex) {
      case COLONNE_ID:
        return periodeDeTravailAtRow.getId();
      case COLONNE_DESCRIPTION:
        return periodeDeTravailAtRow.getDescriptionPeriodeTravail();
      case COLONNE_NOM_CHAUFFEUR:
        return periodeDeTravailAtRow.getChauffeur().getNom();
      case COLONNE_STATUT:
        return periodeDeTravailAtRow.getContrat().getStatut();     
      case COLONNE_MOTIF_FIN_CONTRAT:
        return periodeDeTravailAtRow.getMotifFinContrat().getLibelle();
      case COLONNE_DATE_DEBUT:
        return new SimpleDateFormat(MotsCleProjet.DATE_FORMAT).format(periodeDeTravailAtRow.getDateDebut());       
      case COLONNE_DATE_FIN:
        Date dateFin = periodeDeTravailAtRow.getDateFin();
        if (dateFin != null) {
          return new SimpleDateFormat(MotsCleProjet.DATE_FORMAT).format(dateFin);
        } else {
          return "";
        }
      case COLONNE_ETAT:
        return periodeDeTravailAtRow.getEtat().getDescrip();
     
      default:
        throw new IllegalStateException("Le nombre de colonne ne peut pas d�passer " + NOMBRE_COLONNE + ". index demand� " + columnIndex);
      }
    }
View Full Code Here

        int column) {
      Component cellule = super.getTableCellRendererComponent(table, value, isSelected, hasFocus,
          row, column);
     
      PeriodeTravailTableModel model = (PeriodeTravailTableModel)table.getModel();
      PeriodeDeTravail periodeDeTravail = model.getAt(row);
     
      Etat etat = periodeDeTravail.getEtat();
      Periode periode  = new Periode(periodeDeTravail.getDateDebut(), periodeDeTravail.getDateFin());

      Date aujourdhui = new Date();
      if (!etat.getDescrip().equals("Inactif") && periode.inclue(aujourdhui)) {
        cellule.setBackground(MotsCleProjet.COULEUR_BLEUE);
      } else {
View Full Code Here

TOP

Related Classes of modele.chauffeur.PeriodeDeTravail

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.