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()> _
<NonPersistent()> _
<NavigationItem(False)> _
<CreatableItem(False)> _
Public Class MoveProductsOtherLocation_PopUp
    Inherits BaseObject

    Private _StorageLocation As StorageLocation
    Private _NewStorageLocation As StorageLocation
    Private _Criteria As String

    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    Public Overrides Sub AfterConstruction()
        MyBase.AfterConstruction()
        Criteria = "1=2"
    End Sub

    <Browsable(False)> _
    Property StorageLocation As StorageLocation
        Get
            Return _StorageLocation
        End Get
        Set(value As StorageLocation)
            SetPropertyValue("StorageLocation", _StorageLocation, value)
        End Set
    End Property
    <ImmediatePostData(True), DataSourceCriteria("Storage='@This.StorageLocation.Storage'")>
    Property NewStorageLocation As StorageLocation
        Get
            Return _NewStorageLocation
        End Get
        Set(value As StorageLocation)
            SetPropertyValue("NewStorageLocation", _NewStorageLocation, value)
        End Set
    End Property
    Property Criteria As String
        Get
            Return _Criteria
        End Get
        Set(value As String)
            SetPropertyValue("Criteria", _Criteria, value)
        End Set
    End Property
    '------------------Readonly--------------
    ReadOnly Property StorageComputedLocations As XPCollection(Of StorageComputedLocations)
        Get
            If Criteria <> "1=2" Then
                Return New XPCollection(Of StorageComputedLocations)(Session, CriteriaOperator.Parse(Criteria))
            Else
                Return Nothing
            End If
        End Get
    End Property
End Class
