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

<DefaultClassOptions()> _
<NonPersistent(), NavigationItem(False), CreatableItem(False)> _
<Appearance("FixedAssetsUsingPopup - Hide HRPerson", AppearanceItemType:="ViewItem", criteria:="FixedAssetsUsingType in ('eCustomers','eCostHolder')", TargetItems:="HRPerson", visibility:=Editors.ViewItemVisibility.Hide)> _
<Appearance("FixedAssetsUsingPopup - Hide Customers", AppearanceItemType:="ViewItem", criteria:="FixedAssetsUsingType in ('eHRPerson','eCostHolder')", TargetItems:="Customers", visibility:=Editors.ViewItemVisibility.Hide)> _
<Appearance("FixedAssetsUsingPopup - Hide CostHolder", AppearanceItemType:="ViewItem", criteria:="FixedAssetsUsingType in ('eCustomers','eHRPerson')", TargetItems:="CostHolder", visibility:=Editors.ViewItemVisibility.Hide)> _
<Appearance("FixedAssetsUsingPopup - Hide when eIn", AppearanceItemType:="ViewItem", criteria:="FixedAssetsUsingMoveType='eIn'", TargetItems:="CostHolder;Customers;HRPerson;FixedAssetsUsingType", visibility:=Editors.ViewItemVisibility.Hide)> _
Public Class FixedAssetsUsingPopup
    Inherits BaseObject
    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()
        DateExecution = GetSQLTime(Session)
        ' Place here your initialization code.
    End Sub
    <ImmediatePostData()> _
    Property FixedAssetsUsingType As eFixedAssetsUsingType
    <RuleRequiredField("FixedAssetsUsingPopup", "DialogOk_Contexts")> _
    Property FixedAssetsUsingParameters As FixedAssetsUsingParameters
    <RuleRequiredField("FixedAssetsUsingPopup-HRPerson", "FixedAssetsUsingPopup", targetcriteria:="FixedAssetsUsingType='eHRPerson' and FixedAssetsUsingMoveType='eOut'")> _
    Property HRPerson As HRPerson
    <RuleRequiredField("FixedAssetsUsingPopup-Customers", "FixedAssetsUsingPopup", targetcriteria:="FixedAssetsUsingType='Customers' and FixedAssetsUsingMoveType='eOut'")> _
    Property Customers As Customers
    <RuleRequiredField("FixedAssetsUsingPopup-CostHolder", "FixedAssetsUsingPopup", targetcriteria:="FixedAssetsUsingType='CostHolder' and FixedAssetsUsingMoveType='eOut'")> _
    Property CostHolder As CostHolder
    Property DateExecution As Date
    <Browsable(False)> Property FixedAssetsUsingMoveType As eFixedAssetsUsingMoveType
End Class
