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

<DefaultClassOptions(), NavigationItem(False), CreatableItem(False)> _
Public Class PopupErrorRows
    Inherits BaseObject

    Private _PopupErrorHeader As PopupErrorHeader
    Private _ErrorMessage As String
    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
    End Sub
    <Association("PopupErrorHeader-PopupErrorRows", GetType(PopupErrorHeader))> _
    Property PopupErrorHeader As PopupErrorHeader
        Get
            Return _PopupErrorHeader
        End Get
        Set(value As PopupErrorHeader)
            SetPropertyValue("PopupErrorHeader", _PopupErrorHeader, value)
        End Set
    End Property
    <Size(-1)> _
    Property ErrorMessage As String
        Get
            Return _ErrorMessage
        End Get
        Set(value As String)
            SetPropertyValue("ErrorMessage", _ErrorMessage, 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
    <NonCloneable> _
    Property ObjectCreated As Date
        Get
            Return _ObjectCreated
        End Get
        Set(value As Date)
            SetPropertyValue("ObjectCreated", _ObjectCreated, value)
        End Set
    End Property

End Class
