public Forum(int forumID) { umbraco.DataLayer.IRecordsReader dr = Data.SqlHelper.ExecuteReader("SELECT * FROM forumForums WHERE ID = @id", Data.SqlHelper.CreateParameter("@id", forumID)); if (dr.Read()) { Node n = new Node(dr.GetInt("id")); Forum f = new Forum(); Id = dr.GetInt("id"); Title = n.Name; if (n.GetProperty("forumDescription") != null) { Description = n.GetProperty("forumDescription").Value; } Exists = true; TotalComments = dr.GetInt("totalComments"); TotalTopics = dr.GetInt("totalTopics"); //Latest private vals _latestAuthorID = dr.GetInt("latestAuthor"); _latestCommentID = dr.GetInt("latestComment"); _latestTopicID = dr.GetInt("latestTopic"); LatestPostDate = dr.GetDateTime("latestPostDate"); } else { Exists = false; } dr.Close(); dr.Dispose(); }
private void FillGrid() { umbraco.DataLayer.IRecordsReader dr = Data.SqlHelper.ExecuteReader("SELECT * FROM forumComments WHERE memberId = " + memberId.Text); commentsGrid.DataSource = dr; commentsGrid.DataBind(); dr.Close(); dr.Dispose(); }
public static List <uForum.Businesslogic.Forum> GetSubscribedForums(int memberId) { List <uForum.Businesslogic.Forum> lt = new List <uForum.Businesslogic.Forum>(); umbraco.DataLayer.IRecordsReader dr = Data.SqlHelper.ExecuteReader( "SELECT forumId FROM forumSubscribers WHERE memberId = " + memberId.ToString() ); while (dr.Read()) { lt.Add(new uForum.Businesslogic.Forum(dr.GetInt("forumId"))); } dr.Close(); dr.Dispose(); return(lt); }