Fix deleting original file error by setting file attributes to normal

This commit is contained in:
Jonathan Jenne
2022-04-01 15:28:48 +02:00
parent 136d2a0f45
commit 569c66d764
6 changed files with 202 additions and 144 deletions

View File

@@ -15,6 +15,7 @@ Public Class frmStart
Private IndexForm As frmIndex
Private FileDrop As FileDrop
Private DroppedFiles As List(Of FileDrop.DroppedFile)
'Private DroppedFiles As List(Of FileDrop.DroppedFile)
@@ -167,15 +168,16 @@ Public Class frmStart
'Erstmal alles löschen
DATABASE_ECM.ExecuteNonQuery("DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')")
Dim oDroppedFiles = FileDrop.GetFiles(e)
If oDroppedFiles.Count > 0 Then
Check_Dropped_Files(oDroppedFiles)
' This timer prevents the cursor from hanging because all of the remaing functions will be called in the timer thread
DroppedFiles = FileDrop.GetFiles(e)
If DroppedFiles.Count > 0 Then
TimerCheckDroppedFiles.Start()
End If
End Sub
' TODO: REMOVE
'If ClassFileDrop.Drop_File(e) = True Then
' TimerCheckDroppedFiles.Start()
'End If
Private Sub TimerCheckDroppedFiles_Tick(sender As Object, e As EventArgs) Handles TimerCheckDroppedFiles.Tick
TimerCheckDroppedFiles.Stop()
Check_Dropped_Files(DroppedFiles)
End Sub
Sub Drag_Enter(sender As Object, e As DragEventArgs)
@@ -209,19 +211,6 @@ Public Class frmStart
End If
Next
'For Each oFiledropString As String In ClassFileDrop.FilesDropped
' If oFiledropString IsNot Nothing Then
' LOGGER.Info(">> Check Drop-File: " & oFiledropString.ToString)
' Dim oLastPipe = oFiledropString.LastIndexOf("|")
' Dim oHandleType As String = oFiledropString.Substring(0, oLastPipe + 1)
' Dim oFilename As String = oFiledropString.Substring(oLastPipe + 1)
' If ClassIndexFunctions.CheckDuplicateFiles(oFilename, "Manuelle Ablage", oHandleType) Then
' ClassFilehandle.Decide_FileHandle(oFilename, oHandleType)
' End If
' End If
'Next
Dim sql As String = $"SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('{Environment.UserName}')"
DTACTUAL_FILES = Nothing
DTACTUAL_FILES = DATABASE_ECM.GetDatatable(sql)
@@ -291,11 +280,6 @@ Public Class frmStart
End Try
End Sub
'Private Sub TimerCheckDroppedFiles_Tick(sender As Object, e As EventArgs) Handles TimerCheckDroppedFiles.Tick
' TimerCheckDroppedFiles.Stop()
' Check_Dropped_Files()
'End Sub
Private Sub btnChoosefiles_Click(sender As Object, e As EventArgs) Handles btnChoosefiles.Click
Try
Dim oFileName As String