From 9d77f906e01730af06d79a95973997d55338dac2 Mon Sep 17 00:00:00 2001 From: Digital Data - Marlon Schreiber Date: Wed, 30 Dec 2020 14:10:28 +0100 Subject: [PATCH] MS --- app/DD_PM_WINDREAM/ClassFinalizeDoc.vb | 2 +- app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb | 2 +- app/DD_PM_WINDREAM/clsPatterns.vb | 12 +- app/DD_PM_WINDREAM/frmInvDashboard.vb | 2 +- app/DD_PM_WINDREAM/frmMain.vb | 4 +- app/DD_PM_WINDREAM/frmMassValidator.vb | 2 +- app/DD_PM_WINDREAM/frmMonitor.vb | 108 ++++++++++-------- .../frmSQL_DESIGNER.Designer.vb | 2 +- app/DD_PM_WINDREAM/frmValidator.vb | 2 +- app/DD_PM_WINDREAM/frmValidatorSearch.vb | 2 +- 10 files changed, 80 insertions(+), 58 deletions(-) diff --git a/app/DD_PM_WINDREAM/ClassFinalizeDoc.vb b/app/DD_PM_WINDREAM/ClassFinalizeDoc.vb index d7a0f13..1ade590 100644 --- a/app/DD_PM_WINDREAM/ClassFinalizeDoc.vb +++ b/app/DD_PM_WINDREAM/ClassFinalizeDoc.vb @@ -37,7 +37,7 @@ ' LOGGER.Info("Unexpected Error in Checking control values for Variable SQL Result - ERROR: " & ex.Message) ' End Try 'Next - Dim sql_Statement = clsPatterns.ReplaceUserValues(dr.Item("SQL_COMMAND"), USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID) + Dim sql_Statement = clsPatterns.ReplaceUserValues(dr.Item("SQL_COMMAND"), USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID, CURRENT_CLICKED_PROFILE_TITLE) sql_Statement = clsPatterns.ReplaceInternalValues(sql_Statement) sql_Statement = clsPatterns.ReplaceWindreamIndicies(sql_Statement, WMObject, True) LOGGER.Debug("sql after ReplaceAllValues: " & sql_Statement) diff --git a/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb b/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb index e38ba03..56bd4aa 100644 --- a/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb +++ b/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/app/DD_PM_WINDREAM/clsPatterns.vb b/app/DD_PM_WINDREAM/clsPatterns.vb index d8ac63a..bc1a8d5 100644 --- a/app/DD_PM_WINDREAM/clsPatterns.vb +++ b/app/DD_PM_WINDREAM/clsPatterns.vb @@ -29,7 +29,8 @@ Public Class clsPatterns Public Const USER_VALUE_SHORTNAME = "SHORTNAME" Public Const USER_VALUE_LANGUAGE = "LANGUAGE" Public Const USER_VALUE_USER_ID = "USER_ID" - Public Const USER_VALUE_PROFILE_ID = "PROFILE_ID" + Public Const VALUE_PROFILE_ID = "PROFILE_ID" + Public Const VALUE_PROFILE_TITLE = "PROFILE_TITLE" Public Const INT_VALUE_USERNAME = "USERNAME" Public Const INT_VALUE_MACHINE = "MACHINE" @@ -64,7 +65,7 @@ Public Class clsPatterns result = ReplaceIDBAttributes(result, is_SQL) End If If Not IsNothing(result) Then - result = ReplaceUserValues(result, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID) + result = ReplaceUserValues(result, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID, CURRENT_CLICKED_PROFILE_TITLE) LOGGER.Debug($"input AFTER replacing: [{result}]") End If @@ -106,7 +107,7 @@ Public Class clsPatterns End Try End Function - Public Shared Function ReplaceUserValues(input As String, prename As Object, surname As Object, shortname As Object, language As String, email As Object, userId As Object, profileId As Object) As String + Public Shared Function ReplaceUserValues(input As String, prename As Object, surname As Object, shortname As Object, language As String, email As Object, userId As Object, profileId As Object, profileTITLE As Object) As String Try Dim result = input @@ -136,9 +137,12 @@ Public Class clsPatterns result = ReplacePattern(result, PATTERN_USER, email) End While - While ContainsPatternAndValue(result, PATTERN_USER, USER_VALUE_PROFILE_ID) + While ContainsPatternAndValue(result, PATTERN_USER, VALUE_PROFILE_ID) result = ReplacePattern(result, PATTERN_USER, profileId) End While + While ContainsPatternAndValue(result, PATTERN_USER, VALUE_PROFILE_TITLE) + result = ReplacePattern(result, PATTERN_USER, profileTITLE) + End While LOGGER.Debug("pInput AFTER ReplaceUserValues: " & input) Return result Catch ex As Exception diff --git a/app/DD_PM_WINDREAM/frmInvDashboard.vb b/app/DD_PM_WINDREAM/frmInvDashboard.vb index 7aa0b61..2b13d28 100644 --- a/app/DD_PM_WINDREAM/frmInvDashboard.vb +++ b/app/DD_PM_WINDREAM/frmInvDashboard.vb @@ -107,7 +107,7 @@ Public Class frmInvDashboard Dim oSqlchart = cRow.Item("SQL_COMMAND") oSqlchart = clsPatterns.ReplaceInternalValues(oSqlchart) - oSqlchart = clsPatterns.ReplaceUserValues(oSqlchart, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID) + oSqlchart = clsPatterns.ReplaceUserValues(oSqlchart, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID, CURRENT_CLICKED_PROFILE_TITLE) oSqlchart = oSqlchart.ToString.ToUpper.Replace("@USER_ID", USER_ID) oSqlchart = oSqlchart.ToString.ToUpper.Replace("@USER", USER_USERNAME) diff --git a/app/DD_PM_WINDREAM/frmMain.vb b/app/DD_PM_WINDREAM/frmMain.vb index 1f8f5fa..ce33ff6 100644 --- a/app/DD_PM_WINDREAM/frmMain.vb +++ b/app/DD_PM_WINDREAM/frmMain.vb @@ -722,7 +722,7 @@ Public Class frmMain Dim oSQL = foundRows(0)("SQL_VIEW") oSQL = clsPatterns.ReplaceInternalValues(oSQL) - oSQL = clsPatterns.ReplaceUserValues(oSQL, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID) + oSQL = clsPatterns.ReplaceUserValues(oSQL, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID, CURRENT_CLICKED_PROFILE_TITLE) oSQL = oSQL.Replace("@USER_ID", USER_ID) oSQL = oSQL.Replace("@USERNAME", USER_USERNAME) @@ -1632,7 +1632,7 @@ Public Class frmMain End If oSQLOverview = clsPatterns.ReplaceInternalValues(oSQLOverview) - oSQLOverview = clsPatterns.ReplaceUserValues(oSQLOverview, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID) + oSQLOverview = clsPatterns.ReplaceUserValues(oSQLOverview, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID, CURRENT_CLICKED_PROFILE_TITLE) oSQLOverview = oSQLOverview.Replace("@USER_ID", USER_ID) oSQLOverview = oSQLOverview.Replace("@USERNAME", USER_USERNAME) diff --git a/app/DD_PM_WINDREAM/frmMassValidator.vb b/app/DD_PM_WINDREAM/frmMassValidator.vb index 6eec2bc..eea6672 100644 --- a/app/DD_PM_WINDREAM/frmMassValidator.vb +++ b/app/DD_PM_WINDREAM/frmMassValidator.vb @@ -1044,7 +1044,7 @@ Public Class frmMassValidator Continue For End If - sql = clsPatterns.ReplaceUserValues(sqlStatement, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID) + sql = clsPatterns.ReplaceUserValues(sqlStatement, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID, CURRENT_CLICKED_PROFILE_TITLE) sql = clsPatterns.ReplaceInternalValues(sql) LOGGER.Debug(">>> sql after ReplaceInternalValues: " & sql) 'sql = ClassPatterns.ReplaceInternalValues(sqlStatement) diff --git a/app/DD_PM_WINDREAM/frmMonitor.vb b/app/DD_PM_WINDREAM/frmMonitor.vb index a6b0531..e8d7b30 100644 --- a/app/DD_PM_WINDREAM/frmMonitor.vb +++ b/app/DD_PM_WINDREAM/frmMonitor.vb @@ -23,6 +23,7 @@ Public Class frmMonitor End Sub Sub Load_Detail() If FormShown = False Then Exit Sub + Dim oDocPath As String = String.Empty Try Dim oDocID Try @@ -40,7 +41,7 @@ Public Class frmMonitor If IsNothing(oDocID) Then Exit Sub End If - Dim oDocPath + Try oDocPath = GridView1.GetFocusedRowCellValue(GridView1.Columns("FULL_FILE_PATH")) Catch ex As Exception @@ -48,64 +49,77 @@ Public Class frmMonitor oDocPath = String.Empty End Try BarStaticItemInfoDoc.Caption = $"DocID: {oDocID} - Docpath: {oDocPath}" - Dim oDetailSQL = GRID2_SQL - oDetailSQL = oDetailSQL.Replace("@DocID", oDocID) - oDetailSQL = oDetailSQL.Replace("@IDBOBJID", oDocID) - oDetailSQL = oDetailSQL.Replace("@UserID", USER_ID) - oDetailSQL = oDetailSQL.Replace("@UserName", USER_USERNAME) - Dim oDT2 As DataTable = ClassDatabase.Return_Datatable(oDetailSQL, "Monitor_Detail1") - If Not IsNothing(oDT2) Then - LOGGER.Debug($"Found {oDT2.Rows.Count} rows for GridView2") - GridView2.Columns.Clear() - GridControl2.DataSource = oDT2 - Try - GridView2.Columns("Wann").DisplayFormat.FormatType = FormatType.DateTime - GridView2.Columns("Wann").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" - Catch ex As Exception - GridView2.Columns("When").DisplayFormat.FormatType = FormatType.DateTime - GridView2.Columns("When").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" - End Try - - End If - If DT_MONITOR_KONFIG.Rows.Count > 2 Then - oDetailSQL = GRID3_SQL + If Not IsNothing(GRID2_SQL) Then + Dim oDetailSQL = GRID2_SQL oDetailSQL = oDetailSQL.Replace("@DocID", oDocID) oDetailSQL = oDetailSQL.Replace("@IDBOBJID", oDocID) oDetailSQL = oDetailSQL.Replace("@UserID", USER_ID) oDetailSQL = oDetailSQL.Replace("@UserName", USER_USERNAME) - Dim oDT3 As DataTable = ClassDatabase.Return_Datatable(oDetailSQL, "Monitor_Detail2") - If Not IsNothing(oDT3) Then - LOGGER.Debug($"Found {oDT3.Rows.Count} rows for GridView3") - GridView3.Columns.Clear() - GridControl3.DataSource = oDT3 + Dim oDT2 As DataTable = ClassDatabase.Return_Datatable(oDetailSQL, "Monitor_Detail1") + If Not IsNothing(oDT2) Then + LOGGER.Debug($"Found {oDT2.Rows.Count} rows for GridView2") + GridView2.Columns.Clear() + GridControl2.DataSource = oDT2 + Try + GridView2.Columns("Wann").DisplayFormat.FormatType = FormatType.DateTime + GridView2.Columns("Wann").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" + Catch ex As Exception + GridView2.Columns("When").DisplayFormat.FormatType = FormatType.DateTime + GridView2.Columns("When").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" + End Try + End If - If DT_MONITOR_KONFIG.Rows.Count = 4 Then - oDetailSQL = GRID4_SQL + If DT_MONITOR_KONFIG.Rows.Count > 2 Then + LOGGER.Debug($"DT_MONITOR_KONFIG.Rows.Count > 2") + oDetailSQL = GRID3_SQL oDetailSQL = oDetailSQL.Replace("@DocID", oDocID) oDetailSQL = oDetailSQL.Replace("@IDBOBJID", oDocID) oDetailSQL = oDetailSQL.Replace("@UserID", USER_ID) oDetailSQL = oDetailSQL.Replace("@UserName", USER_USERNAME) - Dim oDT4 As DataTable = ClassDatabase.Return_Datatable(oDetailSQL, "Monitor_Detail3") - If Not IsNothing(oDT4) Then - LOGGER.Debug($"Found {oDT4.Rows.Count} rows for GridView4") - GridView4.Columns.Clear() - GridControl4.DataSource = oDT4 - Try - GridView4.Columns("Geändert wann").DisplayFormat.FormatType = FormatType.DateTime - GridView4.Columns("Geändert wann").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" - Catch ex As Exception - GridView4.Columns("Changed when").DisplayFormat.FormatType = FormatType.DateTime - GridView4.Columns("Changed when").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" - End Try + Dim oDT3 As DataTable = ClassDatabase.Return_Datatable(oDetailSQL, "Monitor_Detail2") + LOGGER.Debug($"oDetailSQL for Grid 3: {oDetailSQL}") + If Not IsNothing(oDT3) Then + LOGGER.Debug($"Found {oDT3.Rows.Count} rows for GridView3") + GridView3.Columns.Clear() + GridControl3.DataSource = oDT3 + End If + If DT_MONITOR_KONFIG.Rows.Count = 4 Then + LOGGER.Debug($"DT_MONITOR_KONFIG.Rows.Count = 4") + oDetailSQL = GRID4_SQL + oDetailSQL = oDetailSQL.Replace("@DocID", oDocID) + oDetailSQL = oDetailSQL.Replace("@IDBOBJID", oDocID) + oDetailSQL = oDetailSQL.Replace("@UserID", USER_ID) + oDetailSQL = oDetailSQL.Replace("@UserName", USER_USERNAME) + LOGGER.Debug($"oDetailSQL for Grid 4: {oDetailSQL}") + Dim oDT4 As DataTable = ClassDatabase.Return_Datatable(oDetailSQL, "Monitor_Detail3") + If Not IsNothing(oDT4) Then + LOGGER.Debug($"Found {oDT4.Rows.Count} rows for GridView4") + GridView4.Columns.Clear() + GridControl4.DataSource = oDT4 + Try + GridView4.Columns("Geändert wann").DisplayFormat.FormatType = FormatType.DateTime + GridView4.Columns("Geändert wann").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" + Catch ex As Exception + GridView4.Columns("Changed when").DisplayFormat.FormatType = FormatType.DateTime + GridView4.Columns("Changed when").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss" + End Try + End If End If End If End If - Load_Doc(oDocPath) + + Catch ex As Exception - 'MsgBox(ex.Message, MsgBoxStyle.Critical, "Error GridView1.FocusedRowChanged:") + MsgBox(ex.Message, MsgBoxStyle.Critical, "Error GridView1.FocusedRowChanged:") + Finally + If oDocPath <> String.Empty Then + Load_Doc(oDocPath) + End If + End Try + End Sub Sub Load_Doc(oDocPath As String) Try @@ -120,7 +134,7 @@ Public Class frmMonitor DocumentViewerMonitor.LoadFile(oDocPath) BarStaticItemInfo.Visibility = DevExpress.XtraBars.BarItemVisibility.Never DocumentViewerMonitor.Visible = True - DocumentViewerMonitor.RightOnlyView(USER_RIGHT_VIEW_ONLY) + ' DocumentViewerMonitor.RightOnlyView(USER_RIGHT_VIEW_ONLY) Else BarStaticItemInfo.Visibility = DevExpress.XtraBars.BarItemVisibility.Always @@ -217,8 +231,11 @@ Public Class frmMonitor End If End If + Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in Load_Grid_Data:") + Finally + FormShown = True End Try End Function Sub LoadGrid1Layout() @@ -397,7 +414,8 @@ Public Class frmMonitor If oActiveGrid IsNot Nothing Then - XtraSaveFileDialog1.FileName = oActiveGrid.Name & ".xlsx" + XtraSaveFileDialog1.FileName = oActiveGrid.Name + XtraSaveFileDialog1.Filter = "Excel documents (.xlsx)|*.xlsx" XtraSaveFileDialog1.DefaultExt = ".xlsx" If XtraSaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then diff --git a/app/DD_PM_WINDREAM/frmSQL_DESIGNER.Designer.vb b/app/DD_PM_WINDREAM/frmSQL_DESIGNER.Designer.vb index ed08019..fe347fd 100644 --- a/app/DD_PM_WINDREAM/frmSQL_DESIGNER.Designer.vb +++ b/app/DD_PM_WINDREAM/frmSQL_DESIGNER.Designer.vb @@ -344,7 +344,7 @@ Partial Class frmSQL_DESIGNER 'cmbUser ' Me.cmbUser.FormattingEnabled = True - Me.cmbUser.Items.AddRange(New Object() {"PRENAME", "SURNAME", "SHORTNAME", "LANGUAGE", "EMAIL", "USER_ID", "PROFILE_ID"}) + Me.cmbUser.Items.AddRange(New Object() {"PRENAME", "SURNAME", "SHORTNAME", "LANGUAGE", "EMAIL", "USER_ID", "PROFILE_ID", "PROFILE_TITLE"}) Me.cmbUser.Location = New System.Drawing.Point(681, 86) Me.cmbUser.Name = "cmbUser" Me.cmbUser.Size = New System.Drawing.Size(194, 21) diff --git a/app/DD_PM_WINDREAM/frmValidator.vb b/app/DD_PM_WINDREAM/frmValidator.vb index 7d564e0..39c1cee 100644 --- a/app/DD_PM_WINDREAM/frmValidator.vb +++ b/app/DD_PM_WINDREAM/frmValidator.vb @@ -2724,7 +2724,7 @@ Public Class frmValidator End Sub Sub load_viewer() DocumentViewerValidator.LoadFile(WMDocPathWindows) - DocumentViewerValidator.RightOnlyView(USER_RIGHT_VIEW_ONLY) + ' DocumentViewerValidator.RightOnlyView(USER_RIGHT_VIEW_ONLY) If USER_RIGHT_VIEW_ONLY = True Then RibbonPageFile.Visible = False Else diff --git a/app/DD_PM_WINDREAM/frmValidatorSearch.vb b/app/DD_PM_WINDREAM/frmValidatorSearch.vb index 2663b4e..cd53d09 100644 --- a/app/DD_PM_WINDREAM/frmValidatorSearch.vb +++ b/app/DD_PM_WINDREAM/frmValidatorSearch.vb @@ -469,7 +469,7 @@ Public Class frmValidatorSearch If Not IsNothing(clsWMDocGrid.SELECTED_DOC_PATH) And Not IsNothing(DocumentViewer1) Then If clsWMDocGrid.SELECTED_DOC_PATH <> "" Then DocumentViewer1.LoadFile(clsWMDocGrid.SELECTED_DOC_PATH) - DocumentViewer1.RightOnlyView(USER_RIGHT_VIEW_ONLY) + DocumentViewer1.RightViewOnly(USER_RIGHT_VIEW_ONLY) If USER_RIGHT_VIEW_ONLY = True Then ToolStripDropDownButtonFile.Visible = False Else