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.SystemModule
Imports DevExpress.Persistent.Base.Security
Imports DevExpress.ExpressApp.ConditionalAppearance
Imports DevExpress.ExpressApp.Filtering

<DefaultClassOptions()> _
<NavigationItem(False), CreatableItem(False)> _
<DefaultProperty("DisplayName")> _
Public Class CertificateofContractRows
    Inherits BaseObject
    Private _CertificateofContractHeader As CertificateofContractHeader
    Private _ContractRows As ContractRows
    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    <Association("CertificateofContractHeader-CertificateofContractRows", GetType(CertificateofContractHeader))> _
    Property CertificateofContractHeader() As CertificateofContractHeader
        Get
            Return _CertificateofContractHeader
        End Get
        Set(ByVal value As CertificateofContractHeader)
            SetPropertyValue("CertificateofContractHeader", _CertificateofContractHeader, value)
        End Set
    End Property
    <ImmediatePostData(True), DataSourceCriteria("Contracts='@This.CertificateofContractHeader.Contracts' and isnull(CertificateofContractRows)=True")>
    Property ContractRows As ContractRows
        Get
            Return _ContractRows
        End Get
        Set(ByVal value As ContractRows)
            SetPropertyValue("ContractRows", _ContractRows, value)

        End Set
    End Property
    ReadOnly Property DisplayName
        Get
            If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then
                Return _CertificateofContractHeader.Contracts.CustomersFrom.FullName & ", " & _CertificateofContractHeader.DateExecution
            Else
                Return ""
            End If
        End Get
    End Property
End Class
