EDMIService: Small tweaks
This commit is contained in:
parent
fd22b6a3bf
commit
2bd253d4f5
@ -506,7 +506,7 @@ Public Class EDMIService
|
|||||||
oStoreType = ClassConstants.FileStoreWork
|
oStoreType = ClassConstants.FileStoreWork
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oRelpath As String = GetFileStorePraefix(oStoreType)
|
Dim oBasePath As String = GetFileStorePraefix(oStoreType)
|
||||||
Dim oSubDirectory As String
|
Dim oSubDirectory As String
|
||||||
|
|
||||||
If IsNothing(Data.DateImported) Then
|
If IsNothing(Data.DateImported) Then
|
||||||
@ -517,21 +517,23 @@ Public Class EDMIService
|
|||||||
|
|
||||||
_Logger.Debug("Subdirectory is [{0}]", oSubDirectory)
|
_Logger.Debug("Subdirectory is [{0}]", oSubDirectory)
|
||||||
|
|
||||||
oRelpath = Path.Combine(oRelpath, oSubDirectory)
|
Dim oFinalPath = Path.Combine(oBasePath, oSubDirectory)
|
||||||
|
|
||||||
If Not Directory.Exists(oRelpath) Then
|
If Not Directory.Exists(oFinalPath) Then
|
||||||
Try
|
Try
|
||||||
_Logger.Debug("Path does not exist, creating: [{0}]", oRelpath)
|
_Logger.Debug("Path does not exist, creating: [{0}]", oFinalPath)
|
||||||
Directory.CreateDirectory(oRelpath)
|
Directory.CreateDirectory(oFinalPath)
|
||||||
_Logger.Debug("Created folder [{0}]", oRelpath)
|
_Logger.Debug("Created folder [{0}]", oFinalPath)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Throw GetFault(ex)
|
Throw GetFault(ex)
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
|
|
||||||
_Logger.Debug("Relative Path is [{0}]", oRelpath)
|
_Logger.Debug("Final Directory is [{0}]", oFinalPath)
|
||||||
|
|
||||||
Dim oFileObjectPath As String = Path.Combine(oRelpath, GetFileObjectFileName(Data.ObjectId, Data.Extension, Data.KeepExtension))
|
Dim oFileName As String = GetFileObjectFileName(Data.ObjectId, Data.Extension, Data.KeepExtension)
|
||||||
|
|
||||||
|
Dim oFileObjectPath As String = Path.Combine(oFinalPath, oFileName)
|
||||||
_Logger.Debug("Final Path is [{0}]", oFileObjectPath)
|
_Logger.Debug("Final Path is [{0}]", oFileObjectPath)
|
||||||
|
|
||||||
Return New NewFileObjectResponse With {.FileObjectPath = oFileObjectPath}
|
Return New NewFileObjectResponse With {.FileObjectPath = oFileObjectPath}
|
||||||
@ -562,8 +564,8 @@ Public Class EDMIService
|
|||||||
oStream.Close()
|
oStream.Close()
|
||||||
End Using
|
End Using
|
||||||
|
|
||||||
' insert into db
|
' Insert into DB
|
||||||
Dim oSQL As String = $"EXEC PRIDB_NEW_IDBFO '{Data.FilePath}','{Data.Who}','{Data.ObjectId}',{oObjectStore.Id}"
|
Dim oSQL As String = $"EXEC PRIDB_NEW_IDBFO '{Data.FilePath}',{Data.Contents.Length},'{Data.Who}','{Data.ObjectId}',{oObjectStore.Id}"
|
||||||
Dim oResult As Boolean = MSSQL_IDB.ExecuteNonQuery(oSQL)
|
Dim oResult As Boolean = MSSQL_IDB.ExecuteNonQuery(oSQL)
|
||||||
|
|
||||||
Return New ImportFileIntoFileObjectResponse() With {.Result = oResult}
|
Return New ImportFileIntoFileObjectResponse() With {.Result = oResult}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user