First create solution
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
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 System.Drawing
|
||||
|
||||
<DefaultClassOptions()> _
|
||||
<NavigationItem("BusinessStocks")> _
|
||||
Public Class ProductsGroups
|
||||
Inherits HCategory
|
||||
Private _ShortName As String
|
||||
Private _Description As String
|
||||
Private _ReportData As ReportData
|
||||
Private _MasterBusinessDirectory As BusinessDirectory
|
||||
Private _Picture As System.Drawing.Image
|
||||
Public Sub New(ByVal session As Session)
|
||||
MyBase.New(session)
|
||||
End Sub
|
||||
<RuleRequiredField("ProductsGroups - ShortName", DefaultContexts.Save)> _
|
||||
Property ShortName As String
|
||||
Get
|
||||
Return _ShortName
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
SetPropertyValue("ShortName", _ShortName, value)
|
||||
End Set
|
||||
End Property
|
||||
<Size(-1)> _
|
||||
Property Description() As String
|
||||
Get
|
||||
Return _Description
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
SetPropertyValue("Description", _Description, value)
|
||||
End Set
|
||||
End Property
|
||||
Property ReportData As ReportData
|
||||
Get
|
||||
Return _ReportData
|
||||
End Get
|
||||
Set(value As ReportData)
|
||||
SetPropertyValue("ReportData", _ReportData, value)
|
||||
End Set
|
||||
End Property
|
||||
Property MasterBusinessDirectory As BusinessDirectory
|
||||
Get
|
||||
Return _MasterBusinessDirectory
|
||||
End Get
|
||||
Set(value As BusinessDirectory)
|
||||
SetPropertyValue("MasterBusinessDirectory", _MasterBusinessDirectory, value)
|
||||
End Set
|
||||
End Property
|
||||
<ValueConverter(GetType(DevExpress.Xpo.Metadata.ImageValueConverter))>
|
||||
Property Picture As Image
|
||||
Get
|
||||
Return _Picture
|
||||
End Get
|
||||
Set(value As Image)
|
||||
SetPropertyValue("Picture", _Picture, value)
|
||||
End Set
|
||||
End Property
|
||||
<VisibleInListView(False), Aggregated(), Association("ProductsGroups-ProductsGroupsDocumentations", GetType(ProductsGroupsDocumentations))> _
|
||||
Public ReadOnly Property ProductsGroupsDocumentations() As XPCollection(Of ProductsGroupsDocumentations)
|
||||
Get
|
||||
Return GetCollection(Of ProductsGroupsDocumentations)("ProductsGroupsDocumentations")
|
||||
End Get
|
||||
End Property
|
||||
<VisibleInListView(False), VisibleInLookupListView(False)> _
|
||||
Public ReadOnly Property ProductsGroups_BusinessDirectory As XPCollection(Of BusinessDirectory)
|
||||
Get
|
||||
Dim _BusinessDirectory_Collection As New XPCollection(Of BusinessDirectory)(Session, CriteriaOperator.Parse("1=2"))
|
||||
|
||||
If MasterBusinessDirectory IsNot Nothing Then
|
||||
If MasterBusinessDirectory.Children.Count > 0 Then
|
||||
_BusinessDirectory_Collection.Add(MasterBusinessDirectory)
|
||||
RecursiveBusinessDirectory(_BusinessDirectory_Collection, MasterBusinessDirectory.NestedBusinessDirectory)
|
||||
Else
|
||||
_BusinessDirectory_Collection.Add(MasterBusinessDirectory)
|
||||
End If
|
||||
End If
|
||||
Return _BusinessDirectory_Collection
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Other subs"
|
||||
Private Sub RecursiveBusinessDirectory(_BusinessDirectoryList As XPCollection(Of BusinessDirectory), _NestedBusinessDirectory As XPCollection(Of BusinessDirectory))
|
||||
For Each _BusinessDirectory As BusinessDirectory In _NestedBusinessDirectory
|
||||
If _BusinessDirectory.Children.Count > 0 Then
|
||||
_BusinessDirectoryList.Add(_BusinessDirectory)
|
||||
RecursiveBusinessDirectory(_BusinessDirectoryList, _BusinessDirectory.NestedBusinessDirectory)
|
||||
Else
|
||||
_BusinessDirectoryList.Add(_BusinessDirectory)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user