protected void dl_shop_category_ItemCommand(object source, System.Web.UI.WebControls.DataListCommandEventArgs e) { if (e.Item.ItemType != ListItemType.Footer) { int category_id = int.Parse(dl_shop_category.DataKeys[(int)e.Item.ItemIndex].ToString()); int shop_id = int.Parse(Session["shop_id"].ToString()); // dl_product.DataSource = shop_category.get_Shop_category_products(shop_id, category_id); //dl_product.DataBind(); // UpdatePanel_product.Update(); Bind_Dl_product(shop_category.get_Shop_category_promation(shop_id, category_id)); } else { int seller_id = int.Parse(Session["id"].ToString()); int shop_id = int.Parse((Seller.get_shop_ID(seller_id).Rows[0][0]).ToString()); Bind_Dl_product(Promotions.get_Shop_promotions(shop_id)); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int id = int.Parse(Session["id"].ToString()); lb_name.Text = BL.Seller.getName(id); // or int shop_id = int.Parse((Seller.get_shop_ID(id).Rows[0][0]).ToString()); Session["shop_id"] = shop_id; // dl_product.DataSource = Stock.get_shop_product(shop_id); // dl_product.DataBind(); Bind_Dl_product(Promotions.get_Shop_promotions(shop_id)); dl_shop_category.DataSource = shop_category.get_shop_category(shop_id); dl_shop_category.DataBind(); // DataTable d = (DataTable)dl_product.DataSource; } }