Show Date in index confirmation, add new hash logic to all paths, fix hash empty when using folder watch #GI-12

This commit is contained in:
Jonathan Jenne
2021-05-04 12:22:38 +02:00
parent 0692d4e295
commit d771895b43
4 changed files with 118 additions and 52 deletions

View File

@@ -1,5 +1,5 @@
Public Class ClassIndexFunctions
Public Shared Function FileExistsinDropTable(Filename As String)
Public Shared Function FileExistsinDropTable(Filename As String) As DateTime
Dim oSQL As String
Dim oHash As String
@@ -15,20 +15,30 @@
oHash = ""
End Try
oSQL = "SELECT COUNT(*) FROM TBGI_FILES_USER WHERE UPPER(FILE_HASH) = UPPER('" & oHash & "') AND WORKED = 0"
Dim oResult = ClassDatabase.Execute_Scalar(oSQL, MyConnectionString, True)
oSQL = "SELECT * FROM TBGI_FILES_USER WHERE UPPER(FILE_HASH) = UPPER('" & oHash & "') AND WORKED = 0 ORDER BY ADDED_WHEN"
Dim oResult As DataTable = ClassDatabase.Return_Datatable_CS(oSQL, MyConnectionString, True)
If oResult = 0 Then
oSQL = "SELECT COUNT(*) FROM TBGI_HISTORY WHERE UPPER(FILE_HASH) = UPPER('" & oHash & "')"
oResult = ClassDatabase.Execute_Scalar(oSQL, MyConnectionString, True)
If oResult Is Nothing Then
Return Nothing
End If
If oResult = 0 Then
Return False
If oResult.Rows.Count = 0 Then
oSQL = "SELECT * FROM TBGI_HISTORY WHERE UPPER(FILE_HASH) = UPPER('" & oHash & "') ORDER BY ADDED_WHEN"
oResult = ClassDatabase.Return_Datatable_CS(oSQL, MyConnectionString, True)
If oResult Is Nothing Then
Return Nothing
End If
If oResult.Rows.Count = 0 Then
Return Nothing
Else
Return True
Dim oFirstRow As DataRow = oResult.Rows.Item(0)
Return oFirstRow.Item("ADDED_WHEN")
End If
Else
Return True
Dim oFirstRow As DataRow = oResult.Rows.Item(0)
Return oFirstRow.Item("ADDED_WHEN")
End If
Catch ex As Exception
MsgBox("Error in FileExistsinDropTable - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & oSQL, MsgBoxStyle.Critical)