예제 #1
0
        public DTOClients SelectByIdClients(string pseudo)
        {
            string     retour = " * from clients where pseudo = \"" + pseudo + "\";";
            DataTable  table  = _dbal.Select(retour);
            DTOClients client = new DTOClients(Convert.ToString(table.Rows[0]["pseudo"]), Convert.ToString(table.Rows[0]["nom"]), Convert.ToString(table.Rows[0]["prenom"]), Convert.ToDateTime(table.Rows[0]["datenaissance"]), Convert.ToString(table.Rows[0]["adresse"]), Convert.ToString(table.Rows[0]["mail"]), Convert.ToString(table.Rows[0]["telephone"]), Convert.ToInt32(table.Rows[0]["credit"]), Convert.ToBoolean(table.Rows[0]["archiver"]));

            for (int i = 0; i < table.Rows.Count; i++)
            {
                DAOxVille dAOxVille = new DAOxVille(_dbal);
                DTOVille  ville     = dAOxVille.SelectByIdVille(Convert.ToInt32(table.Rows[i]["idVille"]));

                client.SetVille(ville);
            }
            return(client);
        }
예제 #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);
        }
예제 #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);
        }