MS
This commit is contained in:
@@ -6,48 +6,153 @@ 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
|
||||
Public Shared SELECTED_DOC_PATH As String
|
||||
'Public Shared RESULT_OBJECTTYPE As String
|
||||
Public Shared SELECTED_INWORK As Boolean
|
||||
Public Shared SELECTED_DOC_ID As Integer
|
||||
'Public Shared RESULT_DISPLAYNAME As String
|
||||
Public Shared RESULT_CONFIG_IDS As Hashtable
|
||||
|
||||
Public Shared DT_RESULTFILES As DataTable
|
||||
|
||||
Private Shared _dropdownValueChangedHandler As EventHandler
|
||||
Private Shared _datepickerValueChangedHandler As EventHandler
|
||||
Private Shared _textValueChangedHandler As EventHandler
|
||||
|
||||
Private Shared Function Init_Table()
|
||||
Try
|
||||
Dim table As New DataTable
|
||||
table.TableName = "TBSELECTED_FILES"
|
||||
' Create two columns, ID and Name.
|
||||
table.Columns.Add("DOC_ID", GetType(Integer))
|
||||
table.Columns.Add("DOC_PATH", GetType(System.String))
|
||||
table.Columns.Add("OBJECTTYPE", GetType(System.String))
|
||||
table.Columns.Add("INWORK", GetType(System.Boolean))
|
||||
table.Columns.Add("DISPLAYNAME", GetType(System.String))
|
||||
DT_RESULTFILES = table
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in Initting TableResult Docs: " & ex.Message, True)
|
||||
DT_RESULTFILES = Nothing
|
||||
Return False
|
||||
End Try
|
||||
|
||||
End Function
|
||||
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
|
||||
If Init_Table() = True Then
|
||||
If gridView.SelectedRowsCount > 0 Then
|
||||
DT_RESULTFILES.Clear()
|
||||
For Each row In gridView.GetSelectedRows
|
||||
Dim newRow As DataRow = DT_RESULTFILES.NewRow()
|
||||
Try
|
||||
Dim DOC_ID = gridView.GetRowCellValue(row, "DocID")
|
||||
SELECTED_DOC_ID = DOC_ID
|
||||
newRow("DOC_ID") = gridView.GetRowCellValue(row, "DocID")
|
||||
Catch ex As Exception
|
||||
newRow("DOC_ID") = 0
|
||||
End Try
|
||||
Try
|
||||
SELECTED_DOC_PATH = gridView.GetRowCellValue(row, "FULLPATH")
|
||||
newRow("DOC_PATH") = gridView.GetRowCellValue(row, "FULLPATH")
|
||||
Catch ex As Exception
|
||||
newRow("DOC_PATH") = ""
|
||||
End Try
|
||||
Try
|
||||
newRow("OBJECTTYPE") = gridView.GetRowCellValue(row, "OBJECTTYPE")
|
||||
Catch ex As Exception
|
||||
newRow("OBJECTTYPE") = ""
|
||||
End Try
|
||||
Try
|
||||
newRow("INWORK") = gridView.GetRowCellValue(row, "in work?")
|
||||
Catch ex As Exception
|
||||
newRow("INWORK") = False
|
||||
End Try
|
||||
Try
|
||||
Dim dpn = gridView.GetRowCellValue(row, "Displayname")
|
||||
If IsDBNull(dpn) Then
|
||||
dpn = ""
|
||||
End If
|
||||
newRow("DISPLAYNAME") = dpn
|
||||
Catch ex As Exception
|
||||
newRow("DISPLAYNAME") = ""
|
||||
End Try
|
||||
DT_RESULTFILES.Rows.Add(newRow)
|
||||
DT_RESULTFILES.AcceptChanges()
|
||||
Next
|
||||
Else
|
||||
Dim newRow As DataRow = DT_RESULTFILES.NewRow()
|
||||
Try
|
||||
Dim DOC_ID = gridView.GetFocusedRowCellValue(gridView.Columns("DocID"))
|
||||
SELECTED_DOC_ID = DOC_ID
|
||||
newRow("DOC_ID") = gridView.GetFocusedRowCellValue(gridView.Columns("DocID"))
|
||||
Catch ex As Exception
|
||||
newRow("DOC_ID") = 0
|
||||
End Try
|
||||
Try
|
||||
SELECTED_DOC_PATH = gridView.GetFocusedRowCellValue(gridView.Columns("FULLPATH"))
|
||||
newRow("DOC_PATH") = gridView.GetFocusedRowCellValue(gridView.Columns("FULLPATH"))
|
||||
Catch ex As Exception
|
||||
newRow("DOC_PATH") = ""
|
||||
End Try
|
||||
Try
|
||||
newRow("OBJECTTYPE") = gridView.GetFocusedRowCellValue(gridView.Columns("OBJECTTYPE"))
|
||||
Catch ex As Exception
|
||||
newRow("OBJECTTYPE") = ""
|
||||
End Try
|
||||
Try
|
||||
newRow("INWORK") = gridView.GetFocusedRowCellValue(gridView.Columns("in work?"))
|
||||
Catch ex As Exception
|
||||
newRow("INWORK") = False
|
||||
End Try
|
||||
Try
|
||||
Dim dpn = gridView.GetFocusedRowCellValue(gridView.Columns("Displayname"))
|
||||
If IsDBNull(dpn) Then
|
||||
dpn = ""
|
||||
End If
|
||||
newRow("DISPLAYNAME") = dpn
|
||||
Catch ex As Exception
|
||||
newRow("DISPLAYNAME") = ""
|
||||
End Try
|
||||
DT_RESULTFILES.Rows.Add(newRow)
|
||||
DT_RESULTFILES.AcceptChanges()
|
||||
End If
|
||||
|
||||
End If
|
||||
'If gridView.SelectedRowsCount = 1 Then
|
||||
' 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
|
||||
'Else
|
||||
|
||||
|
||||
'End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Sub FillColumns(gridView As GridView, DT_RESULT As DataTable, DT_WINDREAM_RESULTLIST As DataTable, DT_DOCRESULT_DROPDOWN_ITEMS As DataTable, DropdownValueChangedHandler As EventHandler, DatepickerValueChangedHandler As EventHandler, TextValueChangedHandler As EventHandler)
|
||||
|
||||
Reference in New Issue
Block a user