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 G2BServicesProvider
Imports System.Collections.Generic

Partial Class LoadTest_TestQueryOffers
    Inherits System.Web.UI.Page


    Private _provider As IG2BServicesProvider

    Private Property Provider() As IG2BServicesProvider
        Get
            Return _provider
        End Get
        Set(ByVal value As IG2BServicesProvider)
            _provider = value
        End Set
    End Property

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        On Error Resume Next
        '################
        'TEST QUERYOFFERS
        '################

        Me.Provider = New ProviderManager()

        Dim requestingAffiliate As New AffiliateType
        Dim origAffiliate As AffiliateType = Nothing
        Dim addr As New Address
        Dim addr1 As New ParsedUSAddressType
        Dim request As New List(Of ServiceType)

        Dim subscriber(2) As AllServiceEnum
        Dim phone As String
        Dim addrOut As New ParsedUSAddressType
        Dim msoOfferResponse(1) As MSOOffersResponseType
        Dim objG2BQueryOffersResponse As G2BQueryOffersResponse


        addr.Street1 = "6318 Alaska Ave"
        addr.Zip = "63111"

        addr1.PrimRange = "5766"
        addr1.PrimName = "Hidden Cove"
        addr1.Suffix = "Ln"
        addr1.City = "Florissant"
        addr1.State = "MO"
        addr1.Zip = "63034"

        request.Add(ServiceType.Basic)
        request.Add(ServiceType.Digital)
        request.Add(ServiceType.DVR)
        request.Add(ServiceType.HDTV)
        request.Add(ServiceType.HSD)
        request.Add(ServiceType.NotSpecified)
        request.Add(ServiceType.Telephony)
        request.Add(ServiceType.VOD)


        subscriber(0) = AllServiceEnum.m_DSL
        subscriber(1) = AllServiceEnum.m_CableBasicVideo

        phone = "3036619100"
        Dim obj As G2BQueryOffersRequest
        '########################################################################
        'MODIFICATION   ROD COPELAND    ISSUE ID 4987
        '########################################################################
        '900001 is "CableLabs Testing", per SBoone - recom system PM June 22, 2009
        '########################################################################
        obj = New G2BQueryOffersRequest(addr, request, 900000)

        obj.Address = addr
        obj.requestLOB = request
        objG2BQueryOffersResponse = Me.Provider.QueryOffers(obj)

        If Not (objG2BQueryOffersResponse Is Nothing) Then
            If Not (objG2BQueryOffersResponse.Exception) Then
                If Not (objG2BQueryOffersResponse.ProductCatalog Is Nothing) Then
                    If (objG2BQueryOffersResponse.ProductCatalog.Bundles.Count > 0) Or (objG2BQueryOffersResponse.ProductCatalog.ServicePlans.Count > 0) Then
                        Response.Write("G2B QUERYOFFERS is Good" & "<br>")
                    Else
                        Response.Write("G2B QUERYOFFERS is <b>Bad</b>" & "<br>")
                    End If
                Else
                    Response.Write("G2B QUERYOFFERS is <b>Bad</b>" & "<br>")
                End If
            Else
                Response.Write("G2B QUERYOFFERS is <b>Bad</b>" & "<br>")
            End If
        Else
            Response.Write("G2B QUERYOFFERS is <b>Bad</b>" & "<br>")
        End If
    End Sub
End Class
