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.
52 lines
1.3 KiB
52 lines
1.3 KiB
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
|