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)> _
Public Class ImmovablesPriceListRowsC
    Inherits BaseObject
    Private _Container As Container
    Private _ImmovablesPriceListHeader As ImmovablesPriceListHeader
    Private _RowType As ImmovablesPriceListRowsType

    'Értékesítési árak
    Private _ListPriceBruttoDEV As Double
    Private _ListPriceBruttoHUF As Double
    Private _ListPriceNettoDEV As Double
    Private _ListPriceNettoHUF As Double
    '--

    'Bérlési árak
    Private _ListPriceBruttoDEVRent As Double
    Private _ListPriceBruttoHUFRent As Double
    Private _ListPriceNettoDEVRent As Double
    Private _ListPriceNettoHUFRent As Double
    '--
    ' Értékesítési nm árak
    Private _AreaListPriceBruttoDEV As Double 'AreaNettoForSale !!! Ezt kell használni az osztáshoz !
    Private _AreaListPriceBruttoHUF As Double
    Private _AreaListPriceNettoDEV As Double
    Private _AreaListPriceNettoHUF As Double
    '--

    'Bérleti nm árak
    Private _AreaListPriceBruttoDEVRent As Double
    Private _AreaListPriceBruttoHUFRent As Double
    Private _AreaListPriceNettoDEVRent As Double
    Private _AreaListPriceNettoHUFRent As Double
    '--
    Private _NoteRow As String

    Public Sub New(ByVal session As Session)
        MyBase.New(session)
        ' This constructor is used when an object is loaded from a persistent storage.
        ' Do not place any code here or place it only when the IsLoading property is false:
        ' if (!IsLoading){
        '   It is now OK to place your initialization code here.
        ' }
        ' or as an alternative, move your initialization code into the AfterConstruction method.
    End Sub
    Public Overrides Sub AfterConstruction()
        MyBase.AfterConstruction()
        ' Place here your initialization code.
    End Sub
    Property Container As Container
        Get
            Return _Container
        End Get
        Set(value As Container)
            SetPropertyValue("Container", _Container, value)
            If Not Session.IsObjectsLoading And Not Session.IsObjectsSaving And value IsNot Nothing Then
                Me.ListPriceBruttoDEV = value.PriceBruttoDEV
                Me.ListPriceBruttoDEVRent = value.PriceBruttoDEVRent
                Me.ListPriceBruttoHUF = value.PriceBruttoHUF
                Me.ListPriceBruttoHUFRent = value.PriceBruttoHUFRent
                Me.ListPriceNettoDEV = value.PriceNettoDEV
                Me.ListPriceNettoDEVRent = value.PriceNettoDEVRent
                Me.ListPriceNettoHUF = value.PriceNettoHUF
                Me.ListPriceNettoHUFRent = value.PriceNettoHUFRent
            End If
        End Set
    End Property
    <Association("ImmovablesPriceListHeader-ImmovablesPriceListRowsC", GetType(ImmovablesPriceListHeader))> _
    Property ImmovablesPriceListHeader As ImmovablesPriceListHeader
        Get
            Return _ImmovablesPriceListHeader
        End Get
        Set(ByVal value As ImmovablesPriceListHeader)
            SetPropertyValue("ImmovablesPriceListHeader", _ImmovablesPriceListHeader, value)
        End Set
    End Property
    Property ListPriceBruttoDEV As Double
        Get
            Return _ListPriceBruttoDEV
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("ListPriceBruttoDEV", _ListPriceBruttoDEV, value)
            If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
                ListPriceNettoDEV = Math.Round(ListPriceBruttoDEV / 1.25, 2, MidpointRounding.AwayFromZero)
                'AreaListPriceBruttoDEV = Math.Round((value / Me.Container.AreaNetto), 2, MidpointRounding.AwayFromZero)
                'AreaListPriceNettoDEV = Math.Round(AreaListPriceBruttoDEV / 1.25, 2, MidpointRounding.AwayFromZero)
            End If
        End Set
    End Property
    Property ListPriceBruttoHUF As Double
        Get
            Return _ListPriceBruttoHUF
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("ListPriceBruttoHUF", _ListPriceBruttoHUF, value)
            If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
                ListPriceNettoHUF = Math.Round(ListPriceBruttoHUF / 1.25, 0, MidpointRounding.AwayFromZero)
                'AreaListPriceBruttoHUF = Math.Round((value / Me.Container.AreaNetto), 0, MidpointRounding.AwayFromZero)
                'AreaListPriceNettoHUF = Math.Round(AreaListPriceBruttoHUF / 1.25, 0, MidpointRounding.AwayFromZero)
            End If
        End Set
    End Property
    Property ListPriceNettoDEV As Double
        Get
            Return _ListPriceNettoDEV
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("ListPriceNettoDEV", _ListPriceNettoDEV, value)
        End Set
    End Property
    Property ListPriceNettoHUF As Double
        Get
            Return _ListPriceNettoHUF
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("ListPriceNettoHUF", _ListPriceNettoHUF, value)
        End Set
    End Property
    Property ListPriceBruttoDEVRent As Double
        Get
            Return _ListPriceBruttoDEVRent
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("ListPriceBruttoDEVRent", _ListPriceBruttoDEVRent, value)
            If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
                ListPriceNettoDEVRent = Math.Round(ListPriceBruttoDEVRent / 1.25, 2, MidpointRounding.AwayFromZero)
                'AreaListPriceBruttoDEVRent = Math.Round((value / Me.Container.AreaNetto), 2, MidpointRounding.AwayFromZero)
                'AreaListPriceNettoDEVRent = Math.Round(AreaListPriceBruttoDEVRent / 1.25, 2, MidpointRounding.AwayFromZero)
            End If
        End Set
    End Property
    Property ListPriceBruttoHUFRent As Double
        Get
            Return _ListPriceBruttoHUFRent
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("ListPriceBruttoHUFRent", _ListPriceBruttoHUFRent, value)
            If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
                ListPriceNettoHUFRent = Math.Round(ListPriceBruttoHUFRent / 1.25, 0, MidpointRounding.AwayFromZero)
                'AreaListPriceBruttoHUFRent = Math.Round((value / Me.Container.AreaNetto), 0, MidpointRounding.AwayFromZero)
                'AreaListPriceNettoHUFRent = Math.Round(AreaListPriceBruttoHUFRent / 1.25, 0, MidpointRounding.AwayFromZero)
            End If
        End Set
    End Property
    Property ListPriceNettoDEVRent As Double
        Get
            Return _ListPriceNettoDEVRent
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("ListPriceNettoDEVRent", _ListPriceNettoDEVRent, value)
        End Set
    End Property
    Property ListPriceNettoHUFRent As Double
        Get
            Return _ListPriceNettoHUFRent
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("ListPriceNettoHUFRent", _ListPriceNettoHUFRent, value)
        End Set
    End Property
    Property AreaListPriceBruttoDEV As Double
        Get
            Return _AreaListPriceBruttoDEV
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AreaListPriceBruttoDEV", _AreaListPriceBruttoDEV, value)
        End Set
    End Property
    Property AreaListPriceBruttoHUF As Double
        Get
            Return _AreaListPriceBruttoHUF
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AreaListPriceBruttoHUF", _AreaListPriceBruttoHUF, value)
        End Set
    End Property
    Property AreaListPriceNettoDEV As Double
        Get
            Return _AreaListPriceNettoDEV
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AreaListPriceNettoDEV", _AreaListPriceNettoDEV, value)
        End Set
    End Property
    Property AreaListPriceNettoHUF As Double
        Get
            Return _AreaListPriceNettoHUF
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AreaListPriceNettoHUF", _AreaListPriceNettoHUF, value)
        End Set
    End Property
    Property AreaListPriceBruttoDEVRent As Double
        Get
            Return _AreaListPriceBruttoDEVRent
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AreaListPriceBruttoDEVRent", _AreaListPriceBruttoDEVRent, value)
        End Set
    End Property
    Property AreaListPriceBruttoHUFRent As Double
        Get
            Return _AreaListPriceBruttoHUFRent
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AreaListPriceBruttoHUFRent", _AreaListPriceBruttoHUFRent, value)
        End Set
    End Property
    Property AreaListPriceNettoDEVRent As Double
        Get
            Return _AreaListPriceNettoDEVRent
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AreaListPriceNettoDEVRent", _AreaListPriceNettoDEVRent, value)
        End Set
    End Property
    Property AreaListPriceNettoHUFRent As Double
        Get
            Return _AreaListPriceNettoHUFRent
        End Get
        Set(ByVal value As Double)
            SetPropertyValue("AreaListPriceNettoHUFRent", _AreaListPriceNettoHUFRent, value)
        End Set
    End Property
    Property NoteRow As String
        Get
            Return _NoteRow
        End Get
        Set(value As String)
            SetPropertyValue("NoteRow", _NoteRow, value)
        End Set
    End Property
End Class
