Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Partial Class SupplierAgreementThanx
    Inherits System.Web.UI.Page
    Dim strEmailId As String
    Dim strkid As String
    Dim strVarifyId As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Page.IsPostBack = False Then
            Dim cmd As New Data.SqlClient.SqlCommand()
            Dim con As New Data.SqlClient.SqlConnection
            Try

                If Request.QueryString("VerificationCode") <> "" Then
                    strVarifyId = Request.QueryString("VerificationCode")
                End If
                If Request.QueryString("Email") <> "" Then
                    strEmailId = Request.QueryString("Email")
                    spEmailID.Text = strEmailId.ToString
                End If
                If Request.QueryString("Id") <> "" Then
                    strkid = DecodeURL(Request.QueryString("Id"))
                End If

                con.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("ConnectionString")
                con.Open()
                'SupplierAppContactPerson_SupplierAppId
                cmd = New Data.SqlClient.SqlCommand("update SupplierApp_Master set SupplierApp_Verification='Verified', SupplierApp_ClientIP='" & Request.UserHostAddress.ToString & "' where SupplierApp_Kid='" & strkid & "' and SupplierApp_Verification='" & strVarifyId & "' and SupplierApp_IsDeleted = '0' and SupplierApp_Kid IN (SELECT SupplierAppContactPerson_SupplierAppId FROM SupplierAppContactPerson_Master WHERE SupplierAppContactPerson_EmailId = '" & strEmailId & "')", con)
                cmd.ExecuteNonQuery()
                con.Close()
            Catch ex As Exception
                showmessage(ex.Message.ToString, lblerror)
            End Try

        End If

    End Sub

    Protected Sub btnEmailConfirm_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEmailConfirm.Click
        Try
            Response.Redirect("~/suppliers/home.aspx?emailId=" & EncodeURL(Request.QueryString("Email").ToString) & "")
        Catch ex As Exception

        End Try
    End Sub
End Class
