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

<DefaultClassOptions()> _
<NavigationItem(False), CreatableItem(False)> _
<DeferredDeletion(False)> _
Public Class BankImportHeaderSum
    Inherits BaseObject
    Private _BankImportHeader As BankImportHeader
    Private _DateOpen As Date 'Nyitó dátumn
    Private _DateClose As Date 'Záró dátum
    Private _AccountNumber As String 'Bankszámlaszám amire a kivonat szól (saját számláink egyike)
    Private _CurrencyName As CurrencyName 'Deviza
    Private _AmountOpen As Double 'Nyitó összeg
    Private _AmountClose As Double  'Záró összeg
    Private _DocumentNumber As String 'Kionat száma
    Private _LiquidAssets As LiquidAssets ' Saját pénzeszközünk !!!

    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    Public Overrides Sub AfterConstruction()
        MyBase.AfterConstruction()
    End Sub
    <Association("BankImportHeader-BankImportHeaderSum", GetType(BankImportHeader))> _
    Property BankImportHeader As BankImportHeader
        Get
            Return _BankImportHeader
        End Get
        Set(value As BankImportHeader)
            SetPropertyValue("BankImportHeader", _BankImportHeader, value)
        End Set
    End Property
    Property DateOpen As Date
        Get
            Return _DateOpen
        End Get
        Set(value As Date)
            SetPropertyValue("DateOpen", _DateOpen, value)
        End Set
    End Property
    Property DateClose As Date
        Get
            Return _DateClose
        End Get
        Set(value As Date)
            SetPropertyValue("DateClose", _DateClose, value)
        End Set
    End Property
    Property AccountNumber As String
        Get
            Return _AccountNumber
        End Get
        Set(value As String)
            SetPropertyValue("AccountNumber", _AccountNumber, value)
        End Set
    End Property
    Property CurrencyName As CurrencyName
        Get
            Return _CurrencyName
        End Get
        Set(value As CurrencyName)
            SetPropertyValue("CurrencyName", _CurrencyName, value)
        End Set
    End Property
    Property AmountOpen As Double
        Get
            Return _AmountOpen
        End Get
        Set(value As Double)
            SetPropertyValue("AmountOpen", _AmountOpen, value)
        End Set
    End Property
    Property AmountClose As Double
        Get
            Return _AmountClose
        End Get
        Set(value As Double)
            SetPropertyValue("AmountClose", _AmountClose, value)
        End Set
    End Property
    Property DocumentNumber As String
        Get
            Return _DocumentNumber
        End Get
        Set(value As String)
            SetPropertyValue("DocumentNumber", _DocumentNumber, value)
        End Set
    End Property
    Property LiquidAssets As LiquidAssets
        Get
            Return _LiquidAssets
        End Get
        Set(value As LiquidAssets)
            SetPropertyValue("LiquidAssets", _LiquidAssets, value)
        End Set
    End Property
    <VisibleInListView(False)> _
    <Association("BankImportHeaderSum-BankImportHeaderSumDetail", GetType(BankImportHeaderSumDetail))> _
    ReadOnly Property BankImportHeaderSumDetail As XPCollection(Of BankImportHeaderSumDetail)
        Get
            Return GetCollection(Of BankImportHeaderSumDetail)("BankImportHeaderSumDetail")
        End Get
    End Property
    ReadOnly Property GLBank As GLBank
        Get
            Dim _GLBank As GLBank
            _GLBank = Session.FindObject(Of GLBank)(CriteriaOperator.Parse("BankImportHeaderSum.Oid=?", Me.Oid))
            Return _GLBank
        End Get
    End Property
    <VisibleInListView(False)> _
    ReadOnly Property GLRows As XPCollection(Of GLRows)
        Get
            If GLBank Is Nothing Then
                Return Nothing
            Else
                Return New XPCollection(Of GLRows)(Session, CriteriaOperator.Parse("GLHeader.Oid=?", GLBank.Oid))
            End If

        End Get
    End Property
    <VisibleInListView(False)> _
    ReadOnly Property BankImportNameParameters As XPCollection(Of BankImportNameParameters)
        Get
            Return New XPCollection(Of BankImportNameParameters)(Session)
        End Get
    End Property
End Class
