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

Public Enum eCostRecordMode
    eNormal = 0 'Mérés alapján (előző és aktuálsi)
    eQuarter = 1 'Állandó szám m2 alapon
End Enum
Public Enum eCostRecordBaseMode
    eFix = 0 'Fix díjas
    eCosuption = 1 'Fogyasztás
End Enum

<DefaultClassOptions()> _
<NavigationItem("RealEstateStocks")> _
<CreatableItem(False)> _
Public Class ImmovablesCostRecordGroup
    Inherits BaseObject
    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    Public Overrides Sub AfterConstruction()
        MyBase.AfterConstruction()
        ' Place here your initialization code.
    End Sub
    Protected Overrides Sub OnSaving()
        MyBase.OnSaving()
        If Session.IsNewObject(Me) Then
            ObjectCreated = GetSQLTime(Session)
            UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser))
        End If
    End Sub

    Private _ImmovablesCostRecordMainGroup As ImmovablesCostRecordMainGroup
    Private _ShortName As String
    Private _Description As String
    Private _eCostRecordMode As eCostRecordMode
    Private _CostRecordBaseMode As eCostRecordBaseMode

    Private _CostPlace As CostPlace
    Private _CostHolder As CostHolder
    Private _Controlling As Controlling

    Private _ObjectCreated As Date
    Private _UserCreated As User
    Private _DecimalPlace As Integer = 2

    <Association("ImmovablesCostRecordMainGroup-ImmovablesCostRecordGroup", GetType(ImmovablesCostRecordMainGroup))> _
    Property ImmovablesCostRecordMainGroup As ImmovablesCostRecordMainGroup
        Get
            Return _ImmovablesCostRecordMainGroup
        End Get
        Set(value As ImmovablesCostRecordMainGroup)
            SetPropertyValue("ImmovablesCostRecordMainGroup", _ImmovablesCostRecordMainGroup, value)
        End Set
    End Property
    Property ShortName As String
        Get
            Return _ShortName
        End Get
        Set(value As String)
            SetPropertyValue("ShortName", _ShortName, value)
        End Set
    End Property
    Property Description As String
        Get
            Return _Description
        End Get
        Set(value As String)
            SetPropertyValue("Description", _Description, value)
        End Set
    End Property
    Property eCostRecordMode As eCostRecordMode
        Get
            Return _eCostRecordMode
        End Get
        Set(value As eCostRecordMode)
            SetPropertyValue("eCostRecordMode", _eCostRecordMode, value)
        End Set
    End Property
    Property CostRecordBaseMode As eCostRecordBaseMode
        Get
            Return _CostRecordBaseMode
        End Get
        Set(value As eCostRecordBaseMode)
            SetPropertyValue("CostRecordBaseMode", _CostRecordBaseMode, value)
        End Set
    End Property
    Property CostPlace As CostPlace
        Get
            Return _CostPlace
        End Get
        Set(value As CostPlace)
            SetPropertyValue("CostPlace", _CostPlace, value)
        End Set
    End Property
    Property CostHolder As CostHolder
        Get
            Return _CostHolder
        End Get
        Set(value As CostHolder)
            SetPropertyValue("CostHolder", _CostHolder, value)
        End Set
    End Property
    Property Controlling As Controlling
        Get
            Return _Controlling
        End Get
        Set(value As Controlling)
            SetPropertyValue("Controlling", _Controlling, value)
        End Set
    End Property
    <NonCloneable> _
    Property ObjectCreated As Date
        Get
            Return _ObjectCreated
        End Get
        Set(value As Date)
            SetPropertyValue("ObjectCreated", _ObjectCreated, value)
        End Set
    End Property
    <NonCloneable> _
    Property UserCreated As User
        Get
            Return _UserCreated
        End Get
        Set(value As User)
            SetPropertyValue("UserCreated", _UserCreated, value)
        End Set
    End Property
    Property DecimalPlace As Integer
        Get
            Return _DecimalPlace
        End Get
        Set(value As Integer)
            SetPropertyValue("DecimalPlace", _DecimalPlace, value)
        End Set
    End Property
End Class

