Initial
This commit is contained in:
51
DataAccess/Dokument.vb
Normal file
51
DataAccess/Dokument.vb
Normal file
@@ -0,0 +1,51 @@
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
'''<summary>Datenzugriff auf Dokumente</summary>
|
||||
Public Class Dokument
|
||||
|
||||
#Region "Public methods"
|
||||
|
||||
'''<summary>Setz den Status eines Dokuments</summary>
|
||||
|
||||
Overloads Shared Function SetStatus(ByVal sourceApplication As String, ByVal parameterName As String, ByVal value As String, ByVal mutiererMitarbeiterNr As Integer) As Integer
|
||||
Dim sqlConn As New SqlConnection()
|
||||
Dim sqlCmd As New SqlCommand()
|
||||
|
||||
Try
|
||||
sqlCmd.CommandText = "sp_SetDokumentStatus"
|
||||
sqlCmd.CommandType = CommandType.StoredProcedure
|
||||
sqlCmd.Connection = sqlConn
|
||||
|
||||
sqlConn.ConnectionString = Common.Datenbank.GetDSN()
|
||||
|
||||
sqlCmd.Parameters.Add(New SqlParameter("@SourceApplication", sourceApplication))
|
||||
sqlCmd.Parameters.Add(New SqlParameter("@ParameterName", parameterName))
|
||||
sqlCmd.Parameters.Add(New SqlParameter("@Value", value))
|
||||
sqlCmd.Parameters.Add(New SqlParameter("@MutiererMitarbeiterNr", mutiererMitarbeiterNr))
|
||||
|
||||
sqlConn.Open()
|
||||
|
||||
If sqlCmd.ExecuteNonQuery() = 0 Then
|
||||
'no rows have been affected
|
||||
Return 1
|
||||
Else
|
||||
'all right
|
||||
Return 0
|
||||
End If
|
||||
|
||||
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
|
||||
End Try
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user