From 0cbb2d25bb653ba1d7de85f0d5066232b12c3434 Mon Sep 17 00:00:00 2001 From: Digital Data - Marlon Schreiber Date: Tue, 10 Apr 2018 15:37:15 +0200 Subject: [PATCH] Dataset --- .../ClassAllgemeineFunktionen.vb | 20 +++++- app/DD_PM_WINDREAM/ClassInit.vb | 36 ++++++---- app/DD_PM_WINDREAM/ClassWindream_allgemein.vb | 6 +- .../DD_DMSLiteDataSet.Designer.vb | 19 ++++- app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xsd | 44 ++++++------ app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xss | 28 ++++---- app/DD_PM_WINDREAM/ModuleRuntimeVariables.vb | 2 + app/DD_PM_WINDREAM/frmMain.vb | 48 +++++++++---- .../frmProfileDesigner.Designer.vb | 69 +++++++++---------- app/DD_PM_WINDREAM/frmProfileDesigner.vb | 7 ++ app/DD_PM_WINDREAM/frmSplash.vb | 1 + app/Setup/Product.wxs | 5 ++ 12 files changed, 179 insertions(+), 106 deletions(-) diff --git a/app/DD_PM_WINDREAM/ClassAllgemeineFunktionen.vb b/app/DD_PM_WINDREAM/ClassAllgemeineFunktionen.vb index 3d2ec99..ebafdfd 100644 --- a/app/DD_PM_WINDREAM/ClassAllgemeineFunktionen.vb +++ b/app/DD_PM_WINDREAM/ClassAllgemeineFunktionen.vb @@ -4,6 +4,24 @@ Imports System.IO Imports WINDREAMLib Public Class ClassAllgemeineFunktionen + Public Shared Sub LoginOut(LoginOut As String) + Try + Dim Sql As String + If LoginOut = "LOGIN" Then + Sql = String.Format("INSERT INTO TBDD_USER_MODULE_LOG_IN (USER_ID,CLIENT_ID,MODULE,VERSION_CLIENT,MACHINE_NAME) VALUES ({0},{1},'Process-Manager','{2}','{3}')", CURRENT_USERID, 1, My.Application.Info.Version.ToString, Environment.MachineName) + Else + Sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & CURRENT_USERID & " AND UPPER(MODULE) = UPPER('Process-Manager')" + End If + If ClassDatabase.Execute_non_Query(Sql, True) = False Then + If LogErrorsOnly = False Then ClassLogger.Add(" >> User logged in....", False) + Else + ClassLogger.Add(" >> User could not be logged in....", False) + End If + Catch ex As Exception + ClassLogger.Add("Error in LoginOut: " & ex.Message) + End Try + End Sub + Public Function Insert_LogEntry(PROFIL_ID As String, ERR_MSG As String, USR As String) Try If IsNumeric(PROFIL_ID) Then @@ -15,7 +33,7 @@ Public Class ClassAllgemeineFunktionen Catch ex As Exception ClassLogger.Add("Error in Insert_LogEntry: " & ex.Message) End Try - + End Function Public Function ExecuteonMSSQL(ByVal sqlcommand As String, ConString As String) diff --git a/app/DD_PM_WINDREAM/ClassInit.vb b/app/DD_PM_WINDREAM/ClassInit.vb index 0434124..90c090c 100644 --- a/app/DD_PM_WINDREAM/ClassInit.vb +++ b/app/DD_PM_WINDREAM/ClassInit.vb @@ -20,7 +20,6 @@ Public Class ClassInit Public Sub InitUserConfig() Settings_Load() End Sub - Public Function InitDatabase() Dim dbResult As Boolean @@ -46,8 +45,8 @@ Public Class ClassInit ' Windream instanziieren _windreamPM = New ClassPMWindream() 'Windream initialisieren (Connection, Session, ... aufbauen) - _windreamPM.Init() - Return True + Return _windreamPM.Init() + Catch ex As Exception MsgBox("Fehler bei Initialisieren von windream: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") Return False @@ -70,10 +69,11 @@ Public Class ClassInit LICENSE_EXPIRED = True LICENSE_COUNT = 0 End If - + If LogErrorsOnly = False Then ClassLogger.Add(" >> license initialized....", False) LICENSE_PROFILES = split(2) Catch ex As Exception + ClassLogger.Add("Unexpected error in Refresh license: " & ex.Message, True) MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei Licensemanager:") End Try End Sub @@ -91,41 +91,47 @@ Public Class ClassInit ERROR_STATE = "NO USER" Throw New Exception("You are not configured in the Useradministration." & vbNewLine & "Please contact the system administrator!") Else + If IsNothing(CURRENT_USERID) Then ClassLogger.Add(" - User: " & USER_USERNAME & " ' not configured in Useradministration! (nothing)", False) ERROR_STATE = "NO USER" Throw New Exception("You are not configured in the Useradministration." & vbNewLine & "Please contact the system administrator!") Else + If LogErrorsOnly = False Then ClassLogger.Add(" >> User exists....", False) 'Am System anmelden Refresh_Licence() + Dim sql1 = "SELECT COUNT(GUID) FROM TBPM_PROFILE" Dim anz = ClassDatabase.Execute_Scalar(sql1, MyConnectionString, True) If anz > LICENSE_PROFILES Then MsgBox("Your amount of configurable profiles is limited to " & LICENSE_PROFILES.ToString & " profiles. You can not add more profiles!" & vbNewLine & "Please contact Digital Data for further licensedetails", MsgBoxStyle.Information) End If - sql = String.Format("UPDATE TBDD_USER SET LOGGED_IN = 1, LOGGED_WHERE = '{0}' WHERE GUID = {1}", Environment.MachineName, CURRENT_USERID) - ClassDatabase.Execute_non_Query(sql) + ClassAllgemeineFunktionen.LoginOut("LOGIN") - sql = String.Format("SELECT PM_ADMIN FROM TBDD_USER WHERE GUID = {0}", CURRENT_USERID) - USER_IS_ADMIN = ClassDatabase.Execute_Scalar(sql, MyConnectionString, True) + sql = String.Format("SELECT * FROM TBDD_USER_MODULES T, TBDD_MODULES T1 WHERE T.MODULE_ID = T1.GUID AND UPPER(T1.SHORT_NAME) = UPPER('PM') AND T.USER_ID = {0}", CURRENT_USERID) + DT_USER2MODULE = ClassDatabase.Return_Datatable(sql) + If Not IsNothing(DT_USER2MODULE) Then + If DT_USER2MODULE.Rows.Count = 1 Then + USER_IS_ADMIN = DT_USER2MODULE.Rows(0).Item("IS_ADMIN") + End If + End If - sql = "SELECT COUNT(*) AS Expr1 FROM TBDD_USER WHERE LOGGED_IN = 1" + sql = String.Format("SELECT COUNT(*) AS Expr1 FROM TBDD_USER_MODULE_LOG_IN WHERE UPPER(MODULE) = UPPER('Process-Manager') AND CLIENT_ID = {0}", 1) USERCOUNT_LOGGED_IN = ClassDatabase.Execute_Scalar(sql, MyConnectionString, True) - If LogErrorsOnly = False Then ClassLogger.Add(" >> Anzahl Angemeldete User: " & USERCOUNT_LOGGED_IN.ToString, False) + + If LogErrorsOnly = False Then ClassLogger.Add(" >> Count Users logged in: " & USERCOUNT_LOGGED_IN.ToString, False) If LICENSE_COUNT < USERCOUNT_LOGGED_IN And LICENSE_EXPIRED = False Then MsgBox("Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der aktuellen Lizenzen!" & vbNewLine & "Anzahl der Lizenzen: " & LICENSE_COUNT.ToString & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:") ClassLogger.Add(" >> Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der Lizenzen (" & LICENSE_COUNT & ") für Process Manager!", False) If USER_IS_ADMIN = False Then - 'Anmeldung wieder herausnehmen - sql = String.Format("UPDATE TBDD_USER SET LOGGED_IN = 0, LOGGED_WHERE = '' WHERE GUID = {0}", CURRENT_USERID) - ClassDatabase.Execute_non_Query(sql, True) - ClassLogger.Add(" - Wieder abgemeldet", False) + ClassAllgemeineFunktionen.LoginOut("LOGOUT") + ClassLogger.Add(" - Wieder abgemeldet - START INCOMPLETE", False) ERROR_STATE = "START INCOMPLETE" End If End If 'Alles OK bis hierhin...nun die FolderwatchKonfig laden - + If LogErrorsOnly = False Then ClassLogger.Add(" >> Init Userlogin successfull completed....", False) End If End If Catch ex As Exception diff --git a/app/DD_PM_WINDREAM/ClassWindream_allgemein.vb b/app/DD_PM_WINDREAM/ClassWindream_allgemein.vb index e3e9c5d..1f3d19f 100644 --- a/app/DD_PM_WINDREAM/ClassWindream_allgemein.vb +++ b/app/DD_PM_WINDREAM/ClassWindream_allgemein.vb @@ -83,9 +83,7 @@ Public Class ClassWindream_allgemein Return False End If - If LogErrorsOnly = False Then - ClassLogger.Add(" >> windream-Version: '" & oSession.GetSystemInfo("WindreamVersion") & "'", False) - End If + If LogErrorsOnly = False Then ClassLogger.Add(" >> windream-Version: '" & oSession.GetSystemInfo("WindreamVersion") & "'", False) ' AUSGABE VON SYSTEMINFORMATIONEN ' Gibt die Versionsart (Lizenztyp) also Small-Business-Edition (SBE), Small-Business-Extension (SBX) @@ -113,7 +111,7 @@ Public Class ClassWindream_allgemein End Try End If - + If LogErrorsOnly = False Then ClassLogger.Add(" >> windream initialized completely", False) Return True Catch ex As Exception diff --git a/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.Designer.vb b/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.Designer.vb index f9b280f..8cd01cf 100644 --- a/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.Designer.vb +++ b/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.Designer.vb @@ -5795,7 +5795,6 @@ Partial Public Class DD_DMSLiteDataSet Me.columnNO_OF_DOCUMENTS.DefaultValue = CType(0,Integer) Me.columnADDED_WHO.AllowDBNull = false Me.columnADDED_WHO.MaxLength = 30 - Me.columnADDED_WHEN.AllowDBNull = false Me.columnCHANGED_WHO.MaxLength = 30 Me.columnFINAL_PROFILE.AllowDBNull = false Me.columnFINAL_PROFILE.DefaultValue = CType(false,Boolean) @@ -10418,7 +10417,11 @@ Partial Public Class DD_DMSLiteDataSet Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")> _ Public Property ADDED_WHEN() As Date Get - Return CType(Me(Me.tableTBPM_PROFILE.ADDED_WHENColumn),Date) + Try + Return CType(Me(Me.tableTBPM_PROFILE.ADDED_WHENColumn),Date) + Catch e As Global.System.InvalidCastException + Throw New Global.System.Data.StrongTypingException("Der Wert für Spalte ADDED_WHEN in Tabelle TBPM_PROFILE ist DBNull.", e) + End Try End Get Set Me(Me.tableTBPM_PROFILE.ADDED_WHENColumn) = value @@ -10622,6 +10625,18 @@ Partial Public Class DD_DMSLiteDataSet Me(Me.tableTBPM_PROFILE.DESCRIPTIONColumn) = Global.System.Convert.DBNull End Sub + _ + Public Function IsADDED_WHENNull() As Boolean + Return Me.IsNull(Me.tableTBPM_PROFILE.ADDED_WHENColumn) + End Function + + _ + Public Sub SetADDED_WHENNull() + Me(Me.tableTBPM_PROFILE.ADDED_WHENColumn) = Global.System.Convert.DBNull + End Sub + _ Public Function IsCHANGED_WHONull() As Boolean diff --git a/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xsd b/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xsd index b2ad97a..fe5c36a 100644 --- a/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xsd +++ b/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xsd @@ -1959,7 +1959,7 @@ WHERE (GUID = @GUID) - + @@ -2004,7 +2004,7 @@ WHERE (GUID = @GUID) - + @@ -2107,7 +2107,7 @@ WHERE (GUID = @GUID) - + @@ -2203,7 +2203,7 @@ WHERE (GUID = @GUID) - + @@ -2266,7 +2266,7 @@ WHERE (GUID = @GUID) - + @@ -2296,7 +2296,7 @@ WHERE (GUID = @GUID) - + @@ -2319,7 +2319,7 @@ WHERE (GUID = @GUID) - + @@ -2408,7 +2408,7 @@ WHERE (GUID = @GUID) - + @@ -2481,7 +2481,7 @@ WHERE (GUID = @GUID) - + @@ -2517,7 +2517,7 @@ WHERE (GUID = @GUID) - + @@ -2532,7 +2532,7 @@ WHERE (GUID = @GUID) - + @@ -2553,7 +2553,7 @@ WHERE (GUID = @GUID) - + @@ -2595,7 +2595,7 @@ WHERE (GUID = @GUID) - + @@ -2661,7 +2661,7 @@ WHERE (GUID = @GUID) - + @@ -2734,7 +2734,7 @@ WHERE (GUID = @GUID) - + @@ -2785,7 +2785,7 @@ WHERE (GUID = @GUID) - + @@ -2876,7 +2876,7 @@ WHERE (GUID = @GUID) - + @@ -3007,11 +3007,11 @@ WHERE (GUID = @GUID) - - - - - + + + + + \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xss b/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xss index 1669183..dc09275 100644 --- a/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xss +++ b/app/DD_PM_WINDREAM/DD_DMSLiteDataSet.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + @@ -17,7 +17,7 @@ - + @@ -27,11 +27,11 @@ - 501 - 387 + 461 + 319 - 501 + 461 24 @@ -39,24 +39,28 @@ - 318 - 319 + 343 + 302 - 318 - 387 + 360 + 302 + + + 360 + 319 - 555 - 593 + 515 + 525 595 - 593 + 525 diff --git a/app/DD_PM_WINDREAM/ModuleRuntimeVariables.vb b/app/DD_PM_WINDREAM/ModuleRuntimeVariables.vb index 775e008..23df3eb 100644 --- a/app/DD_PM_WINDREAM/ModuleRuntimeVariables.vb +++ b/app/DD_PM_WINDREAM/ModuleRuntimeVariables.vb @@ -13,6 +13,8 @@ Public ERROR_STATE = "" Public USER_IS_ADMIN As Boolean = False Public USER_USERNAME As String + Public DT_USER2MODULE As DataTable + Public CURRENT_USERID Public LICENSE_COUNT As Integer = 0 Public LICENSE_EXPIRED As Boolean = False diff --git a/app/DD_PM_WINDREAM/frmMain.vb b/app/DD_PM_WINDREAM/frmMain.vb index f0f14b2..a608c73 100644 --- a/app/DD_PM_WINDREAM/frmMain.vb +++ b/app/DD_PM_WINDREAM/frmMain.vb @@ -30,7 +30,8 @@ Public Class frmMain Private Sub frmProfiles_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing Try - TBPM_USERTableAdapter.cmdLoginOut(False, Environment.MachineName, Environment.UserName) + ClassAllgemeineFunktionen.LoginOut("LOGOUT") + ClassLogger.Add("## ProcessManager beendet - " & Now, False) ClassLogger.Add("", False) Catch ex As Exception @@ -62,7 +63,13 @@ Public Class frmMain End Sub Private Sub frmProfiles_Load(sender As Object, e As System.EventArgs) Handles Me.Load - UserLookAndFeel.Default.SetSkinStyle("VS2010") + If LogErrorsOnly = False Then ClassLogger.Add(" >> Initializing MainForm....", False) + Try + UserLookAndFeel.Default.SetSkinStyle("VS2010") + Catch ex As Exception + + End Try + tslblVersion.Text = String.Format("Version {0}", My.Application.Info.Version.ToString) If ERROR_STATE = "NO DB-CONNECTION" Or ERROR_STATE = "FAILED DBCONNECTION" Then MsgBox("Bitte hinterlegen Sie die Datenbankverbindung in der Konfiguration!", MsgBoxStyle.Critical, "Fehlende Konfiguration:") @@ -81,7 +88,7 @@ Public Class frmMain If Refresh_ConnectionString() = True Then Try tslblLicenses.Text = "Anzahl Lizenzen: " & LICENSE_COUNT - + If LogErrorsOnly = False Then ClassLogger.Add(" >> Initializing MainForm....", False) If ERROR_STATE = "NO USER" Then MsgBox("Achtung: Sie sind nicht für die Nutzung von ProcessManager freigegeben!" & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:") Me.Close() @@ -90,6 +97,7 @@ Public Class frmMain 'Wenn license abgelaufen und der User nicht admin ist! If LICENSE_EXPIRED = True Then If USER_IS_ADMIN = False Then + MsgBox("Achtung: Lizenz ist abgelaufen oder ungültig!" & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:") Me.Close() End If End If @@ -109,6 +117,7 @@ Public Class frmMain Try tsstlblUser.Text = Environment.UserName Decide_Load() + Catch ex As System.Exception MsgBox("Fehler bei Laden des Formulars: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:") End Try @@ -123,18 +132,24 @@ Public Class frmMain Check_Timer_Notification() Restore_Form_Position() + If LogErrorsOnly = False Then ClassLogger.Add(" >> MainForm initialized!", False) End If End Sub Sub Check_Timer_Notification() - If My.Settings.IntervallReminder <> 0 Then - TimerReminder.Stop() - TimerReminder.Interval = My.Settings.IntervallReminder * 60000 - TimerReminder.Start() - Else - TimerReminder.Enabled = False - TimerReminder.Stop() - End If + Try + If My.Settings.IntervallReminder <> 0 Then + TimerReminder.Stop() + TimerReminder.Interval = My.Settings.IntervallReminder * 60000 + TimerReminder.Start() + Else + TimerReminder.Enabled = False + TimerReminder.Stop() + End If + Catch ex As Exception + + End Try + End Sub Sub Restore_Form_Position() Try @@ -700,7 +715,7 @@ Public Class frmMain Load_single_Profile() End If Catch ex As Exception - + ClassLogger.Add("Unexpected error in Decide_load: " & ex.Message) End Try If TimerRefresh.Enabled = False Then TimerRefresh.Start() @@ -736,7 +751,12 @@ Public Class frmMain Dim splash As New frmSplash() splash.ShowDialog() ' Dieser Aufruf ist für den Designer erforderlich. - InitializeComponent() + Try + InitializeComponent() + Catch ex As Exception + ClassLogger.Add("Unexpected Error in Initializing components: " & ex.Message) + End Try + ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu. End Sub @@ -962,7 +982,7 @@ Public Class frmMain Dim DT As DataTable = DD_DMSLiteDataSet.Tables("VWPM_PROFILE_USER") If DT.Rows.Count = 0 Then - ClassLogger.Add(" >> KEINE PROFILE FÜR USER: '" & Environment.UserName & "' hinterlegt?!", False) + ClassLogger.Add(" >> no profiles for user: '" & Environment.UserName & "' configured!", False) MsgBox("Keine Profile für Ihren User: '" & Environment.UserName & "' hinterlegt", MsgBoxStyle.Exclamation, "Achtung:") Cursor = Cursors.Default Exit Sub diff --git a/app/DD_PM_WINDREAM/frmProfileDesigner.Designer.vb b/app/DD_PM_WINDREAM/frmProfileDesigner.Designer.vb index 525a074..9477d2b 100644 --- a/app/DD_PM_WINDREAM/frmProfileDesigner.Designer.vb +++ b/app/DD_PM_WINDREAM/frmProfileDesigner.Designer.vb @@ -22,7 +22,6 @@ Partial Class frmProfileDesigner 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. _ Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container() Dim GUIDLabel As System.Windows.Forms.Label Dim NAMELabel As System.Windows.Forms.Label Dim DESCRIPTIONLabel As System.Windows.Forms.Label @@ -65,7 +64,7 @@ Partial Class frmProfileDesigner Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.DD_DMSLiteDataSet = New DD_PM_WINDREAM.DD_DMSLiteDataSet() Me.TableAdapterManager = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TableAdapterManager() - Me.TBPM_PROFILEBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.TBPM_PROFILEBindingSource = New System.Windows.Forms.BindingSource() Me.TBPM_PROFILETableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_PROFILETableAdapter() Me.BindingNavigatorMoveFirstItem = New System.Windows.Forms.ToolStripButton() Me.BindingNavigatorMovePreviousItem = New System.Windows.Forms.ToolStripButton() @@ -78,7 +77,7 @@ Partial Class frmProfileDesigner Me.BindingNavigatorSeparator2 = New System.Windows.Forms.ToolStripSeparator() Me.VWPM_PROFILE_USERBindingNavigatorSaveItem = New System.Windows.Forms.ToolStripButton() Me.cmbProfiles = New System.Windows.Forms.ToolStripSplitButton() - Me.TBPM_PROFILEBindingNavigator = New System.Windows.Forms.BindingNavigator(Me.components) + Me.TBPM_PROFILEBindingNavigator = New System.Windows.Forms.BindingNavigator() Me.tstrpbtn_add = New System.Windows.Forms.ToolStripButton() Me.tstrlblSave = New System.Windows.Forms.ToolStripLabel() Me.btnRefreshProfiles = New System.Windows.Forms.ToolStripButton() @@ -96,7 +95,7 @@ Partial Class frmProfileDesigner Me.GroupBox2 = New System.Windows.Forms.GroupBox() Me.Label1 = New System.Windows.Forms.Label() Me.cmbType = New System.Windows.Forms.ComboBox() - Me.TBPM_TYPEBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.TBPM_TYPEBindingSource = New System.Windows.Forms.BindingSource() Me.GroupBox3 = New System.Windows.Forms.GroupBox() Me.MOVE2FOLDERTextBox = New System.Windows.Forms.TextBox() Me.btnmovetoFolderDialog = New System.Windows.Forms.Button() @@ -156,15 +155,15 @@ Partial Class frmProfileDesigner Me.cmbIndexe2 = New System.Windows.Forms.ComboBox() Me.btnSaveSQLCommand = New System.Windows.Forms.Button() Me.SQL_COMMANDTextBox = New System.Windows.Forms.TextBox() - Me.TBPM_PROFILE_FINAL_INDEXINGBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.TBPM_PROFILE_FINAL_INDEXINGBindingSource = New System.Windows.Forms.BindingSource() Me.btnShowConnections = New System.Windows.Forms.Button() Me.Label14 = New System.Windows.Forms.Label() Me.cmbConnection = New System.Windows.Forms.ComboBox() - Me.TBPM_CONNECTIONBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.TBPM_CONNECTIONBindingSource = New System.Windows.Forms.BindingSource() Me.Label4 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() Me.Label6 = New System.Windows.Forms.Label() - Me.TBPM_PROFILE_FINAL_INDEXINGBindingNavigator = New System.Windows.Forms.BindingNavigator(Me.components) + Me.TBPM_PROFILE_FINAL_INDEXINGBindingNavigator = New System.Windows.Forms.BindingNavigator() Me.BindingNavigatorCountItem4 = New System.Windows.Forms.ToolStripLabel() Me.BindingNavigatorMoveFirstItem4 = New System.Windows.Forms.ToolStripButton() Me.BindingNavigatorMovePreviousItem4 = New System.Windows.Forms.ToolStripButton() @@ -193,7 +192,7 @@ Partial Class frmProfileDesigner Me.TBPM_PROFILE_ZuordnungDataGridView = New System.Windows.Forms.DataGridView() Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.TBPM_PROFILE_ZuordnungBindingNavigator = New System.Windows.Forms.BindingNavigator(Me.components) + Me.TBPM_PROFILE_ZuordnungBindingNavigator = New System.Windows.Forms.BindingNavigator() Me.BindingNavigatorCountItem1 = New System.Windows.Forms.ToolStripLabel() Me.BindingNavigatorMoveFirstItem1 = New System.Windows.Forms.ToolStripButton() Me.BindingNavigatorMovePreviousItem1 = New System.Windows.Forms.ToolStripButton() @@ -211,8 +210,8 @@ Partial Class frmProfileDesigner Me.DataGridViewTextBoxColumn7 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn8 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn9 = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.TBPROFILE_USERBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.TBPROFILE_USERBindingNavigator = New System.Windows.Forms.BindingNavigator(Me.components) + Me.TBPROFILE_USERBindingSource = New System.Windows.Forms.BindingSource() + Me.TBPROFILE_USERBindingNavigator = New System.Windows.Forms.BindingNavigator() Me.BindingNavigatorCountItem2 = New System.Windows.Forms.ToolStripLabel() Me.BindingNavigatorDeleteItem = New System.Windows.Forms.ToolStripButton() Me.BindingNavigatorMoveFirstItem2 = New System.Windows.Forms.ToolStripButton() @@ -237,7 +236,7 @@ Partial Class frmProfileDesigner Me.DataGridViewTextBoxColumn19 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn20 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn21 = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.TBPM_USERBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.TBPM_USERBindingSource = New System.Windows.Forms.BindingSource() Me.TabPage8 = New System.Windows.Forms.TabPage() Me.RIGHT_FILE_DELETECheckBox = New System.Windows.Forms.CheckBox() Me.lblSaveUser = New System.Windows.Forms.Label() @@ -245,13 +244,12 @@ Partial Class frmProfileDesigner Me.CHANGED_WHOTextBox1 = New System.Windows.Forms.TextBox() Me.ADDED_WHENTextBox1 = New System.Windows.Forms.TextBox() Me.ADDED_WHOTextBox1 = New System.Windows.Forms.TextBox() - Me.ADMINCheckBox = New System.Windows.Forms.CheckBox() Me.EMAILTextBox = New System.Windows.Forms.TextBox() Me.USERNAMETextBox = New System.Windows.Forms.TextBox() Me.NAMETextBox1 = New System.Windows.Forms.TextBox() Me.PRENAMETextBox = New System.Windows.Forms.TextBox() Me.GUIDTextBox = New System.Windows.Forms.TextBox() - Me.TBPM_USERBindingNavigator = New System.Windows.Forms.BindingNavigator(Me.components) + Me.TBPM_USERBindingNavigator = New System.Windows.Forms.BindingNavigator() Me.ToolStripButton5 = New System.Windows.Forms.ToolStripButton() Me.ToolStripLabel3 = New System.Windows.Forms.ToolStripLabel() Me.ToolStripButton6 = New System.Windows.Forms.ToolStripButton() @@ -269,7 +267,7 @@ Partial Class frmProfileDesigner Me.TabPage3 = New System.Windows.Forms.TabPage() Me.Button2 = New System.Windows.Forms.Button() Me.VEKTOR_DELIMITERTextBox = New System.Windows.Forms.TextBox() - Me.TBPM_KONFIGURATIONBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.TBPM_KONFIGURATIONBindingSource = New System.Windows.Forms.BindingSource() Me.btnConnections = New System.Windows.Forms.Button() Me.btnopen_SQLAdmin = New System.Windows.Forms.Button() Me.EMAIL_ACTIVECheckBox = New System.Windows.Forms.CheckBox() @@ -297,8 +295,8 @@ Partial Class frmProfileDesigner Me.DataGridViewTextBoxColumn23 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn24 = New System.Windows.Forms.DataGridViewTextBoxColumn() Me.DataGridViewTextBoxColumn25 = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.TBPM_ERROR_LOGBindingSource = New System.Windows.Forms.BindingSource(Me.components) - Me.TBPM_ERROR_LOGBindingNavigator = New System.Windows.Forms.BindingNavigator(Me.components) + Me.TBPM_ERROR_LOGBindingSource = New System.Windows.Forms.BindingSource() + Me.TBPM_ERROR_LOGBindingNavigator = New System.Windows.Forms.BindingNavigator() Me.BindingNavigatorCountItem3 = New System.Windows.Forms.ToolStripLabel() Me.BindingNavigatorDeleteItem1 = New System.Windows.Forms.ToolStripButton() Me.BindingNavigatorMoveFirstItem3 = New System.Windows.Forms.ToolStripButton() @@ -309,7 +307,7 @@ Partial Class frmProfileDesigner Me.BindingNavigatorMoveNextItem3 = New System.Windows.Forms.ToolStripButton() Me.BindingNavigatorMoveLastItem3 = New System.Windows.Forms.ToolStripButton() Me.BindingNavigatorSeparator11 = New System.Windows.Forms.ToolStripSeparator() - Me.TBPM_PROFILE_CONTROLSBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.TBPM_PROFILE_CONTROLSBindingSource = New System.Windows.Forms.BindingSource() Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() Me.tstrpinfo = New System.Windows.Forms.ToolStripStatusLabel() Me.TBPROFILE_USERTableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPROFILE_USERTableAdapter() @@ -319,9 +317,10 @@ Partial Class frmProfileDesigner Me.TBPM_ERROR_LOGTableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_ERROR_LOGTableAdapter() Me.TBPM_PROFILE_FINAL_INDEXINGTableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_PROFILE_FINAL_INDEXINGTableAdapter() Me.TBPM_PROFILE_CONTROLSTableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_PROFILE_CONTROLSTableAdapter() - Me.TBPM_PROFILE_FILESBindingSource = New System.Windows.Forms.BindingSource(Me.components) + Me.TBPM_PROFILE_FILESBindingSource = New System.Windows.Forms.BindingSource() Me.TBPM_PROFILE_FILESTableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_PROFILE_FILESTableAdapter() Me.TBPM_CONNECTIONTableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_CONNECTIONTableAdapter() + Me.Button4 = New System.Windows.Forms.Button() GUIDLabel = New System.Windows.Forms.Label() NAMELabel = New System.Windows.Forms.Label() DESCRIPTIONLabel = New System.Windows.Forms.Label() @@ -1480,7 +1479,7 @@ Partial Class frmProfileDesigner Me.TabControlFinalIndices.Location = New System.Drawing.Point(668, 161) Me.TabControlFinalIndices.Name = "TabControlFinalIndices" Me.TabControlFinalIndices.SelectedIndex = 0 - Me.TabControlFinalIndices.Size = New System.Drawing.Size(1587, 564) + Me.TabControlFinalIndices.Size = New System.Drawing.Size(1587, 567) Me.TabControlFinalIndices.TabIndex = 90 ' 'TabPage9 @@ -1501,7 +1500,7 @@ Partial Class frmProfileDesigner Me.TabPage9.Location = New System.Drawing.Point(4, 25) Me.TabPage9.Name = "TabPage9" Me.TabPage9.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage9.Size = New System.Drawing.Size(1579, 535) + Me.TabPage9.Size = New System.Drawing.Size(1579, 538) Me.TabPage9.TabIndex = 0 Me.TabPage9.Text = "Fester Wert" Me.TabPage9.UseVisualStyleBackColor = True @@ -1670,7 +1669,7 @@ Partial Class frmProfileDesigner Me.TabPage10.Location = New System.Drawing.Point(4, 25) Me.TabPage10.Name = "TabPage10" Me.TabPage10.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage10.Size = New System.Drawing.Size(1579, 538) + Me.TabPage10.Size = New System.Drawing.Size(1579, 541) Me.TabPage10.TabIndex = 1 Me.TabPage10.Text = "Dynamisches SQL" Me.TabPage10.UseVisualStyleBackColor = True @@ -1930,7 +1929,7 @@ Partial Class frmProfileDesigner Me.TBPM_PROFILE_FINAL_INDEXINGDataGridView.Location = New System.Drawing.Point(9, 161) Me.TBPM_PROFILE_FINAL_INDEXINGDataGridView.MultiSelect = False Me.TBPM_PROFILE_FINAL_INDEXINGDataGridView.Name = "TBPM_PROFILE_FINAL_INDEXINGDataGridView" - Me.TBPM_PROFILE_FINAL_INDEXINGDataGridView.Size = New System.Drawing.Size(653, 582) + Me.TBPM_PROFILE_FINAL_INDEXINGDataGridView.Size = New System.Drawing.Size(653, 585) Me.TBPM_PROFILE_FINAL_INDEXINGDataGridView.TabIndex = 75 ' 'GUID @@ -2481,6 +2480,7 @@ Partial Class frmProfileDesigner 'TabPage8 ' Me.TabPage8.AutoScroll = True + Me.TabPage8.Controls.Add(Me.Button4) Me.TabPage8.Controls.Add(Me.RIGHT_FILE_DELETECheckBox) Me.TabPage8.Controls.Add(Me.lblSaveUser) Me.TabPage8.Controls.Add(CHANGED_WHENLabel1) @@ -2491,7 +2491,6 @@ Partial Class frmProfileDesigner Me.TabPage8.Controls.Add(Me.ADDED_WHENTextBox1) Me.TabPage8.Controls.Add(ADDED_WHOLabel1) Me.TabPage8.Controls.Add(Me.ADDED_WHOTextBox1) - Me.TabPage8.Controls.Add(Me.ADMINCheckBox) Me.TabPage8.Controls.Add(EMAILLabel) Me.TabPage8.Controls.Add(Me.EMAILTextBox) Me.TabPage8.Controls.Add(USERNAMELabel) @@ -2514,7 +2513,7 @@ Partial Class frmProfileDesigner ' Me.RIGHT_FILE_DELETECheckBox.DataBindings.Add(New System.Windows.Forms.Binding("CheckState", Me.TBPM_USERBindingSource, "PM_RIGHT_FILE_DELETE", True)) Me.RIGHT_FILE_DELETECheckBox.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.RIGHT_FILE_DELETECheckBox.Location = New System.Drawing.Point(624, 66) + Me.RIGHT_FILE_DELETECheckBox.Location = New System.Drawing.Point(520, 66) Me.RIGHT_FILE_DELETECheckBox.Name = "RIGHT_FILE_DELETECheckBox" Me.RIGHT_FILE_DELETECheckBox.Size = New System.Drawing.Size(136, 24) Me.RIGHT_FILE_DELETECheckBox.TabIndex = 79 @@ -2578,17 +2577,6 @@ Partial Class frmProfileDesigner Me.ADDED_WHOTextBox1.Size = New System.Drawing.Size(188, 22) Me.ADDED_WHOTextBox1.TabIndex = 12 ' - 'ADMINCheckBox - ' - Me.ADMINCheckBox.DataBindings.Add(New System.Windows.Forms.Binding("CheckState", Me.TBPM_USERBindingSource, "PM_ADMIN", True)) - Me.ADMINCheckBox.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.ADMINCheckBox.Location = New System.Drawing.Point(520, 66) - Me.ADMINCheckBox.Name = "ADMINCheckBox" - Me.ADMINCheckBox.Size = New System.Drawing.Size(76, 24) - Me.ADMINCheckBox.TabIndex = 11 - Me.ADMINCheckBox.Text = "Admin?" - Me.ADMINCheckBox.UseVisualStyleBackColor = True - ' 'EMAILTextBox ' Me.EMAILTextBox.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBPM_USERBindingSource, "EMAIL", True)) @@ -3261,6 +3249,15 @@ Partial Class frmProfileDesigner ' Me.TBPM_CONNECTIONTableAdapter.ClearBeforeFill = True ' + 'Button4 + ' + Me.Button4.Location = New System.Drawing.Point(672, 67) + Me.Button4.Name = "Button4" + Me.Button4.Size = New System.Drawing.Size(147, 23) + Me.Button4.TabIndex = 80 + Me.Button4.Text = "User als Admin setzen" + Me.Button4.UseVisualStyleBackColor = True + ' 'frmProfileDesigner ' Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!) @@ -3582,7 +3579,6 @@ Partial Class frmProfileDesigner Friend WithEvents CHANGED_WHOTextBox1 As System.Windows.Forms.TextBox Friend WithEvents ADDED_WHENTextBox1 As System.Windows.Forms.TextBox Friend WithEvents ADDED_WHOTextBox1 As System.Windows.Forms.TextBox - Friend WithEvents ADMINCheckBox As System.Windows.Forms.CheckBox Friend WithEvents EMAILTextBox As System.Windows.Forms.TextBox Friend WithEvents USERNAMETextBox As System.Windows.Forms.TextBox Friend WithEvents NAMETextBox1 As System.Windows.Forms.TextBox @@ -3626,4 +3622,5 @@ Partial Class frmProfileDesigner Friend WithEvents ANNOTATE_ALL_WORK_HISTORY_ENTRIESCheckBox As CheckBox Friend WithEvents SQL_VIEWTextBox As TextBox Friend WithEvents WORK_HISTORY_ENTRYTextBox As TextBox + Friend WithEvents Button4 As Button End Class diff --git a/app/DD_PM_WINDREAM/frmProfileDesigner.vb b/app/DD_PM_WINDREAM/frmProfileDesigner.vb index 6223f93..16f596c 100644 --- a/app/DD_PM_WINDREAM/frmProfileDesigner.vb +++ b/app/DD_PM_WINDREAM/frmProfileDesigner.vb @@ -922,4 +922,11 @@ Public Class frmProfileDesigner Private Sub btnShowConnections_Click(sender As Object, e As EventArgs) Handles btnShowConnections.Click frmConnection.ShowDialog() End Sub + + Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click + Dim sql = String.Format("UPDATE TBDD_USER_MODULES SET IS_ADMIN = 1 WHERE USER_ID = {0} AND MODULE_ID = (SELECT GUID FROM TBDD_MODULES WHERE SHORT_NAME = 'PM')", GUIDTextBox.Text) + If ClassDatabase.Execute_non_Query(sql) = True Then + MsgBox("User is now admin in ProcessManager!", MsgBoxStyle.Information) + End If + End Sub End Class \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmSplash.vb b/app/DD_PM_WINDREAM/frmSplash.vb index 2ad3e22..64d42e9 100644 --- a/app/DD_PM_WINDREAM/frmSplash.vb +++ b/app/DD_PM_WINDREAM/frmSplash.vb @@ -112,6 +112,7 @@ Public NotInheritable Class frmSplash Private Sub bw_RunWorkerCompleted(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) ' Bei Fehler MsgBox anzeigen und Programm beenden If e.Error IsNot Nothing Then + ClassLogger.Add("Unexpected error in Initializing application....") MsgBox(e.Error.Message, MsgBoxStyle.Critical, "Unexpected error in Initializing application") Application.Exit() End If diff --git a/app/Setup/Product.wxs b/app/Setup/Product.wxs index 03d2635..f240750 100644 --- a/app/Setup/Product.wxs +++ b/app/Setup/Product.wxs @@ -88,12 +88,17 @@ + + + + +