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()> _
<NonPersistent()> _
<NavigationItem(False)> _
<CreatableItem(False)> _
<Appearance("APCSheetHeader - Hide Products if NeedProducts = False", AppearanceItemType.ViewItem, "NeedProducts = False", TargetItems:="Products", visibility:=Editors.ViewItemVisibility.Hide)> _
Public Class APCSheetByTerritorial_New_PopUp
    Inherits BaseObject

    Private _City As String 'település
    Private _LotNumber As String 'Helyrajzi szám
    Private _BlockNumber As String 'Termőterülethez tartozó blokkszám
    Private _Area As Double 'termőterület mérete ha
    Private _Products As ProductsFunding
    Private _OwnerState As eOwnerState 'Bérlő vagy tulajdonos
    Private _DueDateRent As Date 'Bérlet lejárta dátuma
    Private _NeedProducts As Boolean

    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    Public Overrides Sub AfterConstruction()
        MyBase.AfterConstruction()
        NeedProducts = True
    End Sub

    <Size(255)> _
    Property City As String
        Get
            Return _City
        End Get
        Set(value As String)
            SetPropertyValue("City", _City, value)
        End Set
    End Property
    <Size(255)> _
    Property LotNumber As String
        Get
            Return _LotNumber
        End Get
        Set(value As String)
            SetPropertyValue("LotNumber", _LotNumber, value)
        End Set
    End Property
    <Size(255)> _
    Property BlockNumber As String
        Get
            Return _BlockNumber
        End Get
        Set(value As String)
            SetPropertyValue("BlockNumber", _BlockNumber, value)
        End Set
    End Property
    Property Area As Double
        Get
            Return _Area
        End Get
        Set(value As Double)
            SetPropertyValue("Area", _Area, value)
        End Set
    End Property
    <ImmediatePostData(True), DataSourceProperty("TerritorialProducts")>
    Property Products As ProductsFunding
        Get
            Return _Products
        End Get
        Set(value As ProductsFunding)
            SetPropertyValue("Products", _Products, value)
        End Set
    End Property
    Property OwnerState As eOwnerState
        Get
            Return _OwnerState
        End Get
        Set(value As eOwnerState)
            SetPropertyValue("OwnerState", _OwnerState, value)
        End Set
    End Property
    Property DueDateRent As Date
        Get
            Return _DueDateRent
        End Get
        Set(value As Date)
            SetPropertyValue("DueDateRent", _DueDateRent, value)
        End Set
    End Property
    <Browsable(False)> _
    Property NeedProducts As Boolean
        Get
            Return _NeedProducts
        End Get
        Set(value As Boolean)
            SetPropertyValue("NeedProducts", _NeedProducts, value)
        End Set
    End Property
    <Browsable(False)> _
    ReadOnly Property TerritorialProducts As XPCollection(Of ProductsFunding)
        Get
            Dim _ProductsCoollection As New XPCollection(Of ProductsFunding)(Session)
            Return _ProductsCoollection
        End Get
    End Property
End Class
