111 lines
4.4 KiB
VB.net
111 lines
4.4 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports Extensiones
|
|
|
|
Partial Class Prospectos_RepProspectosRedes
|
|
Inherits ClsPaginas
|
|
|
|
Private Property DtDatos As DataTable
|
|
Get
|
|
Return DirectCast(ViewState("DtDatos"), DataTable)
|
|
End Get
|
|
Set(value As DataTable)
|
|
ViewState("DtDatos") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Private Property CveProspectoSeleccionado As Integer
|
|
Get
|
|
Return ViewState("CveProspectoSeleccionado").ToString.ToEntero
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveProspectoSeleccionado") = value
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
|
|
If Not Page.IsPostBack Then
|
|
ViewState("Orden") = ""
|
|
CveProspectoSeleccionado = -1 'UsuarioActual.CveProspecto
|
|
|
|
DdlClasificacion.DataSource = GlobalDTProspectosClasificaciones(UsuarioActual.CveEmpresa) : DdlClasificacion.DataBind()
|
|
DdlZona.DataSource = GlobalDTProspectosSupervisores(UsuarioActual.CveEmpresa) : DdlZona.DataBind()
|
|
DdlRegion.DataSource = GlobalDTProspectosCoordinadores(DdlZona.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) : DdlRegion.DataBind()
|
|
DdlMunicipioFiltro.DataSource = GlobalDTGralMunicipios("26") : DdlMunicipioFiltro.DataBind()
|
|
DdlEscolaridad.DataSource = GlobalDTGralEscolaridades : DdlEscolaridad.DataBind()
|
|
|
|
CargaDatos(True)
|
|
End If
|
|
|
|
End Sub
|
|
Public Sub CargaDatos(Optional RecargaArbol As Boolean = False)
|
|
Dim ObjProspectos As New ClsProspectos
|
|
If ObjProspectos.GetProspectosAgrupados2(DdlClasificacion.SelectedValue.ToEntero, DdlEscolaridad.SelectedValue.ToEntero, DdlIFE.SelectedValue.ToEntero, DdlSexo.SelectedValue.ToEntero, DdlZona.SelectedValue.ToEntero, DdlRegion.SelectedValue.ToEntero, _
|
|
DdlMunicipioFiltro.SelectedValue.ToEntero, -1, DdlAuditado.SelectedValue.ToEntero, CveProspectoSeleccionado, DdlAgrupador.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
ViewState("DTProspectos") = ObjProspectos.DtResultados
|
|
Else
|
|
Me.GvDatos.DataSource = Nothing
|
|
End If
|
|
Dim InicioPadre As Integer = 0
|
|
If CveProspectoSeleccionado > 0 Then
|
|
InicioPadre = CveProspectoSeleccionado
|
|
|
|
'Dim node As New TreeNode
|
|
'node.Text = String.Format("<span>{0} ({1})</span>", dr("NombreCompleto"), dr("Hijos"))
|
|
'node.Value = dr("CveProspecto").ToString
|
|
'AddNodes(node)
|
|
'TV.Nodes.Add(node)
|
|
End If
|
|
|
|
|
|
ObjProspectos.Dispose()
|
|
|
|
If ViewState("Orden").ToString() <> String.Empty Then
|
|
CargaGrid(ViewState("Orden").ToString())
|
|
Else
|
|
CargaGrid("")
|
|
End If
|
|
UPDatos.Update()
|
|
End Sub
|
|
|
|
Private Sub CargaGrid(Orden As String)
|
|
If Orden <> String.Empty Then
|
|
Dim DV As New DataView(CType(ViewState("DTProspectos"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
|
GvDatos.DataSource = DV.ToTable()
|
|
DV.Dispose()
|
|
Else
|
|
GvDatos.DataSource = CType(ViewState("DTProspectos"), DataTable)
|
|
End If
|
|
GvDatos.DataBind()
|
|
End Sub
|
|
|
|
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.Header Then
|
|
e.Row.Cells(0).Text = DdlAgrupador.SelectedItem.Text
|
|
ElseIf e.Row.RowType = DataControlRowType.DataRow Then
|
|
If e.Row.RowIndex = 0 Then
|
|
e.Row.Cells(0).Width = Unit.Pixel(250)
|
|
e.Row.Cells(1).Width = Unit.Pixel(100)
|
|
e.Row.CssClass = "Totales"
|
|
End If
|
|
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
|
End If
|
|
End Sub
|
|
|
|
|
|
Protected Sub DdlZona_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlZona.SelectedIndexChanged
|
|
DdlRegion.Items.Clear()
|
|
DdlRegion.Items.Add(New ListItem("Todos", "-1"))
|
|
DdlRegion.DataSource = GlobalDTProspectosCoordinadores(DdlZona.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) : DdlRegion.DataBind()
|
|
End Sub
|
|
|
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
|
CargaDatos()
|
|
End Sub
|
|
End Class
|