Пример #1
0
        public Regions Lister(Pays c)
        {
            Regions liste = new Regions();

            con.Open();
            try
            {
                IDbCommand com = con.CreateCommand();
                com.CommandText = "SELECT * FROM Regions WHERE IdPays=" + c.Id.ToString();
                IDataReader reader = com.ExecuteReader();
                while (reader.Read())
                {
                    Region cd = reader2Region(reader);
                    liste.Ajouter(cd);
                }
            }
            finally
            {
                con.Close();
            }
            return(liste);
        }
Пример #2
0
        /// <summary>
        /// liste toutes les régions de la base de données
        /// </summary>
        /// <returns></returns>
        public Regions Lister()
        {
            Regions liste = new Regions();

            con.Open();
            try
            {
                IDbCommand com = con.CreateCommand();
                com.CommandText = "SELECT * FROM Region";
                IDataReader reader = com.ExecuteReader();
                while (reader.Read())
                {
                    Region r = reader2Region(reader);
                    liste.Ajouter(r);
                }
            }
            finally
            {
                con.Close();
            }
            return(liste);
        }