productpromotioncontrol.ascx.vb

来自「C#语言制作asp.net网上商店的」· VB 代码 · 共 45 行

VB
45
字号
Imports NetShopForge.Library.SpecialOffer

Partial Class Shop_Product_ProductPromotionControl
    Inherits System.Web.UI.UserControl

    Public ProductID As Integer
    Public SpecialList As Generic.List(Of SpecialOfferInfo)

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then


            Dim spIDs As String = SpecialOfferController.GetAvailableSpecialOfferString(ProductID, "P")
            SpecialList = SpecialOfferController.GetSpecialOfferList(New String() {spIDs.ToString})
            BindData()


        End If


    End Sub

    Private Sub BindData()
        dlProductPromotion.DataSource = SpecialList
        dlProductPromotion.DataBind()
    End Sub

    Protected Sub dlProductPromotion_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles dlProductPromotion.ItemDataBound
        Dim lbPromotionTitle As Label = e.Item.FindControl("lbPromotionTitle")

        Dim objSP As SpecialOfferInfo = SpecialList.Item(e.Item.ItemIndex)
        If objSP.ShortPromoText.Length > 0 Then
            lbPromotionTitle.Text = objSP.ShortPromoText
        Else
            lbPromotionTitle.Text = objSP.Title
        End If

        If objSP.BonusType = BonusType.SpecialPrice Then


        End If
    
    End Sub
End Class

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?