Imports System
Imports System.ComponentModel

Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering

Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.Persistent.Validation

Imports DevExpress.ExpressApp.ConditionalAppearance
<DefaultClassOptions()> _
<NavigationItem(False), CreatableItem(False)> _
Public Class RegistryChoiceNextStep 'Ez a class csak egy popup window-hoz kell
    Inherits BaseObject
    Private _RegistryHeader As RegistryHeader 'Melyik iktatással kapcsolatos
    Private _HRPerson As HRPerson 'Kinek delegálja 
    Private _WorkflowSystemSteps As WorkflowSystemSteps 'Milyen lépésre teszi
    Private _Description As String 'Mit kell csinálni a feladatban !
    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    Property RegistryHeader As RegistryHeader
        Get
            Return _RegistryHeader
        End Get
        Set(ByVal value As RegistryHeader)
            SetPropertyValue("RegistryHeader", _RegistryHeader, value)
        End Set
    End Property
    Property HRPerson As HRPerson
        Get
            'If _WorkflowSystemSteps IsNot Nothing Then
            '    If _WorkflowSystemSteps.HRResponsible IsNot Nothing Then
            '        _HRPerson = _WorkflowSystemSteps.HRResponsible
            '    End If
            'End If
            Return _HRPerson
        End Get
        Set(ByVal value As HRPerson)
            SetPropertyValue("HRPerson", _HRPerson, value)
        End Set
    End Property
    <ImmediatePostData(True), DataSourceCriteria("WorkflowSystem = '@This.RegistryHeader.RegistryType.WorkflowSystem'")>
    Property WorkflowSystemSteps As WorkflowSystemSteps
        Get
            Return _WorkflowSystemSteps
        End Get
        Set(ByVal value As WorkflowSystemSteps)
            SetPropertyValue("WorkflowSystemSteps", _WorkflowSystemSteps, value)

            If Session.IsObjectsLoading() = False And Session.IsObjectsSaving() = False And Me.WorkflowSystemSteps IsNot Nothing Then
                If Me.WorkflowSystemSteps.HRResponsible IsNot Nothing Then
                    Me.HRPerson = Me.WorkflowSystemSteps.HRResponsible
                Else
                    Me.HRPerson = Me.RegistryHeader.HRResponsible
                End If
            End If
        End Set
    End Property
    <Size(-1)>
    Property Description As String
        Get
            Return _Description
        End Get
        Set(ByVal value As String)
            SetPropertyValue("Description", _Description, value)
        End Set
    End Property
End Class
<DefaultClassOptions()>
<NavigationItem(False), CreatableItem(False)>
Public Class InvoiceChoiceNextStep 'Ez a class csak egy popup window-hoz kell
    Inherits BaseObject
    Private _InvoiceHeader As InvoiceHeader 'Melyik iktatással kapcsolatos
    Private _HRPerson As HRPerson 'Kinek delegálja 
    Private _WorkflowSystemSteps As WorkflowSystemSteps 'Milyen lépésre teszi
    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    <Browsable(False)>
    Property InvoiceHeader As InvoiceHeader
        Get
            Return _InvoiceHeader
        End Get
        Set(ByVal value As InvoiceHeader)
            SetPropertyValue("InvoiceHeader", _InvoiceHeader, value)
        End Set
    End Property
    Property HRPerson As HRPerson
        Get
            If _WorkflowSystemSteps IsNot Nothing Then
                If _WorkflowSystemSteps.HRResponsible IsNot Nothing Then
                    _HRPerson = _WorkflowSystemSteps.HRResponsible
                End If
            End If
            Return _HRPerson
        End Get
        Set(ByVal value As HRPerson)
            SetPropertyValue("HRPerson", _HRPerson, value)
        End Set
    End Property
    <ImmediatePostData(True), DataSourceCriteria("WorkflowSystem.Oid='@This.InvoiceHeader.InvoiceType.WorkflowSystem.Oid'")>
    Property WorkflowSystemSteps As WorkflowSystemSteps
        Get
            Return _WorkflowSystemSteps
        End Get
        Set(ByVal value As WorkflowSystemSteps)
            SetPropertyValue("WorkflowSystemSteps", _WorkflowSystemSteps, value)
        End Set
    End Property
End Class

