diff --git a/app/DD_Clipboard_Searcher/ClassInit.vb b/app/DD_Clipboard_Searcher/ClassInit.vb index 5eee8a9..e823faa 100644 --- a/app/DD_Clipboard_Searcher/ClassInit.vb +++ b/app/DD_Clipboard_Searcher/ClassInit.vb @@ -7,7 +7,7 @@ Public Class ClassInit Public Sub InitLogger() Try ' legt den Speicherort fest - Dim f As New IO.DirectoryInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Digital Data\Clipboard Searcher\Log")) + Dim f As New IO.DirectoryInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Digital Data\Clipboard Watcher\Log")) If IO.Directory.Exists(f.ToString) = False Then IO.Directory.CreateDirectory(f.ToString) End If diff --git a/app/DD_Clipboard_Searcher/frmAdministration.Designer.vb b/app/DD_Clipboard_Searcher/frmAdministration.Designer.vb index 626333a..be9f65f 100644 --- a/app/DD_Clipboard_Searcher/frmAdministration.Designer.vb +++ b/app/DD_Clipboard_Searcher/frmAdministration.Designer.vb @@ -661,7 +661,7 @@ Partial Class frmAdministration Me.btnAddUser2Profile.Name = "btnAddUser2Profile" Me.btnAddUser2Profile.Size = New System.Drawing.Size(256, 28) Me.btnAddUser2Profile.TabIndex = 59 - Me.btnAddUser2Profile.Text = "User zu ausgefügtem Profil hinzufügen" + Me.btnAddUser2Profile.Text = "User zu ausgewähltem Profil hinzufügen" Me.btnAddUser2Profile.TextAlign = System.Drawing.ContentAlignment.MiddleRight Me.btnAddUser2Profile.UseVisualStyleBackColor = True ' diff --git a/app/DD_Clipboard_Searcher/frmAdministration.vb b/app/DD_Clipboard_Searcher/frmAdministration.vb index cf909ff..cf003a8 100644 --- a/app/DD_Clipboard_Searcher/frmAdministration.vb +++ b/app/DD_Clipboard_Searcher/frmAdministration.vb @@ -60,9 +60,13 @@ Public Class frmAdministration End Sub Private Sub GUIDTextBox_TextChanged(sender As Object, e As EventArgs) Handles GUIDTextBox.TextChanged - Refresh_Profile_user() - Refresh_Free_Users() - Load_Profile_Process() + + If GUIDTextBox.Text <> "" Then + Refresh_Profile_user() + Refresh_Free_Users(GUIDTextBox.Text) + Load_Profile_Process() + End If + End Sub Sub Refresh_Profile_user() Try @@ -97,20 +101,20 @@ Public Class frmAdministration For Each row As DataRow In MyDataset.TBWH_User.Rows row.Item(0) = CBool(False) Next - Refresh_Free_Users() - Refresh_Profile_user() + If GUIDTextBox.Text <> "" Then + Refresh_Free_Users(GUIDTextBox.Text) + Refresh_Profile_user() + End If + Catch ex As Exception MsgBox("Unexpected Error while adding user-rights: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try End Sub - Sub Refresh_Free_Users() - Try - Dim ID = CInt(GUIDTextBox.Text) - Catch ex As Exception - Exit Sub - End Try + Sub Refresh_Free_Users(PROFILE_ID As Integer) + + Dim Sql = String.Format("SELECT DISTINCT * FROM VWDD_USER_MODULE_CW WHERE GUID NOT IN (SELECT USER_ID FROM TBCW_USER_PROFILE WHERE PROFILE_ID = {0}) ORDER BY USERNAME", PROFILE_ID) + - Dim Sql = String.Format("SELECT * FROM TBDD_USER WHERE MODULE_DDCBSEARCHER = 1 AND GUID NOT IN (SELECT USER_ID FROM TBCW_USER_PROFILE WHERE PROFILE_ID = {0}) ORDER BY USERNAME", GUIDTextBox.Text) Dim DT_USER = clsDatabase.Return_Datatable(Sql) Try MyDataset.TBWH_User.Clear() @@ -148,7 +152,10 @@ Public Class frmAdministration Dim del = String.Format("DELETE FROM TBCW_USER_PROFILE WHERE GUID = {0}", ID) If clsDatabase.Execute_non_Query(del) = True Then Refresh_Profile_user() - Refresh_Free_Users() + 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) @@ -244,4 +251,10 @@ Public Class frmAdministration ToolTip1.ToolTipIcon = ToolTipIcon.Info ToolTip1.UseAnimation = True End Sub + + Private Sub frmAdministration_Shown(sender As Object, e As EventArgs) Handles Me.Shown + If GUIDTextBox.Text = "" Then + Refresh_Free_Users(0) + End If + End Sub End Class \ No newline at end of file diff --git a/app/DD_Clipboard_Searcher/frmMain.vb b/app/DD_Clipboard_Searcher/frmMain.vb index 1fb5d9a..4bef0e4 100644 --- a/app/DD_Clipboard_Searcher/frmMain.vb +++ b/app/DD_Clipboard_Searcher/frmMain.vb @@ -145,9 +145,8 @@ Public Class frmMain If ERROR_INIT = "NO CLIENT" Then MsgBox("You are not related to a client!" & vbNewLine & "Please contact the system administrator!", MsgBoxStyle.Exclamation) Else - MsgBox("Sorry Something went wrong in user configuration!" & vbNewLine & "Please contact the system administrator!", MsgBoxStyle.Exclamation) + MsgBox("Sorry Something went wrong in user configuration!" & vbNewLine & "Reason: " & ERROR_INIT & vbNewLine & "Please contact the system administrator!", MsgBoxStyle.Exclamation) End If - Exit Sub End If Me.NotifyIconMain.Visible = True