MS Globix Integration
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Imports DevExpress.XtraSplashScreen
|
||||
Imports System.IO
|
||||
Imports DevExpress.XtraSplashScreen
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Messaging
|
||||
|
||||
@@ -13,6 +14,7 @@ Public Class frmFlowForm
|
||||
Private Init As ClassInit
|
||||
Private DTIDB_SEARCHES As DataTable
|
||||
Private CLSFileDrop As ClassFileDrop
|
||||
Private clsFilehandle As ClassFilehandle
|
||||
' Runtime Flags
|
||||
Private ApplicationLoading As Boolean = True
|
||||
Private IDBSearchActive As Boolean = False
|
||||
@@ -20,6 +22,8 @@ Public Class frmFlowForm
|
||||
' Runtime Variables
|
||||
Private ESCHitCount As Integer = 0
|
||||
|
||||
Private IndexForm As frmGlobix_Index
|
||||
|
||||
' Events
|
||||
Public Event ClipboardChanged As EventHandler(Of IDataObject)
|
||||
|
||||
@@ -35,18 +39,18 @@ Public Class frmFlowForm
|
||||
Private Sub frmFlowForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
' === Initialize Logger ===
|
||||
Logger = My.LogConfig.GetLogger()
|
||||
|
||||
' === Show Splash Screen ===
|
||||
SplashScreenManager.ShowForm(Me, GetType(frmSplash), False, False)
|
||||
|
||||
' === Initialization ===
|
||||
Init = New ClassInit(My.LogConfig, Me)
|
||||
CLSFileDrop = New ClassFileDrop(My.LogConfig)
|
||||
clsFilehandle = New ClassFilehandle(My.LogConfig)
|
||||
AddHandler Init.Completed, AddressOf Init_Completed
|
||||
Init.InitializeApplication()
|
||||
End Sub
|
||||
|
||||
Private Sub Init_Completed(sender As Object, e As EventArgs)
|
||||
Private Sub Init_Completed(sender As Object, e As EventArgs)
|
||||
' === Initialization Complete ===
|
||||
ApplicationLoading = False
|
||||
SplashScreenManager.CloseForm(False)
|
||||
@@ -96,7 +100,7 @@ Public Class frmFlowForm
|
||||
'TODO: Refresh Data
|
||||
End Sub
|
||||
|
||||
Private Sub frmFlowForm_MouseLeave(sender As Object, e As EventArgs)
|
||||
Private Sub frmFlowForm_MouseLeave(sender As Object, e As EventArgs)
|
||||
Opacity = OPACITY_HIDDEN
|
||||
End Sub
|
||||
|
||||
@@ -188,13 +192,14 @@ Public Class frmFlowForm
|
||||
End Sub
|
||||
|
||||
Private Sub frmFlowForm_DragEnter(sender As Object, e As DragEventArgs) Handles MyBase.DragEnter
|
||||
PictureBox1.image = My.Resources._1_LOGO_ZOO_FLOW_DROP3
|
||||
PictureBox1.Image = My.Resources._1_LOGO_ZOO_FLOW_DROP3
|
||||
|
||||
e.Effect = DragDropEffects.Copy
|
||||
e.Effect = DragDropEffects.Copy
|
||||
Drag_Enter(sender, e)
|
||||
End Sub
|
||||
|
||||
Private Sub frmFlowForm_DragDrop(sender As Object, e As DragEventArgs) Handles MyBase.DragDrop
|
||||
PictureBox1.Image = My.Resources._1_LOGO_ZOO_FLOW1
|
||||
DragDropForm(e)
|
||||
End Sub
|
||||
|
||||
Private Sub frmFlowForm_DragLeave(sender As Object, e As EventArgs) Handles Me.DragLeave
|
||||
@@ -289,13 +294,86 @@ Public Class frmFlowForm
|
||||
MsgBox("Please index the active file first!", MsgBoxStyle.Exclamation, "Drag 'n Drop not allowed!")
|
||||
Exit Sub
|
||||
End If
|
||||
Dim frmCollection = Application.OpenForms
|
||||
|
||||
'Erstmal alles löschen
|
||||
My.Database.ExecuteNonQuery("DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')")
|
||||
|
||||
If CLSFileDrop.Drop_File(e) = True Then
|
||||
'TimerCheckDroppedFiles.Start()
|
||||
TimerCheckDroppedFiles.Start()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub PictureBox1_DragDrop(sender As Object, e As DragEventArgs) Handles PictureBox1.DragDrop
|
||||
DragDropForm(e)
|
||||
End Sub
|
||||
|
||||
Private Sub TimerCheckDroppedFiles_Tick(sender As Object, e As EventArgs) Handles TimerCheckDroppedFiles.Tick
|
||||
TimerCheckDroppedFiles.Stop()
|
||||
Check_Dropped_Files()
|
||||
End Sub
|
||||
Sub Check_Dropped_Files()
|
||||
Try
|
||||
My.Database.ExecuteNonQuery("DELETE FROM TBGI_FILES_USER WHERE WORKED = 1 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')")
|
||||
Dim i As Integer
|
||||
For Each Str As Object In ClassFileDrop.files_dropped
|
||||
If Not Str Is Nothing Then
|
||||
Logger.Info(">> Check Drop-File: " & Str.ToString)
|
||||
Dim handleType As String = Str.Substring(0, Str.LastIndexOf("|") + 1)
|
||||
Dim filename As String = Str.Substring(Str.LastIndexOf("|") + 1)
|
||||
If My.Application.Globix.FileExistsinDropTable(filename) = False Then
|
||||
clsFilehandle.Decide_FileHandle(filename, handleType)
|
||||
i += 1
|
||||
Else
|
||||
' Console.WriteLine("File gibt es bereits")
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim sql As String = "SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')"
|
||||
My.Application.Globix.DTACTUAL_FILES = Nothing
|
||||
My.Application.Globix.DTACTUAL_FILES = My.Database.GetDatatable(sql, True)
|
||||
My.Application.Globix.ABORT_INDEXING = False
|
||||
|
||||
Dim oOnlyFilesFromFilesystem = True
|
||||
For Each oRow As DataRow In My.Application.Globix.DTACTUAL_FILES.Rows
|
||||
If oRow.Item("HANDLE_TYPE").ToString <> "|DROPFROMFSYSTEM|" Then
|
||||
oOnlyFilesFromFilesystem = False
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If My.Application.Globix.DTACTUAL_FILES.Rows.Count > 1 And oOnlyFilesFromFilesystem = False Then
|
||||
frmGlobixIndexFileList.ShowDialog()
|
||||
My.Application.Globix.DTACTUAL_FILES = Nothing
|
||||
My.Application.Globix.DTACTUAL_FILES = My.Database.GetDatatable(sql)
|
||||
End If
|
||||
|
||||
For Each oFileRow As DataRow In My.Application.Globix.DTACTUAL_FILES.Rows
|
||||
Dim filestring As String = oFileRow.Item("FILENAME2WORK").ToString
|
||||
My.Application.Globix.CURRENT_FILENAME = oFileRow.Item("FILENAME2WORK").ToString
|
||||
My.Application.Globix.CURRENT_WORKFILE_GUID = oFileRow.Item(0)
|
||||
My.Application.Globix.CURRENT_WORKFILE = oFileRow.Item("FILENAME2WORK").ToString
|
||||
Logger.Info(">> CURRENT_WORKFILE: " & My.Application.Globix.CURRENT_WORKFILE)
|
||||
If File.Exists(My.Application.Globix.CURRENT_WORKFILE) = True And My.Application.Globix.DTACTUAL_FILES.Rows.Count > 0 Then
|
||||
Globix_Open_IndexDialog()
|
||||
End If
|
||||
Next
|
||||
Show()
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in Check_Dropped_Files:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Sub Globix_Open_IndexDialog()
|
||||
Try
|
||||
Hide()
|
||||
IndexForm.ShowDialog()
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
||||
Finally
|
||||
Show()
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user