From 78b29cdf066da373bb3372b2166beeffb6dabb46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Gross?= <loic.gross@unistra.fr>
Date: Wed, 1 Apr 2020 16:08:43 +0200
Subject: [PATCH] Ajout ListeEleve

---
 .../InterfaceInfoEleve.Designer.cs            | 22 +++++++++----------
 .../psychorientation/InterfaceInfoEleve.cs    | 20 ++++++++---------
 .../psychorientation/ListeEleve.cs            | 14 ++++++++++--
 3 files changed, 33 insertions(+), 23 deletions(-)

diff --git a/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs b/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs
index af44eda..9d4d0ff 100644
--- a/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs
+++ b/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs
@@ -49,7 +49,7 @@
             // 
             this.lblEleve.AutoSize = true;
             this.lblEleve.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lblEleve.Location = new System.Drawing.Point(107, 18);
+            this.lblEleve.Location = new System.Drawing.Point(77, 16);
             this.lblEleve.Name = "lblEleve";
             this.lblEleve.Size = new System.Drawing.Size(99, 33);
             this.lblEleve.TabIndex = 0;
@@ -58,7 +58,7 @@
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(60, 96);
+            this.label1.Location = new System.Drawing.Point(41, 71);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(50, 13);
             this.label1.TabIndex = 1;
@@ -67,7 +67,7 @@
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(69, 136);
+            this.label2.Location = new System.Drawing.Point(50, 100);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(41, 13);
             this.label2.TabIndex = 2;
@@ -76,7 +76,7 @@
             // label3
             // 
             this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(34, 177);
+            this.label3.Location = new System.Drawing.Point(15, 146);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(76, 13);
             this.label3.TabIndex = 3;
@@ -85,7 +85,7 @@
             // lblClasse
             // 
             this.lblClasse.AutoSize = true;
-            this.lblClasse.Location = new System.Drawing.Point(116, 96);
+            this.lblClasse.Location = new System.Drawing.Point(97, 71);
             this.lblClasse.Name = "lblClasse";
             this.lblClasse.Size = new System.Drawing.Size(35, 13);
             this.lblClasse.TabIndex = 4;
@@ -95,7 +95,7 @@
             // 
             this.panel1.BackColor = System.Drawing.Color.Silver;
             this.panel1.Controls.Add(this.pnlEffort);
-            this.panel1.Location = new System.Drawing.Point(116, 131);
+            this.panel1.Location = new System.Drawing.Point(97, 100);
             this.panel1.Name = "panel1";
             this.panel1.Size = new System.Drawing.Size(139, 26);
             this.panel1.TabIndex = 5;
@@ -103,7 +103,7 @@
             // pnlEffort
             // 
             this.pnlEffort.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.pnlEffort.Location = new System.Drawing.Point(3, 4);
+            this.pnlEffort.Location = new System.Drawing.Point(3, 5);
             this.pnlEffort.Name = "pnlEffort";
             this.pnlEffort.Size = new System.Drawing.Size(133, 18);
             this.pnlEffort.TabIndex = 6;
@@ -112,7 +112,7 @@
             // 
             this.panel2.BackColor = System.Drawing.Color.Silver;
             this.panel2.Controls.Add(this.pnlCompetence);
-            this.panel2.Location = new System.Drawing.Point(116, 173);
+            this.panel2.Location = new System.Drawing.Point(97, 146);
             this.panel2.Name = "panel2";
             this.panel2.Size = new System.Drawing.Size(139, 26);
             this.panel2.TabIndex = 6;
@@ -144,7 +144,7 @@
             // label4
             // 
             this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(12, 215);
+            this.label4.Location = new System.Drawing.Point(12, 189);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(98, 13);
             this.label4.TabIndex = 9;
@@ -153,7 +153,7 @@
             // lblMoyenne
             // 
             this.lblMoyenne.AutoSize = true;
