protected void ProRPT_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView dr = e.Item.DataItem as DataRowView; if (DataConvert.CStr(dr["Class"]) == "2")//套装促销 { Repeater rpt = e.Item.FindControl("SuitPro_RPT") as Repeater; rpt.DataSource = proBll.Suit_GetProduct(DataConvert.CStr(dr["procontent"]), DataConvert.CLng(dr["Pronum"])); rpt.DataBind(); } } }
protected void ProRPT_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView dr = e.Item.DataItem as DataRowView; switch (DataConvert.CLng(dr["Class"])) { case 2: //套装促销 Repeater rpt = e.Item.FindControl("SuitPro_RPT") as Repeater; rpt.DataSource = proBll.Suit_GetProduct(DataConvert.CStr(dr["procontent"]), DataConvert.CLng(dr["Pronum"])); rpt.DataBind(); break; default: //普通商品,支持赠品等促销逻辑 { Label ptLabel = e.Item.FindControl("Present_HTML") as Label; ptLabel.Text = PageHelper.Aspx_GetHtml("/cart/comp/cart_present.aspx", dr); } break; } } }