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 EBSServicesProvider


Partial Class LoadTest_TestEAICSGGetAccounts
    Inherits System.Web.UI.Page

    Private _provider As IEBSServicesProvider

    Private Property Provider() As IEBSServicesProvider
        Get
            Return _provider
        End Get
        Set(ByVal value As IEBSServicesProvider)
            _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

        '##################################################################################
        'MODIFICATION   ROD COPELAND    JUNE 24, 2008   ISSUE ID 3943
        '##################################################################################
        'THERE IS A NEED TO MONITOR THE AVAILABILITY OF THE EAI WS METHOD GET ACCOUNTS 
        'AS THIS METHOD IS USED TO PROVIDE BILLING SUMMARY INFORMATION ON THE MY ACCOUNT 
        'LANDING PAGE.  THERE HAVE BEEN ISSUES WITH INTERMITTANT AVAILABILITY AND THE 
        'WEB SELF CARE FOLKS HAVE REQUESTED A NOTIFICATION WHEN THIS IS NOT AVAILABLE.
        'OVIS IS USED TO MONITOR THIS PAGE.
        '##################################################################################
        Me.Provider = New ProviderManager()

        Dim fullAcctNumber As String = "8751220011221320"
        Dim objGetAccountsRequestCSG As GetAccountsRequestCSG
        Dim objGetAccountsResponseCSG As GetAccountsResponseCSG
        Dim lCriteria As New AccountCriteriaCSG

        lCriteria.Item = fullAcctNumber
        lCriteria.ItemElementName = ItemChoiceTypeCSG.AccountNumber
        objGetAccountsRequestCSG = New GetAccountsRequestCSG(Nothing, lCriteria)



        '########################################################################
        'MAKE CALL TO THE PROVIDER WHICH IN TURN WILL CALL THE EBS WEB SERVICE
        '########################################################################
        objGetAccountsResponseCSG = CType(Me.Provider.GetAccountsFromCSG(objGetAccountsRequestCSG), GetAccountsResponseCSG)







        If Not (objGetAccountsResponseCSG Is Nothing) Then
            If Not objGetAccountsResponseCSG.Exception Then
                Response.Write("Machince Name: " & Environment.MachineName.ToLower & " <h1>Good</h1> Account Number: " & fullAcctNumber & " <br/>Criteria Item:" & ItemChoiceTypeCSG.AccountNumber.ToString() & "<br>")
            Else
                Response.Write("Machince Name: " & Environment.MachineName.ToLower & " <h1>Bad</h1> Account Number: " & fullAcctNumber & " <br/>Criteria Item:" & ItemChoiceTypeCSG.AccountNumber.ToString() & "<br>")
                Response.Write("Exception Message: " & objGetAccountsResponseCSG.ExceptionMessage & "<br>")
                Response.Write("Exception Details: " & objGetAccountsResponseCSG.ExceptionStackTrace & "<br>")
            End If
        Else
            Response.Write("Machince Name: " & Environment.MachineName.ToLower & "   <h1>Bad</h1>  Account Number: " & fullAcctNumber & " <br/>Criteria Item:" & ItemChoiceTypeCSG.AccountNumber.ToString() & "<br>")
            Response.Write("Exception Message: " & objGetAccountsResponseCSG.ExceptionMessage & "<br>")
            Response.Write("Exception Details: " & objGetAccountsResponseCSG.ExceptionStackTrace & "<br>")
        End If


    End Sub
End Class
