Imports System.Data
Imports System.Data.SqlClient
'''Datenzugriff auf Profile
Public Class Profil
#Region "Public methods"
'''Gibt eine Liste mit allen Profilen für einen Mitarbeitern zurück
'''Profile von diesem Mitarbeiter
'''
Overloads Shared Sub GetListeByMitarbeiterNr(ByVal mitarbeiterNr As Integer, ByRef ds As DataSet)
Dim sqlConn As New SqlConnection()
Dim sqlCmd As New SqlCommand()
Dim da As New SqlDataAdapter()
Try
sqlCmd.CommandText = "dbo.pv_profil_select"
sqlCmd.CommandType = CommandType.StoredProcedure
sqlCmd.Connection = sqlConn
sqlConn.ConnectionString = Common.Datenbank.GetDSN()
sqlCmd.Parameters.Add(New SqlParameter("@mitarbeiternr", mitarbeiterNr))
'DANGER: mandantNr is hardcoded here
sqlCmd.Parameters.Add(New SqlParameter("@mandantnr", 1))
sqlConn.Open()
da.SelectCommand = sqlCmd
da.Fill(ds, "ProfilListe")
Catch ex As Exception
Throw ex
Finally
If sqlCmd Is Nothing Then
sqlCmd.Dispose()
End If
If sqlConn Is Nothing Then
sqlConn.Dispose()
End If
If da Is Nothing Then
da.Dispose()
End If
End Try
End Sub
#End Region
End Class