/// <summary>
        /// Méthode Ajouter un Adhérent
        /// </summary>
        /// <param name="tabAdher"></param>
        public void Ajoute(string numAd, string nom, string prenom, int numR, string nomR, int cpost, string ville, string tel, string adrMail, DateTime perime, string mdp)
        {
            Adherent a = new Adherent(numAd, nom, prenom, numR, nomR, cpost, ville, tel, adrMail, perime, mdp);

            this.Add(a);
            //...
            DAO_Adherent.Ajout_Adherent(a);
        }
        public void init()
        {
            //for (int i = 0; i < 10; i++)
            //{
            //    this.Add(new Adherent("Num Adherent"+i, "Nom" + i, "Prenom" + i, i, "Nom rue" + i, i, "Ville" + i, "Tel" + i , "Mail" + i, DateTime.Now.AddDays(30), "Mdp" + i));

            //}
            DAO_Adherent.Init_Adherents(this);
        }
Exemple #3
0
        // Mise à jour de l'adherent
        public void MAJ(Adherent a)
        {
            //Tout est mis à jour SAUF le numéro d'adhérent
            this.Nom         = a.Nom;
            this.Prenom      = a.Prenom;
            this.NumeroDeRue = a.NumeroDeRue;
            this.NomDeRue    = a.NomDeRue;
            this.CodePostal  = a.CodePostal;
            this.Ville       = a.Ville;
            this.Telephone   = a.Telephone;
            this.Mail        = a.Mail;
            this.PerimeLe    = a.PerimeLe;
            this.Password    = a.Password;

            DAO_Adherent.MAJ_Adherent(a);
        }
        public Adherents Recherche_par_nom(string nom)
        {
            Adherents resultat = new Adherents();

            resultat.Clear();

            foreach (Adherent a in this)
            {
                if (a.Nom.ToUpper() == nom.ToUpper())
                {
                    resultat.Add(a);
                    break;
                }
            }
            DAO_Adherent.Init_Adherents(this);
            return(this);
        }
        public Adherents Recherche_par_num(int num)
        {
            Adherents resultat = new Adherents();

            resultat.Clear();

            foreach (Adherent a in this)
            {
                if (a.NumeroAdherent.ToString() == num.ToString())
                {
                    resultat.Add(a);
                    break;
                }
            }
            DAO_Adherent.Init_Adherents(this);
            return(this);
        }
 /// <summary>
 /// Méthode Supprimer
 /// </summary>
 /// <param name="SuppAdher"></param>
 public void Supprimer(Adherent a)
 {
     // Suppression de l'adherent courant
     DAO_Adherent.Supprimer_Adherent(a);
     this.Remove(a);
 }