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.
76 lines
1.8 KiB
76 lines
1.8 KiB
Imports EDOKALib.Common
|
|
|
|
'''<summary>Diese klasse beinhaltet die Logik für ein Dokument. Da diese Klasse vorständig sehr komplext wäre, ist diese hier NICHT vollständig und wird laufend um die benötigte Funktionalität erweitert</summary>
|
|
Public Class Dokument
|
|
|
|
#Region "Members"
|
|
|
|
Private _dokumentId As String
|
|
|
|
#End Region
|
|
|
|
#Region "Public methods"
|
|
|
|
Public Shared Function SetStatus()
|
|
Try
|
|
If IsNothing(Common.Action.Action) Then
|
|
'action muss existieren
|
|
TKBLib.Errorhandling.TraceHelper.Msg("EdokaLib.Dokument.SetStatus", "2 Static action object is nothing", TraceLevel.Warning)
|
|
Throw New DokumentException(2, "Static action object is nothing")
|
|
End If
|
|
|
|
Dim paramName, value As String
|
|
|
|
'nötige werte aus action xml lesen
|
|
paramName = "OrderNr"
|
|
value = Action.Action.GetParameterByName("fanummer3").Value
|
|
|
|
Dim mitarbeiter As New mitarbeiter(Action.Action.CreatorTgNr)
|
|
|
|
Dim result As Integer
|
|
'effektiver status setzen
|
|
result = DataAccess.Dokument.SetStatus(Action.Action.SourceApplication, paramName, value, mitarbeiter.MitarbeiterNr)
|
|
|
|
If result <> 0 Then
|
|
Throw New DokumentException(1, "No rows have been affected")
|
|
End If
|
|
|
|
Catch ex As Exception
|
|
TKBLib.Errorhandling.TraceHelper.Msg("EdokaLib.Dokument.SetStatus", ex.Message & ex.StackTrace, TraceLevel.Error)
|
|
Throw ex
|
|
End Try
|
|
End Function
|
|
|
|
#End Region
|
|
|
|
End Class
|
|
|
|
#Region "DokumentException"
|
|
|
|
Public Class DokumentException
|
|
Inherits Exception
|
|
|
|
Private _number As Integer
|
|
Private _description As String
|
|
|
|
Public Sub New(ByVal number As Integer, ByVal description As String)
|
|
_number = number
|
|
_description = description
|
|
End Sub
|
|
|
|
Public Overrides ReadOnly Property Message() As String
|
|
Get
|
|
Return _description
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Number() As Integer
|
|
Get
|
|
Return _number
|
|
End Get
|
|
End Property
|
|
|
|
End Class
|
|
|
|
#End Region
|