You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.2 KiB

Imports System.Data
Imports System.Data.SqlClient
'''<summary>Datenzugriff auf Profile</summary>
Public Class Profil
#Region "Public methods"
'''<summary>Gibt eine Liste mit allen Profilen für einen Mitarbeitern zurück</summary>
'''<param name="mitarbeiterNr">Profile von diesem Mitarbeiter</param>
'''<param name="ds"></param>
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