MS Folderwatcher

This commit is contained in:
2022-03-28 13:43:49 +02:00
parent ef7683a587
commit 8de78f57bf
3 changed files with 49 additions and 24 deletions

View File

@@ -97,7 +97,13 @@ Public Class frmAdmin_UserImport
Logger.Warn("User [{0}] could not be imported!", oRow.samAccountName)
End If
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
Next
@@ -187,13 +193,24 @@ Public Class frmAdmin_UserImport
VALUES ('{prename}','{name}','{username}','{email}','{oAddedWho}')"
Dim oResult = My.DatabaseECM.ExecuteNonQuery(oSql)
Return True
Return oResult
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
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)
Try
Dim addedWho As String = Environment.UserName