Esempio n. 1
0
        public static DataTable GetPostsByPage(int siteId, int pageId)
        {
            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("PostID", typeof(int));
            dataTable.Columns.Add("ItemID", typeof(int));
            dataTable.Columns.Add("ThreadID", typeof(int));
            dataTable.Columns.Add("ModuleID", typeof(int));
            dataTable.Columns.Add("ModuleTitle", typeof(string));
            dataTable.Columns.Add("Subject", typeof(string));
            dataTable.Columns.Add("Post", typeof(string));
            dataTable.Columns.Add("ViewRoles", typeof(string));

            using (IDataReader reader = DBForums.ForumThreadGetPostsByPage(siteId, pageId))
            {
                while (reader.Read())
                {
                    DataRow row = dataTable.NewRow();
                    row["PostID"]      = reader["PostID"];
                    row["ItemID"]      = reader["ItemID"];
                    row["ModuleID"]    = reader["ModuleID"];
                    row["ThreadID"]    = reader["ThreadID"];
                    row["ModuleTitle"] = reader["ModuleTitle"];
                    row["Subject"]     = reader["Subject"];
                    row["Post"]        = reader["Post"];
                    row["ViewRoles"]   = reader["ViewRoles"];

                    dataTable.Rows.Add(row);
                }
            }

            return(dataTable);
        }