Beispiel #1
0
        protected void Button_OK_Click(object sender, EventArgs e)
        {
            //Response.Write(SelectedCategoryID);
            BrandCategoryRelationBll relationBll = new BrandCategoryRelationBll();

            DataTable dt = relationBll.GetCategoryBrandList(SelectedCategoryID);

            if (dt.Rows.Count <= 0)
            {
                //MessageBox.Show(this, "当前分类下尚无品牌,请先添加品牌!");
                MessageBox.ResponseScript(this, @"
                    if(confirm('当前分类下尚无品牌,是否转向品牌添加页面?'))
                        window.self.location.href='/Brand/Relation/List.aspx?cid=" + SelectedCategoryID + @"';
                    ");
                return;
            }

            LastSelectedCategoryPath = bll.GetModel(SelectedCategoryID).CatePath;

            if (!String.IsNullOrEmpty(Request.QueryString["pid"]))
            {
                Response.Redirect(String.Format("edit.aspx?ProductID={0}&CategoryID={1}", Request.QueryString["pid"], SelectedCategoryID));
            }
            else
            {
                Response.Redirect(String.Format("add.aspx?CategoryID={0}", SelectedCategoryID));
            }
        }
Beispiel #2
0
        private void InitConditionItems(int cateId)
        {
            BrandCategoryRelationBll bcrbll = new BrandCategoryRelationBll();

            this.cblBrands.DataSource     = bcrbll.GetCategoryBrandList(cateId);
            this.cblBrands.DataTextField  = "BrandName";
            this.cblBrands.DataValueField = "BrandId";
            this.cblBrands.DataBind();

            NoName.NetShop.Product.BLL.CategoryModelBll cbll = new CategoryModelBll();
            this.cblSubCate.DataSource     = cbll.GetSubCategory(cateId);
            this.cblSubCate.DataTextField  = "CateName";
            this.cblSubCate.DataValueField = "CateId";
            this.cblSubCate.DataBind();


            CategoryParaModelBll     cpbll = new CategoryParaModelBll();
            List <CategoryParaModel> plist = cpbll.GetModelList("status=1 and paratype=1 and cateid=" + cateId);

            rpItems.DataSource = plist;
            rpItems.DataBind();
        }
 private void BindData(int CategoryID)
 {
     if (CategoryID != -1)
     {
         DataTable dt = bll.GetCategoryBrandList(CategoryID);
         if (dt.Rows.Count > 0)
         {
             dt.Columns.Add("brandurl");
             foreach (DataRow row in dt.Rows)
             {
                 row["brandurl"] = String.Format(ConfigurationManager.AppSettings["foreFlatRootUrl"] + "brand-{0}-c{1}.html", row["brandid"], CategoryID);
             }
             Repeater_BrandList.DataSource = dt;
             Repeater_BrandList.DataBind();
             Label_Informer.Text = String.Empty;
         }
         else
         {
             Repeater_BrandList.DataSource = new DataTable();
             Repeater_BrandList.DataBind();
             Label_Informer.Text = "该分类下暂无关联品牌";
         }
     }
 }