Imports CharterDotCom.CommonEntities.Library.Enumerations
Imports CharterDotCom.WebSite.Library
Imports CharterDotCom.CommonEntities.Library

Partial Class Visitors_Channels
    Inherits CharterCMSPage

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        GetCMSContent("Home:ShowSubMenu", Me.litScriptToSelectSubMenu)
        SetItemContentKeys()
    End Sub

    Private Sub SetItemContentKeys()
        If Not (Request.QueryString(QueryStringName.Channel) Is Nothing) Then
            Dim _channelid As Channel = Channel.Unspecified
            _channelid = CType(Request.QueryString(QueryStringName.Channel), Channel)

            channelSearchContainer.Visible = False
            CustomContent1.Visible = True

            Select Case _channelid
                Case Channel.Sports
                    Me.CustomContent1.ContentKey = "product:cable:sports:heroflash"
                    Me.CustomContent6.ContentKey = "product:cable:DVR:bottomrightpromotion"
                    Me.CustomContent4.ContentKey = "product:phone:sploffers:bottomLeftPromotion"
                    Me.CustomContent5.ContentKey = "product:cable:programmingflash"
                Case Channel.Family
                    Me.CustomContent1.ContentKey = "product:cable:family:heroflash"
                    Me.CustomContent6.ContentKey = "product:cable:DVR:bottomrightpromotion"
                    Me.CustomContent4.ContentKey = "product:phone:sploffers:bottomLeftPromotion"
                    Me.CustomContent5.ContentKey = "product:cable:programmingflash"
                Case Channel.Women
                    Me.CustomContent1.ContentKey = "product:cable:women:heroflash"
                    Me.CustomContent6.ContentKey = "product:cable:DVR:bottomrightpromotion"
                    Me.CustomContent4.ContentKey = "product:phone:sploffers:bottomLeftPromotion"
                    Me.CustomContent5.ContentKey = "product:cable:programmingflash"
                Case Channel.Men
                    Me.CustomContent1.ContentKey = "product:cable:men:heroflash"
                    Me.CustomContent6.ContentKey = "product:cable:DVR:bottomrightpromotion"
                    Me.CustomContent4.ContentKey = "product:phone:sploffers:bottomLeftPromotion"
                    Me.CustomContent5.ContentKey = "product:cable:programmingflash"
                Case Channel.Children
                    Me.CustomContent1.ContentKey = "product:cable:children:heroflash"
                    Me.CustomContent6.ContentKey = "product:cable:DVR:bottomrightpromotion"
                    Me.CustomContent4.ContentKey = "product:phone:sploffers:bottomLeftPromotion"
                    Me.CustomContent5.ContentKey = "product:cable:programmingflash"
                Case Channel.Movie
                    Me.CustomContent1.ContentKey = "product:cable:movie:heroflash"
                    Me.CustomContent6.ContentKey = "product:cable:DVR:bottomrightpromotion"
                    Me.CustomContent4.ContentKey = "product:phone:sploffers:bottomLeftPromotion"
                    Me.CustomContent5.ContentKey = "product:cable:programmingflash"
                Case Channel.Food
                    Me.CustomContent1.ContentKey = "product:cable:food:heroflash"
                    Me.CustomContent6.ContentKey = "product:cable:DVR:bottomrightpromotion"
                    Me.CustomContent4.ContentKey = "product:phone:sploffers:bottomLeftPromotion"
                    Me.CustomContent5.ContentKey = "product:cable:programmingflash"
            End Select

        Else
            channelSearchContainer.Visible = True
            CustomContent1.Visible = False
        End If

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        SetPageTitle("Channels")
    End Sub

    Private Sub GetCMSContent(ByVal userControlName As String, ByRef literalControl As Literal)
        Dim cmsContent As String = String.Empty
        cmsContent = ContentManager.Instance.GetContent(userControlName, "1", OwnerType.Other)
        If Not (cmsContent Is Nothing) Then
            literalControl.Text = cmsContent
        Else
            literalControl.Text = "content not found: " & userControlName
        End If
    End Sub
End Class
