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.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using LZBS.Model;
using LZBS.BLL;

namespace LZBS.Web
{
    public partial class ProductList : System.Web.UI.Page
    {
        M_Product model = new M_Product();
        B_Product bll = new B_Product();
        protected void Page_Load(object sender, EventArgs e)
        {
            anpPager.RecordCount = bll.GetProductList().Rows.Count;
            ProductBind();
        }

        private void ProductBind()
        {
            PagedDataSource pdsList = new PagedDataSource();
            //对PagedDataSource 对象的相关属性赋值        
            pdsList.DataSource = bll.GetProductList().DefaultView;
            pdsList.AllowPaging = true;
            pdsList.PageSize = anpPager.PageSize;
            //pdsList.AllowCustomPaging = true;
            pdsList.CurrentPageIndex = anpPager.CurrentPageIndex - 1;
            dlProduct.DataSource = pdsList;
            dlProduct.DataBind();
        }

        protected void anpPager_PageChanged(object sender, EventArgs e)
        {
            ProductBind();
        }


    }
}
