Option Explicit On 
Option Strict On
Option Compare Text

Imports System.Data.SqlClient
Imports System.Web.Security

Public MustInherit Class TopPageAddRemove
	Inherits System.Web.UI.UserControl

#Region " Web Form Designer Generated Code "

	'This call is required by the Web Form Designer.
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

	End Sub

	Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
		'CODEGEN: This method call is required by the Web Form Designer
		'Do not modify it using the code editor.
		InitializeComponent()
	End Sub

#End Region

	Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		If Not (Session("LoginType") Is Nothing) Then
            If Not ((CType(Session.Item("LoginType"), String) = "administrator") Or (CType(Session.Item("LoginType"), String) = "ptoadmin")) Then
                'if no session then go to login page
                Session.Abandon()
                FormsAuthentication.SignOut()
                'Response.Redirect("login.aspx")
                Page.RegisterClientScriptBlock("NoSession", "<script language='javascript'>alert('Your session has expired,    \n\nKindly re-login!');window.close();</script>")
            End If
        Else
			Page.RegisterClientScriptBlock("NoSession", "<script language='javascript'>alert('Your session has expired,    \n\nKindly re-login!');window.close();</script>")
		End If
	End Sub

End Class
