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

<DefaultClassOptions()> _
<NavigationItem(False), CreatableItem(False)> _
<DeferredDeletion(False)> _
Public Class SpecTranRevaluationRowsAccounts 'Devizás átértékelés számlák
    Inherits BaseObject
    Private _SpecTranRevaluation As SpecTranRevaluation
    Private _CustomersFrom As CustomersFrom
    Private _Customers As Customers
    Private _PartnerType As ePartnerType
    Private _ConnectInfo As String
    Private _BallanceDEV As Double
    Private _BallanceHUF As Double
    Private _BallanceHUF_Revaluation As Double
    Private _DifferenceHUF As Double
    Private _CurrencyRate_Account As Double
    Private _GLAccounts As GLAccounts
    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    Public Overrides Sub AfterConstruction()
        MyBase.AfterConstruction()
    End Sub
    <Association("SpecTranRevaluation-SpecTranRevaluationRowsAccounts", GetType(SpecTranRevaluation))> _
    Property SpecTranRevaluation As SpecTranRevaluation
        Get
            Return _SpecTranRevaluation
        End Get
        Set(value As SpecTranRevaluation)
            SetPropertyValue("SpecTranRevaluation", _SpecTranRevaluation, value)
        End Set
    End Property
    Property CustomersFrom As CustomersFrom
        Get
            Return _CustomersFrom
        End Get
        Set(value As CustomersFrom)
            SetPropertyValue("CustomersFrom", _CustomersFrom, value)
        End Set
    End Property
    Property Customers As Customers
        Get
            Return _Customers
        End Get
        Set(value As Customers)
            SetPropertyValue("Customers", _Customers, value)
        End Set
    End Property
    Property PartnerType As ePartnerType
        Get
            Return _PartnerType
        End Get
        Set(value As ePartnerType)
            SetPropertyValue("PartnerType", _PartnerType, value)
        End Set
    End Property
    Property ConnectInfo As String
        Get
            Return _ConnectInfo
        End Get
        Set(value As String)
            SetPropertyValue("ConnectInfo", _ConnectInfo, value)
        End Set
    End Property
    Property BallanceDEV As Double
        Get
            Return _BallanceDEV
        End Get
        Set(value As Double)
            SetPropertyValue("BallanceDEV", _BallanceDEV, value)
        End Set
    End Property
    Property BallanceHUF As Double
        Get
            Return _BallanceHUF
        End Get
        Set(value As Double)
            SetPropertyValue("BallanceHUF", _BallanceHUF, value)
        End Set
    End Property
    Property BallanceHUF_Revaluation As Double
        Get
            Return _BallanceHUF_Revaluation
        End Get
        Set(value As Double)
            SetPropertyValue("BallanceHUF_Revaluation", _BallanceHUF_Revaluation, value)
        End Set
    End Property
    Property DifferenceHUF As Double
        Get
            Return _DifferenceHUF
        End Get
        Set(value As Double)
            SetPropertyValue("DifferenceHUF", _DifferenceHUF, value)
        End Set
    End Property
    <VisibleInDetailView(False)> _
    ReadOnly Property BallanceRateDiffImage As Image
        Get
            If PartnerType = ePartnerType.eReceivables Then
                If BallanceHUF - BallanceHUF_Revaluation > 0 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 BallanceHUF - BallanceHUF_Revaluation > 0 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
    Property CurrencyRate_Account As Double
        Get
            Return _CurrencyRate_Account
        End Get
        Set(value As Double)
            SetPropertyValue("CurrencyRate_Account", _CurrencyRate_Account, value)
        End Set
    End Property
    <Browsable(False)> _
    Property GLAccounts As GLAccounts
        Get
            Return _GLAccounts
        End Get
        Set(ByVal value As GLAccounts)
            SetPropertyValue("GLAccounts", _GLAccounts, value)
        End Set
    End Property

End Class

