Formatierung der DateTime-Spalten im Grid Overview - Load_Grid_Overview
This commit is contained in:
parent
0cca734cd0
commit
2727548bde
@ -2155,64 +2155,41 @@ Public Class frmMain
|
||||
LOGGER.Error(ex)
|
||||
End Try
|
||||
End If
|
||||
|
||||
RestoreLayout()
|
||||
|
||||
Try
|
||||
Dim oSQLFormat = "SELECT * FROM TBDD_COLUMNS_FORMAT WHERE MODULE = 'taskFLOW' AND GRIDVIEW = 'GridViewWorkflows'"
|
||||
Dim dtColFormat As DataTable = Await DatabaseFallback.GetDatatableECMAsync(oSQLFormat)
|
||||
|
||||
'Dim oSQl = "SELECT * FROM TBDD_COLUMNS_FORMAT where MODULE = 'taskFLOW'"
|
||||
'Dim DTColumsFormat As DataTable = DatabaseFallback.GetDatatable("TBDD_COLUMNS_FORMAT", New GetDatatableOptions(oSQl, DatabaseType.ECM))
|
||||
For Each oColumn As DevExpress.XtraGrid.Columns.GridColumn In GridViewWorkflows.Columns
|
||||
|
||||
'For Each oColumn As Columns.GridColumn In GridViewWorkflows.Columns
|
||||
' For Each oRow As DataRow In DTColumsFormat.Rows
|
||||
For Each oRow As DataRow In dtColFormat.Rows
|
||||
Dim colName = oRow("COLUMN_TITLE").ToString()
|
||||
|
||||
' Dim oColumnName = oColumn.FieldName
|
||||
' If oColumnName = oRow.Item("COLUMN_TITLE").ToString Then
|
||||
If oColumn.FieldName = colName Then
|
||||
Dim oSollFormatType = oRow("TYPE2FORMAT").ToString()
|
||||
|
||||
' Dim oFormat = oRow.Item("TYPE2FORMAT").ToString
|
||||
' If oFormat = "DateTime" Then
|
||||
If oSollFormatType = "DateTime" Then
|
||||
|
||||
' If DT_CURR_WF_ITEMS.Columns.Contains(oColumnName) Then
|
||||
' Dim oColumnType = DT_CURR_WF_ITEMS.Columns(oColumnName).DataType
|
||||
' If oColumnType IsNot GetType(DateTime) Then
|
||||
' Continue For
|
||||
' End If
|
||||
' End If
|
||||
If oColumn.ColumnType <> GetType(DateTime) Then
|
||||
oColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime
|
||||
End If
|
||||
|
||||
' If oColumn.DisplayFormat.FormatType <> FormatType.DateTime Then
|
||||
' oColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
' oColumn.DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
|
||||
' End If
|
||||
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
'Next
|
||||
|
||||
|
||||
'For Each oColumn As Columns.GridColumn In GridViewWorkflows.Columns
|
||||
|
||||
' If DT_CURR_WF_ITEMS.Columns.Contains(oColumn.FieldName) Then
|
||||
' Dim dtColumn As DataColumn = DT_CURR_WF_ITEMS.Columns(oColumn.FieldName)
|
||||
|
||||
' If dtColumn.DataType Is GetType(String) Then
|
||||
' For Each row As DataRow In DT_CURR_WF_ITEMS.Rows
|
||||
' Dim cellValue = row(oColumn.FieldName).ToString()
|
||||
' Dim dateValue As DateTime
|
||||
|
||||
' If DateTime.TryParse(cellValue, dateValue) Then
|
||||
' row(oColumn.FieldName) = dateValue
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' dtColumn.DataType = GetType(DateTime)
|
||||
|
||||
' oColumn.DisplayFormat.FormatType = FormatType.DateTime
|
||||
' oColumn.DisplayFormat.FormatString = "dd.MM.yyyy HH:mm:ss"
|
||||
' End If
|
||||
' End If
|
||||
'Next
|
||||
If oColumn.ColumnType = GetType(DateTime) And oColumn.DisplayFormat.FormatString <> "dd.MM.yyyy HH:mm:ss" Then
|
||||
oColumn.DisplayFormat.FormatString = "dd.MM.yyyy HH:mm:ss"
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
Catch ex As Exception
|
||||
LOGGER.Warn("Fehler beim Anwenden der Formatierung aus TBDD_COLUMNS_FORMAT: " & ex.Message)
|
||||
End Try
|
||||
|
||||
oStopWatch.Done()
|
||||
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
LOGGER.Info("Load_Grid_Overview - Fehler: " & ex.Message)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user