MS3006
This commit is contained in:
@@ -9,6 +9,7 @@ Public Class frmRecordView
|
||||
Private Const SEE_MASK_NOCLOSEPROCESS = &H40
|
||||
Private Const SEE_MASK_FLAG_NO_UI = &H400
|
||||
Public Const SW_SHOW As Short = 5
|
||||
Private DT_RESULTLIST_OPTIONS As DataTable
|
||||
|
||||
<DllImport("Shell32", CharSet:=CharSet.Auto, SetLastError:=True)> _
|
||||
Public Shared Function ShellExecuteEx(ByRef lpExecInfo As SHELLEXECUTEINFO) As Boolean
|
||||
@@ -32,44 +33,67 @@ Public Class frmRecordView
|
||||
End Structure
|
||||
|
||||
Private Sub frmRecordView_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
Me.Text = "Detailview Record"
|
||||
Else
|
||||
Me.Text = "Detailansicht Record"
|
||||
End If
|
||||
recordView = New ClassRecordView(pnlDetails)
|
||||
recordView.LoadRecord(JUMP_RECORD_ID)
|
||||
|
||||
'Titel updaten
|
||||
Me.Text &= " " + recordView.RecordId.ToString()
|
||||
Try
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
Me.Text = "Detailview Record"
|
||||
Else
|
||||
Me.Text = "Detailansicht Record"
|
||||
End If
|
||||
recordView = New ClassRecordView(pnlDetails)
|
||||
recordView.LoadRecord(JUMP_RECORD_ID)
|
||||
|
||||
'Titel updaten
|
||||
Me.Text &= " " + recordView.RecordId.ToString()
|
||||
Dim sql = "SELECT FORM_ID FROM TBPMO_RECORD WHERE GUID = " & JUMP_RECORD_ID
|
||||
ENTITY_ID = ClassDatabase.Execute_Scalar(sql)
|
||||
sql = String.Format("select * from TBPMO_DOCSEARCH_VARIABLE_CONTROLS WHERE ENTITY_ID = {0}", ENTITY_ID) 'TBPMO_WINDREAM_RESULTLIST_CONFIG"
|
||||
DT_RESULTLIST_OPTIONS = ClassDatabase.Return_Datatable(sql, "GETVARIABLE CONTROLS")
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected error in loading form: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
RUN_WDSEARCH_GRID()
|
||||
Load_Tasks()
|
||||
End Sub
|
||||
Private Sub RUN_WDSEARCH_GRID()
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Dim gridGUID = 2
|
||||
Dim sql_ResultList = "select * from TBPMO_WINDREAM_RESULTLIST_CONFIG"
|
||||
Dim DT_WINDREAM_RESULTLIST_DEF As DataTable = ClassDatabase.Return_Datatable(sql_ResultList, "GETRESULTLIST KONFIG")
|
||||
Dim DT_WINDREAM_RESULTLIST As DataTable
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
gridGUID = 3
|
||||
End If
|
||||
For Each row As DataRow In DT_WINDREAM_RESULTLIST_DEF.Rows
|
||||
If row.Item(0) <> gridGUID Then
|
||||
row.Delete()
|
||||
End If
|
||||
Next
|
||||
DT_WINDREAM_RESULTLIST_DEF.AcceptChanges()
|
||||
If DT_WINDREAM_RESULTLIST_DEF.Rows.Count = 1 Then
|
||||
DT_WINDREAM_RESULTLIST = DT_WINDREAM_RESULTLIST_DEF
|
||||
End If
|
||||
|
||||
Dim sql_ResultList = String.Format("select * from TBPMO_DOCSEARCH_RESULTLIST_CONFIG WHERE ENTITY_ID = {0} AND LANGUAGE = '{1}'", ENTITY_ID, USER_LANGUAGE) 'TBPMO_WINDREAM_RESULTLIST_CONFIG"
|
||||
Dim DT_WINDREAM_RESULTLIST As DataTable = ClassDatabase.Return_Datatable(sql_ResultList, "GETRESULTLIST KONFIG")
|
||||
Try
|
||||
Dim sw As New Stopwatch
|
||||
sw.Start()
|
||||
Dim elapsed As Double
|
||||
Dim SQL_DOC_SEARCH = String.Format("SELECT * FROM VWPMO_WD_DOC_SEARCH WHERE [RECORD_ID] = {0}", JUMP_RECORD_ID)
|
||||
Dim OPTION1 = DT_RESULTLIST_OPTIONS.Rows(0).Item("OPTION1_CTRL")
|
||||
Dim OPTION2 = DT_RESULTLIST_OPTIONS.Rows(0).Item("OPTION2_CTRL")
|
||||
Dim OPTION3 = DT_RESULTLIST_OPTIONS.Rows(0).Item("OPTION3_CTRL")
|
||||
Dim OPTION4 = DT_RESULTLIST_OPTIONS.Rows(0).Item("OPTION4_CTRL")
|
||||
Dim OPTION5 = DT_RESULTLIST_OPTIONS.Rows(0).Item("OPTION5_CTRL")
|
||||
If DT_RESULTLIST_OPTIONS.Rows.Count = 0 Then
|
||||
OPTION1 = 0
|
||||
OPTION2 = 0
|
||||
OPTION3 = 0
|
||||
OPTION4 = 0
|
||||
OPTION5 = 0
|
||||
End If
|
||||
Dim SQL_DOC_SEARCH = String.Format("SELECT * ," & _
|
||||
"(CASE (SELECT FORM_ID FROM TBPMO_RECORD WHERE GUID = {0}) " & _
|
||||
"WHEN {1} THEN " & _
|
||||
" (SELECT VALUE FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {2} AND RECORD_ID = {0}) " & _
|
||||
"ELSE '' END) AS OPTION1," & _
|
||||
"CASE (SELECT FORM_ID FROM TBPMO_RECORD WHERE GUID = 3305) " & _
|
||||
"WHEN {1} THEN " & _
|
||||
" (SELECT VALUE FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {3} AND RECORD_ID = {0}) " & _
|
||||
"ELSE '' END AS OPTION2," & _
|
||||
"CASE (SELECT FORM_ID FROM TBPMO_RECORD WHERE GUID = 3305) " & _
|
||||
"WHEN {1} THEN " & _
|
||||
" (SELECT VALUE FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {4} AND RECORD_ID = {0}) " & _
|
||||
"ELSE '' END AS OPTION3," & _
|
||||
"CASE (SELECT FORM_ID FROM TBPMO_RECORD WHERE GUID = 3305) " & _
|
||||
"WHEN {1} THEN " & _
|
||||
" (SELECT VALUE FROM TBPMO_CONTROL_VALUE WHERE CONTROL_ID = {5} AND RECORD_ID = {0}) " & _
|
||||
"ELSE '' END AS OPTION4 " & _
|
||||
"FROM VWPMO_WD_DOC_SEARCH WHERE RECORD_ID LIKE '%#{0}%'", JUMP_RECORD_ID, ENTITY_ID, OPTION1, OPTION2, OPTION3, OPTION4)
|
||||
|
||||
|
||||
Dim DT_FILE_RESULT As DataTable = ClassDatabase.Return_Datatable_Connection(SQL_DOC_SEARCH, 1)
|
||||
@@ -90,7 +114,7 @@ Public Class frmRecordView
|
||||
tslblWindreamView.Text = msg
|
||||
Dim DTGrid As New DataTable
|
||||
|
||||
Dim ColArray As New List(Of String)
|
||||
Dim ColArrayDEFINITION As New List(Of String)
|
||||
Try
|
||||
'Die Icon Colum erstellen und konfigurieren
|
||||
Dim colIcon As New System.Data.DataColumn()
|
||||
@@ -105,49 +129,37 @@ Public Class frmRecordView
|
||||
colPath.Caption = "Fullpath"
|
||||
DTGrid.Columns.Add(colPath)
|
||||
|
||||
Dim colOtype As New System.Data.DataColumn()
|
||||
colOtype.DataType = GetType(String)
|
||||
colOtype.ColumnName = "OBJECTTYPE"
|
||||
colOtype.Caption = "Objecttype"
|
||||
DTGrid.Columns.Add(colOtype)
|
||||
|
||||
If Not DT_WINDREAM_RESULTLIST Is Nothing And DT_WINDREAM_RESULTLIST.Rows.Count = 1 Then
|
||||
If Not DT_WINDREAM_RESULTLIST Is Nothing And DT_WINDREAM_RESULTLIST.Rows.Count >= 1 Then
|
||||
Dim ColCount As Integer = 1
|
||||
For Each Column As DataColumn In DT_WINDREAM_RESULTLIST.Columns
|
||||
If Column.ColumnName.StartsWith("COLUMN") And Column.ColumnName.EndsWith("WIDTH") = False Then
|
||||
Dim ColumnName = DT_WINDREAM_RESULTLIST.Rows(0).Item(Column.ColumnName)
|
||||
If Not IsDBNull(ColumnName) Then
|
||||
If Not IsDBNull(ColumnName) Or IsNothing(ColumnName) Or ColumnName <> "" Or ColumnName <> "{}" Then
|
||||
'Jetzt die Spalten aus Array hinzufügen und Breite konfigurieren
|
||||
Dim Width = DT_WINDREAM_RESULTLIST.Rows(0).Item(String.Format("COLUMN{0}_WIDTH", ColCount))
|
||||
If IsNothing(Width) Or IsDBNull(Width) Then
|
||||
Width = 200
|
||||
End If
|
||||
'Die Spalte definieren
|
||||
DTGrid.Columns.Add(ColumnName)
|
||||
ColCount += 1
|
||||
End If
|
||||
End If
|
||||
For Each rw As DataRow In DT_WINDREAM_RESULTLIST.Rows
|
||||
Dim ColumnName = rw.Item("HEADER_CAPTION")
|
||||
Dim Width = rw.Item("WIDTH")
|
||||
If IsNothing(Width) Or IsDBNull(Width) Then
|
||||
Width = 200
|
||||
End If
|
||||
'Die Spalte definieren
|
||||
DTGrid.Columns.Add(ColumnName)
|
||||
ColCount += 1
|
||||
Next
|
||||
'Jetzt das Array zusammenbauen um die Spaltenwerte zu erhalten
|
||||
ColCount = 1
|
||||
For Each Column As DataColumn In DT_WINDREAM_RESULTLIST.Columns
|
||||
If Column.ColumnName = String.Format("COLUMN{0}", ColCount) Then
|
||||
Dim ColumnName = DT_WINDREAM_RESULTLIST.Rows(0).Item(Column.ColumnName)
|
||||
If Not IsDBNull(ColumnName) Then
|
||||
If Not IsDBNull(ColumnName) Or IsNothing(ColumnName) Or ColumnName <> "" Or ColumnName <> "{}" Then
|
||||
'Jetzt die Spalten aus Array hinzufügen und Breite konfigurieren
|
||||
ColArray.Add(Column.ColumnName)
|
||||
End If
|
||||
End If
|
||||
ColCount += 1
|
||||
End If
|
||||
For Each rw As DataRow In DT_WINDREAM_RESULTLIST.Rows
|
||||
ColArrayDEFINITION.Add(rw.Item("COLUMN_VIEW"))
|
||||
Next
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in Construct Datatable for GridResult: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
'COL_ARRAY_RESULTLIST = ColArray
|
||||
|
||||
For Each row As DataRow In DT_FILE_RESULT.Rows
|
||||
For Each FILE_ROW As DataRow In DT_FILE_RESULT.Rows
|
||||
|
||||
Dim fullpath = row.Item("FULL_FILENAME")
|
||||
Dim fullpath = FILE_ROW.Item("FULL_FILENAME")
|
||||
Dim objecttype = FILE_ROW.Item("OBJECTTYPE")
|
||||
'Dim Folderpath = Path.GetDirectoryName(fullpath)
|
||||
Dim filename = Path.GetFileName(fullpath)
|
||||
Dim extension = Path.GetExtension(fullpath)
|
||||
@@ -182,21 +194,13 @@ Public Class frmRecordView
|
||||
End Select
|
||||
'Den Filepath mitgeben
|
||||
NewRow.Item(1) = fullpath
|
||||
|
||||
Dim i = 2 'Fängt bei 2 an, um die ICON Column zu überspringen
|
||||
For Each Column As String In ColArray
|
||||
Dim Colname = DT_WINDREAM_RESULTLIST.Rows(0).Item(Column)
|
||||
NewRow.Item(2) = objecttype
|
||||
Dim i = 3 'Fängt bei 2 an, um die ICON Column zu überspringen
|
||||
For Each Colname As String In ColArrayDEFINITION
|
||||
Dim rowvalue
|
||||
Try
|
||||
If Colname = "Dateiname" Or Colname = "filename" Then
|
||||
rowvalue = filename
|
||||
ElseIf Colname = "Dokumentart" Or Colname = "doctype" Then
|
||||
rowvalue = row.Item("Doctype")
|
||||
ElseIf Colname = "Erstellt" Or Colname = "created" Then
|
||||
rowvalue = row.Item("Creation_DateTime")
|
||||
Else
|
||||
rowvalue = row.Item(Colname)
|
||||
End If
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> now rowvalue for Colname '" & Colname & "'", False)
|
||||
rowvalue = FILE_ROW.Item(Colname)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> rowvalue : '" & rowvalue.ToString & "'", False)
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in GetVariableValue for Column '" & Colname & "- Error: " & ex.Message)
|
||||
@@ -220,18 +224,11 @@ Public Class frmRecordView
|
||||
GridViewDoc_Search.Columns.Item("ICON").MaxWidth = 24
|
||||
GridViewDoc_Search.Columns.Item("ICON").MinWidth = 24
|
||||
GridViewDoc_Search.Columns.Item("FULLPATH").Visible = False
|
||||
|
||||
For Each col As DataColumn In DT_WINDREAM_RESULTLIST.Columns
|
||||
If col.ColumnName.EndsWith("WIDTH") Or col.ColumnName.StartsWith("ADDED") Or col.ColumnName.StartsWith("CHANGED") Then
|
||||
Continue For
|
||||
End If
|
||||
Dim rowvalue = DT_WINDREAM_RESULTLIST.Rows(0).Item(col.ColumnName)
|
||||
If IsDBNull(rowvalue) Or IsNumeric(rowvalue) Then
|
||||
Continue For
|
||||
End If
|
||||
Dim Width = DT_WINDREAM_RESULTLIST.Rows(0).Item(String.Format("{0}_WIDTH", col.ColumnName))
|
||||
GridViewDoc_Search.Columns.Item("OBJECTTYPE").Visible = False
|
||||
For Each rw As DataRow In DT_WINDREAM_RESULTLIST.Rows
|
||||
Dim Width = rw.Item("WIDTH") 'DT_WINDREAM_RESULTLIST.Rows(0).Item(String.Format("{0}_WIDTH", col.ColumnName))
|
||||
If Not IsNothing(Width) And Not IsDBNull(Width) Then
|
||||
Dim column = DirectCast(GridViewDoc_Search.Columns.Item(rowvalue), DevExpress.XtraGrid.Columns.GridColumn)
|
||||
Dim column = DirectCast(GridViewDoc_Search.Columns.Item(rw.Item("HEADER_CAPTION")), DevExpress.XtraGrid.Columns.GridColumn)
|
||||
column.Width = Width
|
||||
Console.WriteLine("ColumnWidth {0} set to {1}", column.FieldName, Width)
|
||||
Console.WriteLine("ColumnWidth {0} really set to {1}", column.FieldName, column.VisibleWidth)
|
||||
@@ -262,9 +259,8 @@ Public Class frmRecordView
|
||||
Me.TBPMO_WORKFLOW_TASK_STATETableAdapter.Connection.ConnectionString = MyConnectionString
|
||||
Me.VWPMO_WF_ACTIVETableAdapter.Connection.ConnectionString = MyConnectionString
|
||||
Me.VWPMO_WF_ACTIVETableAdapter.FillByRecord(Me.DD_DMSDataSet.VWPMO_WF_ACTIVE, USER_LANGUAGE, Environment.UserName, JUMP_RECORD_ID)
|
||||
Dim sql = "SELECT FORM_ID FROM TBPMO_RECORD WHERE GUID = " & JUMP_RECORD_ID
|
||||
ENTITY_ID = ClassDatabase.Execute_Scalar(sql)
|
||||
sql = "SELECT GUID FROM TBPMO_FORM_VIEW WHERE SCREEN_ID = 1 AND FORM_ID = " & ENTITY_ID
|
||||
|
||||
Dim Sql = "SELECT GUID FROM TBPMO_FORM_VIEW WHERE SCREEN_ID = 1 AND FORM_ID = " & ENTITY_ID
|
||||
FORMVIEW_ID = ClassDatabase.Execute_Scalar(sql)
|
||||
sql = "SELECT PARENT_ID FROM TBPMO_FORM WHERE GUID = " & ENTITY_ID
|
||||
PARENT_ENTITY_ID = ClassDatabase.Execute_Scalar(sql)
|
||||
@@ -495,7 +491,7 @@ Public Class frmRecordView
|
||||
CURRENT_FORM_ID = ENTITY_ID
|
||||
CURRENT_FORMVIEW_ID = FORMVIEW_ID
|
||||
If ClassDatabase.Execute_Scalar("SELECT COUNT(*) FROM TBPMO_FILES_USER WHERE GUID = " & CURRENT_FILEID & " AND WORKED = 0") = 1 Then
|
||||
frmWD_Index_Dokart.ShowDialog()
|
||||
frmWD_IndexFile.ShowDialog()
|
||||
Else
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> File was deleted or worked meanwhile!")
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user