Initial commit
This commit is contained in:
70
SW/Dokumente/DMS/clsStammdaten.vb
Normal file
70
SW/Dokumente/DMS/clsStammdaten.vb
Normal file
@@ -0,0 +1,70 @@
|
||||
Imports System
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Namespace db
|
||||
|
||||
Public Class clsStammdaten
|
||||
Public Function Get_Stammdaten(ByVal Tabelle As String, ByVal orderby As String) As DataTable
|
||||
Dim selectcommand As New SqlCommand
|
||||
Dim connection As New SqlConnection()
|
||||
Dim da As New SqlDataAdapter("", connection)
|
||||
Dim ds As New DataSet
|
||||
selectcommand.CommandText = "sp_get_stammdaten"
|
||||
selectcommand.Parameters.Add("@Mitarbeiternr", SqlDbType.Int, 4)
|
||||
selectcommand.Parameters.Add("@Tabelle", SqlDbType.VarChar, 255)
|
||||
selectcommand.Parameters.Add("@Orderby", SqlDbType.VarChar, 255)
|
||||
selectcommand.Parameters(0).Value = Globals.Mitarbeiternr
|
||||
selectcommand.Parameters(1).Value = Tabelle
|
||||
selectcommand.Parameters(2).Value = orderby
|
||||
|
||||
selectcommand.CommandType = CommandType.StoredProcedure
|
||||
selectcommand.Connection = connection
|
||||
Try
|
||||
connection.ConnectionString = Globals.sConnectionString
|
||||
connection.Open()
|
||||
da.SelectCommand = selectcommand
|
||||
da.Fill(ds)
|
||||
Return ds.Tables(0)
|
||||
Catch ex As Exception
|
||||
Finally
|
||||
connection.Close()
|
||||
da.Dispose()
|
||||
ds.Dispose()
|
||||
selectcommand.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Get_Gremium(ByVal type As Integer, ByVal subtype As Integer) As DataTable
|
||||
Dim selectcommand As New SqlCommand
|
||||
Dim connection As New SqlConnection()
|
||||
Dim da As New SqlDataAdapter("", connection)
|
||||
Dim ds As New DataSet
|
||||
selectcommand.CommandText = "dbo.sp_get_gremium"
|
||||
selectcommand.Parameters.Add("@type", SqlDbType.Int, 4)
|
||||
selectcommand.Parameters.Add("@subtype", SqlDbType.Int, 4)
|
||||
selectcommand.Parameters(0).Value = type
|
||||
selectcommand.Parameters(1).Value = subtype
|
||||
|
||||
selectcommand.CommandType = CommandType.StoredProcedure
|
||||
selectcommand.Connection = connection
|
||||
Try
|
||||
connection.ConnectionString = Globals.sConnectionString
|
||||
connection.Open()
|
||||
da.SelectCommand = selectcommand
|
||||
da.Fill(ds)
|
||||
Return ds.Tables(0)
|
||||
Catch ex As Exception
|
||||
Finally
|
||||
connection.Close()
|
||||
da.Dispose()
|
||||
ds.Dispose()
|
||||
selectcommand.Dispose()
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Reference in New Issue
Block a user