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 Enum eOutMode eProducts = 0 ePacketNumber = 1 eSerialNumber = 2 End Enum ' _ ' _ _ _ _ 0", AppearanceItemType.ViewItem, "row_OutMode<>0", TargetItems:="row_StorageComputed", visibility:=Editors.ViewItemVisibility.Hide)> _ _ _ _ _ _ _ 6", AppearanceItemType.ViewItem, "StorageMoveType.MoveType<>6", TargetItems:="StorageTo", visibility:=Editors.ViewItemVisibility.Hide)> _ _ Public Class StorageOutHeader Inherits BaseObject Private _StorageMoveType As StorageMoveType Private _CustomersFrom As CustomersFrom Private _Customers As Customers Private _DocumentNumber As String Private _Storage As Storage Private _StorageTo As Storage Private _CreateDate As Date Private _Active As Boolean = True Private _ObjectCreated As Date Private _UserCreated As User 'Ki készítette Private _IsStorno As Boolean = False Private _IsEditable As Boolean = True Private _IsFinalized As Boolean = False 'Volt-e már véglegesítve ? Private _RecipeExecutionSimple As RecipeExecutionSimple 'Melyik gyártáshoz kapcs. kitárolás Private _WorkSheet_Header As WorkSheet_Header 'Melyik munkalaphoz kapcsolódik a kitárolás Private _StoragePDACollectionHeader As StoragePDACollectionHeader Private _ConnectInfo As String Private _DeliveryNoteOutHeader As DeliveryNoteOutHeader 'Milyen szállítólevelen lett raktárközi kiszállítva, visszárúzva stb. '---------------------------------------------------------------------------- Private _row_OutMode As eOutMode Private _row_QTT As Double Private _row_QTT_Will As Double Private _row_StorageComputed As StorageComputed Private _row_StorageInRows As StorageInRows '---------------------------------------------------------------------------- Public Sub New(ByVal session As Session) MyBase.New(session) End Sub Public Overrides Sub AfterConstruction() MyBase.AfterConstruction() CreateDate = GetSQLTime(Session) End Sub Protected Overrides Sub OnSaving() MyBase.OnSaving() If String.IsNullOrEmpty(DocumentNumber) Then _DocumentNumber = _Storage.NumberGeneratorOut.GetNewNumber(_Storage.NumberGeneratorOut) End If If Session.IsNewObject(Me) Then ObjectCreated = GetSQLTime(Session) UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser)) End If End Sub Property StorageMoveType As StorageMoveType Get Return _StorageMoveType End Get Set(value As StorageMoveType) SetPropertyValue("StorageMoveType", _StorageMoveType, value) End Set End Property Property CustomersFrom As CustomersFrom Get Return _CustomersFrom End Get Set(ByVal value As CustomersFrom) SetPropertyValue("CustomersFrom", _CustomersFrom, value) End Set End Property Property Customers As Customers Get Return _Customers End Get Set(ByVal value As Customers) SetPropertyValue("Customres", _Customers, value) End Set End Property Property DocumentNumber() As String Get Return _DocumentNumber End Get Set(ByVal value As String) SetPropertyValue("DocumentNumber", _DocumentNumber, value) End Set End Property Property Storage() As Storage Get Return _Storage End Get Set(ByVal value As Storage) SetPropertyValue("Storage", _Storage, value) If Not Session.IsObjectsLoading And Not Session.IsObjectsSaving Then If StorageMoveType IsNot Nothing Then If StorageMoveType.MoveType = eMoveType.InventoryTransfer Then Customers = value.CustomersFrom End If End If End If End Set End Property Property StorageTo As Storage Get Return _StorageTo End Get Set(value As Storage) SetPropertyValue("StorageTo", _StorageTo, value) If Not Session.IsObjectsLoading And Not Session.IsObjectsSaving Then If StorageMoveType.MoveType = eMoveType.InventoryTransfer Then If value Is Nothing Then Customers = Nothing Else Customers = value.CustomersFrom End If End If End If End Set End Property Property CreateDate() As Date Get Return _CreateDate End Get Set(ByVal value As Date) SetPropertyValue("CreateDate", _CreateDate, value) End Set End Property Property Active() As Boolean Get Return _Active End Get Set(ByVal value As Boolean) SetPropertyValue("Active", _Active, value) End Set End Property Property ObjectCreated() As Date Get Return _ObjectCreated End Get Set(ByVal value As Date) SetPropertyValue("ObjectCreated", _ObjectCreated, value) End Set End Property Property UserCreated As User Get Return _UserCreated End Get Set(value As User) SetPropertyValue("UserCreated", _UserCreated, value) End Set End Property Property IsStorno() As Boolean Get Return _IsStorno End Get Set(ByVal value As Boolean) SetPropertyValue("IsStorno", _IsStorno, value) End Set End Property Property IsEditable() As Boolean Get Return _IsEditable End Get Set(ByVal value As Boolean) SetPropertyValue("IsEditable", _IsEditable, value) End Set End Property Property IsFinalized As Boolean Get Return _IsFinalized End Get Set(value As Boolean) SetPropertyValue("IsFinalized", _IsFinalized, value) End Set End Property Property RecipeExecutionSimple As RecipeExecutionSimple Get Return _RecipeExecutionSimple End Get Set(value As RecipeExecutionSimple) SetPropertyValue("RecipeExecutionSimple", _RecipeExecutionSimple, value) End Set End Property 1")> Property WorkSheet_Header As WorkSheet_Header Get Return _WorkSheet_Header End Get Set(value As WorkSheet_Header) SetPropertyValue("WorkSheet_Header", _WorkSheet_Header, value) End Set End Property Property StoragePDACollectionHeader As StoragePDACollectionHeader Get Return _StoragePDACollectionHeader End Get Set(value As StoragePDACollectionHeader) SetPropertyValue("StoragePDACollectionHeader", _StoragePDACollectionHeader, value) End Set End Property Property ConnectInfo As String Get Return _ConnectInfo End Get Set(value As String) SetPropertyValue("ConnectInfo", _ConnectInfo, value) End Set End Property ''' ''' Milyen szállítólevelen lett kiszállítva (raktárközi, visszárú esetén) ''' ''' Property DeliveryNoteOutHeader As DeliveryNoteOutHeader Get Return _DeliveryNoteOutHeader End Get Set(value As DeliveryNoteOutHeader) SetPropertyValue("DeliveryNoteOutHeader", _DeliveryNoteOutHeader, value) End Set End Property 'Nonpersistent Property row_OutMode As eOutMode Get Return _row_OutMode End Get Set(value As eOutMode) SetPropertyValue("row_OutMode", _row_OutMode, value) End Set End Property Property row_QTT() As Double Get Return _row_QTT End Get Set(ByVal value As Double) SetPropertyValue("Row_QTT", _row_QTT, value) End Set End Property Property row_QTT_Will() As Double Get Return _row_QTT_Will End Get Set(ByVal value As Double) SetPropertyValue("Row_QTT_Will", _row_QTT_Will, value) End Set End Property Property row_StorageComputed() As StorageComputed Get Return _row_StorageComputed End Get Set(ByVal value As StorageComputed) SetPropertyValue("Row_StorageComputed", _row_StorageComputed, value) End Set End Property QTT_Out")> _ _ Property row_StorageInRows As StorageInRows Get Return _row_StorageInRows End Get Set(value As StorageInRows) SetPropertyValue("row_StorageInRows", _row_StorageInRows, value) End Set End Property 'XPCollections Public ReadOnly Property StorageOutRows As XPCollection(Of StorageOutRows) Get Return GetCollection(Of StorageOutRows)("StorageOutRows") End Get End Property _ ReadOnly Property StorageOutRowsInRows As XPCollection(Of StorageOutRowsInRows) Get Dim _StorageOutRowsInRows_Collection As New XPCollection(Of StorageOutRowsInRows)(Session, CriteriaOperator.Parse("1=2")) Dim _StorageOutRows As StorageOutRows Dim _StorageOutRowsInRows As StorageOutRowsInRows For Each _StorageOutRows In Me.StorageOutRows For Each _StorageOutRowsInRows In _StorageOutRows.StorageOutRowsInRows _StorageOutRowsInRows_Collection.Add(_StorageOutRowsInRows) Next Next Return _StorageOutRowsInRows_Collection End Get End Property _ ReadOnly Property StorageInRows As XPCollection(Of StorageInRows) Get Dim _StorageInRows_Collection As New XPCollection(Of StorageInRows)(Session, CriteriaOperator.Parse("1=2")) Dim _StorageOutRows As StorageOutRows Dim _StorageOutRowsInRows As StorageOutRowsInRows For Each _StorageOutRows In Me.StorageOutRows For Each _StorageOutRowsInRows In _StorageOutRows.StorageOutRowsInRows _StorageInRows_Collection.Add(_StorageOutRowsInRows.StorageInRows) Next Next Return _StorageInRows_Collection End Get End Property End Class