using System;
using System.Web.SessionState;
using TaoBaoAPI;
namespace TaoHuoNet
{
    public partial class Index :StaticFileCachePageBase, IRequiresSessionState
    {
        public int count = 1;
        public string sort = "credit_desc";
        public string web_description;
        public string web_keyword;

        private void BindHot(TaoBaoKe tbk)
        {
            tbk.Cid = "";
            tbk.Keyword = " ";
            tbk.Sort = this.sort;
            tbk.Page_size = "9";
            this.rptHot.DataSource = TaoBaoKe.GetItemsGet(tbk);
            this.rptHot.DataBind();
        }

        private void BindJiaDian(TaoBaoKe tbk)
        {
            tbk.Cid = "50012100";
            tbk.Sort = this.sort;
            tbk.Page_size = "4";
            this.rptJiaDian.DataSource = TaoBaoKe.GetItemsGet(tbk);
            this.rptJiaDian.DataBind();
        }

        private void BindMeiRong(TaoBaoKe tbk)
        {
            tbk.Cid = "1801";
            tbk.Sort = this.sort;
            tbk.Page_size = "4";
            this.rptMeiRong.DataSource = TaoBaoKe.GetItemsGet(tbk);
            this.rptMeiRong.DataBind();
        }

        private void BindMuYing(TaoBaoKe tbk)
        {
            tbk.Cid = "50008165";
            tbk.Sort = this.sort;
            tbk.Page_size = "4";
            this.rptMuYing.DataSource = TaoBaoKe.GetItemsGet(tbk);
            this.rptMuYing.DataBind();
        }

        private void BindNvZhuang(TaoBaoKe tbk)
        {
            tbk.Cid = "16";
            tbk.Sort = this.sort;
            tbk.Page_size = "4";
            this.rptNvZhuang.DataSource = TaoBaoKe.GetItemsGet(tbk);
            this.rptNvZhuang.DataBind();
        }

        private void BindShuMa(TaoBaoKe tbk)
        {
            tbk.Cid = "1512";
            tbk.Sort = this.sort;
            tbk.Page_size = "4";
            this.rptShuma.DataSource = TaoBaoKe.GetItemsGet(tbk);
            this.rptShuma.DataBind();
        }

        private void BindXie(TaoBaoKe tbk)
        {
            tbk.Cid = "50010388";
            tbk.Sort = this.sort;
            tbk.Page_size = "4";
            this.rptXie.DataSource = TaoBaoKe.GetItemsGet(tbk);
            this.rptXie.DataBind();
        }

        public int GetCount()
        {
            return this.count++;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
               
                this.Page.Title = Config.indexTitle;
                this.web_keyword = "\"" + Config.indexKey + "\"";
                this.web_description = "\"" + Config.indexDes + "\"";
                TaoBaoKe tbk = new TaoBaoKe();
                this.BindHot(tbk);
                this.BindNvZhuang(tbk);
                this.BindShuMa(tbk);
                this.BindXie(tbk);
                this.BindMeiRong(tbk);
                this.BindJiaDian(tbk);
                this.BindMuYing(tbk);
            }
        }

    }
}
