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 Class Recipe 'Gygártási receptek Inherits BaseObject Private _RecipeType As RecipeType Private _CustomersFrom As CustomersFrom 'Saját cég Private _DocumentNumber As String 'Recept sorszáma Private _ShortName As String 'Recept megnevezése Private _Description As String 'Recept leírása Private _UserCreated As User Private _ObjectCreated As Date 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() If Session.IsNewObject(Me) Then ObjectCreated = GetSQLTime(Session) UserCreated = Session.GetObjectByKey(Of User)(Session.GetKeyValue(SecuritySystem.CurrentUser)) End If If String.IsNullOrEmpty(DocumentNumber) Then If RecipeType IsNot Nothing Then If RecipeType.NumberGenerator IsNot Nothing Then DocumentNumber = RecipeType.NumberGenerator.GetNewNumber(RecipeType.NumberGenerator) End If End If End If End Sub _ _ Property RecipeType As RecipeType Get Return _RecipeType End Get Set(value As RecipeType) SetPropertyValue("RecipeType", _RecipeType, value) End Set End Property Property CustomersFrom As CustomersFrom Get Return _CustomersFrom End Get Set(value As CustomersFrom) SetPropertyValue("CustomersFrom", _CustomersFrom, 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 ShortName As String Get Return _ShortName End Get Set(value As String) SetPropertyValue("ShortName", _ShortName, value) End Set End Property Property Description As String Get Return _Description End Get Set(value As String) SetPropertyValue("Description", _Description, 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 ObjectCreated As Date Get Return _ObjectCreated End Get Set(value As Date) SetPropertyValue("ObjectCreated", _ObjectCreated, value) End Set End Property _ _ ReadOnly Property RecipeFrom As XPCollection(Of RecipeFrom) Get Return GetCollection(Of RecipeFrom)("RecipeFrom") End Get End Property _ _ ReadOnly Property RecipeFromOther As XPCollection(Of RecipeFromOther) Get Return GetCollection(Of RecipeFromOther)("RecipeFromOther") End Get End Property _ _ ReadOnly Property RecipeTo As XPCollection(Of RecipeTo) Get Return GetCollection(Of RecipeTo)("RecipeTo") End Get End Property _ _ ReadOnly Property RecipeToOther As XPCollection(Of RecipeToOther) Get Return GetCollection(Of RecipeToOther)("RecipeToOther") End Get End Property End Class