Exemplo n.º 1
0
        public static WebContentCollection GetByUser(string utilisateur)
        {
            SqlParameter[] parameters = new SqlParameter[1];
            parameters[0]       = new SqlParameter("@Utilisateur", SqlDbType.NVarChar);
            parameters[0].Value = utilisateur;

            DataSet ds = new DataSet();

            ds = SqlDataProvider.ExecuteDataset
                 (
                Tools.DatabaseConnectionString,
                CommandType.StoredProcedure,
                "GetWebContentByUser",
                parameters
                 );

            WebContentCollection oc = new WebContentCollection();

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                WebContent o = WebContent.Fill(r);
                oc.Add(o);
            }
            return(oc);
        }
Exemplo n.º 2
0
        // Trouver tous les WebContent d'un utilisateur pour une section
        // b ne sert à rien
        public static WebContentCollection GetWebContents(string utilisateur, string section, bool b)
        {
            WebContentCollection newwcc     = new WebContentCollection();
            WebContentCollection collection = WebContentDAL.GetByUser(utilisateur);

            foreach (WebContent o in collection)
            {
                if (o.Section == section)
                {
                    newwcc.Add(o);
                }
            }
            return(newwcc);
        }
Exemplo n.º 3
0
        public static WebContentCollection GetAll()
        {
            DataSet ds = new DataSet();

            ds = SqlDataProvider.ExecuteDataset
                 (
                Tools.DatabaseConnectionString,
                CommandType.StoredProcedure,
                "GetWebContentAll"
                 );

            WebContentCollection oc = new WebContentCollection();

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                WebContent o = WebContent.Fill(r);
                oc.Add(o);
            }
            return(oc);
        }