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

Public Enum eMonths
    eJanuary = 1
    eFebruary = 2
    eMarch = 3
    eApril = 4
    eMay = 5
    eJune = 6
    eJuly = 7
    eAugust = 8
    eSeptember = 9
    eOctober = 10
    eNovember = 11
    eDecember = 12
End Enum

<DefaultClassOptions()> _
<NavigationItem(False)> _
<CreatableItem(False)> _
<DefaultProperty("Products.ShortName")> _
Public Class ProductsFunding
    Inherits BaseObject

    Private _Products As Products 'Termék
    Private _MaxContractQuantity As Double 'Max szerződhető mennyiség hektáronként
    Private _FundingHatoHUF As Double 'Egységre jutó finanszírozás /ha /tonna
    Private _CollateralhatoHUF As Double 'Egységre jutó fedezeti érték /ha
    Private _ProductExpirationDate As eMonths 'Lejárati dátum
    Private _ContractTemplate As ContractTemplate

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

    <RuleRequiredField("ProductsFunding - Products", DefaultContexts.Save)> _
    Property Products As Products
        Get
            Return _Products
        End Get
        Set(value As Products)
            SetPropertyValue("Products", _Products, value)
        End Set
    End Property
    <RuleRequiredField("ProductsFunding - MaxContractQuantity", DefaultContexts.Save)> _
    Property MaxContractQuantity As Double
        Get
            Return _MaxContractQuantity
        End Get
        Set(value As Double)
            SetPropertyValue("MaxContractQuantity", _MaxContractQuantity, value)
        End Set
    End Property
    <RuleRequiredField("ProductsFunding - FundingHatoHUF", DefaultContexts.Save)> _
    Property FundingHatoHUF As Double
        Get
            Return _FundingHatoHUF
        End Get
        Set(value As Double)
            SetPropertyValue("FundingHatoHUF", _FundingHatoHUF, value)
        End Set
    End Property
    <RuleRequiredField("ProductsFunding - CollateralhatoHUF", DefaultContexts.Save)> _
    Property CollateralhatoHUF As Double
        Get
            Return _CollateralhatoHUF
        End Get
        Set(value As Double)
            SetPropertyValue("CollateralhatoHUF", _CollateralhatoHUF, value)
        End Set
    End Property
    <RuleRequiredField("ProductsFunding - ProductExpirationDate", DefaultContexts.Save)> _
    Property ProductExpirationDate As eMonths
        Get
            Return _ProductExpirationDate
        End Get
        Set(value As eMonths)
            SetPropertyValue("ProductExpirationDate", _ProductExpirationDate, value)
        End Set
    End Property
    <RuleRequiredField("ProductsFunding - ContractTemplate", DefaultContexts.Save)> _
    Property ContractTemplate As ContractTemplate
        Get
            Return _ContractTemplate
        End Get
        Set(value As ContractTemplate)
            SetPropertyValue("ContractTemplate", _ContractTemplate, value)
        End Set
    End Property
End Class
