Ejemplo n.º 1
0
        private void button4_Click(object sender, EventArgs e) // Supprimer [DONE]
        {
            string code;

            code = textBox1.Text;
            if (code == "")
            {
                MessageBox.Show("Entrez le code étudiant pour supprimer un étudiant !");
                return;
            }
            if (!_Getudiant.EtudiantExiste(code))
            {
                MessageBox.Show("cet étudiant n'existe pas !! ");
                return;
            }
            // Supprimer l'étudiant ,
            var selectedoption = MessageBox.Show("Etes vous sure de vouloir supprimer cet étudiant ?", "Confirmation", MessageBoxButtons.YesNo);

            if (selectedoption == DialogResult.No)
            {
                return;
            }
            eleves ee = _Getudiant.RechercherUnEtudiant(code);

            _Getudiant.SupprimerEtudiant(code);
            MessageBox.Show("Étudiant Supprimé ! ");
            InitialiserGrid();
            DeletingInXML dl = new DeletingInXML("D:\\ensat.xml");

            dl.AjouterEleveSupprimerAuFichierXML(ee);
        }