Option Strict On

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

Imports Microsoft.VisualBasic

Public Class elecciones
    Public Shared Function LeoBancasDiputadosNac() As SqlDataReader
        LeoBancasDiputadosNac = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        db.RunProcedure("spel_bancasDiputadosNac", LeoBancasDiputadosNac)

    End Function
    Public Shared Function LeoBancasSenadoresNac() As SqlDataReader
        LeoBancasSenadoresNac = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        db.RunProcedure("spel_bancasSenadoresNac", LeoBancasSenadoresNac)

    End Function
    Public Shared Function LeoTotalBancasDiputadosNac() As SqlDataReader
        LeoTotalBancasDiputadosNac = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        db.RunProcedure("spel_totalbancasDiputadosNac", LeoTotalBancasDiputadosNac)

    End Function
    Public Shared Function LeoTotalBancasSenadoresNac() As SqlDataReader
        LeoTotalBancasSenadoresNac = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        db.RunProcedure("spel_totalbancasSenadoresNac", LeoTotalBancasSenadoresNac)

    End Function
    Public Shared Function LeoResultadosProvincias(tipoeleccion As Int32) As SqlDataReader
        LeoResultadosProvincias = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@tipoeleccion", tipoeleccion)}
        db.RunProcedure("spel_mapaprov_2015f", parameters, LeoResultadosProvincias)

    End Function
    Public Shared Function LeoResultadosMunicipios(tipoeleccion As Int32) As SqlDataReader
        LeoResultadosMunicipios = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@tipoeleccion", tipoeleccion)}
        db.RunProcedure("spel_mapamuni_2015f", parameters, LeoResultadosMunicipios)

    End Function
    Public Shared Function LeoResultadosMunicipiosGobe(tipoeleccion As Int32) As SqlDataReader
        LeoResultadosMunicipiosGobe = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@tipoeleccion", tipoeleccion)}
        db.RunProcedure("spel_mapamuni_2015fGobe", parameters, LeoResultadosMunicipiosGobe)

    End Function
    Public Shared Function LeoResultadosMunicipiosLista(tipoeleccion As Int32) As SqlDataReader
        LeoResultadosMunicipiosLista = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@tipoeleccion", tipoeleccion)}
        db.RunProcedure("spel_mapamuni_2015", parameters, LeoResultadosMunicipiosLista)

    End Function
    Public Shared Function LeoResultadosProvinciasGobe(tipoeleccion As Int32) As SqlDataReader
        LeoResultadosProvinciasGobe = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@tipoeleccion", tipoeleccion)}
        db.RunProcedure("spel_mapaprov_2015fGobe", parameters, LeoResultadosProvinciasGobe)

    End Function
    Public Shared Function LeoTotalVotosPais() As Integer
        LeoTotalVotosPais = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Return db.RunProcedure("spel_totalvotos_2015_presi")

    End Function
    Public Shared Function LeoVotosDistrito(codeleccion As Int32, coddistrito As String) As Integer
        LeoVotosDistrito = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Return db.RunProcedure("spel_LeoVotosDistrito_2015", New SqlParameter() {db.MakeParameter("@codeleccion", codeleccion), db.MakeParameter("@coddistrito", coddistrito)})
    End Function
    Public Shared Function LeoVotosMunicipio(codeleccion As Int32, codmunicipio As String) As Integer
        LeoVotosMunicipio = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Return db.RunProcedure("spel_LeoVotosMunicipio_2015", New SqlParameter() {db.MakeParameter("@codeleccion", codeleccion), db.MakeParameter("@codmunicipio", codmunicipio)})
    End Function
    Public Shared Function LeoTotalVotosBA() As Integer
        LeoTotalVotosBA = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Return db.RunProcedure("spel_votosBA_2015_presi")

    End Function
    Public Shared Function LeoTotalVotosBAGobe() As Integer
        LeoTotalVotosBAGobe = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Return db.RunProcedure("spel_votosBA_2015_gobe")

    End Function

    Public Shared Function LeoResultadosConu(tipoeleccion As Int32) As SqlDataReader
        LeoResultadosConu = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@tipoeleccion", tipoeleccion)}
        db.RunProcedure("spel_mapaConu_2015f", parameters, LeoResultadosConu)

    End Function

    Public Shared Function LeoResultadosBA(tipoeleccion As Int32) As SqlDataReader
        LeoResultadosBA = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@tipoeleccion", tipoeleccion)}
        db.RunProcedure("spel_mapaBA_2015f", parameters, LeoResultadosBA)

    End Function

    Public Shared Function LeoResultadosBAGobe(tipoeleccion As Int32) As SqlDataReader
        LeoResultadosBAGobe = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@tipoeleccion", tipoeleccion)}
        db.RunProcedure("spel_mapaBA_2015fGobe", parameters, LeoResultadosBAGobe)

    End Function
    Public Shared Function PorcentajeEscrutado(tipoeleccion As Int32) As SqlDataReader
        PorcentajeEscrutado = Nothing

        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@tipoeleccion", tipoeleccion)}
        db.RunProcedure("spel_porcentajeescrutado_2015", parameters, PorcentajeEscrutado)
    End Function
    Public Shared Function PorcentajeEscrutadoBA(tipoeleccion As Int32) As SqlDataReader
        PorcentajeEscrutadoBA = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@tipoeleccion", tipoeleccion)}
        db.RunProcedure("spel_porcentajeescrutadoBA_2015", parameters, PorcentajeEscrutadoBA)
    End Function
    Public Shared Function LeoResultadosProvinciasLista(tipoeleccion As Int32) As SqlDataReader
        LeoResultadosProvinciasLista = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@tipoeleccion", tipoeleccion)}
        db.RunProcedure("spel_mapaprov_2015", parameters, LeoResultadosProvinciasLista)

    End Function
    Public Shared Function LeoResultadosBALista(tipoeleccion As Int32) As SqlDataReader
        LeoResultadosBALista = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@tipoeleccion", tipoeleccion)}
        db.RunProcedure("spel_mapaBA_2015", parameters, LeoResultadosBALista)

    End Function
    Public Shared Function LeoResultadosBALista(codeleccion As Int32, codmunicipio As String) As SqlDataReader
        LeoResultadosBALista = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@codeleccion", codeleccion), db.MakeParameter("@codmunicipio", codmunicipio)}
        db.RunProcedure("spel_cuadroBA_2015", parameters, LeoResultadosBALista)

    End Function

    Public Shared Function LeoDistritos(codeleccion As Int32) As SqlDataReader
        LeoDistritos = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@codeleccion", codeleccion)}
        db.RunProcedure("spel_leodistritos_2015", parameters, LeoDistritos)

    End Function
    Public Shared Function LeoResultadosxProvincia(codeleccion As Int32, coddistrito As String) As SqlDataReader
        LeoResultadosxProvincia = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@codeleccion", codeleccion), db.MakeParameter("@coddistrito", coddistrito)}
        db.RunProcedure("spel_cuadroprov_2015f", parameters, LeoResultadosxProvincia)

    End Function
    Public Shared Function LeoResultadosxLista(codeleccion As Int32, coddistrito As String) As SqlDataReader
        LeoResultadosxLista = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@codeleccion", codeleccion), db.MakeParameter("@coddistrito", coddistrito)}
        db.RunProcedure("spel_cuadroprov_2015", parameters, LeoResultadosxLista)

    End Function
    Public Shared Function PorcentajeEscrutadoxProvincia(codeleccion As Int32, coddistrito As String) As SqlDataReader
        PorcentajeEscrutadoxProvincia = Nothing
        Dim db As New Database
        db.ConString = System.Configuration.ConfigurationManager.AppSettings("con_elecciones")
        Dim parameters() As SqlParameter = {db.MakeParameter("@codeleccion", codeleccion), db.MakeParameter("@coddistrito", coddistrito)}
        db.RunProcedure("spel_porcentajeescrutadoprov_2015", parameters, PorcentajeEscrutadoxProvincia)
    End Function


End Class
