예제 #1
0
        /// <summary>
        /// 绑定品牌信息
        /// </summary>
        private void BrandsBind()
        {
            WebSiteData.Brands brands = new WebSiteData.Brands();

            //获得某一个站点所有的数据分类
            DataTable dt = brands.GetList("").Tables[0];

            this.ddBrands.Items.Clear();
            this.ddBrands.Items.Add(new ListItem("品牌信息", ""));//默认值是0

            foreach (DataRow dr in dt.Rows)
            {
                string Id    = dr["BrandsID"].ToString();
                string Title = dr["BrandsName"].ToString().Trim();
                this.ddBrands.Items.Add(new ListItem(Title, Id));
            }
        }
예제 #2
0
        /// <summary>
        /// 组合查询的条件
        /// </summary>
        /// <param name="_strWhere">组合条件</param>
        /// <param name="_orderby"></param>
        private void RptBind(string _strWhere, string _orderby)
        {
            //得到第几页数据
            this.page = DTRequest.GetQueryInt("page", 1);

            //绑定关键字
            this.txtKeywords.Text = this.keywords;

            WebSiteData.Brands mdata = new WebSiteData.Brands();

            //参数分别是:每页条数  第几页  查询条件 排序条件 数据总数
            this.rptList.DataSource = mdata.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("BrandsList.aspx", urlParamsPage, this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
            litCount.Text         = this.totalCount.ToString();
        }