Public Class PlazaBusinessObject
    Inherits BusinessObject(Of Plaza)

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

    Public Sub New(ByVal entity As Plaza)
        MyBase.New(entity)
        DbHelper = New PlazaDbHelper
    End Sub

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

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

    Public Shared Function GetListPlazaByContratacion(ByVal idContratacion As Int32, Optional ByVal foreignLevel As Integer = 0) As EntityList(Of Plaza)
        Return GetDdHelperInstance.GetListPlazaByContratacion(idContratacion, foreignLevel)
    End Function

    Public Shared Function GetListPlazaByConvocatoria(ByVal idConvocatoria As String, Optional ByVal foreignLevel As Integer = 0) As EntityList(Of Plaza)
        Return GetDdHelperInstance.GetListPlazaByConvocatoria(idConvocatoria, foreignLevel)
    End Function

    Public Shared Function GetListPlazaByEstadoPlaza(ByVal idEstadoPlaza As Int32, Optional ByVal foreignLevel As Integer = 0) As EntityList(Of Plaza)
        Return GetDdHelperInstance.GetListPlazaByEstadoPlaza(idEstadoPlaza, foreignLevel)
    End Function

    Public Shared Function GetListPlazaByProcesoEvaluacion(ByVal idProcesoEvaluacion As Int32, Optional ByVal foreignLevel As Integer = 0) As EntityList(Of Plaza)
        Return GetDdHelperInstance.GetListPlazaByProcesoEvaluacion(idProcesoEvaluacion, foreignLevel)
    End Function

    Public Shared Function GetListPlazaBySTP_Municipio(ByVal idMunicipio As String, Optional ByVal foreignLevel As Integer = 0) As EntityList(Of Plaza)
        Return GetDdHelperInstance.GetListPlazaBySTP_Municipio(idMunicipio, foreignLevel)
    End Function

#End Region
End Class

