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 eSalesPolicyDocumentState eDeleted = -1 eReadyforSign = 0 eSigned = 2 End Enum _ _ _ _ _ _ _ _ Public Class APCSheetByProductsSalesPolicyH 'Értékesítési szándéknyilatkozat fejléc termeltetési szerződéshez Inherits BaseObject Private _CustomersFrom As CustomersFrom Private _APCSheetHeader As APCSheetHeader 'Termeltetési szerz. Private _DocumentNumber As String 'Sorszám Private _Customers As Customers 'Vevő Private _DateCreated As Date 'Dátum Private _SalesPolicyDocumentState As eSalesPolicyDocumentState Private _FileData As FileData 'Az aláírt szkennelt file Private _ObjectCreated As Date Private _UserCreated As User Public Sub New(ByVal session As Session) MyBase.New(session) End Sub Public Overrides Sub AfterConstruction() MyBase.AfterConstruction() End Sub Protected Overrides Sub OnSaving() MyBase.OnSaving() ' Dim _APCParameters As APCParameters = Session.FindObject(Of APCParameters)(CriteriaOperator.Parse("CustomersFrom=? AND NumberGenaratorSalesPolicy<>?", CustomersFrom, Nothing)) Dim _APCParameters As APCParameters = Me._APCSheetHeader.APCParameters If _APCParameters IsNot Nothing Then If _APCParameters.NumberGenaratorSalesPolicy IsNot Nothing Then If String.IsNullOrEmpty(DocumentNumber) Then DocumentNumber = _APCParameters.NumberGenaratorSalesPolicy.GetNewNumber(_APCParameters.NumberGenaratorSalesPolicy) End If End If If Session.IsNewObject(Me) Then ObjectCreated = GetSQLTime(Session) UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser)) End If End Sub _ Property CustomersFrom As CustomersFrom Get Return _CustomersFrom End Get Set(value As CustomersFrom) SetPropertyValue("CustomersFrom", _CustomersFrom, value) End Set End Property _ Property APCSheetHeader As APCSheetHeader Get Return _APCSheetHeader End Get Set(value As APCSheetHeader) SetPropertyValue("APCSheetHeader", _APCSheetHeader, value) End Set End Property Property DocumentNumber As String Get Return _DocumentNumber End Get Set(value As String) SetPropertyValue("DocumentNumber", _DocumentNumber, value) End Set End Property Property Customers As Customers Get Return _Customers End Get Set(value As Customers) SetPropertyValue("Customers", _Customers, value) End Set End Property Property DateCreated As Date Get Return _DateCreated End Get Set(value As Date) SetPropertyValue("DateCreated", _DateCreated, value) End Set End Property Property SalesPolicyDocumentState As eSalesPolicyDocumentState Get Return _SalesPolicyDocumentState End Get Set(value As eSalesPolicyDocumentState) SetPropertyValue("SalesPolicyDocumentState", _SalesPolicyDocumentState, value) End Set End Property Property FileData As FileData Get Return _FileData End Get Set(value As FileData) SetPropertyValue("FileData", _FileData, value) End Set End Property _ Property ObjectCreated As Date Get Return _ObjectCreated End Get Set(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 _ _ ReadOnly Property APCSheetByProductsSalesPolicyR As XPCollection(Of APCSheetByProductsSalesPolicyR) Get Return GetCollection(Of APCSheetByProductsSalesPolicyR)("APCSheetByProductsSalesPolicyR") End Get End Property End Class