Package gui.util

Examples of gui.util.ErreurDeValidation


      try {
        dateFichePaie = new SimpleDateFormat(gui.MotsCleProjet.DATE_FORMAT).parse(textDatePaie.getText());
        fichePaie.setDatePaie(dateFichePaie);
      } catch (ParseException e1) {
       
        erreursDeValidation.add(new ErreurDeValidation(textDatePaie, "le format date est invalide' "+ gui.MotsCleProjet.DATE_FORMAT));
       
        //TaxiGuiUtil.MessageBox(MainWindow.desktop(), "Le format de date est invalide : attendu " + gui.MotsCleProjet.DATE_FORMAT, "Erreur");
      }
     
      if (textNbJrPreste.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textNbJrPreste.ChampsTxt, "nombre de jour  est obligatoire"));
      }
      try {
        Integer.parseInt(textNbJrPreste.ChampsTxt.getText());
      } catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(textNbJrPreste.ChampsTxt, "nombre de jour  n'est pas un nombre"));
      }
     
      if (textNbHrPreste.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textNbHrPreste.ChampsTxt, "nombre heure  est obligatoire"));
      }
     
     
      if (textRecSalBrut.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textRecSalBrut.ChampsTxt, "la recette chauffeur est obligatoire"));
      }
      try {
        new BigDecimal(textRecSalBrut.ChampsTxt.getText());
      } catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(textRecSalBrut.ChampsTxt, "la recette n'est pas un nombre"));
      }
     
     
      if (textBrutOnss.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textBrutOnss.ChampsTxt, "Brut ONSS est obligatoire"));
      }
      try {
        new BigDecimal(textBrutOnss.ChampsTxt.getText());
      } catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(textBrutOnss.ChampsTxt, "Brut ONSS n'est pas un nombre"));
      }
     
      if (textPreCpteProf.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textPreCpteProf.ChampsTxt, "Pr�compte professionnel est obligatoire"));
      }
      try {
        new BigDecimal(textPreCpteProf.ChampsTxt.getText());
      } catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(textPreCpteProf.ChampsTxt, "Pr�compte professionnel n'est pas un nombre"));
      }
     
      if (textIndemi.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textIndemi.ChampsTxt, "Idemnit� est obligatoire"));
      }
      try {
        new BigDecimal(textIndemi.ChampsTxt.getText());
      } catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(textIndemi.ChampsTxt, "indemni n'est pas un nombre"));
      }
     
      if (textCotisSecu.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textCotisSecu.ChampsTxt, "cotisation s�cu est obligatoire"));
      }
      try {
        new BigDecimal(textCotisSecu.ChampsTxt.getText());
      } catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(textCotisSecu.ChampsTxt, "Cotisation s�cu n'est pas un nombre"));
      }

     
      if (textChrgPatronal.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textChrgPatronal.ChampsTxt, "charge patronal est obligatoire"));
      }
      try {
        new BigDecimal(textChrgPatronal.ChampsTxt.getText());
      } catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(textChrgPatronal.ChampsTxt, "charge patronal n'est pas un nombre"));
      }
     
      if (textReducBasRevenu.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textReducBasRevenu.ChampsTxt, "reduction bas revenu est obligatoire"));
      }
      try {
        new BigDecimal(textReducBasRevenu.ChampsTxt.getText());
      } catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(textReducBasRevenu.ChampsTxt, "reduction bas revenu n'est pas un nombre"));
      }
     
      if (textReducBasRevenu.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textReducBasRevenu.ChampsTxt, "reduction bas revenu est obligatoire"));
      }
      try {
        new BigDecimal(textReducBasRevenu.ChampsTxt.getText());
      } catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(textReducBasRevenu.ChampsTxt, "reduction bas revenu n'est pas un nombre"));
      }
     
      if (!erreursDeValidation.isEmpty()) {
        StringBuffer erreurAffichee = new StringBuffer();
        for (ErreurDeValidation erreurDeValidation : erreursDeValidation) {
View Full Code Here


  private Collection<ErreurDeValidation> validateDebutTourn�e() {
   
    Collection<ErreurDeValidation> erreursDeValidation = new ArrayList<ErreurDeValidation>();
   
    if (cmbChauffeur.getSelectedIndex() == -1) {
      erreursDeValidation.add(new ErreurDeValidation(cmbChauffeur, "le chauffeur est obligatoire"));
    }
   
    if (cmbVoiture.getSelectedIndex() == -1) {
      erreursDeValidation.add(new ErreurDeValidation(cmbVoiture, "la voiture est obligatoire"));
    }
   
    try {
      new SimpleDateFormat(MotsCleProjet.DATE_TIME_FORMAT).parse(textDateDebutTournee.getText());
    } catch (ParseException e) {
      erreursDeValidation.add(new ErreurDeValidation(textDateDebutTournee, "la date de d�but de tourn�e est invalide"));
    }
   
    if (textIndexKmBordDebut.getText().trim().equals("")) {
      erreursDeValidation.add(new ErreurDeValidation(textDateDebutTournee, "le kilom�trage tableau de bord de d�but de tourn�e est obligatoire"));
    }   
    try {
      Long.parseLong(textIndexKmBordDebut.getText());
    } catch (NumberFormatException e) {
      erreursDeValidation.add(new ErreurDeValidation(textIndexKmBordDebut, "le kilom�trage tableau de bord de d�but de tourn�e n'est pas un nombre"));
    }

    if (textIndexKmTxmtDebut.getText().trim().equals("")) {
      erreursDeValidation.add(new ErreurDeValidation(textIndexKmTxmtDebut, "le kilom�trage taxim�tre de d�but de tourn�e est obligatoire"));
    }   
    try {
      Long.parseLong(textIndexKmTxmtDebut.getText());
    } catch (NumberFormatException e) {
      erreursDeValidation.add(new ErreurDeValidation(textIndexKmTxmtDebut, "le kilom�trage taxim�tre de d�but de tourn�e n'est pas un nombre"));
   
   
    Long kmBord = Long.parseLong(textIndexKmBordDebut.getText());
    Long kmTaxiMtDeb = Long.parseLong(textIndexKmTxmtDebut.getText());
    if (kmTaxiMtDeb.longValue() > kmBord ) {
      erreursDeValidation.add(new ErreurDeValidation(textIndexKmTxmtDebut, "km taxim�tre de d�but doit �tre inf�rieur ou �gal au  Km bord d�but "));
    }

    if (textIndexKmChrgDebut.getText().trim().equals("")) {
      erreursDeValidation.add(new ErreurDeValidation(textIndexKmChrgDebut, "le kilom�trage en charge de d�but de tourn�e est obligatoire"));
    }
    try {
      Long.parseLong(textIndexKmChrgDebut.getText());
    } catch (NumberFormatException e) {
      erreursDeValidation.add(new ErreurDeValidation(textIndexKmChrgDebut, "le kilom�trage en charge de d�but de tourn�e n'est pas un nombre"));
    }
   
    Long kmCharge = Long.parseLong(textIndexKmChrgDebut.getText());
    if (kmCharge.longValue() > kmBord) {
      erreursDeValidation.add(new ErreurDeValidation(textIndexKmChrgDebut, "km charge d�but doit �tre inf�rieur ou �gal au  Km bord d�but "));
    }
   
    if (kmCharge.longValue() > kmTaxiMtDeb)  {
      erreursDeValidation.add(new ErreurDeValidation(textIndexKmChrgDebut, "km charge d�but doit �tre < = km taxim�tre d�but"));
    }

    if (textNbPriseDebut.getText().trim().equals("")) {
      erreursDeValidation.add(new ErreurDeValidation(textNbPriseDebut, "Le nombre de prise en charge de d�but de tourn�e est obligatoire"));
    }
    try {
      Integer.parseInt(textNbPriseDebut.getText());
    } catch (NumberFormatException e) {
      erreursDeValidation.add(new ErreurDeValidation(textNbPriseDebut, "Le nombre de prise en charge de d�but de tourn�e n'est pas un nombre"));
    }

    if (textChuteDebut.getText().trim().equals("")) {
      erreursDeValidation.add(new ErreurDeValidation(textChuteDebut, "L'index de chute de bord de d�but de tourn�e est obligatoire"));
    }
    try {
      new BigDecimal(textChuteDebut.getText());
    } catch (NumberFormatException e) {
      erreursDeValidation.add(new ErreurDeValidation(textChuteDebut, "L'index de chute de d�but de tourn�e n'est pas un nombre"));
    }
    return erreursDeValidation;
  }
View Full Code Here

      BigDecimal tarif1 = null;     
      try {
        tarif1 =new BigDecimal(txtTarif1.ChampsTxt.getText());
      }
      catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(txtTarif1.ChampsTxt, "le texte introduit pour le tarif 1 n'est pas un nombre d�cimal"));
      }
     
      BigDecimal tarif2 = null;
      try {
        tarif2 =new BigDecimal(txtTarif2.ChampsTxt.getText());
      }
      catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(txtTarif2.ChampsTxt, "le texte introduit pour le tarif 2 n'est pas un nombre d�cimal"));
      }
     
      BigDecimal priseEnCharge = null;
      try {
        priseEnCharge = new BigDecimal(txtPriseEnChrgTJr.ChampsTxt.getText());
      }
      catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(txtPriseEnChrgTJr.ChampsTxt, "le texte introduit pour la prise en charge n'est pas un nombre d�cimal"));
      }
     
      BigDecimal heureAttente = null;
      try {
        heureAttente = new BigDecimal(txtPrixHrAtt.ChampsTxt.getText());
      }
      catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(txtPrixHrAtt.ChampsTxt, "le texte introduit pour prix heure d'attente n'est pas un nombre d�cimal"));
      }
     
      BigDecimal supplementNuit = null;
      try {
        supplementNuit = new BigDecimal(txtPrixSupplForfaitTNuit.ChampsTxt.getText());
      }
      catch (NumberFormatException ex) {
        erreursDeValidation.add(new ErreurDeValidation(txtPrixSupplForfaitTNuit.ChampsTxt, "le texte introduit pour supplement nuit n'est pas un nombre d�cimal"));
      }
     
     
           
      if (!erreursDeValidation.isEmpty()) {
View Full Code Here

     
     
      Vector<ErreurDeValidation> erreursDeValidation = new Vector<ErreurDeValidation>();
     
      if (textLibelle.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textLibelle.ChampsTxt, "le champ 'motif fin contrat' est obligatoire."));
      }
     
     
      if (!erreursDeValidation.isEmpty()) {
        StringBuffer erreurAffichee = new StringBuffer();
View Full Code Here

    String cmd = e.getActionCommand();
    if (CMD_OK.equals(cmd)) {
     
      Vector<ErreurDeValidation> erreursDeValidation = new Vector<ErreurDeValidation>();
      if (textLibelle.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textLibelle.ChampsTxt, "le champ 'description p�riode contrat' est obligatoire."));
      }
     
      Date dateDebut = null;
      try {
        dateDebut = new SimpleDateFormat(gui.MotsCleProjet.DATE_FORMAT).parse(textDtDebCont.getText());
        periodeDeTravail.setDateDebut(dateDebut);
      } catch (ParseException e1) {
        //TaxiGuiUtil.MessageBox(MainWindow.desktop(), "Le format de date est invalide : attendu " + gui.MotsCleProjet.DATE_FORMAT, "Erreur");
        erreursDeValidation.add(new ErreurDeValidation(textDtDebCont, "le champ 'date d�but  p�riode contrat' est obligatoire: attendu " + gui.MotsCleProjet.DATE_FORMAT));
      }
     
      Date dateFin = null;
      if (textDtFinCont.getText().trim().equals("")) {
        periodeDeTravail.setDateFin(null);
      } else {
        try {
          dateFin = new SimpleDateFormat(gui.MotsCleProjet.DATE_FORMAT).parse(textDtFinCont.getText());
          periodeDeTravail.setDateFin(dateFin);
        } catch (ParseException e1) {
          //TaxiGuiUtil.MessageBox(MainWindow.desktop(), "Le format de date est invalide : attendu " + gui.MotsCleProjet.DATE_FORMAT, "Erreur");
          erreursDeValidation.add(new ErreurDeValidation(textDtFinCont, "le champ 'date d�but  p�riode contrat' est obligatoire: attendu " + gui.MotsCleProjet.DATE_FORMAT));
        }
      }
     
      if (dateDebut != null) {
        // v�rifier que le chauffeur n'a pas de de p�riode de travail pour les dates sp�cifi�es.
        Collection<PeriodeDeTravail> periodesDeTravailExistantesDuChauffeur = getPeriodeDeTravailDao().findByChauffeur(getChauffeurSelectionne());
        for (PeriodeDeTravail periodeDeTravailExistante : periodesDeTravailExistantesDuChauffeur) {
          if (!periodeDeTravailExistante.getId().equals(periodeDeTravail.getId())) {
            if (periodeDeTravailExistante.getPeriode().couvre(new Periode(dateDebut, dateFin))) {
              erreursDeValidation.add(new ErreurDeValidation(textDtFinCont, "Une p�riode de travail est d�j� d�finie porula p�riode [" + new SimpleDateFormat(MotsCleProjet.DATE_FORMAT).format(dateDebut) + "," + (dateFin != null ? new SimpleDateFormat(MotsCleProjet.DATE_FORMAT).format(dateFin) : "<null>" )+ "]"));
            }
          }
        }
      }
      if (!erreursDeValidation.isEmpty()) {
View Full Code Here

     
     
Vector<ErreurDeValidation> erreursDeValidation = new Vector<ErreurDeValidation>();
     
      if (textStatut.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textStatut.ChampsTxt, "le champ 'statut contrat' est obligatoire."));
      }
     
     
      if (!erreursDeValidation.isEmpty()) {
        StringBuffer erreurAffichee = new StringBuffer();
View Full Code Here

    if (CMD_OK.equals(cmd)) {     

      Vector<ErreurDeValidation> erreursDeValidation = new Vector<ErreurDeValidation>();
     
      if (textCodePays.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textCodePays.ChampsTxt, "le champ 'code pays' est obligatoire."));
      }
     
      if (textNomPays.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textNomPays.ChampsTxt, "le champ 'nom pays' est obligatoire."));
      }
     
     
      if (!erreursDeValidation.isEmpty()) {
        StringBuffer erreurAffichee = new StringBuffer();
View Full Code Here

    if (CMD_OK.equals(cmd)) {
     
      Vector<ErreurDeValidation> erreursDeValidation = new Vector<ErreurDeValidation>();
     
      if (textDescrip.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textDescrip.ChampsTxt, "le champ 'etat' est obligatoire."));
      }
      else if (textTypeEtat.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textTypeEtat.ChampsTxt, "le champ 'type etat' est obligatoire."));
      }
     
     
      if (!erreursDeValidation.isEmpty()) {
        StringBuffer erreurAffichee = new StringBuffer();
View Full Code Here

    if (CMD_OK.equals(cmd)) {
     
      Vector<ErreurDeValidation> erreursDeValidation = new Vector<ErreurDeValidation>();
     
      if (textLibelle.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textLibelle.ChampsTxt, "le champ 'mod�le voiture' est obligatoire."));
      }
     
     
      if (!erreursDeValidation.isEmpty()) {
        StringBuffer erreurAffichee = new StringBuffer();
View Full Code Here

     
      Vector<ErreurDeValidation> erreursDeValidation = new Vector<ErreurDeValidation>();
     
           
      if (textLibelle.ChampsTxt.getText().trim().equals("")) {
        erreursDeValidation.add(new ErreurDeValidation(textLibelle.ChampsTxt, "le champ 'type contrat' est obligatoire."));
      }
      typeEntretien.setLibelle(textLibelle.ChampsTxt.getText());
     
      if (!erreursDeValidation.isEmpty()) {
        StringBuffer erreurAffichee = new StringBuffer();
View Full Code Here

TOP

Related Classes of gui.util.ErreurDeValidation

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.