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.Persistent.Base.General
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Linq
Imports System.Linq.Expressions
<DefaultClassOptions()> _
<NavigationItem(False), CreatableItem(False)> _
Public Class BankParameterDEV
    Inherits BaseObject
    Private _CustomersFrom As CustomersFrom '-- Saját cég
    Private _BankCost As eBankCost '-- Ki fizeti az utalást
    Private _CurrencyName As CurrencyName '-- A teljesítés milyen devizában legyen
    Private _Ref As String '-- Referencia string
    Private _Urgent As Boolean = False '-- Sürgős vagy nem
    Private _DateExecution As Date '-- Teljesítés dátuma
    Private _BankInformation As BankInformation '-- Milyen számlaszámról menjen az utalás
    Private _FolderName As String
    Private _TransferCount As Long '? db számlát akar utalni
    Private _TransferTotalHUF As Double '? az utalni kívánt tételek összege
    Private _TransferTotalDEV As Double '? az utalni mkívánt tételek összege devizában
    Private _CustomFileName As String 'Opciós, ha meg van adva, akkor ez lesz a letöltéskori file neve
    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    Public Overrides Sub AfterConstruction()
        MyBase.AfterConstruction()
        CustomFileName = ""
    End Sub
    Property CustomersFrom As CustomersFrom
        Get
            Return _CustomersFrom
        End Get
        Set(ByVal value As CustomersFrom)
            SetPropertyValue("CustomersFrom", _CustomersFrom, value)

        End Set
    End Property
    Property BankCost As eBankCost
        Get
            Return _BankCost
        End Get
        Set(ByVal value As eBankCost)
            SetPropertyValue("BankCost", _BankCost, value)
        End Set
    End Property
    <RuleRequiredField("BankParameterDEV-CurrencyName", DefaultContexts.Save)> _
    Property CurrencyName As CurrencyName
        Get
            Return _CurrencyName
        End Get
        Set(ByVal value As CurrencyName)
            SetPropertyValue("CurrencyName", _CurrencyName, value)
        End Set
    End Property
    Property Urgent As Boolean
        Get
            Return _Urgent
        End Get
        Set(ByVal value As Boolean)
            SetPropertyValue("Urgent", _Urgent, value)
        End Set
    End Property
    Property DateExecution As Date
        Get
            Return _DateExecution
        End Get
        Set(ByVal value As Date)
            SetPropertyValue("DateExecution", _DateExecution, value)
        End Set
    End Property
    <RuleRequiredField("BankParameterDEV-BankInformation", DefaultContexts.Save)> _
    <DataSourceCriteria("LiquidAssests.CustomerFrom='@This.CustomersFrom'")> _
    Property BankInformation As BankInformation
        Get
            Return _BankInformation
        End Get
        Set(ByVal value As BankInformation)
            SetPropertyValue("BankInformation", _BankInformation, value)
        End Set
    End Property
    <Size(255)> _
    Property FolderName As String
        Get
            Return _FolderName
        End Get
        Set(ByVal value As String)
            SetPropertyValue("FolderName", _FolderName, value)
        End Set
    End Property
    Property TransferCount As Long
        Get
            Return _TransferCount
        End Get
        Set(ByVal value As Long)
            SetPropertyValue("TransferCount", _TransferCount, value)
        End Set
    End Property
    Property TransferTotalHUF As Double
        Get
            Return _TransferTotalHUF
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("TransferTotalHUF", _TransferTotalHUF, value)
        End Set
    End Property
    Property TransferTotalDEV As Double
        Get
            Return _TransferTotalDEV
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("TransferTotalDEV", _TransferTotalDEV, value)
        End Set
    End Property
    Property CustomFileName As String
        Get
            Return _CustomFileName
        End Get
        Set(value As String)
            SetPropertyValue("CustomFileName", _CustomFileName, value)
        End Set
    End Property
    Public ReadOnly Property PCIGroup As XPCollection(Of PCIGroup)
        Get
            Return New XPCollection(Of PCIGroup)(Session, CriteriaOperator.Parse("PartnerType=1 and BallanceHUF<0"))
        End Get
    End Property
End Class
