Imports System.Data.SqlClient

Public Class ColaDAO




    Dim Operaciones As New Operaciones
    Public Function EstadoArbitraje() As DataTable
        Dim objCon As New Conexion
        Dim da As New SqlDataAdapter
        Dim ds As New DataSet

        Dim cn As SqlConnection = objCon.Conectar
        If cn.State = ConnectionState.Closed Then
            cn.Open()
        End If
        Dim sql = "[dbo].[SP_ControlProcesoTitulosYReportos]"


        Dim cmd As New SqlCommand(sql, cn)
        cmd.CommandType = CommandType.StoredProcedure


        da = New SqlDataAdapter(cmd)

        da.Fill(ds)
        cn.Close()
        Return ds.Tables(0)
    End Function





    Public Function TablasArbitraje(ByVal Tipo As String, ByVal CodigoAsociado As String) As DataTable
        Dim objCon As New Conexion
        Dim da As New SqlDataAdapter
        Dim ds As New DataSet
        Dim cn As SqlConnection = objCon.Conectar
        If cn.State = ConnectionState.Closed Then
            cn.Open()
        End If
        Dim sql = "[dbo].[SP_TiposTitulosReporto]"


        Dim cmd As New SqlCommand(sql, cn)
        cmd.CommandType = CommandType.StoredProcedure
        With cmd.Parameters
            .Add("@Tipo", SqlDbType.VarChar).Value = Tipo
            .Add("@CodigoAsociado", SqlDbType.VarChar).Value = CodigoAsociado
        End With

        da = New SqlDataAdapter(cmd)

        da.Fill(ds)
        cn.Close()
        Return ds.Tables(0)
    End Function



End Class
