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 Class TakeoverProtocolHeader Inherits BaseObject Private _CustomersFrom As CustomersFrom Private _DocumentNumber As String Private _TakeoverProtocolType As TakeoverProtocolType Private _DateExecution As Date Private _Customers As Customers Private _ObjectCreated As Date 'Objektum keletkezésének dátuma Private _UserCreated As User Private _IsEditable As Boolean = True Private _IsStorno As Boolean = False '--------------NonPersistent-------------- Private _row_Installation As Installation Private _row_UniqueObjects As UniqueObjects Public Sub New(ByVal session As Session) MyBase.New(session) End Sub Public Overrides Sub AfterConstruction() MyBase.AfterConstruction() IsEditable = True End Sub Protected Overrides Sub OnSaving() MyBase.OnSaving() If String.IsNullOrEmpty(DocumentNumber) Then DocumentNumber = TakeoverProtocolType.NumberGenerator.GetNewNumber(TakeoverProtocolType.NumberGenerator) End If If Session.IsNewObject(Me) Then ObjectCreated = GetSQLTime(Session) UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser)) End If End Sub _ Property Customers() As Customers Get Return _Customers End Get Set(ByVal value As Customers) SetPropertyValue("Customers", _Customers, value) End Set End Property Property DocumentNumber() As String Get Return _DocumentNumber End Get Set(ByVal value As String) SetPropertyValue("DocumentNumber", _DocumentNumber, value) End Set End Property Property TakeoverProtocolType As TakeoverProtocolType Get Return _TakeoverProtocolType End Get Set(value As TakeoverProtocolType) SetPropertyValue("TakeoverProtocolType", _TakeoverProtocolType, value) End Set End Property Property DateExecution As Date Get Return _DateExecution End Get Set(ByVal value As Date) SetPropertyValue("DateExecution", _DateExecution, value) End Set End Property Property CustomersFrom() As CustomersFrom Get Return _CustomersFrom End Get Set(ByVal value As CustomersFrom) SetPropertyValue("CustomersFrom", _CustomersFrom, value) End Set End Property Property ObjectCreated As Date Get Return _ObjectCreated End Get Set(value As Date) SetPropertyValue("ObjectCreated", _ObjectCreated, value) End Set End Property Property UserCreated As User Get Return _UserCreated End Get Set(value As User) SetPropertyValue("UserCreated", _UserCreated, value) End Set End Property Property IsEditable As Boolean Get Return _IsEditable End Get Set(value As Boolean) SetPropertyValue("IsEditable", _IsEditable, value) End Set End Property Property IsStorno As Boolean Get Return _IsStorno End Get Set(value As Boolean) SetPropertyValue("IsStorno", _IsStorno, value) End Set End Property '--------------NonPersistent-------------- Property row_Installation() As Installation Get Return _row_Installation End Get Set(ByVal value As Installation) SetPropertyValue("row_Installation", _row_Installation, value) End Set End Property Property row_UniqueObjects() As UniqueObjects Get Return _row_UniqueObjects End Get Set(ByVal value As UniqueObjects) SetPropertyValue("row_UniqueObjects", _row_UniqueObjects, value) End Set End Property '----------ReadOnly-------------------- _ _ Public ReadOnly Property TakeOverProtocolRows() As XPCollection(Of TakeoverProtocolRows) Get Return GetCollection(Of TakeoverProtocolRows)("TakeOverProtocolRows") End Get End Property _ _ Private ReadOnly Property RowInstallationCollection As XPCollection(Of Installation) Get Dim _RowInstallationCollection_Collection As XPCollection(Of Installation) _RowInstallationCollection_Collection = New XPCollection(Of Installation)(Session, CriteriaOperator.Parse("isnull(TakeoverProtocolRows)=True or (InstallationType.IsVirtual=True)")) Return _RowInstallationCollection_Collection End Get End Property End Class