Example #1
0
        public static DataTable GetHtmlContentByPage(int siteId, int pageId)
        {
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("ItemID", typeof(int));
            dataTable.Columns.Add("ModuleID", typeof(int));
            dataTable.Columns.Add("ModuleTitle", typeof(string));
            dataTable.Columns.Add("Title", typeof(string));
            dataTable.Columns.Add("Body", typeof(string));
            dataTable.Columns.Add("ViewRoles", typeof(string));

            using (IDataReader reader = DBHtmlContent.GetHtmlContentByPage(siteId, pageId))
            {
                while (reader.Read())
                {
                    DataRow row = dataTable.NewRow();

                    row["ItemID"]      = reader["ItemID"];
                    row["ModuleID"]    = reader["ModuleID"];
                    row["ModuleTitle"] = reader["ModuleTitle"];
                    row["Title"]       = reader["Title"];
                    row["Body"]        = reader["Body"];
                    row["ViewRoles"]   = reader["ViewRoles"];

                    dataTable.Rows.Add(row);
                }
            }

            return(dataTable);
        }
Example #2
0
        public DataTable GetHtmlContentByPage(int siteId, int pageId)
        {
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("ItemID", typeof(int));
            dataTable.Columns.Add("ModuleID", typeof(int));
            dataTable.Columns.Add("ModuleTitle", typeof(string));
            dataTable.Columns.Add("Title", typeof(string));
            dataTable.Columns.Add("Body", typeof(string));
            dataTable.Columns.Add("ViewRoles", typeof(string));
            dataTable.Columns.Add("IncludeInSearch", typeof(bool));

            dataTable.Columns.Add("CreatedByName", typeof(string));
            dataTable.Columns.Add("CreatedByFirstName", typeof(string));
            dataTable.Columns.Add("CreatedByLastName", typeof(string));

            dataTable.Columns.Add("CreatedDate", typeof(DateTime));
            dataTable.Columns.Add("LastModUtc", typeof(DateTime));
            dataTable.Columns.Add("ExcludeFromRecentContent", typeof(bool));



            using (IDataReader reader = DBHtmlContent.GetHtmlContentByPage(siteId, pageId))
            {
                while (reader.Read())
                {
                    DataRow row = dataTable.NewRow();

                    row["ItemID"]      = reader["ItemID"];
                    row["ModuleID"]    = reader["ModuleID"];
                    row["ModuleTitle"] = reader["ModuleTitle"];
                    row["Title"]       = reader["Title"];
                    row["Body"]        = reader["Body"];
                    row["ViewRoles"]   = reader["ViewRoles"];

                    row["CreatedByName"]      = reader["CreatedByName"];
                    row["CreatedByFirstName"] = reader["CreatedByFirstName"];
                    row["CreatedByLastName"]  = reader["CreatedByLastName"];

                    row["IncludeInSearch"] = Convert.ToBoolean(reader["IncludeInSearch"]);

                    row["CreatedDate"] = Convert.ToDateTime(reader["CreatedDate"]);
                    row["LastModUtc"]  = Convert.ToDateTime(reader["LastModUtc"]);
                    row["ExcludeFromRecentContent"] = Convert.ToBoolean(reader["ExcludeFromRecentContent"]);

                    dataTable.Rows.Add(row);
                }
            }

            return(dataTable);
        }