-            this.lblMoyenne.Location = new System.Drawing.Point(116, 215);
+            this.lblMoyenne.Location = new System.Drawing.Point(113, 189);
             this.lblMoyenne.Name = "lblMoyenne";
             this.lblMoyenne.Size = new System.Drawing.Size(35, 13);
             this.lblMoyenne.TabIndex = 10;
@@ -175,7 +175,7 @@
             this.Controls.Add(this.label1);
             this.Controls.Add(this.lblEleve);
             this.Name = "InterfaceInfoEleve";
-            this.Size = new System.Drawing.Size(479, 247);
+            this.Size = new System.Drawing.Size(246, 216);
             this.Load += new System.EventHandler(this.InterfaceInfoEleve_Load);
             this.panel1.ResumeLayout(false);
             this.panel2.ResumeLayout(false);
diff --git a/psychorientation/psychorientation/InterfaceInfoEleve.cs b/psychorientation/psychorientation/InterfaceInfoEleve.cs
index c8c93df..ccfa2fc 100644
--- a/psychorientation/psychorientation/InterfaceInfoEleve.cs
+++ b/psychorientation/psychorientation/InterfaceInfoEleve.cs
@@ -24,31 +24,31 @@ namespace psychorientation
 
         }
 
-        public void setParam(Eleve el, List<string> listClasse)
+        public void setParam(Eleve el)
         {
             this.eleve = el;
-            this.listClasse = listClasse;
             actualiser();
         }
 
         private void actualiser()
         {
-            lblEleve.Text = "Eleve n°"+eleve.getId();
-            lblClasse.Text = listClasse[eleve.getClasse()];
-            lblEffort.Text = eleve.getEffort().ToString();
-            lblCompetence.Text = eleve.getCompetence().ToString();
-            double moyenne = eleve.getMoyenne();
+            Libelle lib = new Libelle();
+            lblEleve.Text = "Eleve n°"+eleve.GetId();
+            lblClasse.Text = lib.Niveau(eleve.GetClasse());
+            lblEffort.Text = eleve.GetEffort().ToString();
+            lblCompetence.Text = eleve.GetCompetence().ToString();
+            double moyenne = eleve.GetMoyenne();
             if (moyenne == -1)
             {
                 lblMoyenne.Text="Pas encore d'évaluation";
             }
             else
             {
-                lblMoyenne.Text = eleve.getMoyenne().ToString()+"/20";
+                lblMoyenne.Text = eleve.GetMoyenne().ToString()+"/20";
             }
             
-            MajPanel(pnlCompetence,eleve.getCompetence());
-            MajPanel(pnlEffort, eleve.getEffort());
+            MajPanel(pnlCompetence,eleve.GetCompetence());
+            MajPanel(pnlEffort, eleve.GetEffort());
         }
         private void MajPanel(Panel p, double valeur)
         {
diff --git a/psychorientation/psychorientation/ListeEleve.cs b/psychorientation/psychorientation/ListeEleve.cs
index fe14085..d7bc218 100755
--- a/psychorientation/psychorientation/ListeEleve.cs
+++ b/psychorientation/psychorientation/ListeEleve.cs
@@ -17,16 +17,26 @@ namespace psychorientation
             InitializeComponent();
         }
 
+
         private void ListeEleve_Load(object sender, EventArgs e)
         {
             GestionnaireEleve gestEleve = new GestionnaireEleve();
-            List<Eleve> listEleve = gestEleve.getListEleve();
+            Libelle lib = new Libelle();
+
+            Eleve el1 = new Eleve(1);
+            Eleve el2 = new Eleve(2);
+            gestEleve.AjouterEleve(el1);
+            gestEleve.AjouterEleve(el2);
 
+            List<Eleve> listEleve = gestEleve.GetListEleve();
+            int y = 0;
             foreach ( Eleve eleve in listEleve)
             {
                 InterfaceInfoEleve ii = new InterfaceInfoEleve();
-                ii.setParam(eleve, listeClasse);
+                ii.setParam(eleve);
+                ii.Location = new Point(10, y);
                 pnlListeEleve.Controls.Add(ii);
+                y += 220;
             }
         }
     }
-- 
GitLab