コード例 #1
0
        private void buttonModifierAdherent_Click(object sender, EventArgs e)
        {
            string   selectedTxt = listBoxAdherents.SelectedItem as string;
            Adherent adherent    = adherents
                                   .Find(a => a.ToString() == selectedTxt);

            if (adherent != null)
            {
                FenetreForm_Adherent frm = new FenetreForm_Adherent(serviceAdherents, adherents, "Modifier Adhérent", adherent);
                frm.Show();
            }
            else
            {
                MessageBox.Show("Vous devez selectionner un adhérent", "Erreur : Absence de selection d'un adhérent", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        private void buttonAjouterAdherent_Click(object sender, EventArgs e)
        {
            FenetreForm_Adherent frm = new FenetreForm_Adherent(serviceAdherents, adherents, "Ajouter Adhérent");

            frm.Show();
        }