get membre d'un groupe donné
This commit is contained in:
parent
305927ef1c
commit
3f25c14e3d
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -219,20 +219,6 @@ public class BDatabase {
|
|||||||
return listGroupe;
|
return listGroupe;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Recuperer le nombre de membre d'un groupe
|
|
||||||
*
|
|
||||||
* @param groupe_id le groupes
|
|
||||||
* @return le nombre de membre
|
|
||||||
* */
|
|
||||||
public int getMemberCount(int groupe_id) {
|
|
||||||
ArrayList<String> forCount = this.fetchAll(
|
|
||||||
"SELECT nom FROM fi_eleves WHERE groupe=" + groupe_id);
|
|
||||||
|
|
||||||
return forCount.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recuperer l'hote courant.
|
* Recuperer l'hote courant.
|
||||||
*
|
*
|
||||||
|
@ -36,13 +36,32 @@ public class Controller implements ActionListener, ListSelectionListener {
|
|||||||
this.db = db;
|
this.db = db;
|
||||||
this.e = this.db.getEtuList();
|
this.e = this.db.getEtuList();
|
||||||
this.g = this.db.getGroupeList();
|
this.g = this.db.getGroupeList();
|
||||||
|
System.out.println(this.getMemberCount(-1) + " ");
|
||||||
this.sv = new StudentView(this.e, this.g, this);
|
this.sv = new StudentView(this.e, this.g, this);
|
||||||
this.pv = new ProfView(this.e, this.g, this);
|
this.pv = new ProfView(this.e, this.g, this);
|
||||||
this.av = new AdminView(this.e, this.g, this);
|
this.av = new AdminView(this.e, this.g, this);
|
||||||
this.parent = new MainMenu(this);
|
this.parent = new MainMenu(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Recuperer le nombre de membre d'un groupe
|
||||||
|
*
|
||||||
|
* @param groupe_id le groupes
|
||||||
|
* @return le nombre de membre
|
||||||
|
* */
|
||||||
|
public int getMemberCount(int id) {
|
||||||
|
int j = 0;
|
||||||
|
|
||||||
|
for(int i = 0; i <= this.e.size()-1; i++) {
|
||||||
|
if(this.e.get(i).getGroupe() == id) {
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return j;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pour creer une JTable
|
* Pour creer une JTable
|
||||||
* @param data Les donnees
|
* @param data Les donnees
|
||||||
|
@ -10,6 +10,7 @@ public class TestTexteMNP {
|
|||||||
* */
|
* */
|
||||||
BDatabase db = new BDatabase();
|
BDatabase db = new BDatabase();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Demarrage de l'appli
|
* Demarrage de l'appli
|
||||||
* */
|
* */
|
||||||
|
Loading…
Reference in New Issue
Block a user