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 InvoiceHoldPopup Inherits BaseObject Private _InvoiceHeader As InvoiceHeader Private _row_DatePayment As Date Private _row_ShortName As String Private _row_AmountHUF As Double Private _row_AmountDEV As Double Private _row_Percent As Double Public Sub New(ByVal session As Session) MyBase.New(session) ' This constructor is used when an object is loaded from a persistent storage. ' Do not place any code here or place it only when the IsLoading property is false: ' if (!IsLoading){ ' It is now OK to place your initialization code here. ' } ' or as an alternative, move your initialization code into the AfterConstruction method. End Sub Public Overrides Sub AfterConstruction() MyBase.AfterConstruction() ' Place here your initialization code. 'row_Percent = 5 End Sub Property InvoiceHeader As InvoiceHeader Get Return _InvoiceHeader End Get Set(value As InvoiceHeader) SetPropertyValue("InvoiceHeader", _InvoiceHeader, value) End Set End Property _ _ Property row_DatePayment As Date Get Return _row_DatePayment End Get Set(value As Date) SetPropertyValue("row_DatePayment", _row_DatePayment, value) End Set End Property _ Property row_ShortName As String Get Return _row_ShortName End Get Set(value As String) SetPropertyValue("row_ShortName", _row_ShortName, value) End Set End Property _ _ Property row_AmountHUF As Double Get Return _row_AmountHUF End Get Set(value As Double) SetPropertyValue("row_AmountHUF", _row_AmountHUF, value) End Set End Property _ _ Property row_AmountDEV As Double Get Return _row_AmountDEV End Get Set(value As Double) SetPropertyValue("row_AmountDEV", _row_AmountDEV, value) End Set End Property _ _ Property row_Percent As Double Get Return _row_Percent End Get Set(value As Double) SetPropertyValue("row_Percent", _row_Percent, value) If Session.IsObjectsLoading = False And Session.IsObjectsSaving = False Then row_AmountHUF = Math.Round(InvoiceHeader.TotalBruttoHUF * (value / 100), 0, MidpointRounding.AwayFromZero) row_AmountDEV = Math.Round(InvoiceHeader.TotalBruttoDEV * (value / 100), 2, MidpointRounding.AwayFromZero) End If End Set End Property _ ReadOnly Property InvoiceHold As XPCollection(Of InvoiceHold) Get Return New XPCollection(Of InvoiceHold)(Session, CriteriaOperator.Parse("InvoiceHeader=?", Me.InvoiceHeader)) End Get End Property End Class