Public Class FactorBusinessObject
    Inherits BusinessObject(Of Factor)

#Region "Contructores"
    Public Sub New()
        MyBase.New()
        DbHelper = New FactorDbHelper
    End Sub

    Public Sub New(ByVal entity As Factor)
        MyBase.New(entity)
        DbHelper = New FactorDbHelper
    End Sub

    Public Sub New(ByVal idFactor As Int32, Optional ByVal foreignLevel As Integer=0)
        Me.New()
        _Entity.idFactor = idFactor
        Dim Entity_Aux As Factor = DbHelper.SelectEntity(_Entity,foreignLevel)
        If Not Entity_Aux Is Nothing Then
            _IsNew = False
            _Entity = Entity_Aux
        End If
    End Sub
#End Region

#Region "Metodos Estaticos"
    Protected Shared _Instance As FactorBusinessObject
    Protected Shared Function GetDdHelperInstance() As FactorDbHelper
        If _Instance Is Nothing Then
            _Instance = New FactorBusinessObject
        End If
    Return CType(_Instance.DbHelper, FactorDbHelper)
    End Function

    Public Shared Function GetListFactor(Optional ByVal foreignLevel As Integer=0) As EntityList(Of Factor)
        Return GetDdHelperInstance.SelectList(foreignLevel)
    End Function

    Public Shared Function GetListFactorByEtapa(ByVal idEtapa as Int32, Optional ByVal foreignLevel As Integer=0) As EntityList(Of Factor)
        Return GetDdHelperInstance.GetListFactorByEtapa(idEtapa, foreignLevel)
    End Function

#End Region
End Class
