using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Admin_Blog_Vetting : System.Web.UI.Page { /****************************************************************************************************/ /// /// Handles the Load event of the Page control. /// /// The source of the event. /// The instance containing the event data. protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) BindBlogs(); } /****************************************************************************************************/ /// /// Binds the blogs. /// private void BindBlogs() { dsBlogs.SelectCommandType = SqlDataSourceCommandType.StoredProcedure; dsBlogs.SelectCommand = "BlogComment_AdminList"; dsBlogs.SelectParameters.Clear(); dsBlogs.SelectParameters.Add("BlogStatus", TypeCode.Int32, "0"); rptBlog.DataBind(); pnlNoComment.Visible = (rptBlog.Items.Count == 0); pnlButtons.Visible = !pnlNoComment.Visible; rptBlog.Visible = pnlButtons.Visible; } /****************************************************************************************************/ /// /// Saves the blog comments. /// /// The sender. /// The instance containing the event data. protected void Save(object sender, EventArgs e) { clsBlogComment comm = new clsBlogComment(); foreach (RepeaterItem comment in rptBlog.Items) { comm.Clear(); comm.bc_id = Convert.ToInt32(((HiddenField)comment.FindControl("bc_id")).Value); comm.bc_user = ((TextBox)comment.FindControl("tbUser")).Text; comm.bc_post = ((TextBox)comment.FindControl("tbPost")).Text; comm.bl_status = Convert.ToInt32(((RadioButtonList)comment.FindControl("rblStatus")).SelectedValue); comm.Moderate(); } BindBlogs(); subMenu.DisplayBlogCount(); } }