Exemplo n.º 1
0
 public override void DataBind()
 {
     this.Items.Clear();
     Maticsoft.BLL.Shop.Products.BrandInfo info = new Maticsoft.BLL.Shop.Products.BrandInfo();
     foreach (Maticsoft.Model.Shop.Products.BrandInfo info2 in info.GetBrands())
     {
         base.Items.Add(new ListItem(info2.BrandName, info2.BrandId.ToString()));
     }
 }
Exemplo n.º 2
0
 private void GetBrandsKVList(HttpContext context)
 {
     List<Maticsoft.Model.Shop.Products.BrandInfo> brands;
     JsonObject obj2 = new JsonObject();
     Maticsoft.BLL.Shop.Products.BrandInfo info = new Maticsoft.BLL.Shop.Products.BrandInfo();
     int productTypeId = Globals.SafeInt(context.Request.Form["ProductTypeId"], -1);
     if (productTypeId < 1)
     {
         brands = info.GetBrands();
     }
     else
     {
         brands = info.GetModelListByProductTypeId(productTypeId, -1);
     }
     JsonArray data = new JsonArray();
     brands.ForEach(delegate (Maticsoft.Model.Shop.Products.BrandInfo info) {
         data.Add(new JsonObject(new string[] { "BrandId", "BrandName" }, new object[] { info.BrandId, info.BrandName }));
     });
     obj2.Put("STATUS", "SUCCESS");
     obj2.Put("DATA", data);
     context.Response.Write(obj2.ToString());
 }