﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using ICaiBan.IBLL;
using ICaiBan.Remoting.Client;
using ICaiBan.ModelBL.Merchant;
namespace MerchantManager.member
{
    /// <summary>
    /// 会员条件赠送商品
    /// author:邓俊龙
    /// create:2013-6-8
    /// </summary>
    public partial class gift : FatherPage
    {
        protected IMerchant merchant = (Merchant)InvokeRemoting.GetObj<IMerchant>();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (base.IsFirstLoad)
            {
                BindProducts();
            }
        }

        #region 绑定赠送商品显示及分页绑定
        /// <summary>
        /// 绑定商品显示
        /// </summary>
        protected void BindProducts()
        {
            PageInfo page = new PageInfo(Paging.CurrentPageIndex, Paging.PageSize);
            int count=0;
            List<Product> list = merchant.GetGiveProduct(new MerchantCommonParam(this.CompanyID), page,out count);
            if (list != null && list.Count > 0)
            {
                RepeaterProduct.DataSource = list;
                RepeaterProduct.DataBind();
                Paging.RecordCount = count;
            }
            Paging.TextBeforePageIndexBox = "共&nbsp;" + Paging.PageCount + "&nbsp;页&nbsp;&nbsp;&nbsp;到第";
        }
        //跳页
        protected void Paging_PageChanged(object sender, EventArgs e)
        {
            BindProducts();
        }
        #endregion

        
    }
}