
Partial Class UserControl_SupplierLoginTopBanner
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            If Session("LogTime") <> "" Then
                Label1.Text = "You previously logged on " & Session("LogTime").ToString
                '  InsertAdminUserLog(Session("LogKid"), Session("LogName").ToString, Request.UserHostAddress, 0, "AdminLogin", "Update")
            End If

            If Not IsPostBack Then
                If Session("AdminID") = Nothing Then
                    lblName.Text = " Welcome  " & ReturnValue("select  Supplier_Name from Supplier_Master where supplier_kid='" & RemoveLiterals(Session.Item("SupplierID").ToString.Trim) & "' ")
                    SupplierHome.Visible = True
                    SupplierLogOut.Visible = True
                    AdminHome.Visible = False
                    AdminListProduct.Visible = False
                    AdminLogOut.Visible = False
                    AdminList.Visible = False
                    changepass.Visible = True
                    DivBar.Visible = True
                Else
                    lblName.Text = " Supplier:- " & ReturnValue("select  Supplier_Name from Supplier_Master where supplier_kid='" & RemoveLiterals(Session.Item("SupplierID").ToString.Trim) & "' ")

                    SupplierHome.Visible = False
                    SupplierLogOut.Visible = False
                    AdminHome.Visible = True
                    AdminListProduct.Visible = True
                    AdminLogOut.Visible = True
                    AdminList.Visible = True
                    changepass.Visible = False
                    DivBar.Visible = False
                End If

            End If
        Catch ex As Exception

        End Try
    End Sub

    Protected Sub lnklogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnklogout.Click
        Try
            InsertAdminUserLog(Session("LogKid"), Session("LogName").ToString, Request.UserHostAddress, 1, "Supplier", "SupplierLogin", "Update")
            Response.Redirect("~/suppliers/listproduct.aspx")
        Catch ex As Exception

        End Try
       
    End Sub

    Protected Sub lnkadminlogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkadminlogout.Click
        Try
            InsertAdminUserLog(Session("LogKid"), Session("LogName").ToString, Request.UserHostAddress, 1, "Admin", "AdminLogin", "Update")
            Response.Redirect("~/Admin/AdminLogin.aspx")
        Catch ex As Exception

        End Try
    End Sub

    Protected Sub lnkchangepass_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkchangepass.Click
        Response.Redirect("~/suppliers/ChangePassword.aspx")
    End Sub
End Class
