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("Customers")> _
<DefaultProperty("ShortName")> _
Public Class CustomersFrom '-- Ezek azok a cégek akik használják a programot vagy project cégek, de mi kezeljük őket
    Inherits Customers
    Private _ShortName As String
    Private _Description As String
    Private _IsDefault As Boolean

    '65A nyomtatványhoz 
    Private _PublicLandAddress1 As String 'Székhelyhez tartozó közterület 
    Private _PublicLandAddress2 As String 'Telephelyhez tartozó közterület 
    Private _AdministratorName As String
    Private _AdministratorPhoneNumber As String

    '// RabbitMQ felhasználók és jelszavak

    Private _RabbitMQServerAddress As String
    Private _RabbitMQServerUser As String
    Private _RabbitMQServerPassword As String
    Private _RabbitMQBodyEncryptCode As String

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

    Property IsDefault() As Boolean
        Get
            Return _IsDefault
        End Get
        Set(ByVal value As Boolean)
            SetPropertyValue("IsDefault", _IsDefault, value)
        End Set
    End Property
    Property PublicLandAddress1 As String
        Get
            Return _PublicLandAddress1
        End Get
        Set(value As String)
            SetPropertyValue("PublicLandAddress1", _PublicLandAddress1, value)
        End Set
    End Property
    Property PublicLandAddress2 As String
        Get
            Return _PublicLandAddress2
        End Get
        Set(value As String)
            SetPropertyValue("PublicLandAddress2", _PublicLandAddress2, value)
        End Set
    End Property
    Property AdministratorName As String
        Get
            Return _AdministratorName
        End Get
        Set(value As String)
            SetPropertyValue("AdministratorName", _AdministratorName, value)
        End Set
    End Property
    Property AdministratorPhoneNumber As String
        Get
            Return _AdministratorPhoneNumber
        End Get
        Set(value As String)
            SetPropertyValue("AdministratorPhoneNumber", _AdministratorPhoneNumber, value)
        End Set
    End Property

    '// RabbitMQ 
    Property RabbitMQServerAddress As String
        Get
            Return _RabbitMQServerAddress
        End Get
        Set(value As String)
            SetPropertyValue("RabbitMQServerAddress", _RabbitMQServerAddress, value)
        End Set
    End Property
    Property RabbitMQServerUser As String
        Get
            Return _RabbitMQServerUser
        End Get
        Set(value As String)
            SetPropertyValue("RabbitMQServerUser", _RabbitMQServerUser, value)
        End Set
    End Property
    <PasswordPropertyText()> _
    <ValueConverter(GetType(Encryption))> _
    Property RabbitMQServerPassword As String
        Get
            Return _RabbitMQServerPassword
        End Get
        Set(value As String)
            SetPropertyValue("RabbitMQServerPassword", _RabbitMQServerPassword, value)
        End Set
    End Property
    <ValueConverter(GetType(Encryption))> _
    Property RabbitMQBodyEncryptCode As String
        Get
            Return _RabbitMQBodyEncryptCode
        End Get
        Set(value As String)
            SetPropertyValue("RabbitMQBodyEncryptCode", _RabbitMQBodyEncryptCode, value)
        End Set
    End Property

    ReadOnly Property DefaultCustomerBankAccounts As CustomerBankAccounts
        Get
            Dim _CustomerBankAccounts As CustomerBankAccounts = Nothing
            Dim _DefaultCustomerBankAccounts As CustomerBankAccounts = Nothing
            For Each _CustomerBankAccounts In Me.CustomerBankAccounts
                If _CustomerBankAccounts.IsDefault Then
                    _DefaultCustomerBankAccounts = _CustomerBankAccounts
                End If
            Next
            Return _DefaultCustomerBankAccounts
        End Get
    End Property
End Class





