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.WebSite.Library
' Imports CharterDotCom.Common.Logging


Partial Class Members_MyAccount
    Inherits CharterCMSPage

    Public strSectionTitle As String = "My Account"

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

        'Logger.WebLog("\UI\Account\MyAccount")

        Dim _account As IAccount = AccountManager.Instance.GetAccount()
        If Not (_account Is Nothing) Then
            If Not _account.ExistingService Is Nothing 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
                    '######################################
                    CustomContent3.ContentKey = "myaccount:Overview:InternetTools:CB"
                Else
                    '######################################
                    'SHOW NORMAL CONTENT RECORD OPTIONS
                    '######################################
                    If _account.ExistingService.Contains(Category.HSD) Then
                        CustomContent3.ContentKey = "myaccount:Overview:InternetTools"
                    Else
                        CustomContent3.ContentKey = "myaccount:Overview:InternetToolsOffer"
                    End If
                End If
                '##########################################################################



            End If

            Dim str As String = ""
            Select Case _account.BillingVendorType
                Case BillingVendorType.CSG
                    CustomContent4.ContentKey = "myaccount:Overview:AutoPayAd"



                    '##################################################################################
                    'MODIFICATION   ROD COPELAND    Issue ID:  7125
                    '##################################################################################
                    'THERE IS A PROBLEM WITH THIS BILL FROM THE BILLING SYSTEM.  RIGHT NOW THE ONLY 
                    'CONDITION THAT FALLS IN THIS CATEGORY IS A NEW CUSTOMER THAT HASNT HAD A BILLING 
                    'CYCLE YET. SHOW A CMS MESSAGE THAT EXPLAINS WHY THE BILL CAN BE DISPLAYED.
                    '##################################################################################
                    Dim validBillForDisplay As IAccount.IBill
                    For Each validBillForDisplay In _account.Bill
                        If Not (validBillForDisplay Is Nothing) Then
                            If Not validBillForDisplay.DisplayBillSummary Then
                                str = ContentManager.Instance.GetContent("Myaccount:Overview:BottomLeft:CSGConverted:CycleDateErrorMsg", 1, OwnerType.Other)
                                Exit For
                            End If
                        End If
                    Next

                    If str IsNot Nothing Then
                        If str.Trim() = "" Then
                            str = ContentManager.Instance.GetContent("myaccount:Overview:MyServices", 1, OwnerType.Other)
                        End If
                    End If
                    '##################################################################################
                    '##################################################################################




                Case BillingVendorType.ICOM
                    str = ContentManager.Instance.GetContent("myaccount:Overview:MyServices:ICOMS", 1, OwnerType.Other)
                    CustomContent4.ContentKey = "myaccount:Overview:autopayadicoms"
            End Select

            Dim street1 As String = "N/A"
            Dim street2 As String = ""
            Dim city As String = ""
            Dim state As String = ""
            Dim zip As String = ""

            If Not _account.Address Is Nothing Then
                street1 = _account.Address.Street1
                If _account.Address.Street2 <> "" Then
                    street2 = "<br />" & _account.Address.Street2
                End If
                city = _account.Address.City
                state = _account.Address.State
                zip = _account.Address.Zip
            End If

            str = str.Replace("{{STREET1}}", street1)
            str = str.Replace("{{STREET2}}", street2)
            str = str.Replace("{{CITY}}", city)
            str = str.Replace("{{STATE}}", state)
            str = str.Replace("{{ZIP}}", zip)
            MyServicesTabContent.Text = str

        End If

        displayPanel()
        QuickPay.Account = _account

    End Sub

    Private Sub displayPanel()
        Me.ucBrowseSupport.isNewPanel = True
        Me.ucBrowseSupport.Productategory = MenuItem.MyAccount
        Me.panelNew.Visible = True
    End Sub
End Class
