Example #1
0
        public DTOTheme SelectByIdTheme(int id)
        {
            string    retour = " * from theme where id = " + id + ";";
            DataTable table  = _dbal.Select(retour);

            DTOTheme theme = new DTOTheme(Convert.ToInt32(table.Rows[0]["id"]), Convert.ToString(table.Rows[0]["nom"]));

            return(theme);
        }
Example #2
0
        public List <DTOSalle> SelectAllSalle()
        {
            DataTable       table      = _dbal.SelectAll("Salle");
            List <DTOSalle> listSalles = new List <DTOSalle>();

            for (int i = 0; i < table.Rows.Count; i++)
            {
                DAOxTheme dAOxTheme = new DAOxTheme(_dbal);
                DTOTheme  theme     = dAOxTheme.SelectByIdTheme(Convert.ToInt32(table.Rows[i][0]));
                DAOxVille dAOxVille = new DAOxVille(_dbal);
                DTOVille  ville     = dAOxVille.SelectByIdVille(Convert.ToInt32(table.Rows[i][0]));
                DataRow   row       = table.Rows[0];
                DTOSalle  salle     = new DTOSalle(Convert.ToInt32(table.Rows[i]["id"]), Convert.ToString(table.Rows[i]["nom"]), theme, ville, Convert.ToString(table.Rows[i]["heure_ouverture"]), Convert.ToString(table.Rows[i]["heure_fermeture"]));
                listSalles.Add(salle);
            }
            return(listSalles);
        }
Example #3
0
        public DTOSalle SelectByIdSalle(int id)
        {
            string    retour = " * from salle where id = " + id + ";";
            DataTable table  = _dbal.Select(retour);
            DTOSalle  salle  = new DTOSalle(Convert.ToInt32(table.Rows[0]["id"]), Convert.ToString(table.Rows[0]["nom"]), Convert.ToString(table.Rows[0]["heure_ouverture"]), Convert.ToString(table.Rows[0]["heure_fermeture"]));

            for (int i = 0; i < table.Rows.Count; i++)
            {
                DAOxTheme dAOxTheme = new DAOxTheme(_dbal);
                DTOTheme  theme     = dAOxTheme.SelectByIdTheme(Convert.ToInt32(table.Rows[i][3]));

                DAOxVille dAOxVille = new DAOxVille(_dbal);
                DTOVille  ville     = dAOxVille.SelectByIdVille(Convert.ToInt32(table.Rows[i][4]));

                salle.SetTheme(theme);
                salle.SetVille(ville);
            }
            return(salle);
        }