refactor(EnvelopeHistory): rename as History
This commit is contained in:
@@ -10,8 +10,8 @@ Public Class ElementModel
|
||||
MyBase.New(pState)
|
||||
End Sub
|
||||
|
||||
Private Function ToElement(pRow As DataRow) As DocumentReceiverElement
|
||||
Return New DocumentReceiverElement() With {
|
||||
Private Function ToElement(pRow As DataRow) As Signature
|
||||
Return New Signature() With {
|
||||
.Id = pRow.ItemEx("GUID", 0),
|
||||
.DocumentId = pRow.ItemEx("DOCUMENT_ID", 0),
|
||||
.ReceiverId = pRow.ItemEx("RECEIVER_ID", 0),
|
||||
@@ -24,7 +24,7 @@ Public Class ElementModel
|
||||
}
|
||||
End Function
|
||||
|
||||
Private Function ToElements(pTable As DataTable) As List(Of DocumentReceiverElement)
|
||||
Private Function ToElements(pTable As DataTable) As List(Of Signature)
|
||||
Return pTable?.Rows.Cast(Of DataRow).
|
||||
Select(AddressOf ToElement).
|
||||
ToList()
|
||||
@@ -80,7 +80,7 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function List(pDocumentId As Integer) As List(Of DocumentReceiverElement)
|
||||
Public Function List(pDocumentId As Integer) As List(Of Signature)
|
||||
Try
|
||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT] WHERE DOCUMENT_ID = {pDocumentId} ORDER BY PAGE ASC"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
@@ -93,7 +93,7 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function List(pDocumentId As Integer, pReceiverId As Integer) As List(Of DocumentReceiverElement)
|
||||
Public Function List(pDocumentId As Integer, pReceiverId As Integer) As List(Of Signature)
|
||||
Try
|
||||
Dim oReceiverConstraint = ""
|
||||
If pReceiverId > 0 Then
|
||||
@@ -111,7 +111,7 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Insert(pElement As DocumentReceiverElement) As Boolean
|
||||
Public Function Insert(pElement As Signature) As Boolean
|
||||
Try
|
||||
Dim oSql = "INSERT INTO [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
|
||||
([DOCUMENT_ID]
|
||||
@@ -161,7 +161,7 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Update(pElement As DocumentReceiverElement) As Boolean
|
||||
Public Function Update(pElement As Signature) As Boolean
|
||||
Try
|
||||
Dim oSql = "UPDATE [dbo].[TBSIG_DOCUMENT_RECEIVER_ELEMENT]
|
||||
SET [POSITION_X] = @POSITION_X
|
||||
@@ -185,7 +185,7 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function GetElementId(pElement As DocumentReceiverElement) As Integer
|
||||
Private Function GetElementId(pElement As Signature) As Integer
|
||||
Try
|
||||
Return Database.GetScalarValue($"SELECT MAX(GUID) FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT
|
||||
WHERE DOCUMENT_ID = {pElement.DocumentId} AND RECEIVER_ID = {pElement.ReceiverId}")
|
||||
@@ -196,7 +196,7 @@ Public Class ElementModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function DeleteElement(pElement As DocumentReceiverElement) As Boolean
|
||||
Public Function DeleteElement(pElement As Signature) As Boolean
|
||||
Try
|
||||
Dim oSql = $"DELETE FROM TBSIG_DOCUMENT_RECEIVER_ELEMENT WHERE GUID = {pElement.Id}"
|
||||
Return Database.ExecuteNonQuery(oSql)
|
||||
|
||||
@@ -10,8 +10,8 @@ Public Class HistoryModel
|
||||
MyBase.New(pState)
|
||||
End Sub
|
||||
|
||||
Private Function ToEnvelopeHistoryEntry(pRow As DataRow) As EnvelopeHistory
|
||||
Return New EnvelopeHistory() With {
|
||||
Private Function ToEnvelopeHistoryEntry(pRow As DataRow) As History
|
||||
Return New History() With {
|
||||
.ActionDate = pRow.ItemEx(Of Date)("ACTION_DATE", Nothing),
|
||||
.EnvelopeId = pRow.Item("ENVELOPE_ID"),
|
||||
.Status = pRow.Item("STATUS"),
|
||||
@@ -19,7 +19,7 @@ Public Class HistoryModel
|
||||
}
|
||||
End Function
|
||||
|
||||
Public Function List(pEnvelopeId As Integer) As List(Of EnvelopeHistory)
|
||||
Public Function List(pEnvelopeId As Integer) As List(Of History)
|
||||
Dim oSql = $"SELECT * FROM TBSIG_ENVELOPE_HISTORY WHERE ENVELOPE_ID = {pEnvelopeId} AND ACTION_DATE IS NOT NULL ORDER BY GUID DESC"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
Return oTable?.Rows.
|
||||
@@ -41,7 +41,7 @@ Public Class HistoryModel
|
||||
Return oRowCount > 0
|
||||
End Function
|
||||
|
||||
Public Function Insert(pHistory As EnvelopeHistory) As Boolean
|
||||
Public Function Insert(pHistory As History) As Boolean
|
||||
Try
|
||||
Dim oSql = "INSERT INTO [dbo].[TBSIG_ENVELOPE_HISTORY] "
|
||||
oSql += " ([ENVELOPE_ID] "
|
||||
|
||||
@@ -18,7 +18,7 @@ Public Class HistoryService
|
||||
End Sub
|
||||
|
||||
Public Function SetEnvelopeStatus(pEnvelope As Envelope, pStatus As EnvelopeStatus, pUserReference As String) As Boolean
|
||||
Dim oResult = HistoryModel.Insert(New EnvelopeHistory() With {
|
||||
Dim oResult = HistoryModel.Insert(New History() With {
|
||||
.EnvelopeId = pEnvelope.Id,
|
||||
.ActionDate = Now(),
|
||||
.Status = pStatus,
|
||||
|
||||
Reference in New Issue
Block a user