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

Public Enum eEmailTo
    eCRM = 0
    eRegistry = 1
    eCRMEstate = 2
End Enum
<DefaultClassOptions()> _
<NavigationItem(False)> _
<CreatableItem(False)> _
<NonPersistent()> _
<Appearance("OutlookEmailIn_To_CRMLeads - Hide Registry properties when EmailTo=0", AppearanceItemType.ViewItem, "EmailTo=0", TargetItems:="CustomersFrom; RegistryType; DeliveryType; CRMEstate_Leads", visibility:=Editors.ViewItemVisibility.Hide)> _
<Appearance("OutlookEmailIn_To_CRMLeads - Hide CRM properties when EmailTo=1", AppearanceItemType.ViewItem, "EmailTo=1", TargetItems:="CRM_Leads; CRM_Opportunities; CRMEstate_Leads", visibility:=Editors.ViewItemVisibility.Hide)> _
<Appearance("OutlookEmailIn_To_CRMLeads - Hide CRM properties when EmailTo=2", AppearanceItemType.ViewItem, "EmailTo=2", TargetItems:="CRM_Leads; CRM_Opportunities; CustomersFrom; RegistryType; DeliveryType;", visibility:=Editors.ViewItemVisibility.Hide)> _
Public Class OutlookEmailIn_To_CRMLeads
    Inherits BaseObject

    Private _EmailTo As eEmailTo
    Private _EMail As String

    '-------CRM----------
    Private _CRM_Leads As CRM_Leads
    Private _CRM_Opportunities As CRM_Opportunities


    '-------Registry-------
    Private _CustomersFrom As CustomersFrom
    Private _RegistryType As RegistryType 'Iktatás típusa

    '-------CRMEstate------
    Private _CRMEstate_Leads As CRMEstate_Leads


    Public Sub New(ByVal session As Session)
        MyBase.New(session)

    End Sub
    Public Overrides Sub AfterConstruction()
        MyBase.AfterConstruction()

    End Sub

    <ImmediatePostData()> _
    Property EmailTo As eEmailTo
        Get
            Return _EmailTo
        End Get
        Set(value As eEmailTo)
            SetPropertyValue("EmailTo", _EmailTo, value)
        End Set
    End Property
    <Browsable(False)> _
    Property EMail As String
        Get
            Return _EMail
        End Get
        Set(value As String)
            SetPropertyValue("EMail", _EMail, value)
        End Set
    End Property

    '-------CRM----------
    Public Property CRM_Leads As CRM_Leads
        Get
            Return _CRM_Leads
        End Get
        Set(value As CRM_Leads)
            SetPropertyValue("CRM_Leads", _CRM_Leads, value)
        End Set
    End Property
    Public Property CRM_Opportunities As CRM_Opportunities
        Get
            Return _CRM_Opportunities
        End Get
        Set(value As CRM_Opportunities)
            SetPropertyValue("CRM_Opportunities", _CRM_Opportunities, value)
        End Set
    End Property

    '-------Registry-------
    Property CustomersFrom As CustomersFrom
        Get
            Return _CustomersFrom
        End Get
        Set(value As CustomersFrom)
            SetPropertyValue("CustomersFrom", _CustomersFrom, value)
        End Set
    End Property
    <DataSourceCriteria("CustomersFrom = '@This.CustomersFrom'")> _
    Property RegistryType As RegistryType
        Get
            Return _RegistryType
        End Get
        Set(value As RegistryType)
            SetPropertyValue("RegistryType", _RegistryType, value)
        End Set
    End Property

    '-------CRMEstate------
    Property CRMEstate_Leads As CRMEstate_Leads
        Get
            Return _CRMEstate_Leads
        End Get
        Set(value As CRMEstate_Leads)
            SetPropertyValue("CRMEstate_Leads", _CRMEstate_Leads, value)
        End Set
    End Property
End Class
