Imports System.Collections.Generic
Imports CharterDotCom.CommonEntities.Library.Enumerations
' 8/2007 jg added:
Imports System.Reflection
Imports System.Text


''' <summary>
''' ServicePlan class updated to correspond to G2B Version 4.1 message
''' format.
''' </summary>
''' <remarks>UPDATED FOR G2B Version 4.1 spec</remarks>
<Serializable()> _
<DebuggerDisplay("ID: {_id}, Name {_name} Price {_price.ToString()} Promo {_promoName} Service Type {_serviceType}")> _
Public Class ServicePlan

    Private m_id As String
    Private m_name As String
    Private m_description As String
    Private m_billingCode As String
    Private m_price As Decimal
    Private m_listPrice As Decimal
    Private m_installPrice As Decimal
    Private m_installDescription As String
    Private m_category As GWYCategory
    Private m_serviceType As ServiceType
    Private m_priceFrequency As PriceFrequency
    ' 9/2007 jwg addded for g2b 4.1
    Private m_priceDisplay As Boolean
    Private m_children As Dictionary(Of String, Feature)
    Private m_selected As Boolean
    Private m_promoName As String
    Private m_promoDisclaimer As String
    Private m_marketinginfo As String
    Private m_marketingdetail As String

#Region "Private Fields added for G2B 4.1"
    ' Fields added for v4.1
    Private m_mediumname As String = String.Empty
    Private m_techSupport As String = String.Empty
    Private m_priceFrequencyG2B As PriceFrequency
    Private m_priceDescription As String = String.Empty

    Private m_installPriceFrequency As PriceFrequency

    Private m_HWPriceFrequency As PriceFrequency
    Private m_HWPrice As Decimal = 0
    Private m_HWpriceDescription As String = String.Empty

    Private m_DepositPriceFrequency As PriceFrequency
    Private m_DepositPrice As Decimal = 0
    Private m_DepositpriceDescription As String = String.Empty
    Private m_Version As Decimal = 0

    Private m_contractEarlyTermFee As Decimal = 0
    Private m_contractValue As Integer = 0
    Private m_contractLength As EntityG2BServices.ContractLengthRateEnum
    Private m_contractDescription As String
    Private m_contractTermsAndConditions As String
    Private m_MovesOffer As Boolean

    Private m_HardwareType As Dictionary(Of String, EntityG2BServices.HardwareType)
    Private m_IncludedItems As Dictionary(Of String, EntityG2BServices.IncludedItemsType)
    Private m_MarketingInfoG2B As EntityG2BServices.MarketingInfoType
    Private m_CustomizationList As Dictionary(Of String, EntityG2BServices.CustomizationTypeQueryOffers)
    Private m_PromotionList As Dictionary(Of String, EntityG2BServices.PromotionType)

    ' Voice Offer-Specific fields
    Private m_longDistanceMinutes As String = String.Empty
    Private m_longDistanceCharges As Decimal = 0
    Private m_voiceMailPrice As EntityG2BServices.PriceType = New EntityG2BServices.PriceType(EntityG2BServices.PriceFrequencyEnum.m_Monthly, String.Empty, 0)
    Private m_internationalPrice As EntityG2BServices.PriceType = New EntityG2BServices.PriceType(EntityG2BServices.PriceFrequencyEnum.m_Monthly, String.Empty, 0)
    Private m_additionalLinePrice As EntityG2BServices.PriceType = New EntityG2BServices.PriceType(EntityG2BServices.PriceFrequencyEnum.m_Monthly, String.Empty, 0)
    Private m_includesCallerID As Boolean = False
    Private m_includesCallWaiting As Boolean = False
    Private m_includesCallerIDWithCallWaiting As Boolean = False
    Private m_includes3WayCalling As Boolean = False
    Private m_includesCallReturn As Boolean = False

    ' Data Offer-specific fields
    Private m_uploadSpeed As EntityG2BServices.DataSpeedType = New EntityG2BServices.DataSpeedType()
    Private m_downloadSpeed As EntityG2BServices.DataSpeedType = New EntityG2BServices.DataSpeedType()
    Private m_emailAccounts As Integer = 0
    Private m_webspace As EntityG2BServices.DiskSpaceType = New EntityG2BServices.DiskSpaceType()
    Private m_dialupAccess As Boolean = False
    Private m_staticIPAddresses As Integer = 0
    Private m_dynamicIPAddresses As Integer = 0
    Private m_requirements As String = String.Empty

    ' Video Offer-specific fields
    Private m_channels As EntityG2BServices.ChannelsType = New EntityG2BServices.ChannelsType()
    Private m_premiumChannels As EntityG2BServices.ChannelsType = New EntityG2BServices.ChannelsType()
    Private m_videoCategory As EntityG2BServices.VideoCategoryEnum = EntityG2BServices.VideoCategoryEnum.m_Basic


#End Region


    'TODO: temporary for G2B data to work
    Public Sub New()

    End Sub

    Public Sub New(ByVal pid As String, _
        ByVal pname As String, _
        ByVal pdescription As String, _
        ByVal pprice As Decimal, _
        ByVal plistPrice As Decimal, _
        ByVal pcategory As GWYCategory, _
        ByVal pinstallPrice As Decimal, _
        ByVal pinstallDescription As String, _
        ByVal ppromoName As String, _
        ByVal ppromoDisclaimer As String, _
        ByVal pmarketinginfo As String, _
        ByVal pserviceType As ServiceType, _
        ByVal pchildren As Dictionary(Of String, Feature))

        m_id = pid
        m_name = pname
        m_description = pdescription
        m_price = pprice
        m_listPrice = plistPrice
        m_installPrice = pinstallPrice
        m_installDescription = pinstallDescription
        m_priceDisplay = True
        m_priceFrequency = PriceFrequency.Monthly
        m_category = pcategory
        m_serviceType = pserviceType
        m_children = pchildren
        m_promoName = ppromoName
        m_promoDisclaimer = ppromoDisclaimer
        m_marketinginfo = pmarketinginfo
    End Sub

    ''' <summary>
    ''' Constructor for all v41 properties
    ''' </summary>
    ''' <param name="pid"></param>
    ''' <param name="pname"></param>
    ''' <param name="pdescription"></param>
    ''' <param name="pprice"></param>
    ''' <param name="plistPrice"></param>
    ''' <param name="pcategory"></param>
    ''' <param name="pinstallPrice"></param>
    ''' <param name="pinstallDescription"></param>
    ''' <param name="ppromoName"></param>
    ''' <param name="ppromoDisclaimer"></param>
    ''' <param name="pmarketinginfo"></param>
    ''' <param name="pserviceType"></param>
    ''' <param name="pchildren"></param>
    ''' <param name="pcontractEarlyTermFee"></param>
    ''' <param name="pcontractLength"></param>
    ''' <param name="pcontractValue"></param>
    ''' <param name="pcustomizationList"></param>
    ''' <param name="pDepositPrice"></param>
    ''' <param name="pDepositpriceDescription"></param>
    ''' <param name="pDepositPriceFrequency"></param>
    ''' <param name="phardwareType"></param>
    ''' <param name="pHWPrice"></param>
    ''' <param name="pHWpriceDescription"></param>
    ''' <param name="pHWPriceFrequency"></param>
    ''' <param name="pincludedItems"></param>
    ''' <param name="pinstallPriceFrequency"></param>
    ''' <param name="pmarketingInfoG2B"></param>
    ''' <param name="pmediumName"></param>
    ''' <param name="ppriceDescription"></param>
    ''' <param name="ppriceFrequencyG2B"></param>
    ''' <param name="ppromotionList"></param>
    ''' <param name="pstrContractDescription"></param>
    ''' <param name="pstrContractTerms"></param>
    ''' <param name="ptechSupport"></param>
    ''' <param name="pVersion"></param>
    ''' <param name="pblnMovesOffer"></param>
    ''' <remarks></remarks>
    Public Sub New(ByVal pid As String, _
        ByVal pname As String, _
        ByVal pdescription As String, _
        ByVal pprice As Decimal, _
        ByVal plistPrice As Decimal, _
        ByVal pcategory As GWYCategory, _
        ByVal pinstallPrice As Decimal, _
        ByVal pinstallDescription As String, _
        ByVal ppromoName As String, _
        ByVal ppromoDisclaimer As String, _
        ByVal pmarketinginfo As String, _
        ByVal pserviceType As ServiceType, _
        ByVal pchildren As Dictionary(Of String, Feature), _
        ByVal pmediumName As String, _
        ByVal ptechSupport As String, _
        ByVal ppriceFrequencyG2B As PriceFrequency, _
        ByVal ppriceDescription As String, _
        ByVal pinstallPriceFrequency As PriceFrequency, _
        ByVal pHWPriceFrequency As PriceFrequency, _
        ByVal pHWPrice As Decimal, _
        ByVal pHWpriceDescription As String, _
        ByVal pDepositPriceFrequency As PriceFrequency, _
        ByVal pDepositPrice As Decimal, _
        ByVal pDepositpriceDescription As String, _
        ByVal pVersion As Decimal, _
        ByVal pcontractEarlyTermFee As Decimal, _
        ByVal pcontractValue As Integer, _
        ByVal pcontractLength As EntityG2BServices.ContractLengthRateEnum, _
        ByVal phardwareType As Dictionary(Of String, EntityG2BServices.HardwareType), _
        ByVal pincludedItems As Dictionary(Of String, EntityG2BServices.IncludedItemsType), _
        ByVal pmarketingInfoG2B As EntityG2BServices.MarketingInfoType, _
        ByVal pcustomizationList As Dictionary(Of String, EntityG2BServices.CustomizationTypeQueryOffers), _
        ByVal ppromotionList As Dictionary(Of String, EntityG2BServices.PromotionType), _
        ByVal pstrContractDescription As String, _
        ByVal pstrContractTerms As String, _
        ByVal pblnMovesOffer As Boolean)

        Me.New(pid, pname, pdescription, _
                pprice, plistPrice, pcategory, _
                pinstallPrice, pinstallDescription, ppromoName, _
                ppromoDisclaimer, pmarketinginfo, _
                pserviceType, pchildren)

        ' added for g2b v4.1
        m_mediumname = pmediumName
        m_techSupport = ptechSupport
        m_priceFrequencyG2B = ppriceFrequencyG2B
        m_priceDescription = ppriceDescription
        m_installPriceFrequency = pinstallPriceFrequency
        m_HWPriceFrequency = pHWPriceFrequency
        m_HWPrice = pHWPrice
        m_HWpriceDescription = pHWpriceDescription
        m_DepositPriceFrequency = pDepositPriceFrequency
        m_DepositPrice = pDepositPrice
        m_DepositpriceDescription = pDepositpriceDescription
        m_Version = pVersion

        m_contractEarlyTermFee = pcontractEarlyTermFee
        m_contractValue = pcontractValue
        m_contractLength = pcontractLength

        m_HardwareType = phardwareType
        m_IncludedItems = pincludedItems
        m_MarketingInfoG2B = pmarketingInfoG2B
        m_CustomizationList = pcustomizationList
        m_PromotionList = ppromotionList
        Me.m_contractDescription = pstrContractDescription
        Me.m_contractTermsAndConditions = pstrContractTerms
        Me.m_MovesOffer = pblnMovesOffer

    End Sub

    Public ReadOnly Property ID() As String
        Get
            Return m_id
        End Get
    End Property

    Public ReadOnly Property Name() As String
        Get
            Return m_name
        End Get
    End Property

    Public ReadOnly Property Description() As String
        Get
            Return m_description
        End Get
    End Property

    Public ReadOnly Property Category() As GWYCategory
        Get
            Return m_category
        End Get
    End Property

    Public ReadOnly Property ServiceType() As ServiceType
        Get
            Return m_serviceType
        End Get
    End Property

    Public Property Price() As Decimal
        Get
            Return m_price
        End Get
        Set(ByVal value As Decimal)
            m_price = value
        End Set
    End Property

    Public Property ListPrice() As Decimal
        Get
            Return m_listPrice
        End Get
        Set(ByVal value As Decimal)
            m_listPrice = value
        End Set
    End Property

    Public Property InstallPrice() As Decimal
        Get
            Return m_installPrice
        End Get
        Set(ByVal value As Decimal)
            m_installPrice = value
        End Set
    End Property

    Public Property PriceDisplay() As Boolean
        Get
            Return m_priceDisplay
        End Get
        Set(ByVal value As Boolean)
            m_priceDisplay = value
        End Set
    End Property
    Public Property InstallDescription() As String
        Get
            Return m_installDescription
        End Get
        Set(ByVal value As String)
            m_installDescription = value
        End Set
    End Property

    Public ReadOnly Property PriceFrequency() As PriceFrequency
        Get
            Return m_priceFrequency
        End Get
    End Property

    'Public ReadOnly Property IsSelected() As Boolean
    '  Get
    '    Return m_selected
    '  End Get
    'End Property

    Public ReadOnly Property Features() As Dictionary(Of String, Feature)
        Get
            Return m_children
        End Get
    End Property

    Public ReadOnly Property PromoName() As String
        Get
            Return m_promoName
        End Get
    End Property

    Public ReadOnly Property PromoDisclaimer() As String
        Get
            Return m_promoDisclaimer
        End Get

    End Property

    Public Property MarketingInfo() As String
        Get
            Return m_marketinginfo
        End Get
        Set(ByVal value As String)
            m_marketinginfo = value
        End Set
    End Property
    Public Property MarketingDetail() As String
        Get
            Return m_marketingdetail
        End Get
        Set(ByVal value As String)
            m_marketingdetail = value
        End Set
    End Property


#Region "Fields added for G2B 4.1"

    ''' <summary>Service Plan Medium Name</summary>
    ''' <value></value>
    ''' <returns>String</returns>
    ''' <remarks>new field for v4.1.  not used in front end</remarks>
    Public Property MediumName() As String
        Get
            Return DefaultString(m_mediumname)
        End Get
        Set(ByVal value As String)
            m_mediumname = value
        End Set
    End Property

    ''' <summary>Service Plan Tech Support</summary>
    ''' <value></value>
    ''' <returns>String</returns>
    ''' <remarks>new field for v4.1.  not used in front end</remarks>
    Public Property techSupport() As String
        Get
            Return DefaultString(m_techSupport)
        End Get
        Set(ByVal value As String)
            m_techSupport = value
        End Set
    End Property

    ''' <summary>Service Plan Price Frequency from G2B</summary>
    ''' <value></value>
    ''' <returns>PriceFrequency from G2B (other PriceFrequency
    ''' property is fixed at Monthly)</returns>
    ''' <remarks>Weekly, Monthly, One Time, etc/</remarks>
    Public Property PriceFrequencyG2B() As PriceFrequency
        Get
            Return m_priceFrequencyG2B
        End Get
        Set(ByVal value As PriceFrequency)
            m_priceFrequencyG2B = value
        End Set
    End Property

    ''' <summary>Service Plan Price Description</summary>
    ''' <value></value>
    ''' <returns>String</returns>
    ''' <remarks>new field for v4.1.  not used in front end</remarks>
    Public Property PriceDescription() As String
        Get
            Return DefaultString(m_priceDescription)
        End Get
        Set(ByVal value As String)
            m_priceDescription = value
        End Set
    End Property

    ''' <summary>Service Plan Install Price Frequency</summary>
    ''' <value></value>
    ''' <returns>InstallPrice Frequency from G2B</returns>
    ''' <remarks>Weekly, Monthly, One Time, etc/</remarks>
    Public Property InstallPriceFrequency() As PriceFrequency
        Get
            Return m_installPriceFrequency
        End Get
        Set(ByVal value As PriceFrequency)
            m_installPriceFrequency = value
        End Set
    End Property


    ''' <summary>Service Plan HW Price</summary>
    ''' <value></value>
    ''' <returns>String</returns>
    ''' <remarks></remarks>
    Public Property HWPrice() As Decimal
        Get
            Return m_HWPrice
        End Get
        Set(ByVal value As Decimal)
            m_HWPrice = value
        End Set
    End Property

    ''' <summary>Service Plan Hardware Price Frequency</summary>
    ''' <value></value>
    ''' <returns>HardwarePriceFrequency from G2B</returns>
    ''' <remarks>Weekly, Monthly, One Time, etc/</remarks>
    Public Property HWPriceFrequency() As PriceFrequency
        Get
            Return m_HWPriceFrequency
        End Get
        Set(ByVal value As PriceFrequency)
            m_HWPriceFrequency = value
        End Set
    End Property
    ''' <summary>Service Plan HardWare price Description</summary>
    ''' <value></value>
    ''' <returns>String</returns>
    ''' <remarks>new field for v4.1.  not used in front end</remarks>
    Public Property HWPriceDescription() As String
        Get
            Return DefaultString(m_HWpriceDescription)
        End Get
        Set(ByVal value As String)
            m_HWpriceDescription = value
        End Set
    End Property


    ''' <summary>Service Plan Deposit Price</summary>
    ''' <value></value>
    ''' <returns>String</returns>
    ''' <remarks></remarks>
    Public Property DepositPrice() As Decimal
        Get
            Return m_DepositPrice
        End Get
        Set(ByVal value As Decimal)
            m_DepositPrice = value
        End Set
    End Property

    ''' <summary>Service Plan Hardware Price Frequency</summary>
    ''' <value></value>
    ''' <returns>HardwarePriceFrequency from G2B</returns>
    ''' <remarks>Weekly, Monthly, One Time, etc/</remarks>
    Public Property DepositPriceFrequency() As PriceFrequency
        Get
            Return m_DepositPriceFrequency
        End Get
        Set(ByVal value As PriceFrequency)
            m_DepositPriceFrequency = value
        End Set
    End Property
    ''' <summary>Service Plan HardWare price Description</summary>
    ''' <value></value>
    ''' <returns>String</returns>
    ''' <remarks>new field for v4.1.  not used in front end</remarks>
    Public Property DepositPriceDescription() As String
        Get
            If m_DepositpriceDescription Is Nothing Then
                Return String.Empty
            Else
                Return m_DepositpriceDescription
            End If
        End Get
        Set(ByVal value As String)
            m_DepositpriceDescription = value
        End Set
    End Property

    ''' <summary>Service Plan Version</summary>
    ''' <value></value>
    ''' <returns>String</returns>
    ''' <remarks>new field for v4.1.  not used in front end</remarks>
    Public Property Version() As Decimal
        Get
            Return m_Version
        End Get
        Set(ByVal value As Decimal)
            m_Version = value
        End Set
    End Property

    Public Property contractEarlyTermFee() As Decimal
        Get
            Return m_contractEarlyTermFee
        End Get
        Set(ByVal value As Decimal)
            m_contractEarlyTermFee = value
        End Set
    End Property

    Public Property contractValue() As Integer
        Get
            Return m_contractValue
        End Get
        Set(ByVal value As Integer)
            m_contractValue = value
        End Set
    End Property

    Public Property contractLength() As EntityG2BServices.ContractLengthRateEnum
        Get
            Return m_contractLength
        End Get
        Set(ByVal value As EntityG2BServices.ContractLengthRateEnum)
            m_contractLength = value
        End Set
    End Property


    ''' <summary>Service Plan Hardware Types</summary>
    ''' <value></value>
    ''' <returns>Dictionary of Hardware Types</returns>
    ''' <remarks></remarks>
    Public Property HardwareTypes() As Dictionary(Of String, EntityG2BServices.HardwareType)
        Get
            Return m_HardwareType
        End Get
        Set(ByVal value As Dictionary(Of String, EntityG2BServices.HardwareType))
            m_HardwareType = value
        End Set
    End Property

    ''' <summary>Service Plan Included Item Types</summary>
    ''' <value></value>
    ''' <returns>Dictionary of Included Item Types</returns>
    ''' <remarks></remarks>
    Public Property IncludedItems() As Dictionary(Of String, EntityG2BServices.IncludedItemsType)
        Get
            Return m_IncludedItems
        End Get
        Set(ByVal value As Dictionary(Of String, EntityG2BServices.IncludedItemsType))
            m_IncludedItems = value
        End Set
    End Property

    ''' <summary>Service Plan Marketing Info</summary>
    ''' <value></value>
    ''' <returns>Dictionary of Marketing Info</returns>
    ''' <remarks></remarks>
    Public Property MarketingInfoG2B() As EntityG2BServices.MarketingInfoType
        Get
            Return m_MarketingInfoG2B
        End Get
        Set(ByVal value As EntityG2BServices.MarketingInfoType)
            m_MarketingInfoG2B = value
        End Set
    End Property

    ''' <summary>Service Plan Customizations</summary>
    ''' <value></value>
    ''' <returns>Dictionary of Customizations</returns>
    ''' <remarks></remarks>
    Public Property Customizations() As Dictionary(Of String, EntityG2BServices.CustomizationTypeQueryOffers)
        Get
            Return m_CustomizationList
        End Get
        Set(ByVal value As Dictionary(Of String, EntityG2BServices.CustomizationTypeQueryOffers))
            m_CustomizationList = value
        End Set
    End Property

    ''' <summary>Service Plan Promotions</summary>
    ''' <value></value>
    ''' <returns>Dictionary of Promotions</returns>
    ''' <remarks></remarks>
    Public Property Promotions() As Dictionary(Of String, EntityG2BServices.PromotionType)
        Get
            Return m_PromotionList
        End Get
        Set(ByVal value As Dictionary(Of String, EntityG2BServices.PromotionType))
            m_PromotionList = value
        End Set
    End Property

    Public Property longDistanceMinutes() As String
        Get
            If m_longDistanceMinutes Is Nothing Then
                Return String.Empty
            Else
                Return m_longDistanceMinutes
            End If

        End Get
        Set(ByVal value As String)
            Me.m_longDistanceMinutes = value
        End Set
    End Property

    Public Property longDistanceCharges() As Decimal
        Get
            Return m_longDistanceCharges
        End Get
        Set(ByVal value As Decimal)
            m_longDistanceCharges = value
        End Set
    End Property

    Public Property voiceMailPrice() As EntityG2BServices.PriceType
        Get
            Return m_voiceMailPrice
        End Get
        Set(ByVal value As EntityG2BServices.PriceType)
            m_voiceMailPrice = value
        End Set
    End Property

    Public Property internationalPrice() As EntityG2BServices.PriceType
        Get
            Return m_internationalPrice
        End Get
        Set(ByVal value As EntityG2BServices.PriceType)
            m_internationalPrice = value
        End Set
    End Property

    Public Property additionalLinePrice() As EntityG2BServices.PriceType
        Get
            Return m_additionalLinePrice
        End Get
        Set(ByVal value As EntityG2BServices.PriceType)
            m_additionalLinePrice = value
        End Set
    End Property

    Public Property includesCallerID() As Boolean
        Get
            Return m_includesCallerID
        End Get
        Set(ByVal value As Boolean)
            m_includesCallerID = value
        End Set
    End Property

    Public Property includesCallerIDWithCallWaiting() As Boolean
        Get
            Return m_includesCallerIDWithCallWaiting
        End Get
        Set(ByVal value As Boolean)
            m_includesCallerIDWithCallWaiting = value
        End Set
    End Property

    Public Property includesCallReturn() As Boolean
        Get
            Return m_includesCallReturn
        End Get
        Set(ByVal value As Boolean)
            m_includesCallReturn = value
        End Set
    End Property

    Public Property includesCallWaiting() As Boolean
        Get
            Return m_includesCallWaiting
        End Get
        Set(ByVal value As Boolean)
            m_includesCallWaiting = value
        End Set
    End Property


    Public Property includes3WayCalling() As Boolean
        Get
            Return m_includes3WayCalling
        End Get
        Set(ByVal value As Boolean)
            m_includes3WayCalling = value
        End Set
    End Property

    Public Property uploadSpeed() As EntityG2BServices.DataSpeedType
        Get
            Return m_uploadSpeed
        End Get
        Set(ByVal value As EntityG2BServices.DataSpeedType)
            m_uploadSpeed = value
        End Set
    End Property

    Public Property downloadSpeed() As EntityG2BServices.DataSpeedType
        Get
            Return m_downloadSpeed
        End Get
        Set(ByVal value As EntityG2BServices.DataSpeedType)
            m_downloadSpeed = value
        End Set
    End Property

    Public Property emailAccounts() As Integer
        Get
            Return m_emailAccounts
        End Get
        Set(ByVal value As Integer)
            m_emailAccounts = value
        End Set
    End Property

    Public Property webspace() As EntityG2BServices.DiskSpaceType
        Get
            Return m_webspace
        End Get
        Set(ByVal value As EntityG2BServices.DiskSpaceType)
            m_webspace = value
        End Set
    End Property

    Public Property dialupAccess() As Boolean
        Get
            Return m_dialupAccess
        End Get
        Set(ByVal value As Boolean)
            m_dialupAccess = value
        End Set
    End Property

    Public Property staticIPAddresses() As Integer
        Get
            Return m_staticIPAddresses
        End Get
        Set(ByVal value As Integer)
            m_staticIPAddresses = value
        End Set
    End Property

    Public Property dynamicIPAddresses() As Integer
        Get
            Return m_dynamicIPAddresses
        End Get
        Set(ByVal value As Integer)
            m_dynamicIPAddresses = value
        End Set
    End Property

    Public Property Requirements() As String
        Get
            Return m_requirements
        End Get
        Set(ByVal value As String)
            m_requirements = value
        End Set
    End Property

    Public Property channels() As EntityG2BServices.ChannelsType
        Get
            Return m_channels
        End Get
        Set(ByVal value As EntityG2BServices.ChannelsType)
            m_channels = value
        End Set
    End Property

    Public Property premiumchannels() As EntityG2BServices.ChannelsType
        Get
            Return m_premiumChannels
        End Get
        Set(ByVal value As EntityG2BServices.ChannelsType)
            m_premiumChannels = value
        End Set
    End Property

    Public Property VideoCategory() As EntityG2BServices.VideoCategoryEnum
        Get
            Return m_videoCategory
        End Get
        Set(ByVal value As EntityG2BServices.VideoCategoryEnum)
            m_videoCategory = value
        End Set
    End Property

    Public Property MovesOffer() As Boolean
        Get
            Return m_MovesOffer
        End Get
        Set(ByVal value As Boolean)
            m_MovesOffer = value
        End Set
    End Property

    Public Property ContractTermsAndConditions() As String
        Get
            Return Me.m_contractTermsAndConditions
        End Get
        Set(ByVal value As String)
            Me.m_contractTermsAndConditions = value
        End Set
    End Property

    Public Property ContractDescription() As String
        Get
            Return Me.m_contractDescription
        End Get
        Set(ByVal value As String)
            m_contractDescription = value
        End Set
    End Property

#End Region

    ' 8/2007 jg added:
    ''' <summary>
    ''' Override ToString to show detailed property list
    ''' </summary>
    ''' <returns>String</returns>
    ''' <remarks></remarks>
    Public Overrides Function ToString() As String
        Dim sb As New StringBuilder(1000)
        Dim t As Type
        Dim pi As PropertyInfo

        Try
            sb.Append("<BR/><H3>Service Plan " & _
                        Me.ID & " " & _
                        Me.Name & "</H3>")
            ' use Reflection to get all properties of each Bundle
            t = Me.GetType()
            For Each mi As System.Reflection.PropertyInfo In t.GetProperties()
                ' see if we have a plain property or if the property is 
                ' a dictionary.  can't do "toString()" on a dictionary
                ' object
                pi = Me.GetType().GetProperty(mi.Name)

                If ((pi.PropertyType.IsPrimitive OrElse pi.PropertyType.Name = "String") _
                  AndAlso _
                     pi.PropertyType.ToString().IndexOf("Dictionary") = -1) Then

                    ' special object that contains other sub-items - Marketing
                    ' Info contains 2 arrays which means we can't just .ToString()
                    ' the Marketing Info object
                    If (Me.GetType().GetProperty(mi.Name).PropertyType.AssemblyQualifiedName.ToUpper().IndexOf( _
                            "CharterDotCom.CommonEntities.Library.EntityG2BServices+MarketingInfo".ToUpper()) > -1) Then
                        If (Me.m_MarketingInfoG2B IsNot Nothing) Then
                            sb.Append("<BR/>Marketing Info from G2B:</BR> " & _
                                        Me.m_MarketingInfoG2B.Main & _
                                        "<BR/>Bullets:")
                            For iBullet As Integer = 0 To Me.m_MarketingInfoG2B.Bullet.Length - 1
                                sb.Append("<BR/>" & Me.m_MarketingInfoG2B.Bullet(iBullet))
                            Next iBullet

                            For iText As Integer = 0 To Me.m_MarketingInfoG2B.Text.Length - 1
                                sb.Append("<BR/>" & Me.m_MarketingInfoG2B.Text(iText))
                            Next iText
                        End If
                    Else
                        '                        If (pi.Name.IndexOf("PriceType") > -1) Then
                        sb.Append("<BR/>&nbsp;&nbsp;&nbsp;" & _
                                mi.Name & " (<i>" & pi.PropertyType.Name & "</i>) : ")
                        If (pi.GetValue(Me, Nothing) IsNot Nothing) Then
                            sb.Append(pi.GetValue(Me, Nothing).ToString())
                        Else
                            sb.Append("NULL")
                        End If

                        '    Else
                        '    ' normal, .ToString-able property:
                        '    sb.Append("<BR/>&nbsp;&nbsp;&nbsp;" & _
                        '            mi.Name & " (<i>" & pi.PropertyType.Name & "</i>) : " & _
                        '            pi.GetValue(Me, Nothing))
                        'End If

                    End If
                Else
                    If (pi Is Nothing) Then
                    Else
                        Debug.WriteLine(pi.PropertyType.ToString())
                        If (pi.GetValue(Me, Nothing) Is Nothing) Then
                        Else
                            If (Me.GetType().GetProperty(mi.Name).PropertyType.AssemblyQualifiedName.ToUpper().IndexOf( _
                                    "CharterDotCom.CommonEntities.Library.Feature".ToUpper()) > -1) Then

                                For Each kvp As KeyValuePair(Of String, Feature) In pi.GetValue(Me, Nothing)
                                    If (Not (IsNothing(kvp))) Then
                                        Debug.WriteLine(kvp.ToString())
                                        sb.Append(kvp.ToString())
                                    End If
                                Next
                            Else
                                If (Me.GetType().GetProperty(mi.Name).PropertyType.AssemblyQualifiedName.ToUpper().IndexOf( _
                                        "CharterDotCom.CommonEntities.Library.EntityG2BServices+HardwareType".ToUpper()) > -1) Then

                                    For Each kvp As KeyValuePair(Of String, EntityG2BServices.HardwareType) In pi.GetValue(Me, Nothing)
                                        If (Not (IsNothing(kvp))) Then
                                            Debug.WriteLine(kvp.ToString())
                                            sb.Append(kvp.ToString())
                                        End If
                                    Next
                                Else
                                    If (Me.GetType().GetProperty(mi.Name).PropertyType.AssemblyQualifiedName.ToUpper().IndexOf( _
                                            "CharterDotCom.CommonEntities.Library.EntityG2BServices+IncludedItems".ToUpper()) > -1) Then

                                        For Each kvp As KeyValuePair(Of String, EntityG2BServices.IncludedItemsType) In pi.GetValue(Me, Nothing)
                                            If (Not (IsNothing(kvp))) Then
                                                Debug.WriteLine(kvp.ToString())
                                                sb.Append(kvp.ToString())
                                            End If
                                        Next
                                    Else
                                        If (Me.GetType().GetProperty(mi.Name).PropertyType.AssemblyQualifiedName.ToUpper().IndexOf( _
                                                "CharterDotCom.CommonEntities.Library.EntityG2BServices+CustomizationTypeQueryOffers".ToUpper()) > -1) Then

                                            For Each kvp As KeyValuePair(Of String, EntityG2BServices.CustomizationTypeQueryOffers) In pi.GetValue(Me, Nothing)
                                                If (Not (IsNothing(kvp))) Then
                                                    Debug.WriteLine(kvp.ToString())
                                                    sb.Append(kvp.ToString())
                                                End If
                                            Next
                                        Else
                                            If (Me.GetType().GetProperty(mi.Name).PropertyType.AssemblyQualifiedName.ToUpper().IndexOf( _
                                                    "CharterDotCom.CommonEntities.Library.EntityG2BServices+PromotionType".ToUpper()) > -1) Then

                                                For Each kvp As KeyValuePair(Of String, EntityG2BServices.PromotionType) In pi.GetValue(Me, Nothing)

                                                    If (Not (IsNothing(kvp))) Then
                                                        Debug.WriteLine(kvp.ToString())
                                                        sb.Append(kvp.ToString())
                                                    End If
                                                Next

                                            Else
                                                If (Me.GetType().GetProperty(mi.Name).PropertyType.AssemblyQualifiedName.ToUpper().IndexOf( _
                                                        "CharterDotCom.CommonEntities.Library.EntityG2BServices+Discount".ToUpper()) > -1) Then

                                                    For Each kvp As KeyValuePair(Of String, EntityG2BServices.DiscountTypeQueryOffers) In pi.GetValue(Me, Nothing)
                                                        If (Not (IsNothing(kvp))) Then
                                                            Debug.WriteLine(kvp.ToString())
                                                            sb.Append(kvp.ToString())
                                                        End If
                                                    Next
                                                End If
                                            End If
                                        End If
                                    End If
                                End If
                            End If

                        End If
                    End If

                End If

            Next mi

            Return sb.ToString()

        Catch ex As Exception
            Debug.WriteLine(ex.ToString())
            Return sb.ToString()
        End Try
    End Function


    Private Function DefaultString(ByVal pobj As Object) As String

        If (pobj Is Nothing) Then
            Return String.Empty
        Else
            Return pobj.ToString()
        End If
    End Function

End Class
