Exemplo n.º 1
0
        private void buttonEnregistrer_Click(object sender, EventArgs e)
        {
            DataContextGestionNotesDataContext dc = new DataContextGestionNotesDataContext();

            eleve EleveSelectionne = listBoxClasses.SelectedItem as eleve;

            if (EleveSelectionne != null)
            {
                EleveSelectionne.nom    = textBox1.Text;
                EleveSelectionne.prenom = textBox2.Text;
                EleveSelectionne.mail   = textBox3.Text;
                EleveSelectionne.mdp    = textBox4.Text;
            }
            dc.SubmitChanges();
        }
Exemplo n.º 2
0
        private void listBoxEleve_SelectedIndexChanged(object sender, EventArgs e)
        {
            eleve EleveSelectionne = listBoxEleve.SelectedItem as eleve;

            DataContextGestionNotesDataContext dc = new DataContextGestionNotesDataContext();

            if (EleveSelectionne != null)
            {
                textBoxNom.Text           = EleveSelectionne.nom;
                textBoxPrenom.Text        = EleveSelectionne.prenom;
                comboBoxDevoir.Enabled    = true;
                buttonEnregistrer.Enabled = true;
                textBoxNote.Enabled       = true;
                textBoxNote.Text          = " ";
            }
        }
Exemplo n.º 3
0
        private void listBoxClasses_SelectedIndexChanged(object sender, EventArgs e)
        {
            eleve EleveSelectionne = listBoxClasses.SelectedItem as eleve;

            DataContextGestionNotesDataContext dc = new DataContextGestionNotesDataContext();
            var lesNotes = (from n in dc.noter
                            select n).ToList();

            if (EleveSelectionne != null)
            {
                textBox1.Text = EleveSelectionne.nom;
                textBox2.Text = EleveSelectionne.prenom;
                textBox3.Text = EleveSelectionne.mail;
                textBox4.Text = EleveSelectionne.mdp;
                textBox5.Text = lesNotes.Average(m => m.note).ToString();
            }
        }
Exemplo n.º 4
0
        private void comboBoxDevoir_SelectedIndexChanged(object sender, EventArgs e)
        {
            eleve  EleveSelectionne = listBoxEleve.SelectedItem as eleve;
            devoir lesDevoirs       = comboBoxDevoir.SelectedItem as devoir;


            DataContextGestionNotesDataContext dc = new DataContextGestionNotesDataContext();

            var laNote = (from b in dc.noter
                          where b.id_devoir == lesDevoirs.id_devoir && b.id_eleve == EleveSelectionne.id_eleve
                          select b).ToList();

            textBoxNote.Text = " ";
            if (laNote != null)
            {
                foreach (var n in laNote)
                {
                    textBoxNote.Text = n.note.ToString();
                }
            }
        }
Exemplo n.º 5
0
 partial void Deleteeleve(eleve instance);
Exemplo n.º 6
0
 partial void Updateeleve(eleve instance);
Exemplo n.º 7
0
 partial void Inserteleve(eleve instance);
Exemplo n.º 8
0
 private void detach_eleve(eleve entity)
 {
     this.SendPropertyChanging();
     entity.classe = null;
 }
Exemplo n.º 9
0
 private void attach_eleve(eleve entity)
 {
     this.SendPropertyChanging();
     entity.classe = this;
 }