Imports System.Data.SqlClient

Partial Class BuyersTopBannerInside
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Try
                lblBuyerName.Text = Session("Byrusername").ToString
            Catch ex As Exception

            End Try

        End If
    End Sub

    Protected Sub btnlogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnlogout.Click
        Dim con1 As New SqlConnection
        con1.ConnectionString = System.Configuration.ConfigurationManager.AppSettings("ConnectionString")
        con1.Open()

        InsertAdminUserLog(Session("LogKid"), Session("LogName").ToString, Request.UserHostAddress, 1, "Buyer", "AdminLogin", "Update")

        Dim str As String = "delete  FROM ShopCart where ShopCart_BuyerUserId ='" & Session("BuyId") & "'"
        Dim da As New SqlDataAdapter
        Dim cmd As New SqlCommand(str, con1)
        cmd.ExecuteNonQuery()
        Session.Abandon()
        Session.RemoveAll()
        con1.Close()
        cmd.Dispose()
        da.Dispose()
        con1.Dispose()
        Response.Redirect(Page.ResolveUrl("buyer-home.aspx"))
    End Sub
End Class
