Ejemplo n.º 1
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["BrandId"], out this.BrandId))
            {
                base.GotoResourceNotFound("");
            }
            this.imgUrl         = (HiImage)this.FindControl("imgUrl");
            this.rptProducts    = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.litBrandDetail = (System.Web.UI.WebControls.Literal) this.FindControl("litBrandDetail");
            this.txtTotal       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            BrandCategoryInfo brandCategory = CategoryBrowser.GetBrandCategory(this.BrandId);

            this.litBrandDetail.SetWhenIsNotNull(brandCategory.Description);
            this.imgUrl.ImageUrl = brandCategory.Logo;
            int pageNumber;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageNumber))
            {
                pageNumber = 1;
            }
            int maxNum;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out maxNum))
            {
                maxNum = 20;
            }
            int num;

            this.rptProducts.DataSource = ProductBrowser.GetBrandProducts(MemberProcessor.GetCurrentMember(), new int?(this.BrandId), pageNumber, maxNum, out num);
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(num.ToString());
            PageTitle.AddSiteNameTitle("品牌详情");
        }
Ejemplo n.º 2
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["BrandId"], out this.BrandId))
            {
                base.GotoResourceNotFound("");
            }
            this.imgUrl         = (HiImage)this.FindControl("imgUrl");
            this.rptProducts    = (AppshopTemplatedRepeater)this.FindControl("rptProducts");
            this.litBrandDetail = (Literal)this.FindControl("litBrandDetail");
            this.txtTotal       = (HtmlInputHidden)this.FindControl("txtTotal");
            BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(this.BrandId);

            this.litBrandDetail.SetWhenIsNotNull(brandCategory.Description);
            this.imgUrl.ImageUrl = brandCategory.Logo;
            int pageNumber = default(int);

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageNumber))
            {
                pageNumber = 1;
            }
            int maxNum = default(int);

            if (!int.TryParse(this.Page.Request.QueryString["size"], out maxNum))
            {
                maxNum = 20;
            }
            DbQueryResult brandProducts = ProductBrowser.GetBrandProducts(this.BrandId, pageNumber, maxNum);

            this.rptProducts.DataSource = brandProducts.Data;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(brandProducts.TotalRecords.ToString());
            PageTitle.AddSiteNameTitle("品牌详情");
        }
Ejemplo n.º 3
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["BrandId"], out this.BrandId))
            {
                base.GotoResourceNotFound("");
            }
            this.imgUrl         = (HiImage)this.FindControl("imgUrl");
            this.rptProducts    = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.litBrandDetail = (System.Web.UI.WebControls.Literal) this.FindControl("litBrandDetail");
            this.txtTotal       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            this.litContent     = (System.Web.UI.WebControls.Literal) this.FindControl("litContent");
            BrandCategoryInfo brandCategory = CategoryBrowser.GetBrandCategory(this.BrandId);

            this.litBrandDetail.SetWhenIsNotNull(brandCategory.Description);
            this.imgUrl.ImageUrl = brandCategory.Logo;
            int pageNumber;

            this.litContent.Text = brandCategory.BrandName;
            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageNumber))
            {
                pageNumber = 1;
            }
            int maxNum;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out maxNum))
            {
                maxNum = 20;
            }
            int num;
            ProductBrowseQuery query = new ProductBrowseQuery();

            query.SortOrder = SortAction.Desc;
            query.SortBy    = "DisplaySequence";
            query.PageIndex = 1;
            query.PageSize  = 12;
            //this.rptProducts.DataSource = ProductBrowser.GetBrandProducts(new int?(this.BrandId), pageNumber, maxNum, out num);
            DbQueryResult dataProducts = ProductBrowser.GetBrandProducts(new int?(this.BrandId), query);

            this.rptProducts.DataSource = dataProducts.Data;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(dataProducts.TotalRecords.ToString());
            PageTitle.AddSiteNameTitle("品牌详情");
        }