//大类>>小类,商品点击量|购买量    批量操作上下架
        private void BindData(int PageIndex)
        {
            if (SearchCondition != ConstructSearchCondition())
            {
                SearchCondition = ConstructSearchCondition();
            }

            //Response.Write(SearchCondition);
            int       RecordCount = 0;
            DataTable dt          = bll.GetList(PageIndex, AspNetPager.PageSize, SearchCondition, out RecordCount).Tables[0];

            //Response.Write("<br/>recordcount:"+RecordCount);

            dt.Columns.Add("producturl");
            dt.Columns.Add("secondarycategoryid");
            dt.Columns.Add("secondarycategoryname");
            dt.Columns.Add("endcategoryid");
            dt.Columns.Add("endcategoryname");
            dt.Columns.Add("ishotsale");
            dt.Columns.Add("isreduce");
            dt.Columns.Add("isrecommend");

            foreach (DataRow row in dt.Rows)
            {
                string CategoryNamePath = new CategoryModelBll().GetCategoryNamePath(Convert.ToInt32(row["cateid"]));
                string CategoryIDPath   = new CategoryModelBll().GetCategoryPath(Convert.ToInt32(row["cateid"]));
                row["producturl"] = GetProductUrl(Convert.ToInt32(row["productid"]));

                row["secondarycategoryid"] = CategoryIDPath.Split('/')[1];
                row["endcategoryid"]       = CategoryIDPath.Split('/')[CategoryIDPath.Split('/').Length - 2];

                row["secondarycategoryname"] = CategoryNamePath.Split('/')[1];
                row["endcategoryname"]       = CategoryNamePath.Split('/')[CategoryNamePath.Split('/').Length - 2];

                SalesProductModelBll salesBll = new SalesProductModelBll();
                row["ishotsale"]   = salesBll.Exists(Convert.ToInt32(row["productid"]), SalesProductType.热销商品);
                row["isreduce"]    = salesBll.Exists(Convert.ToInt32(row["productid"]), SalesProductType.直降特卖);
                row["isrecommend"] = salesBll.Exists(Convert.ToInt32(row["productid"]), SalesProductType.鼎鼎推荐);
            }

            GridView1.DataSource = dt;
            GridView1.DataBind();

            AspNetPager.RecordCount      = RecordCount;
            AspNetPager.CurrentPageIndex = PageIndex;

            //InitializeSerchCondition();
        }
示例#2
0
        private void BindSalesData()
        {
            DataSet ds = new SalesProductModelBll().GetListForShoppingProcedure();

            foreach (DataTable dt in ds.Tables)
            {
                foreach (DataRow row in dt.Rows)
                {
                    row["mediumimage"] = ProductMainImageRule.GetMainImageUrl(row["mediumimage"].ToString());
                }
            }

            Repeater_Reduce.DataSource = ds.Tables[0];
            Repeater_Reduce.DataBind();
            Repeater_Recommend.DataSource = ds.Tables[1];
            Repeater_Recommend.DataBind();
            Repeater_HotSale.DataSource = ds.Tables[2];
            Repeater_HotSale.DataBind();
        }