JJ 13.09 ClassWindreamDocGrid
This commit is contained in:
parent
1fa90c6746
commit
9539a78ebf
284
app/DD-Record-Organiser/ClassWindreamDocGrid.vb
Normal file
284
app/DD-Record-Organiser/ClassWindreamDocGrid.vb
Normal file
@ -0,0 +1,284 @@
|
||||
Imports DevExpress.Utils
|
||||
Imports DevExpress.XtraGrid
|
||||
Imports DevExpress.XtraGrid.Columns
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports DevExpress.XtraEditors
|
||||
Imports DevExpress.XtraEditors.Repository
|
||||
|
||||
Public Class ClassWindreamDocGrid
|
||||
Public Shared RESULT_DOC_PATH As String
|
||||
Public Shared RESULT_OBJECTTYPE As String
|
||||
Public Shared RESULT_INWORK As Boolean
|
||||
Public Shared RESULT_DOC_ID As Integer
|
||||
Public Shared RESULT_DISPLAYNAME As String
|
||||
|
||||
Private Shared _dropdownValueChangedHandler As EventHandler
|
||||
|
||||
Public Shared Sub GetDocItems(gridView As GridView)
|
||||
Try
|
||||
RESULT_DOC_PATH = gridView.GetFocusedRowCellValue(gridView.Columns("FULLPATH"))
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Attention: Could not set DocVariable RESULT_DOC_PATH: " & ex.Message, False)
|
||||
RESULT_DOC_PATH = Nothing
|
||||
End Try
|
||||
Try
|
||||
RESULT_OBJECTTYPE = gridView.GetFocusedRowCellValue(gridView.Columns("OBJECTTYPE"))
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Attention: Could not set DocVariable RESULT_OBJECTTYPE: " & ex.Message, False)
|
||||
RESULT_OBJECTTYPE = ""
|
||||
End Try
|
||||
Try
|
||||
RESULT_INWORK = gridView.GetFocusedRowCellValue(gridView.Columns("in work?"))
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Attention: Could not set DocVariable RESULT_INWORK: " & ex.Message, False)
|
||||
RESULT_INWORK = ""
|
||||
End Try
|
||||
Try
|
||||
RESULT_DOC_ID = gridView.GetFocusedRowCellValue(gridView.Columns("DocID"))
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Attention: Could not set DocVariable RESULT_DOC_ID: " & ex.Message, False)
|
||||
RESULT_DOC_ID = Nothing
|
||||
End Try
|
||||
Try
|
||||
RESULT_DISPLAYNAME = gridView.GetFocusedRowCellValue(gridView.Columns("Displayname"))
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Attention: Could not set DocVariable RESULT_DISPLAYNAME: " & ex.Message, False)
|
||||
RESULT_DISPLAYNAME = ""
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Shared Sub FormatColumns(gridView As GridView, DT_RESULT As DataTable, DT_WINDREAM_RESULTLIST As DataTable, DT_DOCRESULT_DROPDOWN_ITEMS As DataTable, DropdownValueChangedHandler As EventHandler)
|
||||
Dim dateColumns As New List(Of String)
|
||||
Dim checkboxColumns As New List(Of String)
|
||||
Dim dropdownTable As New DataTable()
|
||||
dropdownTable.TableName = "DROPDOWN_TABLE"
|
||||
dropdownTable.Columns.Add("ID", GetType(Integer))
|
||||
dropdownTable.Columns.Add("COLUMN_VIEW", GetType(String))
|
||||
|
||||
_dropdownValueChangedHandler = DropdownValueChangedHandler
|
||||
|
||||
For Each row As DataRow In DT_WINDREAM_RESULTLIST.Rows
|
||||
Dim guid As Integer = row.Item("GUID")
|
||||
Dim width As Integer = row.Item("WIDTH")
|
||||
Dim typeID As Integer = row.Item("TYPE_ID")
|
||||
Dim isVisible As Boolean = row.Item("VISIBLE")
|
||||
Dim columnTitle As String = row.Item("HEADER_CAPTION")
|
||||
|
||||
' Liste aller Datumsspalten erstellen
|
||||
If typeID = 3 And isVisible = True Then
|
||||
dateColumns.Add(columnTitle)
|
||||
End If
|
||||
|
||||
' Liste aller Checkboxspalten erstellen
|
||||
If typeID = 2 And isVisible = True Then
|
||||
checkboxColumns.Add(columnTitle)
|
||||
End If
|
||||
|
||||
If typeID = 4 And isVisible = True Then
|
||||
Dim dropdownRow As DataRow = dropdownTable.NewRow()
|
||||
dropdownRow.Item("ID") = guid
|
||||
dropdownRow.Item("COLUMN_VIEW") = columnTitle
|
||||
dropdownTable.Rows.Add(dropdownRow)
|
||||
dropdownTable.AcceptChanges()
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim clonedTable As DataTable = DT_RESULT.Clone()
|
||||
' In DataTable die DateSpalten mit dem Type Date belegen
|
||||
For Each dateColumnTitle As String In dateColumns
|
||||
Dim dateColumn As DataColumn = clonedTable.Columns(dateColumnTitle)
|
||||
If Not IsNothing(dateColumn) Then
|
||||
dateColumn.DataType = GetType(Date)
|
||||
End If
|
||||
Next
|
||||
' In DataTable die CheckboxSpalten mit dem Typ Boolean belegen
|
||||
For Each checkboxColunmTitle As String In checkboxColumns
|
||||
Dim checkboxColumn As DataColumn = clonedTable.Columns(checkboxColunmTitle)
|
||||
If Not IsNothing(checkboxColumn) Then
|
||||
checkboxColumn.DataType = GetType(Boolean)
|
||||
End If
|
||||
Next
|
||||
|
||||
Try
|
||||
clonedTable.Load(DT_RESULT.CreateDataReader())
|
||||
DT_RESULT = clonedTable
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Attention: Could not load converted datatable DocSearch: " & ex.Message, False)
|
||||
End Try
|
||||
|
||||
gridView.GridControl.DataSource = DT_RESULT
|
||||
|
||||
' Breite der Spalten anpassen
|
||||
For Each row As DataRow In DT_WINDREAM_RESULTLIST.Rows
|
||||
Dim Width = row.Item("WIDTH")
|
||||
If Not IsNothing(Width) And Not IsDBNull(Width) Then
|
||||
Dim column = DirectCast(gridView.Columns.Item(row.Item("HEADER_CAPTION")), DevExpress.XtraGrid.Columns.GridColumn)
|
||||
If Not IsNothing(column) Then
|
||||
column.Width = Width
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
' Dropdown/Combobox Editor für passende Spalten anwenden
|
||||
For Each dropdownRow As DataRow In dropdownTable.Rows
|
||||
Dim dropdown As New RepositoryItemComboBox()
|
||||
Dim columnTitle As String = dropdownRow.Item("COLUMN_VIEW")
|
||||
Dim guid As Integer = dropdownRow.Item("ID")
|
||||
|
||||
Dim expression As String = String.Format("CONFIG_ID = {0}", guid.ToString())
|
||||
Dim matchingRows() As DataRow = DT_DOCRESULT_DROPDOWN_ITEMS.Select(expression, "SEQUENCE")
|
||||
|
||||
' Dropdown füllen
|
||||
For Each matchingRow As DataRow In matchingRows
|
||||
Dim item As New WindreamDocGridComboboxItem()
|
||||
item.ConfigID = matchingRow.Item("CONFIG_ID")
|
||||
item.Value = matchingRow.Item("VALUE")
|
||||
|
||||
dropdown.Items.Add(item)
|
||||
Next
|
||||
|
||||
gridView.GridControl.RepositoryItems.Add(dropdown)
|
||||
|
||||
If Not IsNothing(gridView.Columns(columnTitle)) Then
|
||||
gridView.Columns(columnTitle).ColumnEdit = dropdown
|
||||
End If
|
||||
AddHandler dropdown.SelectedValueChanged, _dropdownValueChangedHandler
|
||||
Next
|
||||
|
||||
' Eigenschaften der Spalten anpassen
|
||||
|
||||
gridView.Columns.Item("ICON").MaxWidth = 24
|
||||
gridView.Columns.Item("ICON").MinWidth = 24
|
||||
gridView.Columns.Item("FULLPATH").Visible = False
|
||||
gridView.Columns.Item("OBJECTTYPE").Visible = False
|
||||
gridView.Columns.Item("DocID").Visible = False
|
||||
|
||||
' Changed & Created Spalten anpassen
|
||||
|
||||
Dim created, changed As String
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
changed = "Changed"
|
||||
created = "Created"
|
||||
Else
|
||||
changed = "Geändert"
|
||||
created = "Erstellt"
|
||||
End If
|
||||
|
||||
Dim createdColumn = gridView.Columns(created)
|
||||
If Not IsNothing(createdColumn) Then
|
||||
createdColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
createdColumn.DisplayFormat.FormatString = CURRENT_DATE_FORMAT & " HH:MM:ss"
|
||||
End If
|
||||
|
||||
Dim changedColumn = gridView.Columns(changed)
|
||||
If Not IsNothing(changedColumn) Then
|
||||
changedColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
changedColumn.DisplayFormat.FormatString = CURRENT_DATE_FORMAT & " HH:MM:ss"
|
||||
End If
|
||||
|
||||
' Für die Dropdown Spalte Änderungen zulassen
|
||||
For Each column As GridColumn In gridView.Columns
|
||||
Dim _AllowEdit As Boolean = False
|
||||
For Each dropdownrow As DataRow In dropdownTable.Rows
|
||||
Dim columnTitle = dropdownrow.Item("COLUMN_VIEW")
|
||||
If columnTitle = column.FieldName Then
|
||||
_AllowEdit = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
column.OptionsColumn.AllowEdit = _AllowEdit
|
||||
Next
|
||||
|
||||
Dim CheckBoxEditorForDisplay = New RepositoryItemCheckEdit()
|
||||
CheckBoxEditorForDisplay.ValueChecked = "True"
|
||||
CheckBoxEditorForDisplay.ValueUnchecked = "False"
|
||||
'Alle Checkbox Spalten durchgehen und CheckBoxEditor zuweisen
|
||||
For Each columnTitle As String In checkboxColumns
|
||||
gridView.GridControl.RepositoryItems.Add(CheckBoxEditorForDisplay)
|
||||
If Not IsNothing(gridView.Columns(columnTitle)) Then
|
||||
gridView.Columns(columnTitle).ColumnEdit = CheckBoxEditorForDisplay
|
||||
End If
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Public Class WindreamDocGridComboboxItem
|
||||
Implements IConvertible
|
||||
|
||||
Public ConfigID As Integer
|
||||
Public Value As String
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return Me.Value
|
||||
End Function
|
||||
|
||||
Public Function ToString1(provider As IFormatProvider) As String Implements IConvertible.ToString
|
||||
Return Me.Value
|
||||
End Function
|
||||
|
||||
Public Function GetTypeCode() As TypeCode Implements IConvertible.GetTypeCode
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToBoolean(provider As IFormatProvider) As Boolean Implements IConvertible.ToBoolean
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToByte(provider As IFormatProvider) As Byte Implements IConvertible.ToByte
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToChar(provider As IFormatProvider) As Char Implements IConvertible.ToChar
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToDateTime(provider As IFormatProvider) As Date Implements IConvertible.ToDateTime
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToDecimal(provider As IFormatProvider) As Decimal Implements IConvertible.ToDecimal
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToDouble(provider As IFormatProvider) As Double Implements IConvertible.ToDouble
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToInt16(provider As IFormatProvider) As Short Implements IConvertible.ToInt16
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToInt32(provider As IFormatProvider) As Integer Implements IConvertible.ToInt32
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToInt64(provider As IFormatProvider) As Long Implements IConvertible.ToInt64
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToSByte(provider As IFormatProvider) As SByte Implements IConvertible.ToSByte
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToSingle(provider As IFormatProvider) As Single Implements IConvertible.ToSingle
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToType(conversionType As Type, provider As IFormatProvider) As Object Implements IConvertible.ToType
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToUInt16(provider As IFormatProvider) As UShort Implements IConvertible.ToUInt16
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToUInt32(provider As IFormatProvider) As UInteger Implements IConvertible.ToUInt32
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
|
||||
Public Function ToUInt64(provider As IFormatProvider) As ULong Implements IConvertible.ToUInt64
|
||||
Throw New NotImplementedException
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Class
|
||||
@ -260,6 +260,7 @@
|
||||
<Compile Include="ClassRecordView.vb" />
|
||||
<Compile Include="ClassSAP.vb" />
|
||||
<Compile Include="ClassDOC_SEARCH.vb" />
|
||||
<Compile Include="ClassWindreamDocGrid.vb" />
|
||||
<Compile Include="DD_DMSDataSet.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
|
||||
@ -138,7 +138,7 @@ Public Class frmConstructor_Main
|
||||
|
||||
Private DT_WINDREAM_RESULTLIST_DEF As DataTable
|
||||
Private DT_WINDREAM_RESULTLIST As DataTable
|
||||
Private DT_DOCRESULT_DROPDOWN_ITMES As DataTable
|
||||
Private DT_DOCRESULT_DROPDOWN_ITEMS As DataTable
|
||||
Private DT_RESULTLIST_OPTIONS As DataTable
|
||||
Private DT_WORKFLOWS_MANUAL As DataTable
|
||||
|
||||
@ -168,11 +168,11 @@ Public Class frmConstructor_Main
|
||||
Private _VIEWNAME As String
|
||||
Private _ENTITYSTRING As String
|
||||
|
||||
Private RESULT_DOC_PATH
|
||||
Private RESULT_OBJECTTYPE
|
||||
Private RESULT_INWORK
|
||||
Private RESULT_DOC_ID
|
||||
Private RESULT_DISPLAYNAME
|
||||
'Private ClassWindreamDocGrid.RESULT_DOC_PATH
|
||||
'Private ClassWindreamDocGrid.RESULT_OBJECTTYPE
|
||||
'Private ClassWindreamDocGrid.RESULT_INWORK
|
||||
'Private ClassWindreamDocGrid.RESULT_DOC_ID
|
||||
'Private ClassWindreamDocGrid.RESULT_DISPLAYNAME
|
||||
|
||||
Private IW_USER As String
|
||||
Private IW_COMMENT As String
|
||||
@ -2199,7 +2199,7 @@ Public Class frmConstructor_Main
|
||||
Update_Record_Label(SELECTED_RECORD_ID)
|
||||
|
||||
' Dim FORM_TYPE = DT_FORM.Rows(0).Item("FORM_TYPE_ID") 'ClassDatabase.Execute_Scalar("SELECT FORM_TYPE_ID FROM TBPMO_FORM WHERE GUID = " & ENTITY_ID)
|
||||
|
||||
|
||||
'CURRENT_DATE_FORMAT = USER_DATE_FORMAT
|
||||
|
||||
If IS_SINGLE_RECORD = False Then
|
||||
@ -2374,7 +2374,7 @@ Public Class frmConstructor_Main
|
||||
Lock_RecordControls(True)
|
||||
RECORD_ENABLED = False
|
||||
CURRENT_RECORD_ENABLED = False
|
||||
|
||||
|
||||
Me.tsButtonDelete.Enabled = False
|
||||
Me.tsButtonAdd.Enabled = True
|
||||
Me.tsButtonSave.Enabled = False
|
||||
@ -2534,7 +2534,7 @@ Public Class frmConstructor_Main
|
||||
Dim sql_ResultList = String.Format("select * from TBPMO_DOCSEARCH_RESULTLIST_CONFIG WHERE VISIBLE = 1 AND ENTITY_ID = {0} AND LANGUAGE = '{1}'", ENTITY_ID, USER_LANGUAGE) 'TBPMO_WINDREAM_RESULTLIST_CONFIG"
|
||||
DT_WINDREAM_RESULTLIST = ClassDatabase.Return_Datatable(sql_ResultList, "GETRESULTLIST KONFIG")
|
||||
sql_ResultList = String.Format("select * from TBPMO_DOCRESULT_DROPDOWN_ITEMS WHERE CONFIG_ID IN (SELECT GUID FROM TBPMO_DOCSEARCH_RESULTLIST_CONFIG WHERE ENTITY_ID = {0} AND TYPE_ID = 4 AND LANGUAGE = '{1}')", ENTITY_ID, USER_LANGUAGE)
|
||||
DT_DOCRESULT_DROPDOWN_ITMES = ClassDatabase.Return_Datatable(sql_ResultList, "GETRESULT_DROPDOWN_ITEMS")
|
||||
DT_DOCRESULT_DROPDOWN_ITEMS = ClassDatabase.Return_Datatable(sql_ResultList, "GETRESULT_DROPDOWN_ITEMS")
|
||||
|
||||
sql_ResultList = 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_ResultList, "GETVARIABLE CONTROLS")
|
||||
@ -4422,142 +4422,153 @@ Public Class frmConstructor_Main
|
||||
|
||||
If DT_RESULT.Rows.Count > 0 Then
|
||||
|
||||
Dim listcheck As New List(Of String)
|
||||
Dim listdate As New List(Of String)
|
||||
Dim DROPDOWN_TABLE As New DataTable
|
||||
DROPDOWN_TABLE.TableName = "DROPDOWN_TABLE"
|
||||
' Create two columns, ID and Name.
|
||||
DROPDOWN_TABLE.Columns.Add("ID", GetType(Integer))
|
||||
DROPDOWN_TABLE.Columns.Add("COLUMN_VIEW", GetType(System.String))
|
||||
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(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)
|
||||
'End If
|
||||
'Liste von allen Spaltentiteln mit Checkbox erstellen
|
||||
If rw.Item("TYPE_ID") = 2 And CBool(rw.Item("VISIBLE")) = True Then
|
||||
listcheck.Add(rw.Item("HEADER_CAPTION"))
|
||||
End If
|
||||
'Liste von allen Spaltentiteln mit Checkbox erstellen
|
||||
If rw.Item("TYPE_ID") = 3 And CBool(rw.Item("VISIBLE")) = True Then
|
||||
listdate.Add(rw.Item("HEADER_CAPTION"))
|
||||
End If
|
||||
If rw.Item("TYPE_ID") = 4 And CBool(rw.Item("VISIBLE")) = True Then
|
||||
Dim newRow As DataRow = DROPDOWN_TABLE.NewRow()
|
||||
newRow("ID") = rw.Item("GUID")
|
||||
newRow("COLUMN_VIEW") = rw.Item("HEADER_CAPTION")
|
||||
DROPDOWN_TABLE.Rows.Add(newRow)
|
||||
DROPDOWN_TABLE.AcceptChanges()
|
||||
End If
|
||||
ClassWindreamDocGrid.FormatColumns(
|
||||
GridViewDoc_Search,
|
||||
DT_RESULT,
|
||||
DT_WINDREAM_RESULTLIST,
|
||||
DT_DOCRESULT_DROPDOWN_ITEMS,
|
||||
AddressOf OnCBSelectedValueChanged)
|
||||
|
||||
Next
|
||||
|
||||
Dim tbltemp As DataTable = DT_RESULT.Clone()
|
||||
For Each col1 As String In listcheck
|
||||
Dim collist As DataColumn = tbltemp.Columns(col1)
|
||||
If Not IsNothing(collist) Then
|
||||
collist.DataType = GetType(Boolean)
|
||||
End If
|
||||
Next
|
||||
For Each col1 As String In listdate
|
||||
Dim coldate As DataColumn = tbltemp.Columns(col1)
|
||||
If Not IsNothing(coldate) Then
|
||||
coldate.DataType = GetType(Date)
|
||||
End If
|
||||
Next
|
||||
Try
|
||||
tbltemp.Load(DT_RESULT.CreateDataReader)
|
||||
DT_RESULT = tbltemp
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Attention: Could not load converted datatable DocSearch: " & ex.Message, False)
|
||||
End Try
|
||||
GridControlDocSearch.DataSource = DT_RESULT
|
||||
' Alle Date Spalten durchgehen
|
||||
For Each col As String In listdate
|
||||
Dim colDate = GridViewDoc_Search.Columns(col)
|
||||
colDate.DisplayFormat.FormatType = FormatType.DateTime
|
||||
colDate.DisplayFormat.FormatString = CURRENT_DATE_FORMAT
|
||||
Next
|
||||
|
||||
' Alle Date Spalten durchgehen
|
||||
For Each dropdownrow As DataRow In DROPDOWN_TABLE.Rows
|
||||
Dim RepositoryItemComboBox = New RepositoryItemComboBox()
|
||||
Dim colstring = dropdownrow.Item(1)
|
||||
Dim guid = dropdownrow.Item("ID")
|
||||
Dim expression As String
|
||||
expression = "CONFIG_ID = " & guid.ToString
|
||||
Dim foundRows() As DataRow
|
||||
' Use the Select method to find all rows matching the filter.
|
||||
foundRows = DT_DOCRESULT_DROPDOWN_ITMES.Select(expression, "SEQUENCE")
|
||||
|
||||
' For each row add an item
|
||||
For i = 0 To foundRows.GetUpperBound(0)
|
||||
Dim item As New WDDoc_Combobox_Item()
|
||||
item.ConfigID = foundRows(i)("CONFIG_ID")
|
||||
item.Value = foundRows(i)("VALUE")
|
||||
|
||||
|
||||
'RepositoryItemComboBox.Items.Add(foundRows(i)("VALUE"))
|
||||
RepositoryItemComboBox.Items.Add(item)
|
||||
Next
|
||||
GridViewDoc_Search.GridControl.RepositoryItems.Add(RepositoryItemComboBox)
|
||||
If Not IsNothing(GridViewDoc_Search.Columns(colstring)) Then
|
||||
GridViewDoc_Search.Columns(colstring).ColumnEdit = RepositoryItemComboBox
|
||||
End If
|
||||
AddHandler RepositoryItemComboBox.SelectedValueChanged, AddressOf OnCBSelectedValueChanged
|
||||
|
||||
Next
|
||||
'Jetzt die Spaltenbreiten anpassen
|
||||
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(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)
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
' Größe der Icon Column anpassen
|
||||
GridViewDoc_Search.Columns.Item("ICON").MaxWidth = 24
|
||||
GridViewDoc_Search.Columns.Item("ICON").MinWidth = 24
|
||||
GridViewDoc_Search.Columns.Item("FULLPATH").Visible = False
|
||||
GridViewDoc_Search.Columns.Item("OBJECTTYPE").Visible = False
|
||||
GridViewDoc_Search.Columns.Item("DocID").Visible = False
|
||||
Dim changed = "Geändert"
|
||||
Dim created = "Erstellt"
|
||||
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
changed = "Changed"
|
||||
created = "Created"
|
||||
If TCDetails.SelectedTabPageIndex <> 1 Then
|
||||
TCDetails.SelectedTabPageIndex = 1
|
||||
End If
|
||||
Try
|
||||
GridViewDoc_Search.Columns(created).DisplayFormat.FormatType = FormatType.DateTime
|
||||
GridViewDoc_Search.Columns(created).DisplayFormat.FormatString = CURRENT_DATE_FORMAT & " HH:MM:ss"
|
||||
GridViewDoc_Search.Columns(changed).DisplayFormat.FormatType = FormatType.DateTime
|
||||
GridViewDoc_Search.Columns(changed).DisplayFormat.FormatString = CURRENT_DATE_FORMAT & " HH:MM:ss"
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Attention: Could not change datetime formats Change/Create: " & ex.Message, False)
|
||||
End Try
|
||||
|
||||
For Each col As DevExpress.XtraGrid.Columns.GridColumn In GridViewDoc_Search.Columns
|
||||
Dim colu = col
|
||||
Console.Write(colu.Name & " - " & colu.FieldName)
|
||||
Dim _AllowEdit As Boolean = False
|
||||
For Each dropdownrow As DataRow In DROPDOWN_TABLE.Rows
|
||||
Dim colstring = dropdownrow.Item(1)
|
||||
If colstring = colu.FieldName Then
|
||||
_AllowEdit = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
col.OptionsColumn.AllowEdit = _AllowEdit
|
||||
Next
|
||||
'Dim listcheck As New List(Of String)
|
||||
'Dim listdate As New List(Of String)
|
||||
'Dim DROPDOWN_TABLE As New DataTable
|
||||
'DROPDOWN_TABLE.TableName = "DROPDOWN_TABLE"
|
||||
'' Create two columns, ID and Name.
|
||||
'DROPDOWN_TABLE.Columns.Add("ID", GetType(Integer))
|
||||
'DROPDOWN_TABLE.Columns.Add("COLUMN_VIEW", GetType(System.String))
|
||||
'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(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)
|
||||
' 'End If
|
||||
' 'Liste von allen Spaltentiteln mit Checkbox erstellen
|
||||
' If rw.Item("TYPE_ID") = 2 And CBool(rw.Item("VISIBLE")) = True Then
|
||||
' listcheck.Add(rw.Item("HEADER_CAPTION"))
|
||||
' End If
|
||||
' 'Liste von allen Spaltentiteln mit Checkbox erstellen
|
||||
' If rw.Item("TYPE_ID") = 3 And CBool(rw.Item("VISIBLE")) = True Then
|
||||
' listdate.Add(rw.Item("HEADER_CAPTION"))
|
||||
' End If
|
||||
' If rw.Item("TYPE_ID") = 4 And CBool(rw.Item("VISIBLE")) = True Then
|
||||
' Dim newRow As DataRow = DROPDOWN_TABLE.NewRow()
|
||||
' newRow("ID") = rw.Item("GUID")
|
||||
' newRow("COLUMN_VIEW") = rw.Item("HEADER_CAPTION")
|
||||
' DROPDOWN_TABLE.Rows.Add(newRow)
|
||||
' DROPDOWN_TABLE.AcceptChanges()
|
||||
' End If
|
||||
|
||||
'Next
|
||||
|
||||
'Dim tbltemp As DataTable = DT_RESULT.Clone()
|
||||
'For Each col1 As String In listcheck
|
||||
' Dim collist As DataColumn = tbltemp.Columns(col1)
|
||||
' If Not IsNothing(collist) Then
|
||||
' collist.DataType = GetType(Boolean)
|
||||
' End If
|
||||
'Next
|
||||
'For Each col1 As String In listdate
|
||||
' Dim coldate As DataColumn = tbltemp.Columns(col1)
|
||||
' If Not IsNothing(coldate) Then
|
||||
' coldate.DataType = GetType(Date)
|
||||
' End If
|
||||
'Next
|
||||
'Try
|
||||
' tbltemp.Load(DT_RESULT.CreateDataReader)
|
||||
' DT_RESULT = tbltemp
|
||||
'Catch ex As Exception
|
||||
' ClassLogger.Add(">> Attention: Could not load converted datatable DocSearch: " & ex.Message, False)
|
||||
'End Try
|
||||
'GridControlDocSearch.DataSource = DT_RESULT
|
||||
'' Alle Date Spalten durchgehen
|
||||
'For Each col As String In listdate
|
||||
' Dim colDate = GridViewDoc_Search.Columns(col)
|
||||
' colDate.DisplayFormat.FormatType = FormatType.DateTime
|
||||
' colDate.DisplayFormat.FormatString = CURRENT_DATE_FORMAT
|
||||
'Next
|
||||
|
||||
'' Alle Date Spalten durchgehen
|
||||
'For Each dropdownrow As DataRow In DROPDOWN_TABLE.Rows
|
||||
' Dim RepositoryItemComboBox = New RepositoryItemComboBox()
|
||||
' Dim colstring = dropdownrow.Item(1)
|
||||
' Dim guid = dropdownrow.Item("ID")
|
||||
' Dim expression As String
|
||||
' expression = "CONFIG_ID = " & guid.ToString
|
||||
' Dim foundRows() As DataRow
|
||||
' ' Use the Select method to find all rows matching the filter.
|
||||
' foundRows = DT_DOCRESULT_DROPDOWN_ITMES.Select(expression, "SEQUENCE")
|
||||
|
||||
' ' For each row add an item
|
||||
' For i = 0 To foundRows.GetUpperBound(0)
|
||||
' Dim item As New WDDoc_Combobox_Item()
|
||||
' item.ConfigID = foundRows(i)("CONFIG_ID")
|
||||
' item.Value = foundRows(i)("VALUE")
|
||||
|
||||
|
||||
' 'RepositoryItemComboBox.Items.Add(foundRows(i)("VALUE"))
|
||||
' RepositoryItemComboBox.Items.Add(item)
|
||||
' Next
|
||||
' GridViewDoc_Search.GridControl.RepositoryItems.Add(RepositoryItemComboBox)
|
||||
' If Not IsNothing(GridViewDoc_Search.Columns(colstring)) Then
|
||||
' GridViewDoc_Search.Columns(colstring).ColumnEdit = RepositoryItemComboBox
|
||||
' End If
|
||||
' AddHandler RepositoryItemComboBox.SelectedValueChanged, AddressOf OnCBSelectedValueChanged
|
||||
|
||||
'Next
|
||||
''Jetzt die Spaltenbreiten anpassen
|
||||
'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(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)
|
||||
' End If
|
||||
|
||||
|
||||
'Next
|
||||
|
||||
'' Größe der Icon Column anpassen
|
||||
'GridViewDoc_Search.Columns.Item("ICON").MaxWidth = 24
|
||||
'GridViewDoc_Search.Columns.Item("ICON").MinWidth = 24
|
||||
'GridViewDoc_Search.Columns.Item("FULLPATH").Visible = False
|
||||
'GridViewDoc_Search.Columns.Item("OBJECTTYPE").Visible = False
|
||||
'GridViewDoc_Search.Columns.Item("DocID").Visible = False
|
||||
'Dim changed = "Geändert"
|
||||
'Dim created = "Erstellt"
|
||||
|
||||
'If USER_LANGUAGE <> "de-DE" Then
|
||||
' changed = "Changed"
|
||||
' created = "Created"
|
||||
'End If
|
||||
'Try
|
||||
' GridViewDoc_Search.Columns(created).DisplayFormat.FormatType = FormatType.DateTime
|
||||
' GridViewDoc_Search.Columns(created).DisplayFormat.FormatString = CURRENT_DATE_FORMAT & " HH:MM:ss"
|
||||
' GridViewDoc_Search.Columns(changed).DisplayFormat.FormatType = FormatType.DateTime
|
||||
' GridViewDoc_Search.Columns(changed).DisplayFormat.FormatString = CURRENT_DATE_FORMAT & " HH:MM:ss"
|
||||
'Catch ex As Exception
|
||||
' ClassLogger.Add(">> Attention: Could not change datetime formats Change/Create: " & ex.Message, False)
|
||||
'End Try
|
||||
|
||||
'For Each col As DevExpress.XtraGrid.Columns.GridColumn In GridViewDoc_Search.Columns
|
||||
' Dim colu = col
|
||||
' Console.Write(colu.Name & " - " & colu.FieldName)
|
||||
' Dim _AllowEdit As Boolean = False
|
||||
' For Each dropdownrow As DataRow In DROPDOWN_TABLE.Rows
|
||||
' Dim colstring = dropdownrow.Item(1)
|
||||
' If colstring = colu.FieldName Then
|
||||
' _AllowEdit = True
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
' col.OptionsColumn.AllowEdit = _AllowEdit
|
||||
'Next
|
||||
|
||||
|
||||
|
||||
@ -4574,10 +4585,10 @@ Public Class frmConstructor_Main
|
||||
'Next
|
||||
'grvwGrid.Columns("Record-ID").OptionsColumn.AllowShowHide = False
|
||||
|
||||
If TCDetails.SelectedTabPageIndex <> 1 Then
|
||||
'If TCDetails.SelectedTabPageIndex <> 1 Then
|
||||
|
||||
TCDetails.SelectedTabPageIndex = 1
|
||||
End If
|
||||
' TCDetails.SelectedTabPageIndex = 1
|
||||
'End If
|
||||
|
||||
|
||||
End If
|
||||
@ -4619,10 +4630,10 @@ Public Class frmConstructor_Main
|
||||
Dim ComboBox As ComboBoxEdit = sender
|
||||
'Dim ItemComboBox As RepositoryItemComboBox
|
||||
'ItemComboBox = sender
|
||||
Dim item As WDDoc_Combobox_Item = ComboBox.SelectedItem
|
||||
Dim item As ClassWindreamDocGrid.WindreamDocGridComboboxItem = ComboBox.SelectedItem
|
||||
Dim value As String = item.Value
|
||||
Dim configId As Integer = item.ConfigID
|
||||
Dim docId As Integer = RESULT_DOC_ID
|
||||
Dim docId As Integer = ClassWindreamDocGrid.RESULT_DOC_ID
|
||||
Dim user As String = Environment.UserName
|
||||
|
||||
Dim Sql As String = String.Format("EXEC PRPMO_DOC_VALUE {0}, {1}, '{2}', '{3}'", docId, configId, value, Environment.UserName)
|
||||
@ -4860,7 +4871,7 @@ Public Class frmConstructor_Main
|
||||
End Sub
|
||||
|
||||
Private Sub TCDetails_SelectedPageChanged(sender As Object, e As DevExpress.XtraTab.TabPageChangedEventArgs) Handles TCDetails.SelectedPageChanged
|
||||
|
||||
|
||||
Update_Status_Label(False, "")
|
||||
'tsButtonEdit.Enabled = True
|
||||
If TCDetails.SelectedTabPage.Text.ToLower.StartsWith("pos") Then
|
||||
@ -5865,11 +5876,11 @@ Public Class frmConstructor_Main
|
||||
End Sub
|
||||
|
||||
Private Sub KopierenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CopyToolStripMenuItem.Click
|
||||
If RESULT_DOC_PATH <> Nothing Then
|
||||
If ClassWindreamDocGrid.RESULT_DOC_PATH <> Nothing Then
|
||||
Try
|
||||
Dim selectedfile(0) As String
|
||||
|
||||
selectedfile(0) = RESULT_DOC_PATH
|
||||
selectedfile(0) = ClassWindreamDocGrid.RESULT_DOC_PATH
|
||||
|
||||
Dim dataobj As New DataObject
|
||||
|
||||
@ -5885,38 +5896,8 @@ Public Class frmConstructor_Main
|
||||
End Sub
|
||||
|
||||
Private Sub GridViewDoc_Search_FocusedRowChanged(sender As Object, e As FocusedRowChangedEventArgs) Handles GridViewDoc_Search.FocusedRowChanged
|
||||
Get_Doc_Items()
|
||||
End Sub
|
||||
Sub Get_Doc_Items()
|
||||
Try
|
||||
RESULT_DOC_PATH = GridViewDoc_Search.GetFocusedRowCellValue(GridViewDoc_Search.Columns("FULLPATH"))
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Attention: Could not set DocVariable RESULT_DOC_PATH: " & ex.Message, False)
|
||||
RESULT_DOC_PATH = Nothing
|
||||
End Try
|
||||
Try
|
||||
RESULT_OBJECTTYPE = GridViewDoc_Search.GetFocusedRowCellValue(GridViewDoc_Search.Columns("OBJECTTYPE"))
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Attention: Could not set DocVariable RESULT_OBJECTTYPE: " & ex.Message, False)
|
||||
RESULT_OBJECTTYPE = ""
|
||||
End Try
|
||||
Try
|
||||
RESULT_INWORK = GridViewDoc_Search.GetFocusedRowCellValue(GridViewDoc_Search.Columns("in work?"))
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Attention: Could not set DocVariable RESULT_INWORK: " & ex.Message, False)
|
||||
RESULT_INWORK = ""
|
||||
End Try
|
||||
Try
|
||||
RESULT_DOC_ID = GridViewDoc_Search.GetFocusedRowCellValue(GridViewDoc_Search.Columns("DocID"))
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Attention: Could not set DocVariable RESULT_DOC_ID: " & ex.Message, False)
|
||||
RESULT_DOC_ID = Nothing
|
||||
End Try
|
||||
Try
|
||||
RESULT_DISPLAYNAME = GridViewDoc_Search.GetFocusedRowCellValue(GridViewDoc_Search.Columns("Displayname"))
|
||||
Catch ex As Exception
|
||||
RESULT_DISPLAYNAME = ""
|
||||
End Try
|
||||
'Get_Doc_Items()
|
||||
ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
|
||||
End Sub
|
||||
|
||||
Private Sub LöschenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DeleteToolStripMenuItem.Click
|
||||
@ -5924,7 +5905,7 @@ Public Class frmConstructor_Main
|
||||
MsgBox("Please select a record!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
If RESULT_DOC_PATH <> Nothing Then
|
||||
If ClassWindreamDocGrid.RESULT_DOC_PATH <> Nothing Then
|
||||
Dim msg = "Wollen Sie die Verknüpfung der Datei wirklich entfernen?" & vbNewLine & "Datei bleibt im DMS/Archiv/Explorer erhalten!"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "Would You like to delete only the references?" & vbNewLine & "File will stay in ECM/Archive/Explorer!"
|
||||
@ -5933,15 +5914,15 @@ Public Class frmConstructor_Main
|
||||
result = MessageBox.Show(msg, "Confirmation:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result = MsgBoxResult.Yes Then
|
||||
Try
|
||||
Dim DT_INDICES As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM TBPMO_WD_OBJECTTYPE WHERE OBJECT_TYPE = '" & RESULT_OBJECTTYPE & "'")
|
||||
Dim DT_INDICES As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM TBPMO_WD_OBJECTTYPE WHERE OBJECT_TYPE = '" & ClassWindreamDocGrid.RESULT_OBJECTTYPE & "'")
|
||||
If Not IsNothing(DT_INDICES) Then
|
||||
If DT_INDICES.Rows.Count = 1 Then
|
||||
'Record-Links entfernen
|
||||
If ClassWindream.REMOVE_VEKTOR_LINK(RESULT_DOC_PATH, DT_INDICES.Rows(0).Item("IDXNAME_RECORDID"), RECORD_ID) = True Then
|
||||
If ClassWindream.REMOVE_VEKTOR_LINK(ClassWindreamDocGrid.RESULT_DOC_PATH, DT_INDICES.Rows(0).Item("IDXNAME_RECORDID"), RECORD_ID) = True Then
|
||||
'ENTITY-Links entfernen
|
||||
If ClassWindream.REMOVE_VEKTOR_LINK(RESULT_DOC_PATH, DT_INDICES.Rows(0).Item("IDXNAME_ENTITYID"), ENTITY_ID) = True Then
|
||||
If ClassFileResult.Delete_ResultFile(RESULT_DOC_ID) = True Then
|
||||
ClassHelper.InsertEssential_Log(RESULT_DOC_ID, "DOC-ID", "RECORD LINK REMOVED FROM DOC-SEARCH")
|
||||
If ClassWindream.REMOVE_VEKTOR_LINK(ClassWindreamDocGrid.RESULT_DOC_PATH, DT_INDICES.Rows(0).Item("IDXNAME_ENTITYID"), ENTITY_ID) = True Then
|
||||
If ClassFileResult.Delete_ResultFile(ClassWindreamDocGrid.RESULT_DOC_ID) = True Then
|
||||
ClassHelper.InsertEssential_Log(ClassWindreamDocGrid.RESULT_DOC_ID, "DOC-ID", "RECORD LINK REMOVED FROM DOC-SEARCH")
|
||||
RUN_WDSEARCH_GRID("RECORD")
|
||||
End If
|
||||
Else
|
||||
@ -5960,12 +5941,12 @@ Public Class frmConstructor_Main
|
||||
End Sub
|
||||
|
||||
Private Sub EigenschaftenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PropertiesToolStripMenuItem.Click
|
||||
If RESULT_DOC_PATH <> Nothing Then
|
||||
If ClassWindreamDocGrid.RESULT_DOC_PATH <> Nothing Then
|
||||
Cursor = Cursors.WaitCursor
|
||||
Dim sei As New SHELLEXECUTEINFO
|
||||
sei.cbSize = Marshal.SizeOf(sei)
|
||||
sei.lpVerb = "properties"
|
||||
sei.lpFile = RESULT_DOC_PATH
|
||||
sei.lpFile = ClassWindreamDocGrid.RESULT_DOC_PATH
|
||||
sei.nShow = SW_SHOW
|
||||
sei.fMask = SEE_MASK_INVOKEIDLIST
|
||||
If Not ShellExecuteEx(sei) Then
|
||||
@ -5977,12 +5958,13 @@ Public Class frmConstructor_Main
|
||||
End Sub
|
||||
|
||||
Private Sub DateiÖffnenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DateiÖffnenToolStripMenuItem.Click
|
||||
ClassHelper.File_open(RESULT_DOC_PATH, RESULT_DOC_ID)
|
||||
ClassHelper.File_open(ClassWindreamDocGrid.RESULT_DOC_PATH, ClassWindreamDocGrid.RESULT_DOC_ID)
|
||||
End Sub
|
||||
Private Sub GridControlDocSearch_DoubleClick(sender As Object, e As EventArgs) Handles GridControlDocSearch.DoubleClick
|
||||
Get_Doc_Items()
|
||||
'Get_Doc_Items()
|
||||
ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
|
||||
If RIGHT_WINDREAM_FORBIDDEN = False Then
|
||||
ClassHelper.File_open(RESULT_DOC_PATH, RESULT_DOC_ID)
|
||||
ClassHelper.File_open(ClassWindreamDocGrid.RESULT_DOC_PATH, ClassWindreamDocGrid.RESULT_DOC_ID)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@ -6249,11 +6231,11 @@ Public Class frmConstructor_Main
|
||||
Try
|
||||
If tsTextBoxRenameFile.Text <> "" Then
|
||||
Dim OldName, NewName As String
|
||||
OldName = RESULT_DOC_PATH
|
||||
OldName = ClassWindreamDocGrid.RESULT_DOC_PATH
|
||||
' Define file names.
|
||||
NewName = tsTextBoxRenameFile.Text
|
||||
Dim name1 = Path.Combine(Path.GetDirectoryName(RESULT_DOC_PATH), NewName)
|
||||
NewName = NewName & Path.GetExtension(RESULT_DOC_PATH)
|
||||
Dim name1 = Path.Combine(Path.GetDirectoryName(ClassWindreamDocGrid.RESULT_DOC_PATH), NewName)
|
||||
NewName = NewName & Path.GetExtension(ClassWindreamDocGrid.RESULT_DOC_PATH)
|
||||
' Rename file.
|
||||
My.Computer.FileSystem.RenameFile(OldName, NewName)
|
||||
RUN_WDSEARCH_GRID("RECORD")
|
||||
@ -6273,9 +6255,9 @@ Public Class frmConstructor_Main
|
||||
End Sub
|
||||
Sub Display_Filename()
|
||||
Try
|
||||
If RESULT_DOC_PATH <> "" Then
|
||||
If ClassWindreamDocGrid.RESULT_DOC_PATH <> "" Then
|
||||
Dim FileToRename As String
|
||||
FileToRename = Path.GetFileNameWithoutExtension(RESULT_DOC_PATH)
|
||||
FileToRename = Path.GetFileNameWithoutExtension(ClassWindreamDocGrid.RESULT_DOC_PATH)
|
||||
tsTextBoxRenameFile.Text = FileToRename
|
||||
tsTextBoxRenameFile.Enabled = True
|
||||
Else
|
||||
@ -6287,18 +6269,18 @@ Public Class frmConstructor_Main
|
||||
End Sub
|
||||
|
||||
Private Sub DateiMitDatensatzVerknüpfenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TSMI_linkRecord.Click
|
||||
Dim fileName As String = RESULT_DOC_PATH
|
||||
CURRENT_DOC_ID = RESULT_DOC_ID
|
||||
Dim frm As New frmWD_Link_to_Record(fileName, RESULT_OBJECTTYPE)
|
||||
Dim fileName As String = ClassWindreamDocGrid.RESULT_DOC_PATH
|
||||
CURRENT_DOC_ID = ClassWindreamDocGrid.RESULT_DOC_ID
|
||||
Dim frm As New frmWD_Link_to_Record(fileName, ClassWindreamDocGrid.RESULT_OBJECTTYPE)
|
||||
frm.Show()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub DetailAnsichtDatensatzToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DetailAnsichtDatensatzToolStripMenuItem.Click
|
||||
ClassJumpRecord.JumpToRecord(0, RECORD_ID)
|
||||
JUMP_RECORD_ID = 0
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub EntitätssucheStartenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EntitätssucheStartenToolStripMenuItem.Click
|
||||
RUN_WDSEARCH_GRID("ENTITY")
|
||||
End Sub
|
||||
@ -6334,7 +6316,7 @@ Public Class frmConstructor_Main
|
||||
|
||||
Private Sub ContextMenuStripResultFiles_Opening(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStripResultFiles.Opening
|
||||
File_in_Work()
|
||||
If RESULT_DISPLAYNAME <> "" Then
|
||||
If ClassWindreamDocGrid.RESULT_DISPLAYNAME <> "" Then
|
||||
TSMIDisplayname.Visible = True
|
||||
Set_Displayname()
|
||||
Else
|
||||
@ -6345,7 +6327,7 @@ Public Class frmConstructor_Main
|
||||
TSMI_inWork.Enabled = True
|
||||
Try
|
||||
Dim expression As String
|
||||
expression = "DocID = " & RESULT_DOC_ID
|
||||
expression = "DocID = " & ClassWindreamDocGrid.RESULT_DOC_ID
|
||||
Dim foundRowsLevel0() As DataRow
|
||||
' Use the Select method to find all rows matching the filter.
|
||||
foundRowsLevel0 = CURRENT_DOC_RESULTS.Select(expression)
|
||||
@ -6361,7 +6343,7 @@ Public Class frmConstructor_Main
|
||||
|
||||
Dim displ As String
|
||||
|
||||
If CBool(RESULT_INWORK) = True Then
|
||||
If CBool(ClassWindreamDocGrid.RESULT_INWORK) = True Then
|
||||
If IW_USER.ToUpper = Environment.UserName.ToUpper Then
|
||||
displ = "Datei wieder freigeben"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
@ -6386,8 +6368,8 @@ Public Class frmConstructor_Main
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub TSMI_inWork_Click(sender As Object, e As EventArgs) Handles TSMI_inWork.Click
|
||||
ClassFileResult.DocID = RESULT_DOC_ID
|
||||
If RESULT_INWORK = True Then ' Datei ist in Bearbeitung
|
||||
ClassFileResult.DocID = ClassWindreamDocGrid.RESULT_DOC_ID
|
||||
If ClassWindreamDocGrid.RESULT_INWORK = True Then ' Datei ist in Bearbeitung
|
||||
Dim displ As String
|
||||
If IW_USER.ToUpper = Environment.UserName.ToUpper Then
|
||||
If ClassFileResult.Set_InWork(0, "") = True Then
|
||||
@ -6402,15 +6384,17 @@ Public Class frmConstructor_Main
|
||||
End If
|
||||
Else
|
||||
frmFileInWork.ShowDialog()
|
||||
RESULT_INWORK = ClassFileResult.InWork
|
||||
ClassWindreamDocGrid.RESULT_INWORK = ClassFileResult.InWork
|
||||
RUN_WDSEARCH_GRID("RECORD")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GridViewDoc_Search_FocusedColumnChanged(sender As Object, e As FocusedColumnChangedEventArgs) Handles GridViewDoc_Search.FocusedColumnChanged
|
||||
Get_Doc_Items()
|
||||
'Get_Doc_Items()
|
||||
ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub AnsichtZurücksetzenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AnsichtZurücksetzenToolStripMenuItem.Click
|
||||
' TODO: Ansicht zurücksetzen
|
||||
Try
|
||||
@ -6437,8 +6421,8 @@ Public Class frmConstructor_Main
|
||||
End Sub
|
||||
Sub Set_Displayname()
|
||||
Try
|
||||
If RESULT_DISPLAYNAME <> "" Then
|
||||
tstbDisplayname.Text = RESULT_DISPLAYNAME
|
||||
If ClassWindreamDocGrid.RESULT_DISPLAYNAME <> "" Then
|
||||
tstbDisplayname.Text = ClassWindreamDocGrid.RESULT_DISPLAYNAME
|
||||
tstbDisplayname.Enabled = True
|
||||
Else
|
||||
tstbDisplayname.Enabled = False
|
||||
@ -6448,13 +6432,13 @@ Public Class frmConstructor_Main
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub tstbDisplayname_KeyUp(sender As Object, e As KeyEventArgs) Handles tstbDisplayname.KeyUp
|
||||
If e.KeyCode = Keys.Return Then
|
||||
Try
|
||||
ClassFileResult.DocID = RESULT_DOC_ID
|
||||
ClassFileResult.DocID = ClassWindreamDocGrid.RESULT_DOC_ID
|
||||
If tstbDisplayname.Text <> "" Then
|
||||
|
||||
|
||||
If ClassFileResult.Set_Displayname(tstbDisplayname.Text) Then
|
||||
RUN_WDSEARCH_GRID("RECORD")
|
||||
ContextMenuStripResultFiles.Close()
|
||||
@ -6469,7 +6453,7 @@ Public Class frmConstructor_Main
|
||||
Private Sub TestToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles tsmiRights.Click
|
||||
Dim msg = "Die Rechte wurden erfolgreich überprüft und aktualisiert!"
|
||||
CURRENT_RECORD_ID = RECORD_ID
|
||||
If ClassDOC_SEARCH.SET_WD_RIGHTS(RESULT_DOC_ID, RESULT_DOC_PATH, ENTITY_ID) = True Then
|
||||
If ClassDOC_SEARCH.SET_WD_RIGHTS(ClassWindreamDocGrid.RESULT_DOC_ID, ClassWindreamDocGrid.RESULT_DOC_PATH, ENTITY_ID) = True Then
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "The rights were successfully renewed!"
|
||||
End If
|
||||
@ -6518,34 +6502,34 @@ Public Class frmConstructor_Main
|
||||
MsgBox("Please select a record!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
If RESULT_DOC_PATH <> Nothing Then
|
||||
Dim msg = "Sind Sie sicher, dass Sie die Datei " & vbNewLine & RESULT_DOC_PATH & vbNewLine & "endgültig löschen wollen?"
|
||||
If ClassWindreamDocGrid.RESULT_DOC_PATH <> Nothing Then
|
||||
Dim msg = "Sind Sie sicher, dass Sie die Datei " & vbNewLine & ClassWindreamDocGrid.RESULT_DOC_PATH & vbNewLine & "endgültig löschen wollen?"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "Are You sure You want to permanently delete this file?" & vbNewLine & RESULT_DOC_PATH
|
||||
msg = "Are You sure You want to permanently delete this file?" & vbNewLine & ClassWindreamDocGrid.RESULT_DOC_PATH
|
||||
End If
|
||||
Dim result1 As MsgBoxResult
|
||||
result1 = MessageBox.Show(msg, "Confirmation:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result1 = MsgBoxResult.Yes Then
|
||||
Try
|
||||
If Not IsNothing(RESULT_DOC_ID) Then
|
||||
If ClassWindream.Delete_WDFile(RESULT_DOC_PATH) = True Then
|
||||
If ClassFileResult.Delete_ResultFile(RESULT_DOC_ID) = True Then
|
||||
ClassHelper.InsertEssential_Log(RESULT_DOC_ID, "DOC-ID", "FILE DELETED BY USER")
|
||||
RUN_WDSEARCH_GRID("RECORD")
|
||||
Else
|
||||
msg = String.Format("Die Datei {0} konnte nicht gelöscht werden! Prüfen Sie die logfile!", RESULT_DOC_PATH)
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = String.Format("The file {0} could not be deleted! Check the logfile!", RESULT_DOC_PATH)
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Critical, "Attention:")
|
||||
Dim result1 As MsgBoxResult
|
||||
result1 = MessageBox.Show(msg, "Confirmation:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result1 = MsgBoxResult.Yes Then
|
||||
Try
|
||||
If Not IsNothing(ClassWindreamDocGrid.RESULT_DOC_ID) Then
|
||||
If ClassWindream.Delete_WDFile(ClassWindreamDocGrid.RESULT_DOC_PATH) = True Then
|
||||
If ClassFileResult.Delete_ResultFile(ClassWindreamDocGrid.RESULT_DOC_ID) = True Then
|
||||
ClassHelper.InsertEssential_Log(ClassWindreamDocGrid.RESULT_DOC_ID, "DOC-ID", "FILE DELETED BY USER")
|
||||
RUN_WDSEARCH_GRID("RECORD")
|
||||
Else
|
||||
msg = String.Format("Die Datei {0} konnte nicht gelöscht werden! Prüfen Sie die logfile!", ClassWindreamDocGrid.RESULT_DOC_PATH)
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = String.Format("The file {0} could not be deleted! Check the logfile!", ClassWindreamDocGrid.RESULT_DOC_PATH)
|
||||
End If
|
||||
MsgBox(msg, MsgBoxStyle.Critical, "Attention:")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in Delete file:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in Delete file:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
@ -4,13 +4,13 @@ Imports System.Runtime.InteropServices
|
||||
Public Class frmRecordView
|
||||
Private recordView As ClassRecordView
|
||||
Private ENTITY_ID, FORMVIEW_ID, PARENT_ENTITY_ID, WF_TASK_ID As Integer
|
||||
Private RESULT_DOC_PATH As String
|
||||
Private Const SEE_MASK_INVOKEIDLIST = &HC
|
||||
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
|
||||
Private DT_WINDREAM_RESULTLIST As DataTable
|
||||
Private DT_DOCRESULT_DROPDOWN_ITEMS As DataTable
|
||||
Private _Changed As Boolean = False
|
||||
|
||||
<DllImport("Shell32", CharSet:=CharSet.Auto, SetLastError:=True)> _
|
||||
@ -57,6 +57,8 @@ Public Class frmRecordView
|
||||
DT_RESULTLIST_OPTIONS = ClassDatabase.Return_Datatable(sql, "GETVARIABLE CONTROLS")
|
||||
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"
|
||||
DT_WINDREAM_RESULTLIST = ClassDatabase.Return_Datatable(sql_ResultList, "GETRESULTLIST KONFIG")
|
||||
sql_ResultList = String.Format("select * from TBPMO_DOCRESULT_DROPDOWN_ITEMS WHERE CONFIG_ID IN (SELECT GUID FROM TBPMO_DOCSEARCH_RESULTLIST_CONFIG WHERE ENTITY_ID = {0} AND TYPE_ID = 4 AND LANGUAGE = '{1}')", ENTITY_ID, USER_LANGUAGE)
|
||||
DT_DOCRESULT_DROPDOWN_ITEMS = ClassDatabase.Return_Datatable(sql_ResultList, "GETRESULT_DROPDOWN_ITEMS")
|
||||
TBPMO_WORKFLOW_TASK_HISTORYTableAdapter.Connection.ConnectionString = MyConnectionString
|
||||
ClassWindowLocation.LoadFormLocationSize(Me, 0, CURRENT_SCREEN_ID, "frmRecordView")
|
||||
|
||||
@ -67,6 +69,26 @@ Public Class frmRecordView
|
||||
RUN_WDSEARCH_GRID()
|
||||
Load_Tasks()
|
||||
End Sub
|
||||
|
||||
Private Sub OnCBSelectedValueChanged(sender As Object, e As EventArgs)
|
||||
Try
|
||||
Dim ComboBox As DevExpress.XtraEditors.ComboBoxEdit = sender
|
||||
'Dim ItemComboBox As RepositoryItemComboBox
|
||||
'ItemComboBox = sender
|
||||
Dim item As ClassWindreamDocGrid.WindreamDocGridComboboxItem = ComboBox.SelectedItem
|
||||
Dim value As String = item.Value
|
||||
Dim configId As Integer = item.ConfigID
|
||||
Dim docId As Integer = ClassWindreamDocGrid.RESULT_DOC_ID
|
||||
Dim user As String = Environment.UserName
|
||||
|
||||
Dim Sql As String = String.Format("EXEC PRPMO_DOC_VALUE {0}, {1}, '{2}', '{3}'", docId, configId, value, Environment.UserName)
|
||||
ClassDatabase.Execute_non_Query(Sql)
|
||||
Catch ex As Exception
|
||||
MsgBox("Error:" & vbNewLine & ex.Message)
|
||||
End Try
|
||||
'Perform your actions
|
||||
End Sub
|
||||
|
||||
Private Sub RUN_WDSEARCH_GRID()
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Try
|
||||
@ -89,21 +111,12 @@ Public Class frmRecordView
|
||||
tslblWindreamView.Text = msg
|
||||
|
||||
If DT_RESULT.Rows.Count > 0 Then
|
||||
GridControlDocSearch.DataSource = DT_RESULT
|
||||
' Größe der Icon Column anpassen
|
||||
GridViewDoc_Search.Columns.Item("ICON").MaxWidth = 24
|
||||
GridViewDoc_Search.Columns.Item("ICON").MinWidth = 24
|
||||
GridViewDoc_Search.Columns.Item("FULLPATH").Visible = False
|
||||
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(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)
|
||||
End If
|
||||
Next
|
||||
ClassWindreamDocGrid.FormatColumns(
|
||||
GridViewDoc_Search,
|
||||
DT_RESULT,
|
||||
DT_WINDREAM_RESULTLIST,
|
||||
DT_DOCRESULT_DROPDOWN_ITEMS,
|
||||
AddressOf OnCBSelectedValueChanged)
|
||||
End If
|
||||
Else
|
||||
Dim msg = "Keine Windream-Dokumente für Record: " & JUMP_RECORD_ID & " gefunden"
|
||||
@ -314,31 +327,31 @@ Public Class frmRecordView
|
||||
|
||||
Private Sub GridViewDoc_Search_FocusedRowChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs)
|
||||
Try
|
||||
RESULT_DOC_PATH = GridViewDoc_Search.GetFocusedRowCellValue(GridViewDoc_Search.Columns("FULLPATH"))
|
||||
ClassWindreamDocGrid.RESULT_DOC_PATH = GridViewDoc_Search.GetFocusedRowCellValue(GridViewDoc_Search.Columns("FULLPATH"))
|
||||
Catch ex As Exception
|
||||
RESULT_DOC_PATH = Nothing
|
||||
ClassWindreamDocGrid.RESULT_DOC_PATH = Nothing
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub GridControlDocSearch_DoubleClick(sender As Object, e As EventArgs)
|
||||
Try
|
||||
RESULT_DOC_PATH = GridViewDoc_Search.GetFocusedRowCellValue(GridViewDoc_Search.Columns("FULLPATH"))
|
||||
ClassWindreamDocGrid.RESULT_DOC_PATH = GridViewDoc_Search.GetFocusedRowCellValue(GridViewDoc_Search.Columns("FULLPATH"))
|
||||
Catch ex As Exception
|
||||
RESULT_DOC_PATH = Nothing
|
||||
ClassWindreamDocGrid.RESULT_DOC_PATH = Nothing
|
||||
End Try
|
||||
ClassHelper.File_open(RESULT_DOC_PATH, 0)
|
||||
ClassHelper.File_open(ClassWindreamDocGrid.RESULT_DOC_PATH, 0)
|
||||
End Sub
|
||||
|
||||
Private Sub DateiÖffnenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DateiÖffnenToolStripMenuItem.Click
|
||||
ClassHelper.File_open(RESULT_DOC_PATH, 0)
|
||||
ClassHelper.File_open(ClassWindreamDocGrid.RESULT_DOC_PATH, 0)
|
||||
End Sub
|
||||
|
||||
Private Sub CopyToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CopyToolStripMenuItem.Click
|
||||
If RESULT_DOC_PATH <> Nothing Then
|
||||
If ClassWindreamDocGrid.RESULT_DOC_PATH <> Nothing Then
|
||||
Try
|
||||
Dim selectedfile(0) As String
|
||||
|
||||
selectedfile(0) = RESULT_DOC_PATH
|
||||
selectedfile(0) = ClassWindreamDocGrid.RESULT_DOC_PATH
|
||||
|
||||
Dim dataobj As New DataObject
|
||||
|
||||
@ -354,7 +367,7 @@ Public Class frmRecordView
|
||||
End Sub
|
||||
|
||||
Private Sub DeleteToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DeleteToolStripMenuItem.Click
|
||||
If RESULT_DOC_PATH <> Nothing Then
|
||||
If ClassWindreamDocGrid.RESULT_DOC_PATH <> Nothing Then
|
||||
Dim msg = "Sind Sie sicher, dass Sie diese Datei löschen wollen?"
|
||||
If USER_LANGUAGE <> "de-DE" Then
|
||||
msg = "Are You sure You want to delete this file?"
|
||||
@ -364,7 +377,7 @@ Public Class frmRecordView
|
||||
If result = MsgBoxResult.Yes Then
|
||||
Try
|
||||
Dim FileToDelete As String
|
||||
FileToDelete = RESULT_DOC_PATH
|
||||
FileToDelete = ClassWindreamDocGrid.RESULT_DOC_PATH
|
||||
|
||||
If System.IO.File.Exists(FileToDelete) = True Then
|
||||
System.IO.File.Delete(FileToDelete)
|
||||
@ -378,12 +391,12 @@ Public Class frmRecordView
|
||||
End Sub
|
||||
|
||||
Private Sub PropertiesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PropertiesToolStripMenuItem.Click
|
||||
If RESULT_DOC_PATH <> Nothing Then
|
||||
If ClassWindreamDocGrid.RESULT_DOC_PATH <> Nothing Then
|
||||
Cursor = Cursors.WaitCursor
|
||||
Dim sei As New SHELLEXECUTEINFO
|
||||
sei.cbSize = Marshal.SizeOf(sei)
|
||||
sei.lpVerb = "properties"
|
||||
sei.lpFile = RESULT_DOC_PATH
|
||||
sei.lpFile = ClassWindreamDocGrid.RESULT_DOC_PATH
|
||||
sei.nShow = SW_SHOW
|
||||
sei.fMask = SEE_MASK_INVOKEIDLIST
|
||||
If Not ShellExecuteEx(sei) Then
|
||||
@ -634,4 +647,8 @@ Public Class frmRecordView
|
||||
e.Appearance.BackColor = Color.Yellow
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GridViewDoc_Search_FocusedRowChanged_1(sender As Object, e As DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs) Handles GridViewDoc_Search.FocusedRowChanged
|
||||
ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
|
||||
End Sub
|
||||
End Class
|
||||
Loading…
x
Reference in New Issue
Block a user