70 lines
2.3 KiB
VB.net
70 lines
2.3 KiB
VB.net
Imports System.Runtime.Serialization
|
|
Imports DigitalData.Modules.Database
|
|
Imports DigitalData.Modules.Logging
|
|
Imports DigitalData.Modules.Language
|
|
Imports ECM.JobRunner.Common
|
|
|
|
Public Class GetJobConfig
|
|
Public Class GetJobConfigMethod
|
|
Inherits Base.BaseMethod
|
|
|
|
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer, pState As State)
|
|
MyBase.New(pLogConfig, pDatabase, pState)
|
|
End Sub
|
|
|
|
Public Function Run() As GetJobConfigResponse
|
|
Return New GetJobConfigResponse With {
|
|
.JobTypes = State.JobTypes,
|
|
.JobDefinitions = State.JobDefinitions,
|
|
.ProfileDefinitions = New GetJobConfigResponse.ProfileDefinitionConfig With {
|
|
.ImportProfiles = State.ProfileDefintions.ImportProfiles.
|
|
Select(AddressOf FillJobForProfile).
|
|
Select(AddressOf FillStepsForProfile).
|
|
ToList()
|
|
},
|
|
.WindreamObjectTypes = State.ObjectTypes
|
|
}
|
|
End Function
|
|
|
|
Private Function FillJobForProfile(pProfile As ImportProfile) As ImportProfile
|
|
Dim oJob = State.JobDefinitions.
|
|
Where(Function(job) job.Id = pProfile.JobId).
|
|
FirstOrDefault()
|
|
|
|
pProfile.Job = oJob
|
|
Return pProfile
|
|
End Function
|
|
|
|
Private Function FillStepsForProfile(pProfile As ImportProfile) As ImportProfile
|
|
Dim oSteps = State.ProfileDefintions.ImportProfileSteps.
|
|
Where(Function(s) s.ProfileId = pProfile.Id).
|
|
ToList()
|
|
|
|
pProfile.Steps = oSteps
|
|
Return pProfile
|
|
End Function
|
|
End Class
|
|
|
|
Public Class GetJobConfigResponse
|
|
Inherits Base.BaseResponse
|
|
|
|
<DataMember>
|
|
Public Property JobTypes As List(Of JobType)
|
|
|
|
<DataMember>
|
|
Public Property WindreamObjectTypes As List(Of ObjectType)
|
|
|
|
<DataMember>
|
|
Public Property JobDefinitions As List(Of JobDefinition)
|
|
|
|
<DataMember>
|
|
Public Property ProfileDefinitions As New ProfileDefinitionConfig
|
|
|
|
Public Class ProfileDefinitionConfig
|
|
Public Property ImportProfiles As List(Of ImportProfile)
|
|
End Class
|
|
End Class
|
|
|
|
End Class
|
|
|