98 lines
4.4 KiB
VB.net
98 lines
4.4 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports Extensiones
|
|
|
|
Partial Class Prospectos_RepEncuestasAvances
|
|
Inherits ClsPaginas
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not Page.IsPostBack Then
|
|
'CveEncuesta = IfNull(Request("CveEncuesta"), "0").ToString.ToEntero()
|
|
|
|
DdlEncuesta.DataSource = GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa).FiltraParametros("CveEncuestaTipo = 1") ' solo las tipo call center
|
|
DdlEncuesta.DataBind()
|
|
|
|
ViewState("Orden") = String.Empty
|
|
CargaDatos()
|
|
End If
|
|
End Sub
|
|
|
|
Public Sub CargaDatos()
|
|
Dim ObjProspectos As New ClsProspectos
|
|
If ObjProspectos.GetRepEncuestasAvances(DdlEncuesta.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
ViewState("DTEncuestasAvances") = ObjProspectos.DtResultados
|
|
Else
|
|
Me.GvDatos.DataSource = Nothing
|
|
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("DTEncuestasAvances"), DataTable), "", Orden, DataViewRowState.CurrentRows)
|
|
GvDatos.DataSource = DV.ToTable()
|
|
DV.Dispose()
|
|
Else
|
|
GvDatos.DataSource = CType(ViewState("DTEncuestasAvances"), 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.DataRow Then
|
|
' If e.Row.RowIndex = 0 Then
|
|
' e.Row.CssClass = "Totales"
|
|
' e.Row.FCLiteral("LtlEvento").Text = "Total General"
|
|
' End If
|
|
|
|
' If e.Row.DBCampo("EventoTipo") <> String.Empty AndAlso e.Row.DBCampo("Municipio") = String.Empty Then
|
|
' e.Row.CssClass = "SubTotales2"
|
|
' e.Row.FCLiteral("LtlEvento").Text = " Evento: " & e.Row.DBCampo("EventoTipo")
|
|
' ' e.Row.Cells(1).Visible = False : e.Row.Cells(0).ColumnSpan = 2
|
|
' ElseIf e.Row.DBCampo("EventoTipo") <> String.Empty AndAlso e.Row.DBCampo("Municipio") <> String.Empty AndAlso e.Row.DBCampo("Evento") = String.Empty Then
|
|
' e.Row.CssClass = "SubTotales"
|
|
' e.Row.FCLiteral("LtlEvento").Text = " Municipio: " & e.Row.DBCampo("Municipio")
|
|
' ' e.Row.Cells(1).Visible = False : e.Row.Cells(0).ColumnSpan = 2
|
|
' ElseIf e.Row.DBCampo("EventoTipo") <> String.Empty AndAlso e.Row.DBCampo("Municipio") <> String.Empty AndAlso e.Row.DBCampo("Evento") <> String.Empty Then
|
|
' 'e.Row.CssClass = "Texto"
|
|
' e.Row.FCLiteral("LtlEvento").Text = " " & e.Row.DBCampo("Evento")
|
|
' Dim Liga As String = String.Format("<a class=""Texto"" href=""/Prospectos/RepEventosDetalle.aspx?CveEvento={0}"">", e.Row.DBCampo("CveEvento"))
|
|
' 'e.Row.FCLiteral("LtlEvento").Text = Liga & e.Row.FCLiteral("LtlEvento").Text & "</a>"
|
|
' e.Row.FCLiteral("LtlNumAsistentes").Text = Liga & e.Row.FCLiteral("LtlNumAsistentes").Text & "</a>"
|
|
' e.Row.FCLiteral("LtlFechaEvento").Text = Liga & e.Row.FCLiteral("LtlFechaEvento").Text & "</a>"
|
|
' End If
|
|
|
|
' e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
|
' e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
|
' End If
|
|
'End Sub
|
|
|
|
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
|
|
GvDatos.ExportToExcel("RepEncuestasAvances")
|
|
End Sub
|
|
|
|
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
|
CargaDatos()
|
|
End Sub
|
|
|
|
Protected Sub BtnReasignar_Click(sender As Object, e As EventArgs) Handles BtnReasignar.Click
|
|
Dim ObjEncuestas As New ClsProspectos()
|
|
If ObjEncuestas.ReasignaEncuestaCallCenter(DdlEncuesta.SelectedValue.ToEntero) Then
|
|
CargaDatos()
|
|
End If
|
|
ObjEncuestas.Dispose()
|
|
End Sub
|
|
End Class
|
|
|