diff --git a/GestionDesInscriptions_1.jar b/GestionDesInscriptions_1.jar
index 17edc42..2f8c784 100644
Binary files a/GestionDesInscriptions_1.jar and b/GestionDesInscriptions_1.jar differ
diff --git a/GestionDesInscriptions_2.jar b/GestionDesInscriptions_2.jar
index 7f16d31..e60e56e 100644
Binary files a/GestionDesInscriptions_2.jar and b/GestionDesInscriptions_2.jar differ
diff --git a/GestionDesInscriptions_3.jar b/GestionDesInscriptions_3.jar
index 225e0d2..04b2aca 100644
Binary files a/GestionDesInscriptions_3.jar and b/GestionDesInscriptions_3.jar differ
diff --git a/L1 Géo et amé _ Aménag..xlsx b/L1 Géo et amé _ Aménag..xlsx
new file mode 100644
index 0000000..48b397a
Binary files /dev/null and b/L1 Géo et amé _ Aménag..xlsx differ
diff --git a/L2 Géo et amé _ Aménag..xlsx b/L2 Géo et amé _ Aménag..xlsx
new file mode 100644
index 0000000..0c00c47
Binary files /dev/null and b/L2 Géo et amé _ Aménag..xlsx differ
diff --git a/L2 Histoire.xlsx b/L2 Histoire.xlsx
new file mode 100644
index 0000000..288809a
Binary files /dev/null and b/L2 Histoire.xlsx differ
diff --git a/L3 Histoire _ Patrimoine.xlsx b/L3 Histoire _ Patrimoine.xlsx
new file mode 100644
index 0000000..41f21aa
Binary files /dev/null and b/L3 Histoire _ Patrimoine.xlsx differ
diff --git a/base.xlsx b/base.xlsx
index 886bcb8..1c30c0c 100644
Binary files a/base.xlsx and b/base.xlsx differ
diff --git a/base.xml b/base.xml
index be7073b..9c2e00a 100644
--- a/base.xml
+++ b/base.xml
@@ -1 +1 @@
-
La base de données est nulle.
"); @@ -105,7 +105,90 @@ public class exportBaseToExcel { - + public static void exportTable(noeud nTable) { + // Données + Object[][] data = new Object[1][29]; + + String formation = nTable.getFirstChild().getAttributes("IAE_-_Etape_lib."); + + + data[0][0] = nTable.getFirstChild().getAttributes("IAE_-_Etape_lib."); + data[0][1] = "Formation"; + data[0][2] = "Individu_-_Code_Etudiant"; + data[0][3] = "Individu_-_Prenom"; + data[0][4] = "Individu_-_Nom"; + data[0][5] = "Profil_etudiant_lib."; + data[0][6] = "Individu_-_Tel._portable"; + data[0][7] = "Individu_-_Email_personnel"; + data[0][8] = "Individu_-_Email"; + data[0][9] = "Groupe"; + data[0][10] = "Groupe_Principal"; + data[0][11] = "Groupe_TD"; + data[0][12] = "Groupe_Langue"; + data[0][13] = "LV1"; + data[0][14] = "LV2"; + data[0][15] = "Groupe_Informatique"; + data[0][16] = "Atelier-rentree_horaire"; + data[0][17] = "Atelier_pre-rentree_enseignant"; + data[0][18] = "Atelier_pre-rentree_salle"; + data[0][19] = "UE_Libre"; + data[0][20] = "Covoiturage"; + data[0][21] = "Etudiant_Covoiturage"; + data[0][22] = "Stage_1"; + data[0][23] = "Num_convention_1"; + data[0][24] = "Periode_1"; + data[0][25] = "Stage_2"; + data[0][26] = "Num_convention_2"; + data[0][27] = "Periode_2"; + + + String[][] data1 = new String[nTable.getChildren().size()][27]; + + int indexStudent = 0; + for(noeud nStudent : nTable.getChildren()) { + data1[indexStudent][0] = nStudent.getAttributes("IAE_-_Etape_lib.");; + data1[indexStudent][1] = nStudent.getAttributes("Individu_-_Code_Etudiant"); + data1[indexStudent][2] = nStudent.getAttributes("Individu_-_Prenom"); + data1[indexStudent][3] = nStudent.getAttributes("Individu_-_Nom"); + data1[indexStudent][4] = nStudent.getAttributes("Profil_etudiant_lib."); + data1[indexStudent][5] = nStudent.getAttributes("Individu_-_Tel._portable"); + data1[indexStudent][6] = nStudent.getAttributes("Individu_-_Email_personnel"); + data1[indexStudent][7] = nStudent.getAttributes("Individu_-_Email"); + data1[indexStudent][8] = nStudent.getAttributes("Groupe"); + data1[indexStudent][9] = nStudent.getAttributes("Groupe_Principal"); + data1[indexStudent][10] = nStudent.getAttributes("Groupe_TD"); + data1[indexStudent][11] = nStudent.getAttributes("Groupe_Langue"); + data1[indexStudent][12] = nStudent.getAttributes("LV1"); + data1[indexStudent][13] = nStudent.getAttributes("LV2"); + data1[indexStudent][14] = nStudent.getAttributes("Groupe_Informatique"); + data1[indexStudent][15] = nStudent.getAttributes("Atelier-rentree_horaire"); + data1[indexStudent][16] = nStudent.getAttributes("Atelier_pre-rentree_enseignant"); + data1[indexStudent][17] = nStudent.getAttributes("Atelier_pre-rentree_salle"); + data1[indexStudent][18] = nStudent.getAttributes("UE_Libre"); + data1[indexStudent][19] = nStudent.getAttributes("Covoiturage"); + data1[indexStudent][20] = nStudent.getAttributes("Etudiant_Covoiturage"); + data1[indexStudent][21] = nStudent.getAttributes("Stage_1"); + data1[indexStudent][22] = nStudent.getAttributes("Num_convention_1"); + data1[indexStudent][23] = nStudent.getAttributes("Periode_1"); + data1[indexStudent][24] = nStudent.getAttributes("Stage_2"); + data1[indexStudent][25] = nStudent.getAttributes("Num_convention_2"); + data1[indexStudent][26] = nStudent.getAttributes("Periode_2"); + + data[0][28] = data1; + indexStudent++; + } + + + + if(data.length>0) { + new CreateCalcWorkbook(data,formation); + }else { + JPanel panel = new JPanel(); + JLabel message = new JLabel("La base de données est nulle.
"); + panel.add(message); + JOptionPane.showMessageDialog(null, panel, "Erreur", JOptionPane.ERROR_MESSAGE); + } + } } diff --git a/src/baseUFRHG/gestionnaire.java b/src/baseUFRHG/gestionnaire.java index d6f23a2..fffa4b4 100644 --- a/src/baseUFRHG/gestionnaire.java +++ b/src/baseUFRHG/gestionnaire.java @@ -26,6 +26,8 @@ import javax.swing.border.EmptyBorder; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; +import baseUFRHG.actions.exportTable; + public class gestionnaire extends JFrame { /** @@ -44,7 +46,7 @@ public class gestionnaire extends JFrame { private JLabel lblNewLabel; private String defautYear = null; private JPanel panelNorth; - private JMenu mnNewMenu; + public noeud nTable = null; @@ -58,6 +60,7 @@ public class gestionnaire extends JFrame { commandes.nBase = recupeBases.recupeLaBase(); } initialize(); + } @@ -176,17 +179,20 @@ public class gestionnaire extends JFrame { JMenuBar menuBar = new JMenuBar(); JMenu fileMenu = new JMenu("Fichier"); - JMenuItem openItem = new JMenuItem("Ouvrir"); - JMenuItem saveItem = new JMenuItem("Enregistrer"); + JMenuItem exportItem = fileMenu.add(new exportTable(this)); + JMenuItem saveItem = new JMenuItem("Enregistrer les modifications"); JMenuItem exitItem = new JMenuItem("Quitter"); - fileMenu.add(openItem); + fileMenu.add(exportItem); fileMenu.add(saveItem); fileMenu.addSeparator(); // Ajouter une séparation entre les éléments du menu fileMenu.add(exitItem); menuBar.add(fileMenu); + + + panelNorth.add(menuBar, BorderLayout.NORTH); @@ -207,8 +213,13 @@ public class gestionnaire extends JFrame { private void majTableFormation() { noeud nYears = commandes.nBase.getChild(cYears.getSelectedItem().toString()); + nTable = new noeud("Table"); + nTable.setAttribut("defaut_Year", defautYear); + if(nYears!=null) { noeud nFormation = nYears.getChild(cFormations.getSelectedItem().toString()); + nTable.setAttribut("Formation", cFormations.getSelectedItem().toString()); + nTable.setAttribut("GroupeTD", " - "); String[] head = new String[31] ; String[][] data = new String[nFormation.getChildren().size()-1][31] ; @@ -227,6 +238,11 @@ public class gestionnaire extends JFrame { indexCol++; } indexRow++; + try { + nTable.addChild(nStudent.clone()); + } catch (CloneNotSupportedException e) { + e.printStackTrace(); + } } @@ -274,10 +290,23 @@ public class gestionnaire extends JFrame { - private void majTableGroupes() { + public void majTableGroupes() { + String GroupeTD = (String) cGroupeTD.getSelectedItem(); + + nTable = new noeud("Table"); + nTable.setAttribut("defaut_Year", defautYear); + if(cGroupeTD.getSelectedItem()!=null) { + nTable.setAttribut("GroupeTD", cGroupeTD.getSelectedItem().toString()); + }else { + nTable.setAttribut("GroupeTD", " - "); + } + + if(GroupeTD!=null) { noeud nYears = commandes.nBase.getChild(cYears.getSelectedItem().toString()); + nTable.setAttribut("Formation", cFormations.getSelectedItem().toString()); + if(nYears!=null) { noeud nFormation = nYears.getChild(cFormations.getSelectedItem().toString()); @@ -310,7 +339,15 @@ public class gestionnaire extends JFrame { } } } - if(trouve)indexRow++; + if(trouve) { + indexRow++; + try { + nTable.addChild(nStudent.clone()); + } catch (CloneNotSupportedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } } table.setModel(new DefaultTableModel(data, head)); @@ -322,6 +359,7 @@ public class gestionnaire extends JFrame { table.revalidate(); table.repaint(); + } } diff --git a/src/baseUFRHG/importAllBaseToExcel.java b/src/baseUFRHG/importAllBaseToExcel.java index a2b087a..5def495 100644 --- a/src/baseUFRHG/importAllBaseToExcel.java +++ b/src/baseUFRHG/importAllBaseToExcel.java @@ -44,7 +44,7 @@ public class importAllBaseToExcel { if(indexCol==0) { // Colonne formation if(cell.getCellType() == CellType.STRING) { - nBF = commandes.nBase.getChild(cell.getStringCellValue()); + nBF = commandes.nBase.getChild(supprimeCaracatresSpeciaux.TousLesCaracatresSpeciaux(cell.getStringCellValue())); } } diff --git a/src/baseUFRHG/noeud.java b/src/baseUFRHG/noeud.java index 657c0d2..3c6bb0f 100644 --- a/src/baseUFRHG/noeud.java +++ b/src/baseUFRHG/noeud.java @@ -14,7 +14,7 @@ import java.util.regex.Pattern; * @author pabr6 * */ -public class noeud { +public class noeud implements Cloneable{ private String name; private String content; private SortedMap