public List<Promotion>SelectPromotionPourUneRegionPourUnType(int idType,int idRegion)
        {
            SqlConnection cnx = AccesBDD.GetInstance().GetSqlConnexion();
            SqlCommand maCommand = new SqlCommand();
            SqlDataReader monLecteur;
            maCommand.Parameters.Clear();

            List<Promotion> lesPromotions = new List<Promotion>();

            maCommand.Connection = cnx;

            maCommand.CommandType = System.Data.CommandType.StoredProcedure;
            maCommand.CommandText = "SelectPromotionPourUneRegionPourUnType";

            maCommand.Parameters.Add("idPromo", System.Data.SqlDbType.Int);
            maCommand.Parameters[0].Value = idType;

            maCommand.Parameters.Add("idRegion", System.Data.SqlDbType.Int);
            maCommand.Parameters[1].Value = idRegion;

            monLecteur = maCommand.ExecuteReader();
            while(monLecteur.Read())
            {
                Pharmacie unePharmacie = new Pharmacie((string)monLecteur["nomPharmacie"]);
                Intervenant unIntervenant = new Intervenant((string)monLecteur["nomIntervenant"]);
                Promotion unePromotion = new Promotion((int)monLecteur["idPromotion"], (string)monLecteur["intitulePromo"], (DateTime)monLecteur["datePromo"], (string)monLecteur["commentairePromo"], unIntervenant, unePharmacie);
                lesPromotions.Add(unePromotion);
            }

            return lesPromotions;
        }
 public int CreerPromotion(string sonIntitulePromo,DateTime saDatePromo,string sonCommentairePromo,int sonIdPharmacie,int sonIdTypePromo,int sonIdIntervenant)
 {
     Pharmacie laPharmacie = new Pharmacie(sonIdPharmacie);
     TypePromo leTypePromo = new TypePromo(sonIdTypePromo);
     Intervenant lIntervenant = new Intervenant(sonIdIntervenant);
     Promotion laPromotion = new Promotion(sonIntitulePromo, saDatePromo, sonCommentairePromo, laPharmacie, leTypePromo,lIntervenant);
     return PromotionDAO.GetInstanceDAOPromotion().AjoutPromotion(laPromotion);
 }
 public Promotion(int idPromotion, string intitulePromo, DateTime datePromo, string commentairePromo, Intervenant unIntervenant, TypePromo unTypePromo)
 {
     this.idPromotion = idPromotion;
     this.intitulePromo = intitulePromo;
     this.datePromo = datePromo;
     this.commentairePromo = commentairePromo;
     this.UnIntervenant = unIntervenant;
     this.unTypePromo = unTypePromo;
 }
 public Promotion(int idPromotion, string intitulePromo, DateTime datePromo, string commentairePromo,Intervenant unIntervenant,Pharmacie unePharmacie)
 {
     this.idPromotion = idPromotion;
     this.intitulePromo = intitulePromo;
     this.datePromo = datePromo;
     this.commentairePromo = commentairePromo;
     this.UnIntervenant = unIntervenant;
     this.unePharmacie = unePharmacie;
 }
 public Promotion(string intitulePromo,DateTime datePromo,string commentairePromo,Pharmacie unePharmacie,TypePromo unTypePromo,Intervenant unIntervenant)
 {
     this.intitulePromo = intitulePromo;
     this.datePromo = datePromo;
     this.commentairePromo = commentairePromo;
     this.unePharmacie = unePharmacie;
     this.unTypePromo = unTypePromo;
     this.UnIntervenant = unIntervenant;
 }
        public List<Intervenant> SelectIntervenant()
        {
            SqlConnection cnx = AccesBDD.GetInstance().GetSqlConnexion();
            SqlCommand maCommand = new SqlCommand();
            maCommand.Parameters.Clear();

            maCommand.Connection = cnx;

            maCommand.CommandType = System.Data.CommandType.StoredProcedure;
            maCommand.CommandText = "SelectIntervenant";

            List<Intervenant> lesIntervenants = new List<Intervenant>();

            SqlDataReader monLecteur = maCommand.ExecuteReader();

            while(monLecteur.Read())
            {
                Intervenant unIntervenant = new Intervenant((int)monLecteur["idIntervenant"], (string)monLecteur["nomIntervenant"]);
                lesIntervenants.Add(unIntervenant);
            }

            return lesIntervenants;
        }