Function BindUserDetails(UserID As String) As Tuple(Of String, String, String)
'Check User Information
Dim objSecurity As New AppFunctions, dsUser As New DataSet, cmd As New SqlCommand
Dim lngRows As Long = 0, blnCheck As Boolean = False, Name As String, Email As String, Department As String
cmd.Parameters.Add("@iUserID", Data.SqlDbType.VarChar).Value = UserID
cmd.Parameters.Add("@commandText", Data.SqlDbType.VarChar).Value = "GetUserDetails"
objSecurity.pFetchRecord(cmd, "spGetUserDetails", dsUser, lngRows)
If lngRows > 0 Then
With dsUser.Tables(0).Rows(0)
Email = .Item("Email")
Name = .Item("UserName")
Department = .Item("UserDepartment")
End With
End If
Dim tup As New Tuple(Of String, String, String)(Name, Email, Department)
Return tup
End Function
Accessing
lblResponsibleDepartment.Text = BindUserDetails(Session("UserID")).Item3
'Check User Information
Dim objSecurity As New AppFunctions, dsUser As New DataSet, cmd As New SqlCommand
Dim lngRows As Long = 0, blnCheck As Boolean = False, Name As String, Email As String, Department As String
cmd.Parameters.Add("@iUserID", Data.SqlDbType.VarChar).Value = UserID
cmd.Parameters.Add("@commandText", Data.SqlDbType.VarChar).Value = "GetUserDetails"
objSecurity.pFetchRecord(cmd, "spGetUserDetails", dsUser, lngRows)
If lngRows > 0 Then
With dsUser.Tables(0).Rows(0)
Email = .Item("Email")
Name = .Item("UserName")
Department = .Item("UserDepartment")
End With
End If
Dim tup As New Tuple(Of String, String, String)(Name, Email, Department)
Return tup
End Function
Accessing
lblResponsibleDepartment.Text = BindUserDetails(Session("UserID")).Item3
Comments
Post a Comment