Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public DTOParties SelectByDate(DateTime date)
        {
            string     retour = " * from parties where date = " + date + ";";
            DataTable  table  = _dbal.Select(retour);
            DTOParties partie = new DTOParties(Convert.ToInt32(table.Rows[0]["id"]), Convert.ToDateTime(table.Rows[0]["date"]), Convert.ToString(table.Rows[0]["heure"]), Convert.ToInt32(table.Rows[0]["nbjoueur"]));

            for (int i = 0; i < table.Rows.Count; i++)
            {
                DAOxClients dAOxClients = new DAOxClients(_dbal);
                DTOClients  clients     = dAOxClients.SelectByIdClients(Convert.ToString(table.Rows[i]["pseudo_client"]));

                DAOxSalle dAOxSalle = new DAOxSalle(_dbal);
                DTOSalle  salle     = dAOxSalle.SelectByIdSalle(Convert.ToInt32(table.Rows[i]["idSalle"]));

                partie.SetClient(clients);
                partie.SetSalle(salle);
            }
            return(partie);
        }
Ejemplo n.º 3
0
        public List <DTOParties> SelectAllPartie()
        {
            DataTable         table      = _dbal.SelectAll("Parties");
            List <DTOParties> listpartie = new List <DTOParties>();

            for (int i = 0; i < table.Rows.Count; i++)
            {
                DAOxClients dAOxClients = new DAOxClients(_dbal);
                DTOClients  client      = dAOxClients.SelectByIdClients(Convert.ToString(table.Rows[i]["pseudo_client"]));

                DAOxSalle dAOxSalle = new DAOxSalle(_dbal);
                DTOSalle  salle     = dAOxSalle.SelectByIdSalle(Convert.ToInt32(table.Rows[i]["idSalle"]));

                DataRow    row    = table.Rows[0];
                DTOParties partie = new DTOParties(Convert.ToInt32(table.Rows[i]["id"]), Convert.ToDateTime(table.Rows[i]["date"]), Convert.ToString(table.Rows[i]["heure"]), Convert.ToInt32(table.Rows[i]["nbjoueur"]), client, salle);
                listpartie.Add(partie);
            }
            return(listpartie);
        }