diff --git a/build/API/AbstractChangementFactory.class b/build/API/AbstractChangementFactory.class index 7bb0ac2..ad80235 100644 Binary files a/build/API/AbstractChangementFactory.class and b/build/API/AbstractChangementFactory.class differ diff --git a/build/API/AbstractGroupeFactory.class b/build/API/AbstractGroupeFactory.class index b07b9a9..cc61166 100644 Binary files a/build/API/AbstractGroupeFactory.class and b/build/API/AbstractGroupeFactory.class differ diff --git a/build/API/Changement.class b/build/API/Changement.class index 29fe6e5..17a2e8e 100644 Binary files a/build/API/Changement.class and b/build/API/Changement.class differ diff --git a/build/API/Etudiant.class b/build/API/Etudiant.class index 81c1c3d..8313375 100644 Binary files a/build/API/Etudiant.class and b/build/API/Etudiant.class differ diff --git a/build/API/Groupe.class b/build/API/Groupe.class index 2de578e..e814d52 100644 Binary files a/build/API/Groupe.class and b/build/API/Groupe.class differ diff --git a/build/API/MonPrint.class b/build/API/MonPrint.class index 92a67e7..74b2632 100644 Binary files a/build/API/MonPrint.class and b/build/API/MonPrint.class differ diff --git a/build/API/Requete.class b/build/API/Requete.class index 048a674..473e3b5 100644 Binary files a/build/API/Requete.class and b/build/API/Requete.class differ diff --git a/build/API/TypeGroupe.class b/build/API/TypeGroupe.class index 8566d06..64a6111 100644 Binary files a/build/API/TypeGroupe.class and b/build/API/TypeGroupe.class differ diff --git a/build/MNP/AbstractChangementFactoryNP.class b/build/MNP/AbstractChangementFactoryNP.class index 29869c1..e36ab44 100644 Binary files a/build/MNP/AbstractChangementFactoryNP.class and b/build/MNP/AbstractChangementFactoryNP.class differ diff --git a/build/MNP/AbstractGroupeFactoryNP.class b/build/MNP/AbstractGroupeFactoryNP.class index e7f1083..073ee56 100644 Binary files a/build/MNP/AbstractGroupeFactoryNP.class and b/build/MNP/AbstractGroupeFactoryNP.class differ diff --git a/build/MNP/ChangementNP.class b/build/MNP/ChangementNP.class index 98bad41..de445e4 100644 Binary files a/build/MNP/ChangementNP.class and b/build/MNP/ChangementNP.class differ diff --git a/build/MNP/EtudiantNP.class b/build/MNP/EtudiantNP.class index f1208d6..6839f73 100644 Binary files a/build/MNP/EtudiantNP.class and b/build/MNP/EtudiantNP.class differ diff --git a/build/MNP/GroupeNP.class b/build/MNP/GroupeNP.class index d92474f..e546820 100644 Binary files a/build/MNP/GroupeNP.class and b/build/MNP/GroupeNP.class differ diff --git a/build/MNP/RequeteNP.class b/build/MNP/RequeteNP.class index 4995e34..8439047 100644 Binary files a/build/MNP/RequeteNP.class and b/build/MNP/RequeteNP.class differ diff --git a/build/Test/AdminView.class b/build/Test/AdminView.class index dde004c..d88400a 100644 Binary files a/build/Test/AdminView.class and b/build/Test/AdminView.class differ diff --git a/build/Test/BDatabase.class b/build/Test/BDatabase.class index 99049eb..77b2efa 100644 Binary files a/build/Test/BDatabase.class and b/build/Test/BDatabase.class differ diff --git a/build/Test/BFrame.class b/build/Test/BFrame.class index 90c3d62..a4d980f 100644 Binary files a/build/Test/BFrame.class and b/build/Test/BFrame.class differ diff --git a/build/Test/BLayout.class b/build/Test/BLayout.class index 6800331..01daf98 100644 Binary files a/build/Test/BLayout.class and b/build/Test/BLayout.class differ diff --git a/build/Test/Controller$1.class b/build/Test/Controller$1.class index eb6b4c9..365c774 100644 Binary files a/build/Test/Controller$1.class and b/build/Test/Controller$1.class differ diff --git a/build/Test/Controller.class b/build/Test/Controller.class index 455668b..86942b8 100644 Binary files a/build/Test/Controller.class and b/build/Test/Controller.class differ diff --git a/build/Test/CustomJButton.class b/build/Test/CustomJButton.class index b6029ee..825514e 100644 Binary files a/build/Test/CustomJButton.class and b/build/Test/CustomJButton.class differ diff --git a/build/Test/MainAdmin.class b/build/Test/MainAdmin.class index 3239c4a..60c9ec1 100644 Binary files a/build/Test/MainAdmin.class and b/build/Test/MainAdmin.class differ diff --git a/build/Test/MainMenu.class b/build/Test/MainMenu.class index c68cece..f37b538 100644 Binary files a/build/Test/MainMenu.class and b/build/Test/MainMenu.class differ diff --git a/build/Test/MainProf.class b/build/Test/MainProf.class index 9562c8c..2a20926 100644 Binary files a/build/Test/MainProf.class and b/build/Test/MainProf.class differ diff --git a/build/Test/MainStudent.class b/build/Test/MainStudent.class index fee1113..e41faf1 100644 Binary files a/build/Test/MainStudent.class and b/build/Test/MainStudent.class differ diff --git a/build/Test/ProfView$1.class b/build/Test/ProfView$1.class index c47c303..e3172c9 100644 Binary files a/build/Test/ProfView$1.class and b/build/Test/ProfView$1.class differ diff --git a/build/Test/ProfView.class b/build/Test/ProfView.class index 01ad1d8..17ad125 100644 Binary files a/build/Test/ProfView.class and b/build/Test/ProfView.class differ diff --git a/build/Test/RoundedBorder.class b/build/Test/RoundedBorder.class index 666d1ff..9ebc6ef 100644 Binary files a/build/Test/RoundedBorder.class and b/build/Test/RoundedBorder.class differ diff --git a/build/Test/StudentView.class b/build/Test/StudentView.class index 55ba91c..5411f8a 100644 Binary files a/build/Test/StudentView.class and b/build/Test/StudentView.class differ diff --git a/build/Test/TestTexteMNP.class b/build/Test/TestTexteMNP.class index 15939cd..ec21de2 100644 Binary files a/build/Test/TestTexteMNP.class and b/build/Test/TestTexteMNP.class differ diff --git a/src/Test/Controller.java b/src/Test/Controller.java index 08ada69..eb3d9c7 100644 --- a/src/Test/Controller.java +++ b/src/Test/Controller.java @@ -634,17 +634,21 @@ public class Controller implements ActionListener, ListSelectionListener { }; for (int i = 0; i <= this.r.size() - 1; i++) { - Object[] info = { - this.getEtuNameById(this.r.get(i).getEtuId()), - this.getGroupeById(this.r.get(i).getWitchGroupe()), - this.r.get(i).getMessage(), - this.r.get(i).getType(), - "[DECISION]" - }; + if (this.r.get(i).getStatut().equals("Pas encore de reponse")) { + Object[] info = { + this.getEtuNameById(this.r.get(i).getEtuId()), + this.getGroupeById(this.r.get(i).getWitchGroupe()), + this.r.get(i).getMessage(), + this.r.get(i).getType(), + "[DECISION]" + }; - data[i] = info; + data[i] = info; + } } + + DisplayWithListner(this.createJTable(data, titre)); } } @@ -676,6 +680,10 @@ public class Controller implements ActionListener, ListSelectionListener { else if (Objects.equals(value, "[SUPPRIMER]")) { deleteGrup(tm, cell); } + + else if (Objects.equals(value, "[DECISION]")) { + makeDecision(tm, cell); + } } } } @@ -688,6 +696,46 @@ public class Controller implements ActionListener, ListSelectionListener { return nom + " " + prenom; } + private void makeDecision(TableModel tm, int[] cell) { + int choice = JOptionPane.showConfirmDialog(this.parent, "Accepter la demande ?"); + int id = getIDGroupeByName((String) tm.getValueAt(cell[0], 1)); + System.out.println((String) tm.getValueAt(cell[0], 1) + ","); + + if (choice == 0) { + if (this.db.updateRow("UPDATE fi_demandes SET statut = 'Acceptée' WHERE id = " + id)) { + if (this.db.updateRow("UPDATE fi_demandes SET statut = 'Acceptée' WHERE id = " + id)) { + JOptionPane.showMessageDialog(this.parent, "La demande a bien été acceptée", "Succès",JOptionPane.INFORMATION_MESSAGE); + + } else { + + } + + } else { + JOptionPane.showMessageDialog( + this.parent, + "Impossible d'accepter la demande", + "Echec", + JOptionPane.INFORMATION_MESSAGE); + } + + } else { + if (this.db.updateRow("UPDATE fi_demandes SET statut = 'Refusée' WHERE id = " + id)) { + JOptionPane.showMessageDialog( + this.parent, + "La demande a bien été refusée", + "Succes", + JOptionPane.INFORMATION_MESSAGE); + + } else { + JOptionPane.showMessageDialog( + this.parent, + "Impossible de refuser la demande", + "Echec", + JOptionPane.INFORMATION_MESSAGE); + } + } + } + private void deleteGrup(TableModel tm, int[] cell) { int choice = JOptionPane.showConfirmDialog(this.parent, "Etes-vous sur ?"); @@ -874,7 +922,7 @@ public class Controller implements ActionListener, ListSelectionListener { public int getIDGroupeByName(String label) { for (int i = 0; i <= this.g.size() - 1; i++) { - if (this.g.get(i).getName() == label) { + if (this.g.get(i).getName().equals(label)) { return this.g.get(i).getId(); } } @@ -921,4 +969,4 @@ public class Controller implements ActionListener, ListSelectionListener { public void setMainMenu(MainMenu m) { this.parent = m; } -} \ No newline at end of file +}