コード例 #1
0
        public void Supprimer(int matricule)
        {
            List <int> listEnfant = enfantDA.findIdByMatricule(matricule);

            foreach (int id in listEnfant)
            {
                participationDA.delete(id);
                enfantDA.delete(id);
                participantDA.delete(id);
            }
            int cin = conjointDA.findCinByMatricule(matricule);

            participationDA.delete(cin);
            conjointDA.delete(cin);
            participantDA.delete(cin);
            participationDA.delete(matricule);
            aDA.delete(matricule);
            Boolean test = participantDA.delete(matricule);

            if (test == true)
            {
                MessageBox.Show("La suppression de cet adhérent est effectué avec succés", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Erreur de suppression !", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }