This commit is contained in:
Digital Data - Marlon Schreiber
2018-05-11 10:37:00 +02:00
parent 17946f1a19
commit f4d1a8c8b1
13 changed files with 273 additions and 187 deletions

View File

@@ -35,6 +35,7 @@ Public Class frmWM_IndexFile
Function WORK_FILE(ImportFilePath As String, VerzeichnisZiel As String, vDokart_ID As Integer, vDokart As String, multiindex As Boolean)
Dim swWORK_FILE As New SW("WORK_FILE: " & DOCTYPE_IDTextBox.Text)
Try
CURRENT_DOC_ID = Nothing
CURRENT_DOKARTSTRING = vDokart
Dim err As Boolean = False
@@ -58,7 +59,7 @@ Public Class frmWM_IndexFile
result = MessageBox.Show(msg, "File alredy exists:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result = MsgBoxResult.Yes Then
If clsWD_SET.Delete_WDFile(CURRENT_NEWFILENAME.Substring(2)) = False Then
swWORK_FILE
swWORK_FILE.Done()
Return False
End If
Else
@@ -88,6 +89,17 @@ Public Class frmWM_IndexFile
sw = New SW("File Indexing")
CURRENT_FILEIN_WD = CURRENT_NEWFILENAME
Dim DOCID
DOCID = clsWD_GET.Index_GetVariableValue(CURRENT_FILEIN_WD, "Dokument-ID")
If Not IsNothing(DOCID) Then
CURRENT_DOC_ID = DOCID
Else
DOCID = clsWD_GET.Index_GetVariableValue(CURRENT_FILEIN_WD, "Document-ID")
If Not IsNothing(DOCID) Then
CURRENT_DOC_ID = DOCID
End If
End If
Dim sql = "SELECT * FROM TBDD_INDEX_AUTOM WHERE ACTIVE = 1 AND UPPER(INDEXNAME) NOT LIKE UPPER('%ONLY %') AND SQL_ACTIVE = 0 AND DOCTYPE_ID = " & vDokart_ID
Dim DT_AUTO_INDEXE As DataTable = ClassDatabase.Return_Datatable(sql, True)
Dim indexierung_erfolgreich As Boolean = True
@@ -251,10 +263,13 @@ Public Class frmWM_IndexFile
End If
End If
Next
sw = New SW("GettingDocID")
sql = String.Format("SELECT DocID FROM VWPMO_DOC_SYNC WHERE UPPER(FULL_FILENAME) = UPPER('{0}') AND CONVERT(DATE,Change_DateTime) = CONVERT(DATE,GETDATE())", CURRENT_FILEIN_WD)
CURRENT_DOC_ID = ClassDatabase.Execute_Scalar(sql)
sw.Done()
If IsNothing(CURRENT_DOC_ID) Then
sw = New SW("GettingDocID")
sql = String.Format("SELECT DocID FROM VWPMO_DOC_SYNC WHERE UPPER(FULL_FILENAME) = UPPER('{0}') AND CONVERT(DATE,Change_DateTime) = CONVERT(DATE,GETDATE())", CURRENT_FILEIN_WD)
CURRENT_DOC_ID = ClassDatabase.Execute_Scalar(sql)
sw.Done()
End If
If Not IsNothing(CURRENT_DOC_ID) Then
ClassHelper.InsertEssential_Log(CURRENT_DOC_ID, "DOC_ID", "File was imported and indexed!")
@@ -315,6 +330,7 @@ Public Class frmWM_IndexFile
stg = "Unexpected Error: Could not get a docId for transmitted file!"
End If
ClassLogger.Add(stg, True)
MsgBox(stg, MsgBoxStyle.Critical, stg1)
End If
Else