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("PDA"), CreatableItem(False)> _
<DefaultProperty("NumberGenerator")> _
<Appearance("Disable ObjectCreated UserCreated", AppearanceItemType.ViewItem, "1=1", TargetItems:="ObjectCreated;UserCreated", Enabled:=False)> _
Public Class StoragePDAParameters
    Inherits BaseObject
    Private _UserCreated As User
    Private _ObjectCreated As Date
    Private _NumberGenerator As NumberGenerator
    Private _CustomersFrom As CustomersFrom
    Private _ShortName As String
    Private _ReportLocationIn As ReportData ' -- Nyomtatvány betárolás
    Private _ReportLocationOut As ReportData ' -- Nyomtatvány kitárolás
    Private _ImportPath As String 'Importálás utvonala (Könyvtár)
    Private _DeleteAfterImport As Boolean 'Törölje-e a beimportált filet.
    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    Public Overrides Sub AfterConstruction()
        MyBase.AfterConstruction()
        Me.ObjectCreated = GetSQLTime(Session)
        Me.UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser))
        DeleteAfterImport = False
    End Sub
    Property ShortName As String
        Get
            Return _ShortName
        End Get
        Set(value As String)
            SetPropertyValue("ShortName", _ShortName, value)
        End Set
    End Property
    <NonCloneable>
    Property UserCreated As User
        Get
            Return _UserCreated
        End Get
        Set(value As User)
            SetPropertyValue("UserCreated", _UserCreated, value)
        End Set
    End Property
    <NonCloneable> _
    Property ObjectCreated As Date
        Get
            Return _ObjectCreated
        End Get
        Set(value As Date)
            SetPropertyValue("ObjectCreated", _ObjectCreated, value)
        End Set
    End Property
    <RuleRequiredField("StoragePDAParameters-NumberGenerator", DefaultContexts.Save)> _
    Property NumberGenerator As NumberGenerator
        Get
            Return _NumberGenerator
        End Get
        Set(value As NumberGenerator)
            SetPropertyValue("NumberGenerator", _NumberGenerator, value)
        End Set
    End Property
    <RuleRequiredField("StoragePDAParameters-CustomersFrom", DefaultContexts.Save)> _
    Property CustomersFrom As CustomersFrom
        Get
            Return _CustomersFrom
        End Get
        Set(value As CustomersFrom)
            SetPropertyValue("CustomersFrom", _CustomersFrom, value)
        End Set
    End Property
    Property ReportLocationIn As ReportData
        Get
            Return _ReportLocationIn
        End Get
        Set(value As ReportData)
            SetPropertyValue("ReportLocationIn", _ReportLocationIn, value)
        End Set
    End Property
    Property ReportLocationOut As ReportData
        Get
            Return _ReportLocationOut
        End Get
        Set(value As ReportData)
            SetPropertyValue("ReportLocationOut", _ReportLocationOut, value)
        End Set
    End Property
    <Size(-1)> _
    Property ImportPath As String
        Get
            Return _ImportPath
        End Get
        Set(value As String)
            SetPropertyValue("ImportPath", _ImportPath, value)
        End Set
    End Property
    Property DeleteAfterImport As Boolean
        Get
            Return _DeleteAfterImport
        End Get
        Set(value As Boolean)
            SetPropertyValue("DeleteAfterImport", _DeleteAfterImport, value)
        End Set
    End Property
End Class
