Public Shared ReadOnly Property EmployeeId() As Integer
Get
Dim eVideo As SqlConnection = New SqlConnection(DbConnectionString)
Dim Id As Integer = 0
'Try
Dim LookupAccountNumber As SqlCommand = New SqlCommand("exec LookupEmployeeId @LoginId", eVideo)
LookupAccountNumber.Parameters.Add("@LoginId", SqlDbType.VarChar).Value = System.Threading.Thread.CurrentPrincipal.Identity.Name
'eVideo.Open()
Id = CInt(LookupAccountNumber.ExecuteScalar())
'Finally
'eVideo.Close()
'End Try
If Id <= 0 Then
Throw New Exception("Caller has no corresponding EmployeeId.")
End If
Return Id
End Get
End Property