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 MemberServicesProvider


Partial Class LoadTest_TestAuthenticate
    Inherits System.Web.UI.Page

    Private _provider As IMemberServicesProvider


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

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            '#################
            'TEST AUTHENTICATE 
            '#################
            Me.Provider = New ProviderManager()




            Dim objRequest As New AuthenticateRequest
            Dim objresult As New AuthenticateResponse


            objRequest.csrLogin = "superficient"
            objRequest.csrPassword = "test12345"

            '#################################################################################
            'MODIFICATION   ROD COPELAND    JUNE 24, 2008   ISSUE ID 4084
            '#################################################################################
            'THE INTENT OF THIS PAGE IS TO SUPPORT THE OVIS PROBES WHEN MONITORING THE 
            'STATUS OF MEMBER SERVICES AVAILABILITY.  SINCE PROBES ARE ONLY ACTIVE IN 
            'PROD, NO NEED TO TEST AUTHENTICATE IN OTHER EVIRONMENTS WITH THIS PAGE 
            'DIRECTLY, JUST USE LOCAL MACHINES TO TEST DIRECTLY THE MEMBER SERVICE WEB SERVICE.
            '#################################################################################
            Select Case Environment.MachineName.ToLower
                Case "kstlmcc2p03"
                    '#######
                    'PROD
                    '#######
                    objRequest.Login = "icomsprobe1"
                    objRequest.Password = "probe1icoms"
                Case "kstlmcc2p04"
                    '#######
                    'PROD
                    '#######
                    objRequest.Login = "csgprobe1"
                    objRequest.Password = "probe1csg"
                Case "kstlmccap01"
                    '#######
                    'PROD
                    '#######
                    objRequest.Login = "icomsprobe2"
                    objRequest.Password = "probe2icoms"
                Case "kstlmccap02"
                    '#######
                    'PROD
                    '#######
                    objRequest.Login = "csgprobe2"
                    objRequest.Password = "probe2csg"
                Case "kstlmccap03"
                    '#######
                    'PROD
                    '#######
                    objRequest.Login = "icomsprobe3"
                    objRequest.Password = "probe3icoms"
                Case "kstlmccap04"
                    '#######
                    'PROD
                    '#######
                    objRequest.Login = "csgprobe3"
                    objRequest.Password = "probe3csg"
                Case "kstlmccap05"
                    '#######
                    'PROD
                    '#######
                    objRequest.Login = "icomsprobe4"
                    objRequest.Password = "probe4icoms"
                    '#################################################################################
                Case "kstlmweb68"
                    '#######
                    'UAT
                    '#######
                    objRequest.Login = "chr8930"
                    objRequest.Password = "studio89"
                Case "kstlmweb69"
                    '#######
                    'UAT
                    '#######
                    objRequest.Login = "chr8930"
                    objRequest.Password = "studio89"
                Case "kstlmweb65"
                    '#######
                    'DEV
                    '#######
                    objRequest.Login = "chr8930"
                    objRequest.Password = "studio89"
                Case Else
                    '#####################################
                    'THIS SHOULD ONLY BE LOCALHOST STUFF HERE.
                    '#####################################
                    objRequest.Login = "chr8930"
                    objRequest.Password = "studio89"
            End Select


      

            objresult = Me.Provider.Authenticate(objRequest)



            If Not (objresult Is Nothing) Then
                If Not objresult.Exception Then
                    Response.Write("Machince Name: " & Environment.MachineName.ToLower & " <br/> - Sign In is Good using ID:" & objRequest.Login & " PW:" & objRequest.Password & "<br>")
                Else
                    Response.Write("Machince Name: " & Environment.MachineName.ToLower & " <br/> - Sign In is <b>Bad</b> using ID:" & objRequest.Login & " PW:" & objRequest.Password & "<br>")
                    Response.Write("Exception Message: " & objresult.ExceptionMessage & "<br>")
                    Response.Write("Exception Details: " & objresult.ExceptionStackTrace & "<br>")
                End If
            Else
                Response.Write("Machince Name: " & Environment.MachineName.ToLower & "<br/> - Sign In is <b>Bad</b> using ID:" & objRequest.Login & " PW:" & objRequest.Password & "<br>")
                Response.Write("Exception Message: " & objresult.ExceptionMessage & "<br>")
                Response.Write("Exception Details: " & objresult.ExceptionStackTrace & "<br>")
            End If
        Catch ex As Exception
            Response.Write(ex.Message)
        End Try



    End Sub
End Class
