This commit is contained in:
Digital Data - Marlon Schreiber 2018-06-20 16:34:29 +02:00
parent e38b5366a7
commit 42e0fd9a48
4 changed files with 29 additions and 17 deletions

View File

@ -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

View File

@ -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
'

View File

@ -60,9 +60,13 @@ Public Class frmAdministration
End Sub
Private Sub GUIDTextBox_TextChanged(sender As Object, e As EventArgs) Handles GUIDTextBox.TextChanged
If GUIDTextBox.Text <> "" Then
Refresh_Profile_user()
Refresh_Free_Users()
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()
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

View File

@ -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