1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| public int nbTotalDispo(int nbE,int nbC,int nbS,Hashtable info_inter) throws Exception
{
int nbToD = 0;
int nb = 0;
int qntr ;
Iterator iter = info_inter.keySet().iterator();
//Tant qu'il y a encore un enseignant
while (iter.hasNext()){
Hashtable hash = (Hashtable) info_inter.get(iter.next());
String qtite = (String)hash.get("quantitetempstravail");
String st = (String)hash.get("statut");
qntr = Integer.parseInt(qtite);
String s = st.toString();
nb = (nbS+nbC)* qntr;
nbToD = nb - nbE;
System.out.println("Je recupere : "+nbToD);
}
}
return nbToD;
}
public static void main(String[] args)throws Exception {
Mysql mysql = new Mysql();
mysql.Connect("services");
NbTotalDispo nb = new NbTotalDispo();
int res = nb.nbTotalDispo(..parametres..);
System.out.println("Resultat :"+res);
} |
Partager