138 lines
6.0 KiB
VB.net
138 lines
6.0 KiB
VB.net
Imports System.Data
|
|
Imports Extensiones
|
|
|
|
Partial Class Prospectos_RepSimpatizantes
|
|
Inherits System.Web.UI.Page
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
|
|
If Not Page.IsPostBack Then
|
|
' CargaFiltros()
|
|
CargaDatos()
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub CargaFiltros()
|
|
Dim ObjProspectos As New ClsProspectos
|
|
|
|
'Municipio
|
|
If ObjProspectos.GetFiltros("Mun") Then
|
|
DdlMunicipio.DataSource = ObjProspectos.DtResultados
|
|
Else
|
|
DdlMunicipio.DataSource = Nothing
|
|
End If
|
|
DdlMunicipio.DataBind()
|
|
DdlMunicipio.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
'Distritos
|
|
Dim DT As DataTable = Nothing
|
|
If ObjProspectos.GetFiltros("Dist") Then
|
|
DT = ObjProspectos.DtResultados
|
|
Else
|
|
DT = Nothing
|
|
End If
|
|
|
|
If DT IsNot Nothing AndAlso DT.Rows.Count > 0 Then
|
|
'Cargo DistLoc
|
|
DdlDistLoc.DataSource = DT.FiltraParametros("", "", {"Dist_Loc"})
|
|
DdlDistLoc.DataBind()
|
|
DdlDistLoc.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
'Cargo Secciones
|
|
DdlSeccion.DataSource = DT.FiltraParametros("", "", {"seccion"})
|
|
DdlSeccion.DataBind()
|
|
DdlSeccion.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
'Cargo DistFed
|
|
DdlDistFed.DataSource = DT.FiltraParametros("", "", {"Dist_Fed"})
|
|
DdlDistFed.DataBind()
|
|
DdlDistFed.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
End If
|
|
If DT IsNot Nothing Then DT.Dispose()
|
|
|
|
'Ocupacion
|
|
If ObjProspectos.GetFiltros("Ocupacion") Then
|
|
DdlOcupacion.DataSource = ObjProspectos.DtResultados
|
|
Else
|
|
DdlOcupacion.DataSource = Nothing
|
|
End If
|
|
DdlOcupacion.DataBind()
|
|
DdlOcupacion.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
|
|
ObjProspectos.Dispose()
|
|
|
|
'
|
|
End Sub
|
|
|
|
Private Sub CargaDatos()
|
|
Dim ObjProspectos As New ClsProspectos
|
|
If ObjProspectos.GetRepEquipoJGM() Then
|
|
If ObjProspectos.DtResultados IsNot Nothing AndAlso ObjProspectos.DtResultados.Rows.Count > 0 Then
|
|
GvDatos.DataSource = ObjProspectos.DtResultados
|
|
Else
|
|
GvDatos.DataSource = Nothing
|
|
End If
|
|
End If
|
|
ObjProspectos.Dispose()
|
|
|
|
GvDatos.DataBind()
|
|
|
|
End Sub
|
|
|
|
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.RowIndex = 0 Then
|
|
e.Row.Cells(0).Width = Unit.Pixel(130)
|
|
End If
|
|
|
|
If e.Row.DBCampo("Tipo") = "3" Then
|
|
e.Row.FCHyperLink("HplContactos").NavigateUrl = String.Format("/Prospectos/RepEventosDetalle.aspx?CveEventoTipo={0}&CveEvento=-1", e.Row.DBCampo("SubTipo"))
|
|
ElseIf e.Row.DBCampo("Tipo") = "2" Then
|
|
e.Row.FCHyperLink("HplContactos").NavigateUrl = "/Prospectos/CatProspectosDetalle.aspx?CveSupervisor=-1&CveCoordinador=-1&CveMunicipio=-1&CveProspectoClasificacion=-1&Auditado=-1&CveEscolaridad=-1&IFE=-1&Sexo=-1&CveRangoEdad=-1&MesAnioIng=-1"
|
|
ElseIf e.Row.DBCampo("Tipo") = "1" Then
|
|
e.Row.FCHyperLink("HplContactos").NavigateUrl = "/Prospectos/RepEncuestasDetalleTabla.aspx?Estructura=1"
|
|
End If
|
|
|
|
e.Row.HorizontalAlign = HorizontalAlign.Center
|
|
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
|
If e.Row.DBCampo("Programa") = String.Empty Then
|
|
e.Row.CssClass = "Totales"
|
|
e.Row.FCHyperLink("HplContactos").CssClass = "Totales"
|
|
Else
|
|
e.Row.Cells(1).CssClass = "SubTotales"
|
|
e.Row.Cells(6).CssClass = "SubTotales"
|
|
e.Row.Cells(8).CssClass = "SubTotales"
|
|
e.Row.Cells(12).CssClass = "SubTotales"
|
|
End If
|
|
|
|
'Limpio cantidades con 0
|
|
|
|
If e.Row.DBCampo("Padron") = "0" Then e.Row.FCLiteral("LtlPadron").Text = "-"
|
|
If e.Row.DBCampo("XValidar") = "0" Then e.Row.FCLiteral("LtlValidar").Text = "-"
|
|
If e.Row.DBCampo("XCapturar") = "0" Then e.Row.FCLiteral("LtlPorCapturar").Text = "-"
|
|
If e.Row.DBCampo("Duplicados") = "0" Then e.Row.FCLiteral("LtlDuplicados").Text = "-"
|
|
If e.Row.DBCampo("Contactos") = "0" Then e.Row.FCLiteral("LtlContactos").Text = "-"
|
|
If e.Row.DBCampo("ProPAN") = "0" Then e.Row.FCLiteral("LtlProPAN").Text = "-"
|
|
If e.Row.DBCampo("ProPANAuditados") = "0" Then e.Row.FCLiteral("LtlProPANAuditados").Text = "-"
|
|
If e.Row.DBCampo("Derivados") = "0" Then e.Row.FCLiteral("LtlDerivados").Text = "-"
|
|
If e.Row.DBCampo("ProPRI") = "0" Then e.Row.FCLiteral("LtlProPRI").Text = "-"
|
|
If e.Row.DBCampo("ProPRD") = "0" Then e.Row.FCLiteral("LtlProPRD").Text = "-"
|
|
If e.Row.DBCampo("NoSabe") = "0" Then e.Row.FCLiteral("LtlNoSabe").Text = "-"
|
|
If e.Row.DBCampo("DerivadosNoSabe") = "0" Then e.Row.FCLiteral("LtlDerivadosNoSabe").Text = "-"
|
|
If e.Row.DBCampo("NuncaPAN") = "0" Then e.Row.FCLiteral("LtlNuncaPAN").Text = "-"
|
|
If e.Row.DBCampo("NuncaPRI") = "0" Then e.Row.FCLiteral("LtlNuncaPRI").Text = "-"
|
|
If e.Row.DBCampo("NuncaPRD") = "0" Then e.Row.FCLiteral("LtlNuncaPRD").Text = "-"
|
|
If e.Row.DBCampo("Otros") = "0" Then e.Row.FCLiteral("LtlOtros").Text = "-"
|
|
If e.Row.DBCampo("JGM") = "0" Then e.Row.FCLiteral("LtlJGM").Text = "-"
|
|
If e.Row.DBCampo("ECG") = "0" Then e.Row.FCLiteral("LtlEGC").Text = "-"
|
|
If e.Row.DBCampo("CPA") = "0" Then e.Row.FCLiteral("LtlCPA").Text = "-"
|
|
End If
|
|
End Sub
|
|
|
|
Protected Sub ImgExcel_Click(sender As Object, e As ImageClickEventArgs) Handles ImgExcel.Click
|
|
GvDatos.ExportToExcel("RepEquipoJGM_" & Now.ToString("yyyy/MM/dd"))
|
|
End Sub
|
|
End Class
|