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

Public Enum eMoveType
    Sales = 0 'Értékesítés
    Uses = 1 'Felhasználás
    Inventory = 3 'Leltár
    Disposal = 4 'Selejtezés
    Production = 5 'Gyártás
    InventoryTransfer = 6 'Raktárközi mozgás
    Asset = 2 'Tárgyi eszköz
    NormalInput = 7 'Normál bevételezés
    CreditNote = 8 'Eladott tétel jóváírásából visszavétel
    ReturnBack = 9 'Szállítói visszárú !
End Enum

<DefaultClassOptions()> _
<NavigationItem("StorageStocks"), CreatableItem(False)> _
<DefaultProperty("DisplayName")> _
Public Class StorageMoveType '-- Mozgási paraméterek
    Inherits BaseObject
    Private _Storage As Storage ' -- Raktár
    Private _MoveType As eMoveType ' Mozgás tipusa

    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    <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
    ReadOnly Property DisplayName As String
        Get
            If Storage Is Nothing Then
                Return ""
            Else
                Return Storage.ShortName & " - > " & CaptionHelper.GetLocalizedText("Enums\SISBusiness.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