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
Public Enum eWorkType
    eGuarantee = 0 'Garanciális
    ePayable = 1 'Fizetős
    eMixed = 2 ' Vegyes
End Enum
Public Enum eWorkRowType
    eServices = 0 'Szolgáltatástörzsből bevitt adat
    eManual = 1 'Kézzel felvitt tétel
End Enum
Public Enum eWorkSheetState
    eOpened = 0 'Nyitott
    <ImageName("lock")> eClosed = 1 'Lezárt
    eReopened = 2 'Újranyitott
    <ImageName("check")> eReadyforClose = 3 'Lezárásra kész, munka elvégezve
End Enum
<DefaultClassOptions()> _
<NavigationItem("BusinessStocks")> _
Public Class WorkSheetType
    Inherits BaseObject
    Private _CustomersFrom As CustomersFrom
    Private _ShortName As String
    Private _Description As String
    Private _NumberGenerator As NumberGenerator
    Private _ExcelProperty As String
    Private _ExcelFile As FileData
    Private _ReportData As ReportData
    Private _Rule5DMatrix As Rule5DMatrix 'Jelölő kitöltés kötelezősítés
    Private _RegistryType As RegistryType
    Private _IsOperationalLog As Boolean
    Private _OperationalLogDescription As String

    Public Sub New(ByVal session As Session)
        MyBase.New(session)
    End Sub
    Public Overrides Sub AfterConstruction()
        MyBase.AfterConstruction()
        IsOperationalLog = False
    End Sub
    <RuleRequiredField("WorkSheetType-CustomersFrom", DefaultContexts.Save)> _
    Property CustomersFrom As CustomersFrom
        Get
            Return _CustomersFrom
        End Get
        Set(value As CustomersFrom)
            SetPropertyValue("CustomersFrom", _CustomersFrom, value)
        End Set
    End Property
    <RuleRequiredField("WorkSheetType-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
    Property Description() As String
        Get
            Return _Description
        End Get
        Set(ByVal value As String)
            SetPropertyValue("Description", _Description, value)
        End Set
    End Property
    Property NumberGenerator() As NumberGenerator
        Get
            Return _NumberGenerator
        End Get
        Set(ByVal value As NumberGenerator)
            SetPropertyValue("NumberGenerator", _NumberGenerator, value)
        End Set
    End Property
    <Size(-1)> _
    Property ExcelProperty As String
        Get
            Return _ExcelProperty
        End Get
        Set(value As String)
            SetPropertyValue("ExcelProperty", _ExcelProperty, value)
        End Set
    End Property
    Property ExcelFile As FileData
        Get
            Return _ExcelFile
        End Get
        Set(value As FileData)
            SetPropertyValue("ExcelFile", _ExcelFile, 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 Rule5DMatrix As Rule5DMatrix
        Get
            Return _Rule5DMatrix
        End Get
        Set(value As Rule5DMatrix)
            SetPropertyValue("Rule5DMatrix", _Rule5DMatrix, value)
        End Set
    End Property
    <ImmediatePostData(True), DataSourceCriteria("CustomersFrom='@This.CustomersFrom' and RegistryMainType='eOther'")>
    Property RegistryType As RegistryType
        Get
            Return _RegistryType
        End Get
        Set(value As RegistryType)
            SetPropertyValue("RegistryType", _RegistryType, value)
        End Set
    End Property
    Property IsOperationalLog As Boolean
        Get
            Return _IsOperationalLog
        End Get
        Set(value As Boolean)
            SetPropertyValue("IsOperationalLog", _IsOperationalLog, value)
        End Set
    End Property
    <Size(255)> _
    Property OperationalLogDescription As String
        Get
            Return _OperationalLogDescription
        End Get
        Set(value As String)
            SetPropertyValue("OperationalLogDescription", _OperationalLogDescription, value)
        End Set
    End Property
    '-------ReadOnly------------
    <VisibleInListView(False)> _
    <Association("WorkSheetType-WorkSheetTypeExcelParam", GetType(WorkSheetTypeExcelParam))> _
    ReadOnly Property WorkSheetTypeExcelParam As XPCollection(Of WorkSheetTypeExcelParam)
        Get
            Return GetCollection(Of WorkSheetTypeExcelParam)("WorkSheetTypeExcelParam")
        End Get
    End Property
End Class
