Small fixes

This commit is contained in:
Jonathan Jenne
2019-07-31 17:11:13 +02:00
parent 71559c9ca5
commit 28d5e590b4
8 changed files with 5375 additions and 865 deletions

View File

@@ -1,6 +1,5 @@
Imports DD_LIB_Standards
Public Class frmAdministration
Private SelectedProcessName As String
Class ProfileType
@@ -12,12 +11,9 @@ Public Class frmAdministration
End Function
End Class
Dim PID As Integer
Private Sub frmAdministration_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Load_Profiles()
Load_ProfileTypes()
Load_Logs()
lbllicenseCount.Text = LICENSE_COUNT
If LICENSE_DATE.ToString.Contains("2099") Then
@@ -28,7 +24,7 @@ Public Class frmAdministration
End Sub
Private Sub TBCW_PROFILESBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles TBCW_PROFILESBindingNavigatorSaveItem.Click
Private Sub TBCW_PROFILESBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
Save_Profile()
clsHotkey.Refresh_Profile_Links()
@@ -60,11 +56,6 @@ Public Class frmAdministration
Next
End Sub
Sub Load_Logs()
End Sub
Sub Save_Profile()
Try
Me.TBCW_PROFILESBindingSource.EndEdit()
@@ -132,7 +123,7 @@ Public Class frmAdministration
End Sub
Private Sub btnAddUser2Profile_Click(sender As Object, e As EventArgs) Handles btnAddUserToProfile.Click
Private Sub btnAddUser2Profile_Click(sender As Object, e As EventArgs)
Try
Try
Dim i As Integer = CInt(GUIDTextBox.Text)
@@ -209,7 +200,7 @@ Public Class frmAdministration
End Try
End Sub
Private Sub btndeleteUserConstructorRel_Click(sender As Object, e As EventArgs) Handles btnRemoveUserFromProfile.Click
Private Sub btndeleteUserConstructorRel_Click(sender As Object, e As EventArgs)
Try
Dim ID = GridViewUserInProfile.GetFocusedRowCellValue(GridViewUserInProfile.Columns("GUID"))
Try
@@ -256,31 +247,6 @@ Public Class frmAdministration
End If
End Sub
Private Sub BindingNavigatorDeleteItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorDeleteItem.Click
Dim swl = String.Format("EXEC PRCW_DELETE_PROFILE {0}", GUIDTextBox.Text)
Dim result As MsgBoxResult = MsgBox("Sind Sie sicher, dass Sie das Profil löschen wollen?", MsgBoxStyle.YesNo, "Bestätigung erforderlich:")
' wenn Speichern ja
If result = MsgBoxResult.Yes Then
If clsDatabase.Execute_non_Query(swl) = True Then
Load_Profiles()
End If
End If
End Sub
Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles ToolStripButton1.Click
Load_Profiles()
Refresh_ProfileData()
Try
Dim ID = CInt(GUIDTextBox.Text)
Catch ex As Exception
Exit Sub
End Try
Refresh_Free_Users(GUIDTextBox.Text)
Refresh_Free_Groups(GUIDTextBox.Text)
End Sub
Private Sub TBCW_PROF_DATA_SEARCHBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles TBCW_PROF_DATA_SEARCHBindingSource.AddingNew
MyDataset.TBCW_PROF_DATA_SEARCH.ADDED_WHOColumn.DefaultValue = Environment.UserName
MyDataset.TBCW_PROF_DATA_SEARCH.PROFILE_IDColumn.DefaultValue = GUIDTextBox.Text
@@ -300,20 +266,136 @@ Public Class frmAdministration
End Try
End Sub
Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles ToolStripButton2.Click
Try
TBCW_PROF_DOC_SEARCHBindingSource.EndEdit()
If Not IsNothing(MyDataset.TBCW_PROF_DOC_SEARCH.GetChanges) Then
CHANGED_WHOTextBox2.Text = Environment.UserName
TBCW_PROF_DOC_SEARCHBindingSource.EndEdit()
TBCW_PROF_DOC_SEARCHTableAdapter.Update(MyDataset.TBCW_PROF_DOC_SEARCH)
Private Sub TBCW_PROF_REL_WINDOWBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs)
MyDataset.TBCW_PROF_REL_WINDOW.ADDED_WHOColumn.DefaultValue = Environment.UserName
MyDataset.TBCW_PROF_REL_WINDOW.PROFILE_IDColumn.DefaultValue = GUIDTextBox.Text
MyDataset.TBCW_PROF_REL_WINDOW.PROCESS_NAMEColumn.DefaultValue = SelectedProcessName
End Sub
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
TBCW_PROFILESBindingSource.AddNew()
End Sub
Private Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem3.ItemClick
Save_Profile()
clsHotkey.Refresh_Profile_Links()
TableAdapterManager.UpdateAll(Me.MyDataset)
End Sub
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
Dim swl = String.Format("EXEC PRCW_DELETE_PROFILE {0}", GUIDTextBox.Text)
Dim result As MsgBoxResult = MsgBox("Sind Sie sicher, dass Sie das Profil löschen wollen?", MsgBoxStyle.YesNo, "Bestätigung erforderlich:")
' wenn Speichern ja
If result = MsgBoxResult.Yes Then
If clsDatabase.Execute_non_Query(swl) = True Then
Load_Profiles()
End If
End If
End Sub
Private Sub BarButtonItem4_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem4.ItemClick
Load_Profiles()
Refresh_ProfileData()
Try
Dim ID = CInt(GUIDTextBox.Text)
Catch ex As Exception
MsgBox("Unexpected Error in Save Data Search: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Exit Sub
End Try
Refresh_Free_Users(GUIDTextBox.Text)
Refresh_Free_Groups(GUIDTextBox.Text)
End Sub
Private Sub BarButtonItem5_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem5.ItemClick
If CtrlApplicationAssignment1.Process_CreateAssignment(GUIDTextBox.Text) = False Then
MsgBox("Error while assigning process!", MsgBoxStyle.Critical, "Clipboard Watcher")
End If
Status_Changed("Prozess gespeichert - " & Now.ToString, Color.Yellow)
End Sub
Private Sub BarButtonItem6_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem6.ItemClick
If MsgBox($"Wollen Sie den Prozess löschen?" & vbNewLine & "Dies wird alle Fenster löschen, die diesem Prozess zugeordnet sind!", MsgBoxStyle.Exclamation Or MsgBoxStyle.YesNo, "Prozess löschen") = MsgBoxResult.No Then
Exit Sub
End If
If CtrlApplicationAssignment1.Process_DeleteAssignment() = False Then
MsgBox("Error while deleting assignment of process!", MsgBoxStyle.Critical, "Clipboard Watcher")
End If
Status_Changed("Prozess gelöscht - " & Now.ToString, Color.Yellow)
End Sub
Private Sub BarButtonItem7_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem7.ItemClick
If CtrlApplicationAssignment1.Window_CreateAssignment(GUIDTextBox.Text) = False Then
MsgBox("Error while assigning window!", MsgBoxStyle.Critical, "Clipboard Watcher")
End If
Status_Changed("Fenster gespeichert - " & Now.ToString, Color.Yellow)
End Sub
Private Sub BarButtonItem8_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem8.ItemClick
If MsgBox($"Wollen Sie die Fenster-Zuordnung löschen?", MsgBoxStyle.Exclamation Or MsgBoxStyle.YesNo, "Prozess löschen") = MsgBoxResult.No Then
Exit Sub
End If
If CtrlApplicationAssignment1.Process_DeleteAssignment() = False Then
MsgBox("Error while deleting assignment of window!", MsgBoxStyle.Critical, "Clipboard Watcher")
End If
Status_Changed("Fenster-Zuordnung gelöscht - " & Now.ToString, Color.Yellow)
Status_Changed("Fenster-Zuordnung gelöscht - " & Now.ToString, Color.Yellow)
End Sub
Private Sub BarButtonItem11_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem11.ItemClick
Try
Try
Dim i As Integer = CInt(GUIDTextBox.Text)
Catch ex As Exception
Exit Sub
End Try
For Each row As DataRow In MyDataset.TBWH_User.Rows
If row.Item(0) = CBool(True) Then
Dim insert = String.Format("INSERT INTO TBCW_USER_PROFILE (PROFILE_ID,USER_ID) VALUES ({0},{1})", GUIDTextBox.Text, row.Item(5))
If clsDatabase.Execute_non_Query(insert) = False Then
MsgBox("Could not insert the User-Definition....Check the logfile!", MsgBoxStyle.Exclamation)
End If
End If
Next
For Each row As DataRow In MyDataset.TBWH_User.Rows
row.Item(0) = CBool(False)
Next
If GUIDTextBox.Text <> "" Then
Refresh_Free_Users(GUIDTextBox.Text)
Refresh_ProfileData()
End If
Catch ex As Exception
MsgBox("Unexpected Error while adding user-rights: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub btnAddGroupToProfile_Click(sender As Object, e As EventArgs) Handles btnAddGroupToProfile.Click
Private Sub BarButtonItem12_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem12.ItemClick
Try
Dim ID = GridViewUserInProfile.GetFocusedRowCellValue(GridViewUserInProfile.Columns("GUID"))
Try
Dim I As Integer = CInt(ID)
Catch ex As Exception
Exit Sub
End Try
Dim del = String.Format("DELETE FROM TBCW_USER_PROFILE WHERE GUID = {0}", ID)
If clsDatabase.Execute_non_Query(del) = True Then
Refresh_ProfileData()
If GUIDTextBox.Text <> "" Then
Refresh_Free_Users(GUIDTextBox.Text)
End If
End If
Catch ex As Exception
MsgBox("Unexpected Error in deleting ProfileUserRelation: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub BarButtonItem13_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem13.ItemClick
Try
Dim oSelectedGroups = GridViewGroupNotInProfile.GetSelectedRows()
@@ -336,7 +418,7 @@ Public Class frmAdministration
End Try
End Sub
Private Sub btnRemoveGroupFromProfile_Click(sender As Object, e As EventArgs) Handles btnRemoveGroupFromProfile.Click
Private Sub BarButtonItem14_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem14.ItemClick
Try
Dim oSelectedGroups = GridViewGroupInProfile.GetSelectedRows()
@@ -359,79 +441,7 @@ Public Class frmAdministration
End Try
End Sub
Private Sub ToolStripButton6_Click(sender As Object, e As EventArgs)
Dim oForm As New frmProcessCapture()
Dim oResult = oForm.ShowDialog()
If oResult = DialogResult.OK Then
Try
Dim oProcessName As String = oForm.ProcessName
If oProcessName <> "" Then
Dim insert = String.Format("INSERT INTO TBCW_PROFILE_PROCESS (PROFILE_ID,PROC_NAME,ADDED_WHO) VALUES ({0},'{1}','{2}')", GUIDTextBox.Text, oProcessName, Environment.UserName)
If clsDatabase.Execute_non_Query(insert) = False Then
MsgBox("Could not insert the Process-Profile-Link....Check the logfile!", MsgBoxStyle.Exclamation)
End If
End If
Load_Profile_Process()
clsHotkey.Refresh_Profile_Links()
Catch ex As Exception
MsgBox("Unexpected Error while adding Process-Profile-link: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End If
End Sub
Private Sub TBCW_PROF_REL_WINDOWBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs)
MyDataset.TBCW_PROF_REL_WINDOW.ADDED_WHOColumn.DefaultValue = Environment.UserName
MyDataset.TBCW_PROF_REL_WINDOW.PROFILE_IDColumn.DefaultValue = GUIDTextBox.Text
MyDataset.TBCW_PROF_REL_WINDOW.PROCESS_NAMEColumn.DefaultValue = SelectedProcessName
End Sub
Private Sub BarButtonProcessAssign_ItemClick_1(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonProcessAssign.ItemClick
If CtrlApplicationAssignment1.Process_CreateAssignment(GUIDTextBox.Text) = False Then
MsgBox("Error while assigning process!", MsgBoxStyle.Critical, "Clipboard Watcher")
End If
Status_Changed("Prozess gespeichert - " & Now.ToString, Color.Yellow)
End Sub
Private Sub BarButtonProcessDelete_ItemClick_1(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonProcessDelete.ItemClick
If MsgBox($"Wollen Sie den Prozess löschen?" & vbNewLine & "Dies wird alle Fenster löschen, die diesem Prozess zugeordnet sind!", MsgBoxStyle.Exclamation Or MsgBoxStyle.YesNo, "Prozess löschen") = MsgBoxResult.No Then
Exit Sub
End If
If CtrlApplicationAssignment1.Process_DeleteAssignment() = False Then
MsgBox("Error while deleting assignment of process!", MsgBoxStyle.Critical, "Clipboard Watcher")
End If
Status_Changed("Prozess gelöscht - " & Now.ToString, Color.Yellow)
End Sub
Private Sub BarButtonWindowAssign_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonWindowAssign.ItemClick
If CtrlApplicationAssignment1.Window_CreateAssignment(GUIDTextBox.Text) = False Then
MsgBox("Error while assigning window!", MsgBoxStyle.Critical, "Clipboard Watcher")
End If
Status_Changed("Fenster gespeichert - " & Now.ToString, Color.Yellow)
End Sub
Private Sub BarButtonWindowDelete_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonWindowDelete.ItemClick
If MsgBox($"Wollen Sie das Fenster löschen?" & vbNewLine & "Dies wird alle Controls löschen, die diesem Fenster zugeordnet sind!", MsgBoxStyle.Exclamation Or MsgBoxStyle.YesNo, "Prozess löschen") = MsgBoxResult.No Then
Exit Sub
End If
If CtrlApplicationAssignment1.Window_DeleteAssignment() = False Then
MsgBox("Error while deleting assignment of window!", MsgBoxStyle.Critical, "Clipboard Watcher")
End If
Status_Changed("Fenster gelöscht - " & Now.ToString, Color.Yellow)
End Sub
Private Sub BarButtonWindowSave_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonWindowSave.ItemClick
If CtrlApplicationAssignment1.Window_SaveAssignment() = False Then
MsgBox("Error while saving assignment of window!", MsgBoxStyle.Critical, "Clipboard Watcher")
End If
Status_Changed("Fenster gespeichert - " & Now.ToString, Color.Yellow)
Private Sub XtraTabControl3_SelectedPageChanged(sender As Object, e As DevExpress.XtraTab.TabPageChangedEventArgs) Handles XtraTabControl3.SelectedPageChanged
'TODO
End Sub
End Class