Public Class ContratosBusinessObject
    Inherits BusinessObject(Of Contratos)

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

    Public Sub New(ByVal entity As Contratos)
        MyBase.New(entity)
        DbHelper = New ContratosDbHelper
    End Sub

    Public Sub New(ByVal idContrato As Int32, Optional ByVal foreignLevel As Integer=0)
        Me.New()
        _Entity.idContrato = idContrato
        Dim Entity_Aux As Contratos = 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 ContratosBusinessObject
    Protected Shared Function GetDdHelperInstance() As ContratosDbHelper
        If _Instance Is Nothing Then
            _Instance = New ContratosBusinessObject
        End If
    Return CType(_Instance.DbHelper, ContratosDbHelper)
    End Function

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

    Public Shared Function GetListContratosByPlaza(ByVal idPlaza as Int32, Optional ByVal foreignLevel As Integer=0) As EntityList(Of Contratos)
        Return GetDdHelperInstance.GetListContratosByPlaza(idPlaza, foreignLevel)
    End Function

#End Region
End Class
