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)
|
LOGGER.Error(ex)
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
|
|
||||||
RestoreLayout()
|
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'"
|
For Each oColumn As DevExpress.XtraGrid.Columns.GridColumn In GridViewWorkflows.Columns
|
||||||
'Dim DTColumsFormat As DataTable = DatabaseFallback.GetDatatable("TBDD_COLUMNS_FORMAT", New GetDatatableOptions(oSQl, DatabaseType.ECM))
|
|
||||||
|
|
||||||
'For Each oColumn As Columns.GridColumn In GridViewWorkflows.Columns
|
For Each oRow As DataRow In dtColFormat.Rows
|
||||||
' For Each oRow As DataRow In DTColumsFormat.Rows
|
Dim colName = oRow("COLUMN_TITLE").ToString()
|
||||||
|
|
||||||
' Dim oColumnName = oColumn.FieldName
|
If oColumn.FieldName = colName Then
|
||||||
' If oColumnName = oRow.Item("COLUMN_TITLE").ToString Then
|
Dim oSollFormatType = oRow("TYPE2FORMAT").ToString()
|
||||||
|
|
||||||
' Dim oFormat = oRow.Item("TYPE2FORMAT").ToString
|
If oSollFormatType = "DateTime" Then
|
||||||
' If oFormat = "DateTime" Then
|
|
||||||
|
|
||||||
' If DT_CURR_WF_ITEMS.Columns.Contains(oColumnName) Then
|
If oColumn.ColumnType <> GetType(DateTime) Then
|
||||||
' Dim oColumnType = DT_CURR_WF_ITEMS.Columns(oColumnName).DataType
|
oColumn.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime
|
||||||
' If oColumnType IsNot GetType(DateTime) Then
|
End If
|
||||||
' Continue For
|
|
||||||
' End If
|
|
||||||
' End If
|
|
||||||
|
|
||||||
' If oColumn.DisplayFormat.FormatType <> FormatType.DateTime Then
|
If oColumn.ColumnType = GetType(DateTime) And oColumn.DisplayFormat.FormatString <> "dd.MM.yyyy HH:mm:ss" Then
|
||||||
' oColumn.DisplayFormat.FormatType = FormatType.DateTime
|
oColumn.DisplayFormat.FormatString = "dd.MM.yyyy HH:mm:ss"
|
||||||
' oColumn.DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
|
End If
|
||||||
' 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
|
|
||||||
|
|
||||||
|
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()
|
oStopWatch.Done()
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
LOGGER.Error(ex)
|
LOGGER.Error(ex)
|
||||||
LOGGER.Info("Load_Grid_Overview - Fehler: " & ex.Message)
|
LOGGER.Info("Load_Grid_Overview - Fehler: " & ex.Message)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user