EDMI: Method NewFileAsync Improvements

This commit is contained in:
Jonathan Jenne
2021-06-28 16:40:21 +02:00
parent 5d296873be
commit 36b86ed9d1
10 changed files with 198 additions and 203 deletions

View File

@@ -580,12 +580,17 @@ Public Class EDMIService
End Function
Public Function ImportFileIntoFileObject(Data As ImportFileIntoFileObjectRequest) As ImportFileIntoFileObjectResponse Implements IEDMIService.ImportFileIntoFileObject
Dim oObjectStore = GlobalState.ObjectStores.First()
Dim oEDMIPath = New EDMI.File.Path(LogConfig, oObjectStore.Path)
Try
Using oStream = New FileStream(Data.pIDBFilePath, FileMode.Create, FileAccess.Write)
_Logger.Info("ImportFile: Saving file to path [{0}]", Data.pIDBFilePath)
Dim oObjectStore = GlobalState.ObjectStores.
Where(Function(o) o.Title = Data.ObjectStoreType).
FirstOrDefault()
If oObjectStore Is Nothing Then
Throw New KeyNotFoundException($"ObjectStore [{Data.ObjectStoreType}] was not found.")
End If
Using oStream = New FileStream(Data.FilePath, FileMode.Create, FileAccess.Write)
_Logger.Info("ImportFile: Saving file to path [{0}]", Data.FilePath)
_Logger.Info("ImportFile: Content Length: {0}", Data.Contents.Length)
oStream.Write(Data.Contents, 0, Data.Contents.Length)
@@ -594,7 +599,7 @@ Public Class EDMIService
End Using
' insert into db
Dim oSQL As String = $"EXEC PRIDB_NEW_IDBFO '{Data.pIDBFilePath}','{Data.pWho}','{Data.pIDB_OBJ_ID}',{Data.pObjectStoreID}"
Dim oSQL As String = $"EXEC PRIDB_NEW_IDBFO '{Data.FilePath}','{Data.Who}','{Data.ObjectId}',{oObjectStore.Id}"
Dim oResult As Boolean = MSSQL_IDB.ExecuteNonQuery(oSQL)
Return New ImportFileIntoFileObjectResponse() With {.Result = oResult}

View File

@@ -32,13 +32,13 @@ Namespace Messages
<MessageBodyMember>
Public Contents() As Byte
<MessageBodyMember>
Public pWho As String
Public Who As String
<MessageBodyMember>
Public pIDBFilePath As String
Public FilePath As String
<MessageBodyMember>
Public pIDB_OBJ_ID As Long
Public ObjectId As Long
<MessageBodyMember>
Public pObjectStoreID As Integer
Public ObjectStoreType As String
End Class
<MessageContract>

View File

@@ -18,7 +18,7 @@ Public Class DatatableJob
Dim oLogConfig As LogConfig = oJobData.Item("LogConfig")
Dim oCronJobId As Integer = oJobData.Item("CronJobId")
Dim oCronJobTitle As String = oJobData.Item("CronJobTitle")
Dim oLogger As Logger = oLogConfig.GetLogger()
Dim oLogger As Logger = oLogConfig.GetLoggerFor("Scheduler")
Dim oResult As New JobResult()

View File

@@ -21,7 +21,7 @@ Public Class JobListener
MyBase.New()
_LogConfig = LogConfig
_Logger = LogConfig.GetLogger()
_Logger = LogConfig.GetLoggerFor("Scheduler")
_MSSQL = MSSQL
Dataset = ResultDataSet
End Sub

View File

@@ -108,8 +108,6 @@ Public Class Scheduler
End Sub
Public Async Function GetCronJobs() As Task(Of DataTable)
Try
Dim oSQL As String = "SELECT * FROM TBAPPSERV_CRON_JOB WHERE ACTIVE = 1"