Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text

Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.Persistent.Base
Imports DevExpress.Data.Filtering
Imports DevExpress.Xpo
Imports DevExpress.ExpressApp.SystemModule
Imports System.Linq
Imports System.IO
Imports DevExpress.ExpressApp.Editors
Public Module ViewRegistry
    Public Sub ViewRegistry(_ObjectSpace As Xpo.XPObjectSpace, Application As DevExpress.ExpressApp.XafApplication, _
                            e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs, _
                            _CustomersFrom As CustomersFrom, _Customers As Customers, _DocumentNumber As String)
        Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace

        Dim _RegistryHeader As RegistryHeader = _ObjectSpace.FindObject(Of RegistryHeader) _
        (CriteriaOperator.Parse("CustomersFrom=? and Customers=? and DocumentNumber=?", _CustomersFrom, _Customers, _DocumentNumber))

        If _RegistryHeader IsNot Nothing Then

            e.ShowViewParameters.CreatedView = Application.CreateDetailView(_onew, "RegistryHeader_DetailView", False, _onew.GetObject(_RegistryHeader))

        End If
    End Sub
End Module
