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 System.Drawing
Imports DevExpress.ExpressApp.Utils

<DefaultClassOptions()> _
<Persistent("vv_WaitforRateDiff")> _
<NavigationItem(False), CreatableItem(False)> _
Public Class RateDiffView
    Inherits XPLiteObject
    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    <Key(True), Persistent("Oid")> Public Oid As Guid
    <Persistent("CustomersFrom")> Public CustomersFrom As CustomersFrom
    <Persistent("PartnerType")> Public PartnerType As ePartnerType
    <Persistent("Customers")> Public Customers As Customers
    <Persistent("ConnectInfo")> Public ConnectInfo As String
    <Persistent("DateExecution_Account")> Public DateExecution_Account As Date
    <Persistent("CurrencyName_Account")> Public CurrencyName_Account As CurrencyName
    <Persistent("AmountDEV_Account")> Public AmountDEV_Account As Double
    <Persistent("BallanceDEV_Account")> Public BallanceDEV_Account As Double
    <Persistent("CurrencyRate_Account")> Public CurrencyRate_Account As Double
    <Persistent("LiquidAssets")> Public LiquidAssets As LiquidAssets
    <Persistent("DateExecution")> Public DateExecution As Date
    <Persistent("InAmountDEV")> Public InAmountDEV As Double
    <Persistent("OutAmountDEV")> Public OutAmountDEV As Double
    <Persistent("InAmountDEV2")> Public InAmountDEV2 As Double
    <Persistent("OutAmountDEV2")> Public OutAmountDEV2 As Double
    <Persistent("CurrencyRate")> Public CurrencyRate As Double
    <Persistent("InAmountHUF")> Public InAmountHUF As Double
    <Persistent("OutAmountHUF")> Public OutAmountHUF As Double
    <Persistent("InAmountHUF_Account")> Public InAmountHUF_Account As Double
    <Persistent("OutAmountHUF_Account")> Public OutAmountHUF_Account As Double
    <Persistent("InAmountHUF_Diff")> Public InAmountHUF_Diff As Double
    <Persistent("OutAmountHUF_Diff")> Public OutAmountHUF_Diff As Double
    <Persistent("GLRowsRatediff"), Browsable(False)> Public GLRowsRatediff As Double
    <Persistent("RateDiffState"), Browsable(False)> Public RateDiffState As Long
    <VisibleInDetailView(False)> _
    ReadOnly Property BallanceRateDiffImage As Image
        Get
            If PartnerType = ePartnerType.eReceivables Then
                If RateDiffState = -1 Then 'Árfolyam veszteség
                    Return ImageLoader.Instance.GetImageInfo("nav_down_red").Image
                Else 'Árfolyam nyereség
                    Return ImageLoader.Instance.GetImageInfo("nav_up_green").Image
                End If
            ElseIf PartnerType = ePartnerType.ePayabels Then
                If RateDiffState = 1 Then 'Árfolyam nyereség
                    Return ImageLoader.Instance.GetImageInfo("nav_up_green").Image
                Else 'Árfolyam veszteség
                    Return ImageLoader.Instance.GetImageInfo("nav_down_red").Image
                End If
            Else
                Return ImageLoader.Instance.GetImageInfo("bullet_ball_glass_blue").Image
            End If
        End Get
    End Property
End Class
