using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spaces;
using Spaces.Blog;
using System.Collections.Generic;
public partial class Admin_FreeBack : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        rprSelectionList.ItemCommand += new RepeaterCommandEventHandler(rprSelectionList_ItemCommand);
        if (!IsPostBack)
            BindList();
    }
    void BindList()
    {
        UserConfig uc = Tools.GetUserConfigBySession();
        PagedFeedBack pf = new PagedFeedBack(0, FreebackPager.CurrentPageIndex, FreebackPager.PageSize);
        pf.BlogID = uc.BlogID;
        int count;
        List<BlogComment> list = Blogs.GetAllPagedFeedBack(pf, out count);
        FreebackPager.RecordCount = count;
        this.rprSelectionList.DataSource = list;
        this.rprSelectionList.DataBind();
        //Response.Write(count.ToString());

    }
    protected void FreebackPager_PageChanged(object src, Xiaoxiao.WebUI.PageChangedEventArgs e)
    {
        FreebackPager.CurrentPageIndex = e.NewPageIndex;
        BindList();
    }
    private void rprSelectionList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
    {
        switch (e.CommandName.ToLower())
        {
            case "delete":
                int id = Convert.ToInt32(e.CommandArgument);
                Blogs.DelPost(id);

                break;
            default:
                break;
        }
        BindList();
    }
}
