$
This commit is contained in:
parent
a96049791d
commit
f956c07bef
Binary file not shown.
Binary file not shown.
@ -44,7 +44,7 @@ public class AdminView extends BFrame {
|
||||
settings.setPositionY(2);
|
||||
JButton addStudGrup = new JButton("Ajouter un etudiant dans un groupe");
|
||||
addStudGrup.addActionListener(this.listener);
|
||||
addStudGrup.setActionCommand("TODO");
|
||||
addStudGrup.setActionCommand("av::AddStudGrup");
|
||||
this.add(addStudGrup, settings);
|
||||
|
||||
this.setResizable(false);
|
||||
|
@ -36,10 +36,10 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
this.g = this.db.getGroupeList();
|
||||
|
||||
// Les 3 fenetres s'ouvriront en meme temps (Pour le contexte du projet)
|
||||
this.pv = new ProfView(e, g, this);
|
||||
System.out.println("[+] Demarrage de la vue professeur -> " + pv);
|
||||
this.av = new AdminView(e, g, this);
|
||||
System.out.println("[+] Demarrage de la vue Administrateur -> " + av);
|
||||
this.pv = new ProfView(this.e, this.g, this);
|
||||
System.out.println("[+] Demarrage de la vue professeur -> " + this.pv);
|
||||
this.av = new AdminView(this.e, this.g, this);
|
||||
System.out.println("[+] Demarrage de la vue Administrateur -> " + this.av);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -285,7 +285,41 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
);
|
||||
}
|
||||
|
||||
else if(Objects.equals(command, "crtll::ActionMoveGrup")) {
|
||||
else if(Objects.equals(command, "av::AddStudGrup")) {
|
||||
Object[][] data = new Object[this.e.size()][3];
|
||||
|
||||
String[] titre = {
|
||||
"Nom",
|
||||
"Prenom",
|
||||
"Groupe",
|
||||
"Action"
|
||||
};
|
||||
|
||||
for(int i = 0; i <= this.e.size()-1; i++) {
|
||||
if(this.e.get(i).getGroupe() == -1) {
|
||||
Object[] info = {
|
||||
this.e.get(i).getNom(),
|
||||
this.e.get(i).getPrenom(),
|
||||
String.valueOf(this.e.get(i).getGroupe()),
|
||||
"[AJOUTER]"
|
||||
};
|
||||
|
||||
data[i] = info;
|
||||
}
|
||||
}
|
||||
|
||||
DisplayWithListner(
|
||||
this.av,
|
||||
"Attriuer un groupe a un etudiant",
|
||||
350,
|
||||
400,
|
||||
this.av.getX(),
|
||||
this.av.getY(),
|
||||
this.createJTable(data, titre)
|
||||
);
|
||||
}
|
||||
|
||||
else if(Objects.equals(command, "crtll::ActionAddAndMoveGrup")) {
|
||||
this.tmpStud.add(String.valueOf(this.list.getSelectedIndex()));
|
||||
|
||||
String query =
|
||||
@ -377,7 +411,7 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
settings.setPositionX(6);
|
||||
settings.setPositionY(0);
|
||||
JButton moveBtn = new JButton("Deplacer");
|
||||
moveBtn.setActionCommand("crtll::ActionMoveGrup");
|
||||
moveBtn.setActionCommand("crtll::ActionAddAndMoveGrup");
|
||||
moveBtn.addActionListener(this);
|
||||
forModal.add(moveBtn, settings);
|
||||
|
||||
@ -392,6 +426,10 @@ public class Controller implements ActionListener, ListSelectionListener {
|
||||
forModal
|
||||
);
|
||||
}
|
||||
|
||||
if(Objects.equals(value, "[AJOUTER]")) {
|
||||
System.out.println("Ajout");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user