Initial
This commit is contained in:
84
Backup/DataAccess/Klassifizierung.vb
Normal file
84
Backup/DataAccess/Klassifizierung.vb
Normal file
@@ -0,0 +1,84 @@
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
'''<summary>Datenzugriff auf Tabelle Klassifizierung</summary>
|
||||
Public Class Klassifizierung
|
||||
|
||||
#Region "Public methods"
|
||||
|
||||
'''<summary>Gibt eine Liste mit allen Funktionsgrupppen zurück</summary>
|
||||
'''<param name="ds">Das DataSet welches gefüllt werden soll</param>
|
||||
|
||||
Overloads Shared Sub GetListe(ByRef ds As DataSet)
|
||||
Dim sqlConn As New SqlConnection()
|
||||
Dim sqlCmd As New SqlCommand()
|
||||
Dim da As New SqlDataAdapter()
|
||||
|
||||
Try
|
||||
sqlCmd.CommandText = "sp_ListKlassifizierung"
|
||||
sqlCmd.CommandType = CommandType.StoredProcedure
|
||||
sqlCmd.Connection = sqlConn
|
||||
|
||||
sqlConn.ConnectionString = Common.Datenbank.GetDSN()
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
da.SelectCommand = sqlCmd
|
||||
da.Fill(ds, "KlassifizierungListe")
|
||||
|
||||
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
|
||||
|
||||
'''<summary>Gibt alle Details zur einer Klassifizierung zurück</summary>
|
||||
'''<param name="klassifizierungNr">Die Datenbank Nummer der Klassifizierung (ID)</param>
|
||||
'''<param name="ds">Das zu füllende DataSet</param>
|
||||
|
||||
Overloads Shared Sub GetById(ByVal klassifizierungNr As Integer, ByRef ds As DataSet)
|
||||
Dim sqlConn As New SqlConnection()
|
||||
Dim sqlCmd As New SqlCommand()
|
||||
Dim da As New SqlDataAdapter()
|
||||
|
||||
Try
|
||||
sqlCmd.CommandText = "sp_GetKlassifizierungById"
|
||||
sqlCmd.CommandType = CommandType.StoredProcedure
|
||||
sqlCmd.Connection = sqlConn
|
||||
|
||||
sqlCmd.Parameters.Add(New SqlParameter("@KlassifizierungNr", klassifizierungNr))
|
||||
|
||||
sqlConn.ConnectionString = Common.Datenbank.GetDSN()
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
da.SelectCommand = sqlCmd
|
||||
da.Fill(ds, "Klassifizierung")
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user