Files
SISBusiness/SISBusiness.Module/BusinessObjects/Business/Products/ProductsGroupsDocumentations.vb
T
2017-03-26 20:00:03 +02:00

153 lines
4.6 KiB
VB.net

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
Imports System.IO
Imports DevExpress.ExpressApp.Utils
<DefaultClassOptions()> _
<NavigationItem(False), CreatableItem(False)> _
Public Class ProductsGroupsDocumentations
Inherits FileAttachmentBase
Private _ProductsGroups As ProductsGroups
Private _Status As eProductsDocumentationStatus
Private _RowGroup1 As String 'Szöveges csoportosítás (nem kötelező)
Private _RowGroup2 As String 'Szöveges másodlagos csoportosítás (nem kötelező)
Private _ShortName As String
Private _Description As String
Private _FileCreated As Date
Private _FileModified As Date
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()
Status = eProductsDocumentationStatus.ePublic
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
End Sub
<Persistent(), Association("ProductsGroups-ProductsGroupsDocumentations")> _
Property ProductsGroups() As ProductsGroups
Get
Return _ProductsGroups
End Get
Set(ByVal value As ProductsGroups)
SetPropertyValue("ProductsGroups", _ProductsGroups, value)
End Set
End Property
Property Status As eProductsDocumentationStatus
Get
Return _Status
End Get
Set(value As eProductsDocumentationStatus)
SetPropertyValue("Status", _Status, value)
End Set
End Property
Property RowGroup1 As String
Get
Return _RowGroup1
End Get
Set(value As String)
SetPropertyValue("RowGroup1", _RowGroup1, value)
End Set
End Property
Property RowGroup2 As String
Get
Return _RowGroup2
End Get
Set(value As String)
SetPropertyValue("RowGroup2", _RowGroup2, 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 FileCreated As Date
Get
Return _FileCreated
End Get
Set(value As Date)
SetPropertyValue("FileCreated", _FileCreated, value)
End Set
End Property
Property FileModified As Date
Get
Return _FileModified
End Get
Set(value As Date)
SetPropertyValue("FileModified", _FileModified, value)
End Set
End Property
<NonCloneable> _
Property ObjectCreated As Date
Get
Return _ObjectCreated
End Get
Set(value As Date)
SetPropertyValue("ObjectCreated", _ObjectCreated, value)
End Set
End Property
<NonCloneable> _
Property UserCreated As User
Get
Return _UserCreated
End Get
Set(value As User)
SetPropertyValue("UserCreated", _UserCreated, value)
End Set
End Property
'--------ReadOnly---------
<VisibleInDetailView(False)> _
ReadOnly Property ImageType As Image
Get
Select Case LCase(Path.GetExtension(File.FileName))
Case ".xls", ".xlsx"
Return ImageLoader.Instance.GetImageInfo("XLS").Image
Case ".doc", ".docx"
Return ImageLoader.Instance.GetImageInfo("DOC").Image
Case ".pdf"
Return ImageLoader.Instance.GetImageInfo("PDF").Image
Case ".txt"
Return ImageLoader.Instance.GetImageInfo("NoImage").Image
Case Else
Return ImageLoader.Instance.GetImageInfo("NoImage").Image
Return Nothing
End Select
End Get
End Property
End Class