Example #1
0
        private void ListeEleve_Load(object sender, EventArgs e)
        {
            Libelle lib = new Libelle();

            // TEST
            //Eleve e1 = new Eleve(4);
            //Eleve e2 = new Eleve(5);
            //e1.AjouterNote("une");
            //e1.AjouterNote("deux");
            //e1.AjouterNote("trois");
            //gestEleve.AjouterEleve(e1);
            //gestEleve.AjouterEleve(e2);

            List <Eleve> listEleve = gestEleve.GetListeEleves();
            int          y         = 0;

            foreach (Eleve eleve in listEleve)
            {
                InterfaceInfoEleve ii = new InterfaceInfoEleve();
                ii.setParam(eleve);
                ii.Location = new Point(10, y);
                pnlListeEleve.Controls.Add(ii);
                y += 220;
            }
        }
Example #2
0
 private void ActualiserEleveCoter()
 {
     foreach (Control c in pnlListeEleve.Controls)
     {
         if (c is InterfaceInfoEleve)
         {
             InterfaceInfoEleve iie = (InterfaceInfoEleve)c;
             iie.actualiser();
         }
     }
 }
Example #3
0
        private void GenererBase()
        {
            lblDate.Text       = libelle.Mois(moisActuel % 12);
            lblClasse.Text     = libelle.Niveau(anneeActuelle);
            effortInitial      = Math.Round(gestEleve.GetEffortClasse(), 1);
            competenceInitial  = Math.Round(gestEleve.GetCompetenceClasse(), 1);
            moyenneInitiale    = Math.Round(gestEleve.GetMoyenneClasse(), 1);
            lblEffort.Text     = "Effort de la classe : " + effortInitial.ToString();
            lblCompetence.Text = "Competence de la classe : " + competenceInitial.ToString();
            lblMoyenne.Text    = "Moyenne de la classe : " + moyenneInitiale.ToString();

            Libelle lib = new Libelle();
            int     y   = 40;

            foreach (Eleve eleve in gestEleve.GetListeEleves())
            {
                InterfaceInfoEleve ii = new InterfaceInfoEleve();
                ii.setParam(eleve);
                ii.Tag      = eleve;
                ii.Location = new Point(6, y);
                ii.Click   += new System.EventHandler(PbOuvrirInfo);
                foreach (Control c in ii.Controls)
                {
                    if (c is Panel)
                    {
                        foreach (Control c2 in (c as Panel).Controls)
                        {
                            c2.Click += new System.EventHandler(PbOuvrirInfo);
                        }
                    }
                    c.Click += new System.EventHandler(PbOuvrirInfo);
                }
                pnlListeEleve.Controls.Add(ii);
                y += 220;
            }

            TrackBar tbNota = new TrackBar();

            tbNota.Location    = new System.Drawing.Point(0, lblNotation.Location.Y + lblNotation.Size.Height);
            tbNota.Size        = new System.Drawing.Size(184, 45);
            tbNota.Maximum     = 20;
            tbNota.BackColor   = System.Drawing.Color.Tan;
            tbNota.Value       = 10;
            tbNota.SmallChange = 1;
            tbNota.LargeChange = 1;
            tbNota.TickStyle   = TickStyle.TopLeft;
            tbNota.Scroll     += new System.EventHandler(tbNota_Scroll);
            pnlChoix.Controls.Add(tbNota);
            lblNotation.Text = notaText;

            lblValEffort.Tag           = "Effort : ";
            lblValCompetence.Tag       = "Compétence : ";
            lblValEffort.Location      = new Point(130, 5 + tbNota.Location.Y + tbNota.Size.Height);
            lblValCompetence.Location  = new Point(1, 5 + tbNota.Location.Y + tbNota.Size.Height);
            lblValEffort.Text          = lblValEffort.Tag + ((tbNota.Value) / 10.0).ToString();
            lblValCompetence.Text      = lblValCompetence.Tag + ((20 - tbNota.Value) / 10.0).ToString();
            lblValCompetence.BackColor = System.Drawing.Color.Transparent;
            lblValEffort.BackColor     = System.Drawing.Color.Transparent;
            pnlChoix.Controls.Add(lblValEffort);
            pnlChoix.Controls.Add(lblValCompetence);

            TrackBar tbCours = new TrackBar();

            tbCours.BackColor   = System.Drawing.Color.Tan;
            tbCours.Location    = new System.Drawing.Point(0, 10 + lblCours.Location.Y + lblCours.Size.Height);
            tbCours.Size        = new System.Drawing.Size(184, 45);
            tbCours.Value       = 5;
            tbCours.SmallChange = 1;
            tbCours.LargeChange = 1;
            tbCours.Scroll     += new System.EventHandler(tbCours_Scroll);
            pnlChoix.Controls.Add(tbCours);
            lblCours.Text = coursText + tbCours.Value.ToString();
        }