29-11-2023

This commit is contained in:
Jonathan Jenne
2023-11-29 16:15:48 +01:00
parent c964b97e55
commit 1b88a6cff7
23 changed files with 342 additions and 257 deletions

View File

@@ -7,46 +7,24 @@ Public Class HistoryModel
MyBase.New(pState)
End Sub
Private Function GetActionDescription(pActionType As Constants.EnvelopeHistoryActionType)
Select Case pActionType
Case Constants.EnvelopeHistoryActionType.Created
Return "Umschlag erfolgreich erstellt"
Case Constants.EnvelopeHistoryActionType.Sent
Return "Umschlag an Empfänger versendet"
Case Constants.EnvelopeHistoryActionType.Seen
Return "Umschlag von Empfänger geöffnet"
Case Constants.EnvelopeHistoryActionType.Signed
Return "Umschlag von Empfänger signiert"
Case Else
Return pActionType.ToString()
End Select
End Function
Public Function Insert(pHistory As EnvelopeHistoryEntry) As Boolean
Try
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE_HISTORY] "
oSql += " ([ENVELOPE_ID] "
oSql += " ,[USER_REFERENCE] "
oSql += " ,[ACTION_TYPE] "
oSql += " ,[ACTION_DESCRIPTION] "
oSql += " ,[STATUS] "
oSql += " ,[ACTION_DATE]) "
oSql += " VALUES "
oSql += " (@ENVELOPE_ID "
oSql += " ,@USER_REFERENCE "
oSql += " ,@ACTION_TYPE "
oSql += " ,@ACTION_DESCRIPTION "
oSql += " ,@STATUS "
oSql += " ,@ACTION_DATE) "
Dim oCommand As New SqlCommand(oSql)
oCommand.Parameters.Add("ENVELOPE_ID", SqlDbType.Int).Value = pHistory.EnvelopeId
oCommand.Parameters.Add("USER_REFERENCE", SqlDbType.NVarChar).Value = pHistory.UserReference
oCommand.Parameters.Add("ACTION_TYPE", SqlDbType.Int).Value = pHistory.ActionType
oCommand.Parameters.Add("ACTION_DESCRIPTION", SqlDbType.NVarChar).Value = GetActionDescription(pHistory.ActionType)
oCommand.Parameters.Add("ACTION_DATE", SqlDbType.DateTime).Value = Now()
oCommand.Parameters.Add("STATUS", SqlDbType.Int).Value = pHistory.Status
oCommand.Parameters.Add("ACTION_DATE", SqlDbType.DateTime).Value = pHistory.ActionDate
If Database.ExecuteNonQuery(oCommand) Then
Return True