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.Utils
<DefaultClassOptions()>
<NavigationItem("StorageStocks"), CreatableItem(False)> _
<DefaultProperty("DisplayName")> _
Public Class StorageMoveType '-- Mozgási paraméterek
    Inherits BaseObject
    Private _ShortName As String
    Private _Storage As Storage ' -- Raktár
    Private _MoveType As eMoveType ' Mozgás tipusa
    Private _MoveDirection As eMoveDirection

    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    Property ShortName As String
        Get
            Return _ShortName
        End Get
        Set(value As String)
            SetPropertyValue("ShortName", _ShortName, value)
        End Set
    End Property

    <RuleRequiredField("StorageMoveType-Storage", DefaultContexts.Save)>
    Property Storage As Storage
        Get
            Return _Storage
        End Get
        Set(ByVal value As Storage)
            SetPropertyValue("Storage", _Storage, value)
        End Set
    End Property
    <RuleRequiredField("StorageMoveType-MoveType", DefaultContexts.Save)>
    Property MoveType As eMoveType
        Get
            Return _MoveType
        End Get
        Set(ByVal value As eMoveType)
            SetPropertyValue("MoveType", _MoveType, value)
        End Set
    End Property
    Property MoveDirection As eMoveDirection
        Get
            Return _MoveDirection
        End Get
        Set(value As eMoveDirection)
            SetPropertyValue("MoveDirection", _MoveDirection, value)
        End Set
    End Property
    ReadOnly Property DisplayName As String
        Get
            If Storage Is Nothing Then
                Return ""
            Else
                Return Storage.ShortName & " - > " & CaptionHelper.GetLocalizedText("Enums\Nuvolar.Module.eMoveType", MoveType.ToString)
            End If
        End Get
    End Property

    <Association("StorageMoveType-StorageMoveTypeYear", GetType(StorageMoveTypeYear))> _
    ReadOnly Property StorageMoveTypeYear As XPCollection(Of StorageMoveTypeYear)
        Get
            Return GetCollection(Of StorageMoveTypeYear)("StorageMoveTypeYear")
        End Get
    End Property
End Class