Option Strict On

Imports System
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web

Imports Microsoft.VisualBasic

Public Class Clasi3

    Public Shared Function GetTipoFunebres(ByVal id As Integer) As SqlDataReader
        GetTipoFunebres = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_clasi3")

        db.RunProcedure("sp_Fun_Tipos", New SqlParameter() {db.MakeParameter("@i", id)}, GetTipoFunebres)

    End Function

    Public Shared Function GetFunebres(ByVal f1 As String, ByVal f2 As String, ByVal id As Integer) As SqlDataReader
        GetFunebres = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_clasi3")

        db.RunProcedure("sp_Fun_nombres", _
        New SqlParameter() {db.MakeParameter("@f1", f1), db.MakeParameter("@f2", f2), _
        db.MakeParameter("@i", id)}, GetFunebres)

    End Function

    Public Shared Function CheckFunebres(ByVal f1 As String, ByVal f2 As String) As SqlDataReader
        CheckFunebres = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_clasi3")
        db.RunProcedure("sp_Fun_Check", _
        New SqlParameter() {db.MakeParameter("@f1", f1), db.MakeParameter("@f2", f2)}, CheckFunebres)
    End Function

    Public Shared Function GetDesplegado(ByVal f1 As String, ByVal f2 As String, ByVal id As Integer, _
                                        ByVal apellido As String, ByVal nombre As String) As SqlDataReader
        GetDesplegado = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_clasi3")

        db.RunProcedure("sp_Fun_Desplegado_nuevo", _
        New SqlParameter() {db.MakeParameter("@f1", f1), db.MakeParameter("@f2", f2), _
        db.MakeParameter("@i", id), db.MakeParameter("@apellido", apellido), _
        db.MakeParameter("@nombre", nombre)}, GetDesplegado)
        Return GetDesplegado
    End Function

    Public Shared Function CheckFunebresNuevo(ByVal fecha As String, ByVal int_tipo As Integer, ByVal int_diario As Integer, ByVal web As Boolean) As SqlDataReader
        CheckFunebresNuevo = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_clasi3")
        db.RunProcedure("sp_funeavisos", _
        New SqlParameter() {db.MakeParameter("@fecha", fecha), db.MakeParameter("@int_tipo", int_tipo), db.MakeParameter("@int_diario", int_diario), db.MakeParameter("@web", web)}, CheckFunebresNuevo)
    End Function

    Public Shared Function VerListado(ByVal fecha As String, ByVal int_tipo As Integer, ByVal int_diario As Integer) As SqlDataReader
        VerListado = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_clasi3")
        Dim DReader As SqlDataReader = Nothing
        db.RunProcedure("sp_funelistado", New SqlParameter() {db.MakeParameter("@fecha", fecha), db.MakeParameter("@int_tipo", int_tipo), db.MakeParameter("@int_diario", int_diario)}, VerListado)
    End Function

End Class
