EDMI: Move Object Status changes into Service

This commit is contained in:
Jonathan Jenne
2022-03-29 14:27:31 +02:00
parent 615666f040
commit abff7fa745
6 changed files with 31 additions and 22 deletions

View File

@@ -199,6 +199,25 @@ Namespace IDB
Return True
End Function
Public Function SetObjectState(pObjectId As Long, pState As String, pWho As String) As Boolean
Try
Dim oSql As String = $"EXEC PRIDB_OBJECT_SET_STATE {pObjectId}, '{pState}', '{pWho}'"
Dim oResult = Database.ExecuteNonQuery(oSql)
If oResult = False Then
Return False
End If
Logger.Info("Object state for [{0}] created: [{1}]", pObjectId, pState)
Return True
Catch ex As Exception
Logger.Warn("Error while setting Object State")
Logger.Error(ex)
Return False
End Try
End Function
End Class
End Namespace