update service and api
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.EDMIAPI
|
||||
Imports DigitalData.Modules.Filesystem
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class frmFileTest
|
||||
@@ -16,7 +15,10 @@ Public Class frmFileTest
|
||||
End Sub
|
||||
|
||||
Private Async Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
Dim oDialog = New OpenFileDialog()
|
||||
Dim oDialog = New OpenFileDialog() With {
|
||||
.Multiselect = True
|
||||
}
|
||||
|
||||
Dim oDialogResult = oDialog.ShowDialog()
|
||||
|
||||
If oDialogResult <> DialogResult.OK Then
|
||||
@@ -24,65 +26,71 @@ Public Class frmFileTest
|
||||
End If
|
||||
|
||||
Try
|
||||
Dim oResult = Await _fileOp.ImportFileAsync(oDialog.FileName)
|
||||
For Each oFileName In oDialog.FileNames
|
||||
Dim oSW As New Stopwatch()
|
||||
oSW.Start()
|
||||
|
||||
If oResult.OK = False Then
|
||||
MsgBox(oResult.ErrorMessage)
|
||||
Exit Sub
|
||||
End If
|
||||
Dim oResult = Await _fileOp.ImportFile2(oFileName)
|
||||
|
||||
listboxLog.Items.Add($"Document uploaded!")
|
||||
listboxLog.Items.Add($"DocId: {oResult.Document.DocumentId}")
|
||||
listboxLog.Items.Add($"ContainerId: {oResult.Document.ContainerId}")
|
||||
listboxLog.Items.Add($"Filename: {oResult.Document.FileName}")
|
||||
listboxLog.Items.Add($"----------------------------------------------------------")
|
||||
oSW.Stop()
|
||||
|
||||
If oResult.OK = False Then
|
||||
MsgBox(oResult.ErrorMessage)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
listboxLog.Items.Add($"Document uploaded!")
|
||||
listboxLog.Items.Add($"Filename: {oResult.Document.FileName}")
|
||||
listboxLog.Items.Add($"Time in milliseconds: {oSW.ElapsedMilliseconds}")
|
||||
listboxLog.Items.Add($"----------------------------------------------------------")
|
||||
Next
|
||||
Catch ex As Exception
|
||||
ShowErrorMessage(ex)
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub btnDocByDocId_Click(sender As Object, e As EventArgs) Handles btnDocByDocId.Click
|
||||
Try
|
||||
Dim oDocId As Int64 = Int64.Parse(TextBox1.Text)
|
||||
Dim oResult = _fileOp.GetDocumentByDocumentId(oDocId)
|
||||
'Private Sub btnDocByDocId_Click(sender As Object, e As EventArgs)
|
||||
' Try
|
||||
' Dim oDocId As Int64 = Int64.Parse(TextBox1.Text)
|
||||
' Dim oResult = _fileOp.GetDocumentByDocumentId(oDocId)
|
||||
|
||||
If Not oResult.OK Then
|
||||
MsgBox(oResult.ErrorMessage)
|
||||
Exit Sub
|
||||
End If
|
||||
' If Not oResult.OK Then
|
||||
' MsgBox(oResult.ErrorMessage)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
Dim oDocObject = oResult.Document
|
||||
' Dim oDocObject = oResult.Document
|
||||
|
||||
listboxLog.Items.Add($"Document fetched!")
|
||||
listboxLog.Items.Add($"DocId: {oDocObject.DocumentId}")
|
||||
listboxLog.Items.Add($"ContainerId: {oDocObject.ContainerId}")
|
||||
listboxLog.Items.Add($"Filename: {oDocObject.FileName}")
|
||||
listboxLog.Items.Add($"----------------------------------------------------------")
|
||||
Catch ex As Exception
|
||||
ShowErrorMessage(ex)
|
||||
End Try
|
||||
End Sub
|
||||
' listboxLog.Items.Add($"Document fetched!")
|
||||
' listboxLog.Items.Add($"DocId: {oDocObject.DocumentId}")
|
||||
' listboxLog.Items.Add($"ContainerId: {oDocObject.ContainerId}")
|
||||
' listboxLog.Items.Add($"Filename: {oDocObject.FileName}")
|
||||
' listboxLog.Items.Add($"----------------------------------------------------------")
|
||||
' Catch ex As Exception
|
||||
' ShowErrorMessage(ex)
|
||||
' End Try
|
||||
'End Sub
|
||||
|
||||
Private Sub btnDocByContainerId_Click(sender As Object, e As EventArgs) Handles btnDocByContainerId.Click, Button2.Click
|
||||
Try
|
||||
Dim oContainerId As Int64 = Int64.Parse(TextBox2.Text)
|
||||
Dim oResult = _fileOp.GetDocumentByContainerId(oContainerId)
|
||||
'Private Sub btnDocByContainerId_Click(sender As Object, e As EventArgs)
|
||||
' Try
|
||||
' Dim oContainerId As Int64 = Int64.Parse(TextBox2.Text)
|
||||
' Dim oResult = _fileOp.GetDocumentByContainerId(oContainerId)
|
||||
|
||||
If Not oResult.OK Then
|
||||
MsgBox(oResult.ErrorMessage)
|
||||
Exit Sub
|
||||
End If
|
||||
' If Not oResult.OK Then
|
||||
' MsgBox(oResult.ErrorMessage)
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
Dim oDocObject = oResult.Document
|
||||
' Dim oDocObject = oResult.Document
|
||||
|
||||
listboxLog.Items.Add($"Document fetched!")
|
||||
listboxLog.Items.Add($"DocId: {oDocObject.DocumentId}")
|
||||
listboxLog.Items.Add($"ContainerId: {oDocObject.ContainerId}")
|
||||
listboxLog.Items.Add($"Filename: {oDocObject.FileName}")
|
||||
listboxLog.Items.Add($"----------------------------------------------------------")
|
||||
Catch ex As Exception
|
||||
ShowErrorMessage(ex)
|
||||
End Try
|
||||
End Sub
|
||||
' listboxLog.Items.Add($"Document fetched!")
|
||||
' listboxLog.Items.Add($"DocId: {oDocObject.DocumentId}")
|
||||
' listboxLog.Items.Add($"ContainerId: {oDocObject.ContainerId}")
|
||||
' listboxLog.Items.Add($"Filename: {oDocObject.FileName}")
|
||||
' listboxLog.Items.Add($"----------------------------------------------------------")
|
||||
' Catch ex As Exception
|
||||
' ShowErrorMessage(ex)
|
||||
' End Try
|
||||
'End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user