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.Xpo Imports DevExpress.Data.Filtering Imports DevExpress.ExpressApp.SystemModule Public Class FixedAssetsQueryVC Inherits DevExpress.ExpressApp.ViewController Public Event InitWork(ByVal _Minimum As Long, ByVal _Step As Long, ByVal _Maximum As Long) Public Event DoWork() Public Event FinalWork Public Sub New() MyBase.New() 'This call is required by the Component Designer. InitializeComponent() RegisterActions(components) End Sub Private Sub aGenerateFixedAssetsQuery_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aGenerateFixedAssetsQuery.Execute Dim _onew As Xpo.XPObjectSpace = Application.CreateObjectSpace Dim _FixedAssetsQueryHeader As FixedAssetsQueryHeader = _onew.GetObject(TryCast(View.SelectedObjects(0), FixedAssetsQueryHeader)) Dim _FixedAssetsCard_Collection As XPCollection(Of FixedAssetsCard) Dim _FixedAssetsCard As FixedAssetsCard = Nothing Dim _FixedAssetsQueryRows As FixedAssetsQueryRows = Nothing _onew.Delete(_FixedAssetsQueryHeader.FixedAssetsQueryRows) _FixedAssetsCard_Collection = New XPCollection(Of FixedAssetsCard)(_onew.Session, CriteriaOperator.Parse("IsEditable=False and IsActivated=True and CustomersFrom=?", _FixedAssetsQueryHeader.CustomersFrom)) For Each _FixedAssetsCard In _FixedAssetsCard_Collection _FixedAssetsQueryRows = _onew.CreateObject(Of FixedAssetsQueryRows)() _FixedAssetsQueryRows.FixedAssetsQueryHeader = _FixedAssetsQueryHeader _FixedAssetsQueryRows.FixedAssetsCard = _FixedAssetsCard '// ÉCS Dim _FixedAssetsCardPlanRows_Collection As New XPCollection(Of FixedAssetsCardPlanRows)(_onew.Session, CriteriaOperator.Parse("FixedAssetsCard=? and FixedAssetsCardPlanRowsType in (1,3) and DateTo