using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Models;
using LoveBLL;

namespace LoveWeb.Admin
{
    public partial class soulManager : System.Web.UI.Page
    {
  
        protected void Page_Load(object sender, EventArgs e)
        {
           
            if (!IsPostBack)
            {
                //int count = pds.Count;
                //AspNetPager1.RecordCount = count;
                //AspNetPager1.PageSize = 1;
                bind();
            }

        }

        public void bind()
        {
            PagedDataSource pds = new PagedDataSource();
            pds.DataSource = ArticleManager.GetAllArti();
            pds.AllowPaging = true;
            pds.PageSize = AspNetPager1.PageSize;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
            AspNetPager1.RecordCount = ArticleManager.GetArtiNum();
            DataList1.DataSource = pds;
            DataList1.DataBind();

        }
        public static string GetPartString(string arti_contents, int num)
        {
            return ArticleManager.GetPart(arti_contents, num);
        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            bind();
        }
    }
}

