public int CreerRegionCategAnimal(int nbTete,int idRegion,int idCategAnimal)
 {
     Region laRegion = new Region(idRegion);
     CategAnimal laCategAnimal = new CategAnimal(idCategAnimal);
     RegionCategAnimal laRegionCategAnimal = new RegionCategAnimal(nbTete, laRegion, laCategAnimal);
     return RegionCategAnimalDAO.GetInstanceDAORegionCategAnimal().AjoutRegionCategAnimal(laRegionCategAnimal);
 }
 public Demande(int numDemande,string libelleDemande,string moisAnnee, Pharmacie unePharmacie, Region uneRegion)
 {
     this.idDemande = numDemande;
     this.libelleDemande = libelleDemande;
     this.moisAnnee = moisAnnee;
     this.unePharmacie = unePharmacie;
     this.UneRegion = uneRegion;
 }
        public List<Region> selectRegion()
        {
            SqlConnection cnx = AccesBDD.GetInstance().GetSqlConnexion();
            SqlCommand maCommand = new SqlCommand();
            maCommand.Parameters.Clear();

            maCommand.Connection = cnx;

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

            List<Region> lesRegions = new List<Region>();

            SqlDataReader monLecteur = maCommand.ExecuteReader();

            while (monLecteur.Read())
            {
                Region uneRegion = new Region((int)monLecteur["idRegion"], (string)monLecteur["intituleRegion"]);
                lesRegions.Add(uneRegion);
            }
            return lesRegions;
        }
        public List<Demande> SelectDemandePourUnTypeDePromo(int idTypePromotion)
        {
            SqlConnection cnx = AccesBDD.GetInstance().GetSqlConnexion();
            SqlCommand maCommand = new SqlCommand();
            SqlDataReader monLecteur;
            maCommand.Parameters.Clear();
            List<Demande> lesDemandes = new List<Demande>();

            maCommand.Connection = cnx;

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

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

            monLecteur = maCommand.ExecuteReader();
            while (monLecteur.Read())
            {
                Region uneRegion = new Region((string)monLecteur["intituleRegion"]);
                Pharmacie unePharmacie = new Pharmacie((string)monLecteur["nomPharmacie"]);
                Demande uneDemande = new Demande((int)monLecteur["idDemande"], (string)monLecteur["libelleDemande"], (string)monLecteur["moisAnnee"],unePharmacie,uneRegion);
                lesDemandes.Add(uneDemande);
            }
            return lesDemandes;
        }