Rework Patterns to allow for row based and final sql replacement when importing
This commit is contained in:
@@ -965,7 +965,7 @@ Namespace Winline
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Async Function ExecuteFinalSQL(pDocument As ExportDocument, pTemplate As Template, pMandator As Mandator) As Task(Of Boolean)
|
||||
Public Async Function ExecuteFinalSQLForExport(pDocument As ExportDocument, pTemplate As Template, pMandator As Mandator) As Task(Of Boolean)
|
||||
Try
|
||||
Dim oSql As String = Patterns.ReplaceForExport(pDocument, pMandator, pTemplate.FinalSQL)
|
||||
Return Await Database.ExecuteNonQueryAsync(oSql)
|
||||
@@ -976,6 +976,17 @@ Namespace Winline
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function ExecuteFinalSQLForImport(pDocument As Document, pTemplate As Template, pReportFilename As String) As Task(Of Boolean)
|
||||
Try
|
||||
Dim oSql As String = Patterns.ReplaceForImportFinalSQL(pDocument, pReportFilename, pTemplate.FinalSQL)
|
||||
Return Await Database.ExecuteNonQueryAsync(oSql)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function GetDocumentFromDataRow(pDataRow As DataRow) As ExportDocument
|
||||
Dim oAccountNumber = pDataRow.Item("ACCOUNT_NUMBER")
|
||||
Dim oRunningNumber As String = pDataRow.Item("RUNNING_NUMBER")
|
||||
|
||||
Reference in New Issue
Block a user