Imports CharterDotCom.CommonEntities.Library
Imports CharterDotCom.CommonEntities.Library.Common
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.WebSite.Library.BLCommon

Partial Class Visitors_FinishOrder
    Inherits CharterCMSPage


	Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        SetPageTitle("Finish & Receipt")
        If (ucFinishOrder.Account Is Nothing) Then
            Dim _account As IAccount                                                            'added
            _account = AccountManager.Instance.GetAccount()             'added
            ucFinishOrder.Account = _account                                            'added
        End If

        If Not Page.IsPostBack Then
            Response.AddCacheItemDependency(CacheKey.OutputCacheDurationKey)

            Me.Master.OrphanPage = True

            If AccountManager.Instance.GetAccount().ExistingService IsNot Nothing Then
                ucOrderStep.Visible = False
                ucOrderStep2.Visible = True
            Else
                ucOrderStep.Visible = True
                ucOrderStep2.Visible = False
            End If
        End If

        If Request.QueryString(QueryStringName.OrderComplete) IsNot Nothing Then
            ucFinishOrder.OrderComplete = CType(Request.QueryString(QueryStringName.OrderComplete), Boolean)
            If ucFinishOrder.OrderComplete Then


            End If
        End If
    End Sub

    Protected Sub ucFinishOrder_onconfirmationNumber(ByVal confirmationNumber As String) Handles ucFinishOrder.onconfirmationNumber
        Dim trackingPixel1, trackingPixel2 As String

        trackingPixel1 = String.Format("<!-- begin AdBrite, Purchases/sales tracking -->" & _
                                            "<img border=""0"" hspace=""0"" vspace=""0"" width=""1"" height=""1"" src=""https://stats.adbrite.com/stats/stats.gif?_uid=379118&_pid=0"" />" & _
                                            "<!-- end AdBrite, Purchases/sales tracking -->" & _
                                            "<!-- -----The following Coding is for the Advertising.com Web Beacon ---- -->" & _
                                            "<!-- ----------------- DO NOT REMOVE THIS CODING ------------------------ -->" & _
                                            "<img src=""https://secure.ace-tag.advertising.com/action/type=801952548/bins=1/rich=0/mnum=1516/logs=0/xsmemid={0}"" height=1 width=1 border=0>" & _
                                            "<!-- -----The preceding Coding is for the Advertising.com Web Beacon ---- -->" & _
                                            "<!-- ----------------- DO NOT REMOVE THIS CODING ------------------------ -->", confirmationNumber)


        trackingPixel2 = "<!-- ----------------- DO NOT REMOVE THIS CODING ------------------------ -->" & _
            "<!-- BEGIN PointRoll tracking -->" & _
            "<script language='JavaScript'>" & _
            " var prd=new Date(),pru=Date.UTC(prd.getUTCFullYear(),prd.getUTCMonth(),prd.getUTCDay(),prd.getUTCHours(),prd.getUTCMinutes(),prd.getUTCSeconds(),prd.getUTCMilliseconds());if(pru<633568608000000000){ var pr_eid=pru+Math.random(); var pr_event=''; var pr_item='" & confirmationNumber & "'; var pr_quantity='';" & _
            " var pr_value='';" & _
            " document.write(""<img width='1' height='1' src='https://s.ev.ads.pointroll.com/event/?ss=A40FD719-2236-4D64-A6C7-8DA9B6C0C001&av=59&eid=""+pr_eid+""&ev=""+pr_event+""&item=""+pr_item+""&q=""+pr_quantity+""&val=""+pr_value+""&r=""+Math.random()+""'>"");" & _
            "}" & _
            "</script>" & _
            "<!-- END PointRoll tracking -->" & _
            "<!-- ----------------- DO NOT REMOVE THIS CODING ------------------------ -->"

        Me.txtTrackingPixel.Text = trackingPixel1 & trackingPixel2

    End Sub
End Class