This commit is contained in:
Jonathan Jenne
2018-02-07 08:55:05 +01:00
parent b1ccfeb450
commit 9a20a6c03b
6 changed files with 46 additions and 8 deletions

View File

@@ -3,6 +3,8 @@ Imports DLLLicenseManager
Imports DevExpress.LookAndFeel
Imports System.Globalization
Imports DevExpress.Utils
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Imports DevExpress.XtraGrid.Views.Grid
Public Class frmMain
Private _windreamPM As ClassPMWindream
@@ -159,19 +161,14 @@ Public Class frmMain
If Me.Visible = True And frmProfileDesigner.Visible = False Then
DTPROFIL = ClassDatabase.Return_Datatable("SELECT * FROM TBPM_PROFILE WHERE GUID = " & CURRENT_ProfilGUID)
PROFILE_COUNT = 0
Dim sql = String.Format("SELECT T.PROFIL_ID,T1.TITLE, T.DOC_ID, T.FILE_PATH, T.DMS_ERSTELLT_DATE,[dbo].[FNPM_LAST_WORKUSER_DOC] (T.PROFIL_ID,T.DOC_ID) AS 'Last User',[dbo].[FNPM_LAST_EDITED_DOC] (T.PROFIL_ID,T.DOC_ID) as 'Last edited' FROM TBPM_PROFILE_FILES T, VWPM_PROFILE_USER T1 " &
Dim sql = String.Format("SELECT '1' TL_STATE,T.PROFIL_ID,T1.TITLE, T.DOC_ID, T.FILE_PATH, T.DMS_ERSTELLT_DATE,[dbo].[FNPM_LAST_WORKUSER_DOC] (T.PROFIL_ID,T.DOC_ID) AS 'Last User',[dbo].[FNPM_LAST_EDITED_DOC] (T.PROFIL_ID,T.DOC_ID) as 'Last edited' FROM TBPM_PROFILE_FILES T, VWPM_PROFILE_USER T1 " &
"WHERE T.PROFIL_ID = T1.PROFIL_ID " &
"AND T1.ACTIVE = 1 And (UPPER(T1.USERNAME) = UPPER('{0}')) Order By T1.PRIORITY", Environment.UserName)
Dim DTGRID As DataTable = ClassDatabase.Return_Datatable(sql, True)
If Not IsNothing(DTGRID) Then
GridControlProfile.DataSource = DTGRID
Try
GridViewProfile.Columns.Item("PROFIL_ID").Visible = False
GridViewProfile.Columns("Last edited").DisplayFormat.FormatType = FormatType.DateTime
GridViewProfile.Columns("Last edited").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
Catch ex As Exception
GridControlProfile.ForceInitialize()
End Try
'Detail-Daten laden
Dim SQL_DETAILS
Try
@@ -183,6 +180,7 @@ Public Class frmMain
Dim DT_DETAILS As DataTable = ClassDatabase.Return_Datatable(SQL_DETAILS, True)
End If
Try
Dim XMLPath = GetXML_LayoutName()
GridViewProfile.RestoreLayoutFromXml(XMLPath)
@@ -190,6 +188,17 @@ Public Class frmMain
End Try
Try
GridViewProfile.Columns.Item("PROFIL_ID").Visible = False
GridViewProfile.Columns("Last edited").DisplayFormat.FormatType = FormatType.DateTime
GridViewProfile.Columns("Last edited").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
GridViewProfile.Columns.Item("TITLE").GroupIndex = 0
GridViewProfile.OptionsView.ShowGroupPanel = False
GridViewProfile.OptionsBehavior.AutoExpandAllGroups = True
Catch ex As Exception
End Try
Else
GridControlProfile.DataSource = Nothing
@@ -344,4 +353,28 @@ Public Class frmMain
Me.Visible = True
LoadProfile_PM()
End Sub
Private Sub GridViewProfile_CustomDrawGroupRow(sender As Object, e As DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs) Handles GridViewProfile.CustomDrawGroupRow
Dim info As GridGroupRowInfo = TryCast(e.Info, GridGroupRowInfo)
If info.Column.FieldName = "TITLE" Then
info.GroupText = info.GroupValueText
End If
End Sub
Private Sub GridViewProfile_RowCellStyle(sender As Object, e As RowCellStyleEventArgs) Handles GridViewProfile.RowCellStyle
Dim view As GridView = TryCast(sender, GridView)
If e.Column.FieldName = "TL_STATE" Then
If e.CellValue = "1" Then
e.Appearance.BackColor = Color.LightSalmon
ElseIf e.CellValue = "2" Then
e.Appearance.BackColor = Color.LightGoldenrodYellow
ElseIf e.CellValue = "3" Then
e.Appearance.BackColor = Color.LightGreen
End If
End If
End Sub
End Class