2023-08-07
This commit is contained in:
43
EnvelopeGenerator.Common/Models/HistoryModel.vb
Normal file
43
EnvelopeGenerator.Common/Models/HistoryModel.vb
Normal file
@@ -0,0 +1,43 @@
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Public Class HistoryModel
|
||||
Inherits BaseModel
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState)
|
||||
End Sub
|
||||
|
||||
Public Function Insert(pHistory As EnvelopeHistoryEntry) As Boolean
|
||||
Try
|
||||
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE_HISTORY]
|
||||
([ENVELOPE_ID]
|
||||
,[STATUS]
|
||||
,[USER_EMAIL_ADDRESS]
|
||||
,[ACTION_TITLE]
|
||||
,[ACTION_DESCRIPTION])
|
||||
VALUES
|
||||
(@ENVELOPE_ID
|
||||
,@STATUS
|
||||
,@EMAIL
|
||||
,@TITLE
|
||||
,@DESCRIPTION"
|
||||
|
||||
Dim oCommand As New SqlCommand(oSql)
|
||||
oCommand.Parameters.Add("ENVELOPE_ID", SqlDbType.Int).Value = pHistory.EnvelopeId
|
||||
oCommand.Parameters.Add("STATUS", SqlDbType.NVarChar).Value = pHistory.Status
|
||||
oCommand.Parameters.Add("EMAIL", SqlDbType.NVarChar).Value = pHistory.UserEmailAddress
|
||||
oCommand.Parameters.Add("TITLE", SqlDbType.NVarChar).Value = pHistory.ActionTitle
|
||||
oCommand.Parameters.Add("DESCRIPTION", SqlDbType.NVarChar).Value = pHistory.ActionDescription
|
||||
|
||||
If Database.ExecuteNonQuery(oCommand) Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
Reference in New Issue
Block a user