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.ExpressApp.ConditionalAppearance

'-- Paraméterek, enumok
<DefaultClassOptions()> _
<NavigationItem(False), CreatableItem(False)> _
<Appearance("Hide CRMEstate_Opportunity_Rent when CRMEstate_Opportunity.OpportunityType=1", AppearanceItemType.LayoutItem, "CRMEstate_Opportunity.OpportunityType=1", TargetItems:="CRMEstate_Opportunity_Rent", visibility:=Editors.ViewItemVisibility.Hide)> _
<Appearance("Hide CRMEstate_Opportunity_Payment_Forecast when CRMEstate_Opportunity.OpportunityType=0", AppearanceItemType.LayoutItem, "CRMEstate_Opportunity.OpportunityType=0", TargetItems:="CRMEstate_Opportunity_Payment_Forecast;CRMEstate_Opportunity_AdvanceMoney", visibility:=Editors.ViewItemVisibility.Hide)> _
Public Class CRMEstate_Opportunity_Immovables
    Inherits BaseObject

    Private _CRMEstate_Opportunity As CRMEstate_Opportunity
    Private _CRMEstate_Leads_Immovables As CRMEstate_Leads_Immovables

    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    Public Overrides Sub AfterConstruction()
        MyBase.AfterConstruction()
    End Sub

    <Association("CRMEstate_Opportunity-CRMEstate_Opportunity_Immovables", GetType(CRMEstate_Opportunity))> _
    Property CRMEstate_Opportunity As CRMEstate_Opportunity
        Get
            Return _CRMEstate_Opportunity
        End Get
        Set(value As CRMEstate_Opportunity)
            SetPropertyValue("CRMEstate_Opportunity", _CRMEstate_Opportunity, value)
        End Set
    End Property
    Property CRMEstate_Leads_Immovables As CRMEstate_Leads_Immovables
        Get
            Return _CRMEstate_Leads_Immovables
        End Get
        Set(value As CRMEstate_Leads_Immovables)
            SetPropertyValue("CRMEstate_Leads_Immovables", _CRMEstate_Leads_Immovables, value)
        End Set
    End Property

    <VisibleInListView(False)> _
    <Association("CRMEstate_Opportunity_Immovables-CRMEstate_Opportunity_Customers", GetType(CRMEstate_Opportunity_Customers))> _
    ReadOnly Property CRMEstate_Opportunity_Customers As XPCollection(Of CRMEstate_Opportunity_Customers)
        Get
            Return GetCollection(Of CRMEstate_Opportunity_Customers)("CRMEstate_Opportunity_Customers")
        End Get
    End Property
    <VisibleInListView(False)> _
    <Association("CRMEstate_Opportunity_Immovables-CRMEstate_Opportunity_Payment_Forecast", GetType(CRMEstate_Opportunity_Payment_Forecast))> _
    ReadOnly Property CRMEstate_Opportunity_Payment_Forecast As XPCollection(Of CRMEstate_Opportunity_Payment_Forecast)
        Get
            Return GetCollection(Of CRMEstate_Opportunity_Payment_Forecast)("CRMEstate_Opportunity_Payment_Forecast")
        End Get
    End Property
    <VisibleInListView(False)> _
    <Association("CRMEstate_Opportunity_Rent-CRMEstate_Opportunity_Immovables", GetType(CRMEstate_Opportunity_Rent))> _
    ReadOnly Property CRMEstate_Opportunity_Rent As XPCollection(Of CRMEstate_Opportunity_Rent)
        Get
            Return GetCollection(Of CRMEstate_Opportunity_Rent)("CRMEstate_Opportunity_Rent")

        End Get
    End Property
    <VisibleInListView(False)> _
    <Association("CRMEstate_Opportunity_Immovables-CRMEstate_Opportunity_AdvanceMoney", GetType(CRMEstate_Opportunity_AdvanceMoney))> _
    ReadOnly Property CRMEstate_Opportunity_AdvanceMoney As XPCollection(Of CRMEstate_Opportunity_AdvanceMoney)
        Get
            Return GetCollection(Of CRMEstate_Opportunity_AdvanceMoney)("CRMEstate_Opportunity_AdvanceMoney")
        End Get
    End Property

    <VisibleInDetailView(False), VisibleInListView(False), VisibleInLookupListView(False)> _
    ReadOnly Property Immovables_Oid As String
        Get
            Dim _Immovables_Oid As String = ""
            If Me.CRMEstate_Leads_Immovables IsNot Nothing Then
                If Me.CRMEstate_Leads_Immovables.Immovables IsNot Nothing Then
                    _Immovables_Oid = Me.CRMEstate_Leads_Immovables.Immovables.Oid.ToString
                End If
            End If
            Return _Immovables_Oid
        End Get
    End Property

End Class



