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 LoveBLL;
using Models;
namespace LoveWeb
{
    public partial class Forum : System.Web.UI.Page
    {
       
        protected void Page_Load(object sender, EventArgs e)
        {
         
            if (!IsPostBack)
            {
             
                bind();
            }

        }
        public static string GetPartString(string invi, int num)
        {
            return InvitationManager.GetPartString(invi, num);
        }

        public void bind()
        {
            PagedDataSource pds = new PagedDataSource();
            pds.DataSource = InvitationManager.GetAllInvi();
            pds.AllowPaging = true;
            pds.PageSize = AspNetPager1.PageSize;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
            AspNetPager1.RecordCount = InvitationManager.GetInviNum();
            DataList1.DataSource = pds;
            DataList1.DataBind();

        }

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

    }
}
