Monorepo/TestGUI/Form1.vb
Digital Data - Marlon Schreiber 8cde9f0119 MS Service und WMDLL
2018-08-21 10:36:59 +02:00

69 lines
2.3 KiB
VB.net

Imports DigitalData.Modules.Windream
Imports DigitalData.Modules.Logging
Public Class Form1
Dim MyLogger As LogConfig
Protected _windream As Windream
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
_windream = New Windream("W", True)
If _windream.LoggedInSession = True Then
MsgBox("Session created")
Else
MsgBox("No session created")
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Process.Start(MyLogger.LogDirectory)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
MyLogger = New LogConfig(LogConfig.PathType.AppData,)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles GetValue.Click
My.Settings.Save()
If IsNothing(_windream) Then
MsgBox("windream initialisieren")
Exit Sub
End If
Dim result As DataTable = _windream.GetValueforIndex(txtWMFile.Text, txtWMIndex.Text)
If result.Rows.Count = 0 Then
MsgBox("No result")
Else
txtWMValue.Text = result.Rows(0).Item(0).ToString
End If
End Sub
Private Sub IndexFile_Click(sender As Object, e As EventArgs) Handles IndexFile.Click
My.Settings.Save()
If IsNothing(_windream) Then
MsgBox("windream initialisieren")
Exit Sub
End If
Dim arrValue() As String = Nothing
ReDim Preserve arrValue(0)
arrValue(0) = txtWMValue.Text
If _windream.NewIndexFile(txtWMFile.Text, txtWMIndex.Text, arrValue) = True Then
MsgBox("Success")
Else
MsgBox("no indexing")
End If
End Sub
Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click
My.Settings.Save()
If IsNothing(_windream) Then
MsgBox("windream initialisieren")
Exit Sub
End If
Dim DTResults As DataTable = _windream.GetSearchDocuments(txtwmsearch.Text, "Dokument-ID")
If DTResults.Rows.Count > 0 Then
GridControl1.DataSource = DTResults
Else
GridControl1.DataSource = Nothing
GridView1.Columns.Clear()
End If
End Sub
End Class