update service and api
This commit is contained in:
83
GUIs.ClientSuite/_TEST/frmFileTest.Designer.vb
generated
83
GUIs.ClientSuite/_TEST/frmFileTest.Designer.vb
generated
@@ -26,13 +26,6 @@ Partial Class frmFileTest
|
||||
Private Sub InitializeComponent()
|
||||
Me.Button1 = New System.Windows.Forms.Button()
|
||||
Me.listboxLog = New System.Windows.Forms.ListBox()
|
||||
Me.btnDocByDocId = New System.Windows.Forms.Button()
|
||||
Me.TextBox1 = New System.Windows.Forms.TextBox()
|
||||
Me.btnDocByContainerId = New System.Windows.Forms.Button()
|
||||
Me.TextBox2 = New System.Windows.Forms.TextBox()
|
||||
Me.TextBox3 = New System.Windows.Forms.TextBox()
|
||||
Me.TextBox4 = New System.Windows.Forms.TextBox()
|
||||
Me.Button2 = New System.Windows.Forms.Button()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'Button1
|
||||
@@ -46,96 +39,26 @@ Partial Class frmFileTest
|
||||
'
|
||||
'listboxLog
|
||||
'
|
||||
Me.listboxLog.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.listboxLog.Dock = System.Windows.Forms.DockStyle.Right
|
||||
Me.listboxLog.FormattingEnabled = True
|
||||
Me.listboxLog.Location = New System.Drawing.Point(0, 225)
|
||||
Me.listboxLog.Location = New System.Drawing.Point(165, 0)
|
||||
Me.listboxLog.Name = "listboxLog"
|
||||
Me.listboxLog.Size = New System.Drawing.Size(800, 225)
|
||||
Me.listboxLog.Size = New System.Drawing.Size(635, 450)
|
||||
Me.listboxLog.TabIndex = 1
|
||||
'
|
||||
'btnDocByDocId
|
||||
'
|
||||
Me.btnDocByDocId.Location = New System.Drawing.Point(655, 12)
|
||||
Me.btnDocByDocId.Name = "btnDocByDocId"
|
||||
Me.btnDocByDocId.Size = New System.Drawing.Size(133, 32)
|
||||
Me.btnDocByDocId.TabIndex = 2
|
||||
Me.btnDocByDocId.Text = "GetDocByDocId"
|
||||
Me.btnDocByDocId.UseVisualStyleBackColor = True
|
||||
'
|
||||
'TextBox1
|
||||
'
|
||||
Me.TextBox1.Location = New System.Drawing.Point(425, 24)
|
||||
Me.TextBox1.Name = "TextBox1"
|
||||
Me.TextBox1.Size = New System.Drawing.Size(224, 20)
|
||||
Me.TextBox1.TabIndex = 3
|
||||
'
|
||||
'btnDocByContainerId
|
||||
'
|
||||
Me.btnDocByContainerId.Location = New System.Drawing.Point(655, 50)
|
||||
Me.btnDocByContainerId.Name = "btnDocByContainerId"
|
||||
Me.btnDocByContainerId.Size = New System.Drawing.Size(133, 32)
|
||||
Me.btnDocByContainerId.TabIndex = 4
|
||||
Me.btnDocByContainerId.Text = "GetDocByContainerId"
|
||||
Me.btnDocByContainerId.UseVisualStyleBackColor = True
|
||||
'
|
||||
'TextBox2
|
||||
'
|
||||
Me.TextBox2.Location = New System.Drawing.Point(425, 62)
|
||||
Me.TextBox2.Name = "TextBox2"
|
||||
Me.TextBox2.Size = New System.Drawing.Size(224, 20)
|
||||
Me.TextBox2.TabIndex = 3
|
||||
'
|
||||
'TextBox3
|
||||
'
|
||||
Me.TextBox3.Location = New System.Drawing.Point(425, 138)
|
||||
Me.TextBox3.Name = "TextBox3"
|
||||
Me.TextBox3.Size = New System.Drawing.Size(224, 20)
|
||||
Me.TextBox3.TabIndex = 5
|
||||
'
|
||||
'TextBox4
|
||||
'
|
||||
Me.TextBox4.Location = New System.Drawing.Point(425, 112)
|
||||
Me.TextBox4.Name = "TextBox4"
|
||||
Me.TextBox4.Size = New System.Drawing.Size(224, 20)
|
||||
Me.TextBox4.TabIndex = 5
|
||||
'
|
||||
'Button2
|
||||
'
|
||||
Me.Button2.Location = New System.Drawing.Point(655, 126)
|
||||
Me.Button2.Name = "Button2"
|
||||
Me.Button2.Size = New System.Drawing.Size(133, 32)
|
||||
Me.Button2.TabIndex = 4
|
||||
Me.Button2.Text = "GetDocByContainerId"
|
||||
Me.Button2.UseVisualStyleBackColor = True
|
||||
'
|
||||
'frmFileTest
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(800, 450)
|
||||
Me.Controls.Add(Me.TextBox4)
|
||||
Me.Controls.Add(Me.TextBox3)
|
||||
Me.Controls.Add(Me.Button2)
|
||||
Me.Controls.Add(Me.btnDocByContainerId)
|
||||
Me.Controls.Add(Me.TextBox2)
|
||||
Me.Controls.Add(Me.TextBox1)
|
||||
Me.Controls.Add(Me.btnDocByDocId)
|
||||
Me.Controls.Add(Me.listboxLog)
|
||||
Me.Controls.Add(Me.Button1)
|
||||
Me.Name = "frmFileTest"
|
||||
Me.Text = "frmFileTest"
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents Button1 As Button
|
||||
Friend WithEvents listboxLog As ListBox
|
||||
Friend WithEvents btnDocByDocId As Button
|
||||
Friend WithEvents TextBox1 As TextBox
|
||||
Friend WithEvents btnDocByContainerId As Button
|
||||
Friend WithEvents TextBox2 As TextBox
|
||||
Friend WithEvents TextBox3 As TextBox
|
||||
Friend WithEvents TextBox4 As TextBox
|
||||
Friend WithEvents Button2 As Button
|
||||
End Class
|
||||
|
||||
@@ -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