Imports CharterDotCom.CommonEntities.Library
Imports CharterDotCom.CommonEntities.Library.Enumerations
Imports CharterDotCom.CommonEntities.Library.EntityMemberServices
Imports CharterDotCom.CommonEntities.Library.EntityEBSServices
Imports CharterDotCom.CommonEntities.Library.EntitySupport
Imports CharterDotCom.CommonEntities.Library.EntitySearch
Imports CharterDotCom.CommonEntities.Library.EntityWebConfig
Imports CharterDotCom.CommonEntities.Library.EntityG2BServices
Imports CharterDotCom.CommonEntities.Library.Common
Imports CharterDotCom.WebSite.Library
Imports System.Collections.Generic

Partial Class Controls_LocalNavigation
    Inherits System.Web.UI.UserControl

    Dim _account As IAccount
    Public _billSystemLink As String = ""


    Public Property Account() As IAccount
        Get
            Return _account
        End Get
        Set(ByVal value As IAccount)
            _account = value
        End Set
    End Property

    Public Property Item() As MenuItem
        Get
            If ViewState(Me.ID & "_Item") Is Nothing Then
                Return MenuItem.Unspecified
            Else
                Return CType(ViewState(Me.ID & "_Item"), MenuItem)
            End If
        End Get

        Set(ByVal value As MenuItem)
            ViewState(Me.ID & "_Item") = value
        End Set
    End Property

    Public Property SubItem() As ProductItem
        Get
            If ViewState(Me.ID & "_SubItem") Is Nothing Then
                Return MenuItem.Unspecified
            Else
                Return CType(ViewState(Me.ID & "_SubItem"), ProductItem)
            End If
        End Get

        Set(ByVal value As ProductItem)
            ViewState(Me.ID & "_SubItem") = value
        End Set
    End Property

    Public Property SubItem2() As NonProductItem
        Get
            If ViewState(Me.ID & "_SubItem2") Is Nothing Then
                Return MenuItem.Unspecified
            Else
                Return CType(ViewState(Me.ID & "_SubItem2"), NonProductItem)
            End If
        End Get

        Set(ByVal value As NonProductItem)
            ViewState(Me.ID & "_SubItem2") = value
        End Set
    End Property

    Public _navigationtype As NavigationType
    Public Property NavigationType() As NavigationType
        Get
            Return _navigationtype
        End Get
        Set(ByVal value As NavigationType)
            _navigationtype = value
        End Set
    End Property

    Public _isPanel3 As Boolean = False
    Public Property IsPanel3() As Boolean
        Get
            Return _isPanel3
        End Get
        Set(ByVal value As Boolean)
            _isPanel3 = value
        End Set
    End Property

    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
        ShowPanel()

        Select Case NavigationType
            Case NavigationType.Tab
                Me.pnlMyAccountTabNavigation.Visible = True
                Me.pnlMyAccount.Visible = False
            Case NavigationType.List
                Me.pnlMyAccountTabNavigation.Visible = False
                Me.pnlMyAccount.Visible = True
        End Select

    End Sub

    Protected Sub ShowPanel()

        _account = AccountManager.Instance.GetAccount()
        If Not (_account Is Nothing) Then
            If Not (_account.ExistingService Is Nothing) Then
                '#################################################################
                'IF THE ACCOUNT HAS A DATA PLAN THEN SHOW THE LINKS ON THE PAGE 
                'THAT ALLOW THE USER TO MANAGE THE DATA RELATED PAGES.  IF THE 
                'DATA PLAN DOESNT EXIST THEN DONT SHOW THE LINKS ON THE PAGE.
                '#################################################################
                If _account.ExistingService.Contains(Category.HSD) Then


                    '##########################################################################
                    'MODIFICATION   ROD COPELAND    4/13/2010   ISSUE ID 8892
                    '##########################################################################
                    'SHOW CHARTER BUSINESS SPECIFIC CONTENT RECORD IN THE EVENT THIS IS A CB 
                    'CUSTOMER.
                    '##########################################################################
                    If Not String.IsNullOrEmpty(Application("ENABLE_CHARTER_BUSINESS_MYACCOUNT_CONTENTRECORDS")) AndAlso _
                    Application("ENABLE_CHARTER_BUSINESS_MYACCOUNT_CONTENTRECORDS").ToString().Trim().ToUpper() = "T" AndAlso _
                    Not String.IsNullOrEmpty(_account.AccountType) AndAlso _
                    _account.AccountType.ToLower().Trim() = "bus" Then
                        '######################################
                        'SHOW CHARTER BUSINESS CONTENT RECORD
                        '######################################
                        ucTabNavigation4.ContentKey = "myaccount:CSG:WOInternetTab:SYCH"
                    Else
                        '######################################
                        'SHOW NORMAL CONTENT RECORD OPTIONS
                        '######################################
                        ucTabNavigation4.ContentKey = "myaccount:CSG:WInternetTab:SYCH"
                    End If
                    '##########################################################################
                    '##########################################################################




                    pnlCheckEmailLink.Visible = True
                    pnlManageEmailAddressesLink.Visible = True
                    If Not (_account.AccountType Is Nothing) Then
                        If _account.AccountType.ToUpper().Trim().Equals("BUS") Then
                            pnlHSSecuritySuiteLink.Visible = False
                            pnlManageWebSpaceLink.Visible = False
                        Else
                            pnlHSSecuritySuiteLink.Visible = True
                            pnlManageWebSpaceLink.Visible = True
                        End If
                    Else
                        pnlHSSecuritySuiteLink.Visible = False
                        pnlManageWebSpaceLink.Visible = False
                    End If
                Else
                    '##########################################################################
                    'MODIFICATION   ROD COPELAND    4/13/2010   ISSUE ID 8892
                    '##########################################################################
                    'SHOW CHARTER BUSINESS SPECIFIC CONTENT RECORD IN THE EVENT THIS IS A CB 
                    'CUSTOMER.
                    '##########################################################################
                    ucTabNavigation4.ContentKey = "myaccount:CSG:WOInternetTab:SYCH"
                    '##########################################################################



                    pnlCheckEmailLink.Visible = False
                    pnlHSSecuritySuiteLink.Visible = False
                    pnlManageEmailAddressesLink.Visible = False
                    pnlManageWebSpaceLink.Visible = False
                End If
        Else
            pnlCheckEmailLink.Visible = False
            pnlHSSecuritySuiteLink.Visible = False
            pnlManageEmailAddressesLink.Visible = False
            pnlManageWebSpaceLink.Visible = False
        End If
        Else
        pnlCheckEmailLink.Visible = False
        pnlHSSecuritySuiteLink.Visible = False
        pnlManageEmailAddressesLink.Visible = False
        pnlManageWebSpaceLink.Visible = False
        End If

        pnlCableTV.Visible = False
        pnlInternet.Visible = False
        pnlTelephone.Visible = False
        pnlSupport.Visible = False
        pnlAboutCharter.Visible = False
        pnlCareers.Visible = False
        pnlMyAccount.Visible = False
        pnlCBMyAccount.Visible = False
        pnlChannelPartners.Visible = False

        trSupportSecurity.Visible = False
        trSupportDownloads.Visible = False

        Select Case Item
            Case MenuItem.CableTV
                pnlCableTV.Visible = True
                trCabeTVPayPerView.Visible = True
                trCabeTVVOD.Visible = True
                trCabeTViTV.Visible = True
            Case MenuItem.Internet
                pnlInternet.Visible = True
            Case MenuItem.Telephone
                pnlTelephone.Visible = True
            Case MenuItem.Support
                pnlSupport.Visible = True
                trSupportSecurity.Visible = True
                trSupportDownloads.Visible = True
            Case MenuItem.AboutCharter
                pnlAboutCharter.Visible = True
            Case MenuItem.Careers
                pnlCareers.Visible = True
            Case MenuItem.MyAccount
                Me.pnlMyAccountTabNavigation.Visible = True

                _billSystemLink = "<a href=""../Account/CharterEPay.aspx"" target=""_blank"">Charter ePay/Bill Options</a>"

                'If Not (_account Is Nothing) Then
                '    If _account.BillingSystemURL Is Nothing Then
                '        _billSystemLink = "<a href=""https://update.charter.com/"" target=""_blank"">Charter ePay</a>"
                '    Else
                '        _billSystemLink = _account.BillingSystemURL
                '    End If
                'End If


                '##########################################################################
                'MODIFICATION   SIVA DOLA   4-3-2008
                '##########################################################################
                'based on user type either charter or charter business panel is shown
                '##########################################################################
                Dim _account As IAccount
                _account = AccountManager.Instance.GetAccount()



                '###############################################################
                'MODIFICATION   SIVA DOLA   CHARTER BUSINESS    11/02/2008
                '###############################################################
                Dim blnCBMyAccountUse As String = Application("ENABLE_CHARTER_BUSINESS_MYACCOUNT_SECTION")
                If Not (blnCBMyAccountUse Is Nothing) Then
                    Select Case blnCBMyAccountUse.Trim().ToUpper()
                        Case "T"
                            '#######################################################################
                            '11/02/2008     Siva Dola   
                            'Users are directed based on account type(Residential or Bussiness) 
                            '#######################################################################
                            If Not _account Is Nothing Then
                                If Not (_account.AccountType Is Nothing) Then
                                    Select Case True
                                        Case _account.AccountType.ToLower().Trim() = "commercial"
                                            pnlCBMyAccount.Visible = True
                                        Case _account.AccountType.ToLower().Trim() = "bus"
                                            pnlCBMyAccount.Visible = True
                                        Case Else
                                            '#################################################################
                                            'CONSIDERED TO BE RESEDENTIAL CUSTOMERS, SEND TO THE RESIDENTIAL 
                                            'MY ACCOUNT LANDING PAGE.
                                            '#################################################################
                                            pnlMyAccount.Visible = True
                                    End Select
                                Else
                                    pnlMyAccount.Visible = True
                                End If
                            Else
                                pnlMyAccount.Visible = True
                            End If
                            '#######################################################################
                        Case Else
                            '###############################################################
                            'ASSUME THE CHARTER BUSINESS MYACCOUNT SECTION IS TURNED OFF, 
                            'JUST SHOW THE NORMAL RESEDENTIAL.
                            '###############################################################
                            pnlMyAccount.Visible = False
                    End Select
                Else
                    pnlMyAccount.Visible = False
                End If
                '###############################################################
                '###############################################################
                '''''''''''''''''''''''''''
                'pnlMyAccount.Visible = True

            Case MenuItem.ChannelPartners
                pnlChannelPartners.Visible = True
        End Select

        Select Case SubItem
            Case ProductItem.CableTV
                ' do nothing
            Case ProductItem.BasicCableTV
                tdCabeTVBasic.Attributes("class") = "secondSelected"
            Case ProductItem.DigitalCableTV
                tdCabeTVDigital.Attributes("class") = "secondSelected"
                trCabeTVPayPerView.Visible = True
                trCabeTVVOD.Visible = True
                trCabeTViTV.Visible = True
            Case ProductItem.PayPerView
                tdCabeTVPayPerView.Attributes("class") = "thirdLevelSelected"
                trCabeTVPayPerView.Visible = True
                trCabeTVVOD.Visible = True
                trCabeTViTV.Visible = True
            Case ProductItem.VideoOnDemand
                tdCabeTVVOD.Attributes("class") = "thirdLevelSelected"
                trCabeTVPayPerView.Visible = True
                trCabeTVVOD.Visible = True
                trCabeTViTV.Visible = True
            Case ProductItem.InteractiveTV
                tdCabeTViTV.Attributes("class") = "thirdLevelSelected"
                trCabeTVPayPerView.Visible = True
                trCabeTVVOD.Visible = True
                trCabeTViTV.Visible = True
            Case ProductItem.HighDefinitionTV
                tdCabeTVHDTV.Attributes("class") = "secondSelected"
            Case ProductItem.DigitalVideoRecorder
                tdCabeTVDVR.Attributes("class") = "secondSelected"
            Case ProductItem.Internet
                ' do nothing
            Case ProductItem.Telephone
                ' do nothing
        End Select

        Select Case SubItem2
            Case NonProductItem.CableTVFAQ
                tdCableTVFAQ.Attributes("class") = "secondSelected"
            Case NonProductItem.CableTVPricing
                tdCabeTVPricing.Attributes("class") = "secondSelected"
            Case NonProductItem.Channels
                tdCabeTVChannels.Attributes("class") = "secondSelected"

            Case NonProductItem.HomeNetworking
                tdInternetHome.Attributes("class") = "secondSelected"
            Case NonProductItem.InternetFAQ
                tdInternetFAQ.Attributes("class") = "secondSelected"
            Case NonProductItem.InternetPricing
                tdInternetPricing.Attributes("class") = "secondSelected"
            Case NonProductItem.InternetServices
                tdInternetServices.Attributes("class") = "secondSelected"
                trInternetCharterNet.Visible = True
                trInternetMail.Visible = True
                trInternetWebSpace.Visible = True
                trInternetSecurity.Visible = True
            Case NonProductItem.InternetCharterNet
                tdInternetCharterNet.Attributes("class") = "thirdLevelSelected"
                trInternetCharterNet.Visible = True
                trInternetMail.Visible = True
                trInternetWebSpace.Visible = True
                trInternetSecurity.Visible = True
            Case NonProductItem.InternetMail
                tdInternetMail.Attributes("class") = "thirdLevelSelected"
                trInternetCharterNet.Visible = True
                trInternetMail.Visible = True
                trInternetWebSpace.Visible = True
                trInternetSecurity.Visible = True
            Case NonProductItem.InternetWebSpace
                tdInternetWebSpace.Attributes("class") = "thirdLevelSelected"
                trInternetCharterNet.Visible = True
                trInternetMail.Visible = True
                trInternetWebSpace.Visible = True
                trInternetSecurity.Visible = True
            Case NonProductItem.InternetSecurity
                tdInternetSecurity.Attributes("class") = "thirdLevelSelected"
                trInternetCharterNet.Visible = True
                trInternetMail.Visible = True
                trInternetWebSpace.Visible = True
                trInternetSecurity.Visible = True
            Case NonProductItem.SystemRequirements
                tdInternetSystem.Attributes("class") = "secondSelected"
                trTestYourComputer.Visible = True
            Case NonProductItem.TestYourComputer
                tdTestYourComputer.Attributes("class") = "thirdLevelSelected"
                trTestYourComputer.Visible = True
            Case NonProductItem.TelephoneFAQ
                tdTelephoneFAQ.Attributes("class") = "secondSelected"
            Case NonProductItem.TelephonePricing
                tdTelephonePricing.Attributes("class") = "secondSelected"
            Case NonProductItem.TelephoneServices
                tdTelephoneServices.Attributes("class") = "secondSelected"
            Case NonProductItem.TelephoneIntlCalling
                If Request.QueryString("section") <> "2" Then
                    tdTelephoneIntlCalling.Attributes("class") = "secondSelected"
                Else
                    tdTelephoneWW250.Attributes("class") = "secondSelected"
                End If
            Case NonProductItem.SupportCableTV
                tdSupportCableTV.Attributes("class") = "secondSelected"
                trSupportSecurity.Visible = True
                trSupportDownloads.Visible = True
            Case NonProductItem.SupportInternet
                tdSupportInternet.Attributes("class") = "secondSelected"
                trSupportSecurity.Visible = True
                trSupportDownloads.Visible = True
            Case NonProductItem.SupportDownloads
                tdSupportDownloads.Attributes("class") = "thirdLevelSelected"
                trSupportSecurity.Visible = True
                trSupportDownloads.Visible = True
            Case NonProductItem.SupportSecurity
                tdSupportSecurity.Attributes("class") = "thirdLevelSelected"
                trSupportSecurity.Visible = True
                trSupportDownloads.Visible = True
            Case NonProductItem.SupportEmail
                tdSupportEmail.Attributes("class") = "secondSelected"
                trSupportSecurity.Visible = True
                trSupportDownloads.Visible = True
            Case NonProductItem.SupportTelephone
                tdSupportTelephone.Attributes("class") = "secondSelected"
                trSupportSecurity.Visible = True
                trSupportDownloads.Visible = True
            Case NonProductItem.SupportMyAccount
                tdSupportMyAccount.Attributes("class") = "secondSelected"
                trSupportSecurity.Visible = True
                trSupportDownloads.Visible = True
            Case NonProductItem.SupportFAQ
                tdSupportFAQ.Attributes("class") = "secondSelected"
                trSupportSecurity.Visible = True
                trSupportDownloads.Visible = True
            Case NonProductItem.AboutCharter
                ' do nothing
            Case NonProductItem.AboutCharterLeaders
                tdAboutCharterLeaders.Attributes("class") = "secondSelected"
            Case NonProductItem.AboutCharterMarkets
                tdAboutCharterMarkets.Attributes("class") = "secondSelected"
            Case NonProductItem.AboutCharterEducation
                tdAboutCharterEducation.Attributes("class") = "secondSelected"
            Case NonProductItem.AboutCharterCareers
                tdAboutCharterCareers.Attributes("class") = "secondSelected"

            Case NonProductItem.Careers
                ' do nothing
            Case NonProductItem.CareersWhyCharter
                tdCareersWhyCharter.Attributes("class") = "secondSelected"
                trCareersBenefits.Visible = True
                '	trCareersTestimonials.Visible = True
            Case NonProductItem.CareersBenefits
                tdCareersBenefits.Attributes("class") = "thirdLevelSelected"
                trCareersBenefits.Visible = True
                'trCareersTestimonials.Visible = True
            Case NonProductItem.CareersTestimonials
                'tdCareersTestimonials.Attributes("class") = "thirdLevelSelected"
                trCareersBenefits.Visible = True
                'trCareersTestimonials.Visible = True
            Case NonProductItem.CareersDiversity
                tdCareersDiversity.Attributes("class") = "secondSelected"
                '	trCareersCharterDiversityCouncil.Visible = True
                'trCareersDiversityNews.Visible = True
                trCareersDiversitySuppliersPartners.Visible = True
                trCareersEEOFCCReports.Visible = True
            Case NonProductItem.CareersCharterDiversityCouncil
                '	tdCareersCharterDiversityCouncil.Attributes("class") = "thirdLevelSelected"
                '	trCareersCharterDiversityCouncil.Visible = True
                '	trCareersDiversityNews.Visible = True
                trCareersDiversitySuppliersPartners.Visible = True
                trCareersEEOFCCReports.Visible = True
            Case NonProductItem.CareersDiversityNews
                '	tdCareersDiversityNews.Attributes("class") = "thirdLevelSelected"
                '	trCareersCharterDiversityCouncil.Visible = True
                '	trCareersDiversityNews.Visible = True
                trCareersDiversitySuppliersPartners.Visible = True
                trCareersEEOFCCReports.Visible = True
            Case NonProductItem.CareersDiversitySuppliersPartners
                tdCareersDiversitySuppliersPartners.Attributes("class") = "thirdLevelSelected"
                '	trCareersCharterDiversityCouncil.Visible = True
                '	trCareersDiversityNews.Visible = True
                trCareersDiversitySuppliersPartners.Visible = True
                trCareersEEOFCCReports.Visible = True
            Case NonProductItem.CareersEEOFCCReports
                tdCareersEEOFCCReports.Attributes("class") = "thirdLevelSelected"
                '	trCareersCharterDiversityCouncil.Visible = True
                '	trCareersDiversityNews.Visible = True
                trCareersDiversitySuppliersPartners.Visible = True
                trCareersEEOFCCReports.Visible = True
            Case NonProductItem.CareersCommunityNews
                'tdCareersCommunityNews.Attributes("class") = "secondSelected"
            Case NonProductItem.CareersCalendar
                tdCareersCalendar.Attributes("class") = "secondSelected"
            Case NonProductItem.CareersJobSearch
                tdCareersJobSearch.Attributes("class") = "secondSelected"
                'trCareersJobSearch.Visible = True
                'trCareersJobAlerts.Visible = True
            Case NonProductItem.CareersJobAlerts
                tdCareersJobAlerts.Attributes("class") = "secondSelected"
                'trCareersJobSearch.Visible = True
                'trCareersJobAlerts.Visible = True

            Case NonProductItem.MyAccountEmailAccounts
                tdMyAccountEmailAccounts.Attributes("class") = "secondSelected"
            Case NonProductItem.MyAccountLogin
                tdMyAccountLogin.Attributes("class") = "secondSelected"
            Case NonProductItem.MyAccountUpgrades
                tdMyAccountUpgrades.Attributes("class") = "secondSelected"
            Case NonProductItem.MyAccountWebSpace
                tdMyAccountWebSpace.Attributes("class") = "secondSelected"
            Case NonProductItem.MyAccountSecuritySuite
                tdMyAccountSecuritySuite.Attributes("class") = "secondSelected"

            Case NonProductItem.PartnersEducational
                tdPartnersEducational.Attributes("class") = "secondSelected"
            Case NonProductItem.PartnersEntertainment
                tdPartnersEntertainment.Attributes("class") = "secondSelected"
            Case NonProductItem.PartnersFamily
                tdPartnersFamily.Attributes("class") = "secondSelected"
            Case NonProductItem.PartnersLatino
                tdPartnersLatino.Attributes("class") = "secondSelected"
            Case NonProductItem.PartnersLifeStyles
                tdPartnersLifeStyles.Attributes("class") = "secondSelected"
            Case NonProductItem.PartnersMusic
                tdPartnersMusic.Attributes("class") = "secondSelected"
            Case NonProductItem.PartnersNews
                tdPartnersNews.Attributes("class") = "secondSelected"
            Case NonProductItem.PartnersPremium
                tdPartnersPremium.Attributes("class") = "secondSelected"
            Case NonProductItem.PartnersSports
                tdPartnersSports.Attributes("class") = "secondSelected"
        End Select

    End Sub
End Class
