Merge branch 'master' of http://dd-vmp07-com04:3000/AppStd/Monorepo
This commit is contained in:
commit
63aa197421
@ -97,7 +97,13 @@ Public Class frmAdmin_UserImport
|
|||||||
Logger.Warn("User [{0}] could not be imported!", oRow.samAccountName)
|
Logger.Warn("User [{0}] could not be imported!", oRow.samAccountName)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
oSkipped += 1
|
If UpdatetUser(oRow.samAccountName, oRow.Surname, oRow.GivenName, oRow.Email) Then
|
||||||
|
oImported += 1
|
||||||
|
Else
|
||||||
|
Logger.Warn("User [{0}] could not be updated!", oRow.samAccountName)
|
||||||
|
oSkipped += 1
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
@ -187,13 +193,24 @@ Public Class frmAdmin_UserImport
|
|||||||
VALUES ('{prename}','{name}','{username}','{email}','{oAddedWho}')"
|
VALUES ('{prename}','{name}','{username}','{email}','{oAddedWho}')"
|
||||||
Dim oResult = My.DatabaseECM.ExecuteNonQuery(oSql)
|
Dim oResult = My.DatabaseECM.ExecuteNonQuery(oSql)
|
||||||
|
|
||||||
Return True
|
Return oResult
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
Return False
|
Return False
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
Public Function UpdatetUser(username As String, prename As String, name As String, email As String)
|
||||||
|
Try
|
||||||
|
Dim oAddedWho As String = Environment.UserName
|
||||||
|
Dim oSql As String = $"UPDATE TBDD_USER SET PRENAME = '{prename}', NAME = '{name}', EMAIL = , CHANGED_WHO = '{Environment.UserName}' WHERE USERNAME = '{username}')"
|
||||||
|
Dim oResult = My.DatabaseECM.ExecuteNonQuery(oSql)
|
||||||
|
|
||||||
|
Return oResult
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
Public Function InsertGroup(name As String, Optional ECM_FK_ID As Integer = 1, Optional adSync As Boolean = True, Optional internal As Boolean = False, Optional active As Boolean = True)
|
Public Function InsertGroup(name As String, Optional ECM_FK_ID As Integer = 1, Optional adSync As Boolean = True, Optional internal As Boolean = False, Optional active As Boolean = True)
|
||||||
Try
|
Try
|
||||||
Dim addedWho As String = Environment.UserName
|
Dim addedWho As String = Environment.UserName
|
||||||
|
|||||||
@ -16,23 +16,29 @@ Public Class ClassFolderwatcher
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function Restart_FolderWatch() As Boolean
|
Public Function Restart_FolderWatch() As Boolean
|
||||||
Try
|
If Directory.Exists(My.Application.Globix.CurrentFolderWatchPath) Then
|
||||||
If FWFolderWatcher.EnableRaisingEvents = True Then
|
Try
|
||||||
'Gestartet also Stoppen
|
If FWFolderWatcher.EnableRaisingEvents = True Then
|
||||||
FWFolderWatcher.EnableRaisingEvents = False
|
'Gestartet also Stoppen
|
||||||
My.Application.Globix.Folderwatchstarted = False
|
FWFolderWatcher.EnableRaisingEvents = False
|
||||||
|
My.Application.Globix.Folderwatchstarted = False
|
||||||
|
|
||||||
FWFolderWatcher = StartFolderwatcherForPath(My.Application.Globix.CurrentFolderWatchPath)
|
FWFolderWatcher = StartFolderwatcherForPath(My.Application.Globix.CurrentFolderWatchPath)
|
||||||
My.Application.Globix.Folderwatchstarted = True
|
My.Application.Globix.Folderwatchstarted = True
|
||||||
My.UIConfig.Globix.FolderWatchStarted = True
|
My.UIConfig.Globix.FolderWatchStarted = True
|
||||||
My.UIConfigManager.Save()
|
My.UIConfigManager.Save()
|
||||||
End If
|
End If
|
||||||
Return True
|
Return True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Logger.Info($"Error in Restart_FolderWatch: {ex.Message}")
|
Logger.Info($"Error in Restart_FolderWatch: {ex.Message}")
|
||||||
Logger.Error(ex.Message)
|
Logger.Error(ex.Message)
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
Else
|
||||||
|
Logger.Info($"Attention: Check the fodlerwatchinit-Module...My.Application.Globix.CurrentFolderWatchPath is not existing [{My.Application.Globix.CurrentFolderWatchPath}]")
|
||||||
Return False
|
Return False
|
||||||
End Try
|
End If
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
Public Sub Restart_FolderWatchSCAN()
|
Public Sub Restart_FolderWatchSCAN()
|
||||||
Try
|
Try
|
||||||
@ -53,7 +59,7 @@ Public Class ClassFolderwatcher
|
|||||||
End Sub
|
End Sub
|
||||||
Public Function StartStop_FolderWatch()
|
Public Function StartStop_FolderWatch()
|
||||||
Try
|
Try
|
||||||
If FWFolderWatcher Is Nothing OrElse FWFolderWatcher.EnableRaisingEvents = False Then
|
If FWFolderWatcher Is Nothing Then 'OrElse FWFolderWatcher.EnableRaisingEvents = False
|
||||||
' Folderwatch neu instanzieren
|
' Folderwatch neu instanzieren
|
||||||
FWFolderWatcher = StartFolderwatcherForPath(My.Application.Globix.CurrentFolderWatchPath)
|
FWFolderWatcher = StartFolderwatcherForPath(My.Application.Globix.CurrentFolderWatchPath)
|
||||||
My.Application.Globix.Folderwatchstarted = True
|
My.Application.Globix.Folderwatchstarted = True
|
||||||
@ -132,13 +138,13 @@ Public Class ClassFolderwatcher
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function StartFolderwatcherForPath(pPath As String) As FileSystemWatcher
|
Private Function StartFolderwatcherForPath(pPath As String) As FileSystemWatcher
|
||||||
|
Logger.Debug("Folder Watcher starting up for Path [{0}]", pPath)
|
||||||
Dim oWatcher = New FileSystemWatcher(pPath, "*.*") With {
|
Dim oWatcher = New FileSystemWatcher(pPath, "*.*") With {
|
||||||
.IncludeSubdirectories = False,
|
.IncludeSubdirectories = False,
|
||||||
.EnableRaisingEvents = True
|
.EnableRaisingEvents = True
|
||||||
}
|
}
|
||||||
AddHandler oWatcher.Created, AddressOf OnCreated
|
AddHandler oWatcher.Created, AddressOf OnCreated
|
||||||
Logger.Debug("Folder Watcher started for Path [{0}]", pPath)
|
Logger.Debug("Folder Watcher started for Path [{0}]", pPath)
|
||||||
|
|
||||||
Return oWatcher
|
Return oWatcher
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ Public Class frmGlobixBasicConfig
|
|||||||
System.IO.Directory.CreateDirectory(pMypath)
|
System.IO.Directory.CreateDirectory(pMypath)
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Logger.Info(" >> Unexpected error in CheckFolder: " & pMypath)
|
Logger.Info(">> Unexpected error in CheckFolder: " & pMypath)
|
||||||
Logger.Error(ex.Message)
|
Logger.Error(ex.Message)
|
||||||
Logger.Info(" >> " & ex.Message)
|
Logger.Info(" >> " & ex.Message)
|
||||||
If My.Application.User.Language = "de-DE" Then
|
If My.Application.User.Language = "de-DE" Then
|
||||||
@ -51,9 +51,9 @@ Public Class frmGlobixBasicConfig
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Dim folderwatch = My.DatabaseECM.GetScalarValue("SELECT GUID FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & My.Application.User.UserId & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'")
|
Dim folderwatch = My.DatabaseECM.GetScalarValue("SELECT COALESCE(MAX(GUID),999999) FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & My.Application.User.UserId & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'")
|
||||||
Dim oSql As String
|
Dim oSql As String
|
||||||
If folderwatch Is Nothing Then
|
If folderwatch = 999999 Then
|
||||||
oSql = "INSERT INTO TBGI_FOLDERWATCH_USER (USER_ID, FOLDER_PATH, FOLDER_TYPE, ADDED_WHO) VALUES (" & My.Application.User.UserId & ",'" & pMypath & "','" & FOLDER_TYPE & "','" & My.Application.User.UserName & "')"
|
oSql = "INSERT INTO TBGI_FOLDERWATCH_USER (USER_ID, FOLDER_PATH, FOLDER_TYPE, ADDED_WHO) VALUES (" & My.Application.User.UserId & ",'" & pMypath & "','" & FOLDER_TYPE & "','" & My.Application.User.UserName & "')"
|
||||||
Else
|
Else
|
||||||
oSql = "UPDATE TBGI_FOLDERWATCH_USER SET FOLDER_PATH = '" & pMypath & "', CHANGED_WHO = '" & My.Application.User.UserName & "' where GUID = " & folderwatch
|
oSql = "UPDATE TBGI_FOLDERWATCH_USER SET FOLDER_PATH = '" & pMypath & "', CHANGED_WHO = '" & My.Application.User.UserName & "' where GUID = " & folderwatch
|
||||||
@ -62,12 +62,14 @@ Public Class frmGlobixBasicConfig
|
|||||||
folderwatch = My.DatabaseECM.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & My.Application.User.UserId & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'")
|
folderwatch = My.DatabaseECM.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & My.Application.User.UserId & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'")
|
||||||
|
|
||||||
If FOLDER_TYPE = "SCAN" Then
|
If FOLDER_TYPE = "SCAN" Then
|
||||||
My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = folderwatch
|
My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = pMypath
|
||||||
Me.TextEditScanfolder.Text = My.Application.Globix.CURRENT_SCAN_FOLDERWATCH
|
Me.TextEditScanfolder.Text = My.Application.Globix.CURRENT_SCAN_FOLDERWATCH
|
||||||
Else
|
Else
|
||||||
My.Application.Globix.CurrentFolderWatchPath = folderwatch
|
My.Application.Globix.CurrentFolderWatchPath = pMypath
|
||||||
Me.TextEditHotfolder.Text = My.Application.Globix.CurrentFolderWatchPath
|
Me.TextEditHotfolder.Text = My.Application.Globix.CurrentFolderWatchPath
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
Logger.Error($"Unexpected error in Adding Folder to TBGI_FOLDERWATCH_USER [{oSql}]")
|
||||||
End If
|
End If
|
||||||
If My.Application.Globix.Folderwatchstarted = True And FOLDER_TYPE = "DEFAULT" Then
|
If My.Application.Globix.Folderwatchstarted = True And FOLDER_TYPE = "DEFAULT" Then
|
||||||
clsFW.Restart_FolderWatch()
|
clsFW.Restart_FolderWatch()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user