This commit is contained in:
2020-05-04 15:19:24 +02:00
parent 61602f42d5
commit 5097c2d595
9 changed files with 109 additions and 172 deletions

View File

@@ -262,7 +262,7 @@ Public Class ClassDOC_SEARCH
Return Nothing
End If
sw = New SW("Get_DOC_RESULTTABLE DTGrid-Definition")
Dim DTGrid As New DataTable
Dim oDTGrid As New DataTable
Dim ColArrayDEFINITION As New List(Of String)
Dim listcheck As New List(Of String)
For Each row As DataRow In DT_TBPMO_DOCSEARCH_RESULTLIST_CONFIG.Rows
@@ -286,25 +286,25 @@ Public Class ClassDOC_SEARCH
colIcon.DataType = GetType(Image)
colIcon.ColumnName = "ICON"
colIcon.Caption = ""
DTGrid.Columns.Add(colIcon)
oDTGrid.Columns.Add(colIcon)
_step = "4"
Dim colPath As New System.Data.DataColumn()
colPath.DataType = GetType(String)
colPath.ColumnName = "FULLPATH"
colPath.Caption = "Fullpath"
DTGrid.Columns.Add(colPath)
oDTGrid.Columns.Add(colPath)
_step = "5"
Dim colOtype As New System.Data.DataColumn()
colOtype.DataType = GetType(String)
colOtype.ColumnName = "OBJECTTYPE"
colOtype.Caption = "Objecttype"
DTGrid.Columns.Add(colOtype)
oDTGrid.Columns.Add(colOtype)
_step = "6"
Dim colDocID As New System.Data.DataColumn()
colDocID.DataType = GetType(Int32)
colDocID.ColumnName = "DocID"
colDocID.Caption = "DocID"
DTGrid.Columns.Add(colDocID)
oDTGrid.Columns.Add(colDocID)
_step = "7"
If Not DT_TBPMO_DOCSEARCH_RESULTLIST_CONFIG Is Nothing And DT_TBPMO_DOCSEARCH_RESULTLIST_CONFIG.Rows.Count >= 1 Then
@@ -330,7 +330,7 @@ Public Class ClassDOC_SEARCH
oColumn.DataType = GetType(DateTime)
End If
DTGrid.Columns.Add(oColumn)
oDTGrid.Columns.Add(oColumn)
ColCount += 1
Catch ex As Exception
ClassLogger.Add(String.Format("Unexpected Error in DTGrid.Columns.Add({0}) - CONSTR_DET_ID: {1} ", ColumnName, CURRENT_CONSTRUCTOR_DETAIL_ID) & ex.Message)
@@ -348,7 +348,7 @@ Public Class ClassDOC_SEARCH
COL_ARRAY_RESULTLIST = ColArrayDEFINITION
_step = "8"
For Each col1 As String In listcheck
Dim collist As DataColumn = DTGrid.Columns(col1)
Dim collist As DataColumn = oDTGrid.Columns(col1)
If Not IsNothing(collist) Then
collist.DataType = GetType(Boolean)
End If
@@ -365,52 +365,53 @@ Public Class ClassDOC_SEARCH
Dim filename = Path.GetFileName(fullpath)
Dim extension = Path.GetExtension(fullpath)
' Try
Dim NewRow As DataRow
NewRow = DTGrid.NewRow()
Dim oNewRow As DataRow
oNewRow = oDTGrid.NewRow()
'Icon zuweisen
Select Case extension.ToUpper
Case ".csv".ToUpper
NewRow.Item(0) = My.Resources.doc_excel_csv
oNewRow.Item(0) = My.Resources.doc_excel_csv
Case ".txt".ToUpper
NewRow.Item(0) = My.Resources.text
oNewRow.Item(0) = My.Resources.text
Case ".pdf".ToUpper
NewRow.Item(0) = My.Resources.pdf
oNewRow.Item(0) = My.Resources.pdf
Case ".doc".ToUpper
NewRow.Item(0) = My.Resources.doc
oNewRow.Item(0) = My.Resources.doc
Case ".docx".ToUpper
NewRow.Item(0) = My.Resources.doc
oNewRow.Item(0) = My.Resources.doc
Case ".xls".ToUpper
NewRow.Item(0) = My.Resources.xls
oNewRow.Item(0) = My.Resources.xls
Case ".xlsx".ToUpper
NewRow.Item(0) = My.Resources.xls
oNewRow.Item(0) = My.Resources.xls
Case ".xlsm".ToUpper
NewRow.Item(0) = My.Resources.xls
oNewRow.Item(0) = My.Resources.xls
Case ".ppt".ToUpper
NewRow.Item(0) = My.Resources.ppt
oNewRow.Item(0) = My.Resources.ppt
Case ".pptx".ToUpper
NewRow.Item(0) = My.Resources.ppt
oNewRow.Item(0) = My.Resources.ppt
Case ".dwg".ToUpper
NewRow.Item(0) = My.Resources.dwg
oNewRow.Item(0) = My.Resources.dwg
Case ".dxf".ToUpper
NewRow.Item(0) = My.Resources.dxf
oNewRow.Item(0) = My.Resources.dxf
Case ".msg".ToUpper
NewRow.Item(0) = My.Resources.email_go
oNewRow.Item(0) = My.Resources.email_go
Case ".msg".ToUpper
NewRow.Item(0) = My.Resources.email_go
oNewRow.Item(0) = My.Resources.email_go
Case Else
NewRow.Item(0) = My.Resources._blank
oNewRow.Item(0) = My.Resources._blank
End Select
'Den Filepath mitgeben
NewRow.Item(1) = fullpath
NewRow.Item(2) = objecttype
NewRow.Item(3) = DocID
oNewRow.Item(1) = fullpath
oNewRow.Item(2) = objecttype
oNewRow.Item(3) = DocID
Dim i = 4 'Fängt bei 4 an, um die definierten Spalten zu überspringen
For Each Colname As String In ColArrayDEFINITION
Dim rowvalue
Try
rowvalue = FILE_ROW.Item(Colname)
If LogErrorsOnly = False Then ClassLogger.Add(" >> rowvalue for Colname '" & Colname & "': '" & rowvalue.ToString & "'", False)
_step = "9.1 rowvalue for Colname [" & Colname & "]: [" & rowvalue.ToString & "]"
If LogErrorsOnly = False Then ClassLogger.Add(" >> rowvalue for Colname [" & Colname & "]: [" & rowvalue.ToString & "]", False)
Catch ex As Exception
If CURRENT_SEARCH_TYPE = "RECORD" Then ClassLogger.Add("Unexpected Error in GetVariableValue for Column '" & Colname & "'- Error: " & ex.Message)
If Colname.ToString.StartsWith("doct") Or Colname.ToString.StartsWith("Dokum") Then
@@ -424,17 +425,36 @@ Public Class ClassDOC_SEARCH
End If
End Try
NewRow.Item(i) = rowvalue.ToString
_step = "9.2 now: NewRow.Item(i) = rowvalue.ToString..."
If LogErrorsOnly = False Then ClassLogger.Add("9.2 now: NewRow.Item(i) = rowvalue.ToString...", False)
Try
Catch ex As Exception
End Try
Try
'If oDTGrid.Columns(i).DataType.ToString = "System.DateTime" And rowvalue = String.Empty Then
' If LogErrorsOnly = False Then ClassLogger.Add("rowvalue Is empty and Column is Datetime...", False)
'Else
oNewRow.Item(i) = rowvalue.ToString
'End If
Catch ex As Exception
ClassLogger.Add("Error in advising value to rowitem (oNewRow.Item(i) = rowvalue.ToString): " + ex.Message, False)
ClassLogger.Add("Type of column: " + oDTGrid.Columns(i).DataType.ToString(), False)
End Try
i += 1
Next
DTGrid.Rows.Add(NewRow)
oDTGrid.Rows.Add(oNewRow)
' Catch ex As Exception
' ClassLogger.Add("Unexpected Error in CreateRow for doc '" & filename & "- Error: " & ex.Message)
' End Try
Next
_step = "10"
Return DTGrid
Return oDTGrid
sw.Done()
Catch ex As Exception