Exemplo n.º 1
0
        public static DataTable GetFeeds(int moduleId)
        {
            using (var dataTable = new DataTable())
            {
                dataTable.Columns.Add("ItemID", typeof(int));
                dataTable.Columns.Add("ItemGuid", typeof(Guid));
                dataTable.Columns.Add("ModuleID", typeof(int));
                dataTable.Columns.Add("ModuleGuid", typeof(Guid));
                dataTable.Columns.Add("Author", typeof(string));
                dataTable.Columns.Add("Url", typeof(string));
                dataTable.Columns.Add("RssUrl", typeof(string));
                dataTable.Columns.Add("ImageUrl", typeof(string));
                dataTable.Columns.Add("FeedType", typeof(string));
                dataTable.Columns.Add("PublishByDefault", typeof(bool));
                dataTable.Columns.Add("TotalEntries", typeof(int));


                using (IDataReader reader = DBRssFeed.GetFeeds(moduleId))
                {
                    while (reader.Read())
                    {
                        DataRow row = dataTable.NewRow();
                        row["ItemID"]           = reader["ItemID"];
                        row["ItemGuid"]         = new Guid(reader["ItemGuid"].ToString());
                        row["ModuleID"]         = reader["ModuleID"];
                        row["ModuleGuid"]       = new Guid(reader["ModuleGuid"].ToString());
                        row["Author"]           = reader["Author"];
                        row["Url"]              = reader["Url"];
                        row["RssUrl"]           = reader["RssUrl"];
                        row["ImageUrl"]         = reader["ImageUrl"];
                        row["FeedType"]         = reader["FeedType"];
                        row["PublishByDefault"] = Convert.ToBoolean(reader["PublishByDefault"]);
                        row["TotalEntries"]     = Convert.ToInt32(reader["TotalEntries"]);

                        dataTable.Rows.Add(row);
                    }
                }//using

                return(dataTable);
            }//using
        }
Exemplo n.º 2
0
 public static DataSet GetFeeds(int moduleId)
 {
     return(DBRssFeed.GetFeeds(moduleId));
 }