diff --git a/app/DD-Record-Organizer/frmNodeNavigation.vb b/app/DD-Record-Organizer/frmNodeNavigation.vb index 6205dd6..9e62ead 100644 --- a/app/DD-Record-Organizer/frmNodeNavigation.vb +++ b/app/DD-Record-Organizer/frmNodeNavigation.vb @@ -2799,75 +2799,74 @@ LOGGER.Error(ex) 'End Sub Private Sub GridViewDoc_Search_RowStyle(sender As Object, e As RowStyleEventArgs) Handles GridViewDoc_Search.RowStyle - 'TODO: Refactor RowStyle maybe - 'If e.RowHandle = DevExpress.XtraGrid.GridControl.AutoFilterRowHandle Then - ' e.Appearance.BackColor = Color.Yellow - 'Else - ' If e.RowHandle = -1 Then - ' Exit Sub - ' End If - ' Try - ' Dim rowCellValue = GridViewDoc_Search.GetRowCellValue(e.RowHandle, "in work?") - ' If Not IsNothing(rowCellValue) Then - ' Dim inwork = rowCellValue - ' If inwork = True Then - ' e.Appearance.BackColor = Color.Orchid - ' e.HighPriority = True - ' End If - ' End If - ' Catch ex As Exception - ' LOGGER.Warn("Unexpected Error in Checking Value In Work: " & ex.Message) - ' End Try + If e.RowHandle = DevExpress.XtraGrid.GridControl.AutoFilterRowHandle Then + e.Appearance.BackColor = Color.Yellow + Else + If e.RowHandle = -1 Then + Exit Sub + End If + Try + Dim rowCellValue = GridViewDoc_Search.GetRowCellValue(e.RowHandle, "in work?") + If Not IsNothing(rowCellValue) Then + Dim inwork = rowCellValue + If inwork = True Then + e.Appearance.BackColor = Color.Orchid + e.HighPriority = True + End If + End If + Catch ex As Exception + LOGGER.Warn("Unexpected Error in Checking Value In Work: " & ex.Message) + End Try - ' Try - ' Dim DROPDOWN_VALUE - ' If Not IsNothing(DT_DOCRESULT_DROPDOWN_ITEMS) Then - ' 'Den ColumnTitle aus ConfigTableholen - ' If DT_DOCRESULT_DROPDOWN_ITEMS.Rows.Count > 0 Then - ' For Each confrow As DataRow In DT_DOCRESULT_DROPDOWN_ITEMS.Rows - ' Dim CAPTION = confrow.Item("HEADER_CAPTION") - ' DROPDOWN_VALUE = GridViewDoc_Search.GetRowCellValue(e.RowHandle, CAPTION) - ' If Not IsNothing(DROPDOWN_VALUE) Then - ' Exit For - ' End If - ' Next + Try + Dim DROPDOWN_VALUE + If Not IsNothing(DT_DOCRESULT_DROPDOWN_ITEMS) Then + 'Den ColumnTitle aus ConfigTableholen + If DT_DOCRESULT_DROPDOWN_ITEMS.Rows.Count > 0 Then + For Each confrow As DataRow In DT_DOCRESULT_DROPDOWN_ITEMS.Rows + Dim CAPTION = confrow.Item("HEADER_CAPTION") + DROPDOWN_VALUE = GridViewDoc_Search.GetRowCellValue(e.RowHandle, CAPTION) + If Not IsNothing(DROPDOWN_VALUE) Then + Exit For + End If + Next - ' If Not IsNothing(DROPDOWN_VALUE) Then - ' Dim ColorRow As Color - ' Dim expression As String = String.Format("VALUE = '{0}'", DROPDOWN_VALUE) - ' Dim matchingRows() As DataRow = DT_DOCRESULT_DROPDOWN_ITEMS.Select(expression, "SEQUENCE") - ' Dim rowcolorname As String = "" - ' 'Die Color für den value auswählen - ' For Each matchingRow As DataRow In matchingRows - ' rowcolorname = "" - ' If Not IsDBNull(matchingRow.Item("COLOR")) Then - ' rowcolorname = matchingRow.Item("COLOR") - ' End If + If Not IsNothing(DROPDOWN_VALUE) Then + Dim ColorRow As Color + Dim expression As String = String.Format("VALUE = '{0}'", DROPDOWN_VALUE) + Dim matchingRows() As DataRow = DT_DOCRESULT_DROPDOWN_ITEMS.Select(expression, "SEQUENCE") + Dim rowcolorname As String = "" + 'Die Color für den value auswählen + For Each matchingRow As DataRow In matchingRows + rowcolorname = "" + If Not IsDBNull(matchingRow.Item("COLOR")) Then + rowcolorname = matchingRow.Item("COLOR") + End If - ' If rowcolorname <> "" Then - ' Exit For - ' End If - ' Next - ' If rowcolorname <> "" Then - ' ColorRow = Color.FromName(rowcolorname) - ' e.Appearance.BackColor = ColorRow - ' e.HighPriority = True - ' End If + If rowcolorname <> "" Then + Exit For + End If + Next + If rowcolorname <> "" Then + ColorRow = Color.FromName(rowcolorname) + e.Appearance.BackColor = ColorRow + e.HighPriority = True + End If - ' 'Dim c As Color = DirectCast(rowCellValue, Color) + 'Dim c As Color = DirectCast(rowCellValue, Color) - ' End If - ' End If + End If + End If - ' End If - ' Catch ex As Exception - ' LOGGER.Error(ex) - ' LOGGER.Warn("Unexpected Error in RowStyle-Color Dropdown: " & ex.Message) - ' End Try + End If + Catch ex As Exception + LOGGER.Error(ex) + LOGGER.Warn("Unexpected Error in RowStyle-Color Dropdown: " & ex.Message) + End Try - 'End If + End If End Sub Private Async Function BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) As Task Handles BbtnitmNodeReorder.ItemClick