/// <summary> /// The GetThreadMessages method is used to obtain the list /// of messages contained within a sub-topic of the /// a top-level discussion message thread. This method is /// used to populate the "DetailList" asp:datalist server control /// in the SelectedItemTemplate of "TopLevelList". /// </summary> /// <returns>returns a SqlDataReader object</returns> protected SqlDataReader GetThreadMessages() { DiscussionDB discuss = new DiscussionDB(); int itemID = Int32.Parse(TopLevelList.DataKeys[TopLevelList.SelectedIndex].ToString()); SqlDataReader dr = discuss.GetThreadMessages(itemID, 'N'); return(dr); }
/// <summary> Binds the threads from the database to the list control </summary> /// <param name="ItemID"> itemID of ANY of the topics in the thread </param> /// <returns>returns nothing</returns> private void BindList(int ItemID) { // Obtain a list of discussion messages for the module and bind to datalist DiscussionDB discuss = new DiscussionDB(); ThreadList.DataSource = discuss.GetThreadMessages(ItemID, 'Y'); // 'Y' means include rootmessage ThreadList.DataBind(); }