Commit inicial Ventas Productivo
This commit is contained in:
258
Prospectos/CatProspectosDetalle.aspx.vb
Normal file
258
Prospectos/CatProspectosDetalle.aspx.vb
Normal file
@@ -0,0 +1,258 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Prospectos_CatProspectosDetalle
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Private Property CveSupervisor As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveSupervisor"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveSupervisor") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveCoordinador As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveCoordinador"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCoordinador") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveMunicipio As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveMunicipio"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveMunicipio") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveProspectoClasificacion As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveProspectoClasificacion"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveProspectoClasificacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveEscolaridad As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveEscolaridad"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveEscolaridad") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property IFE As Integer
|
||||
Get
|
||||
Return CType(ViewState("IFE"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("IFE") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property Sexo As Integer
|
||||
Get
|
||||
Return CType(ViewState("Sexo"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("Sexo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveRangoEdad As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveRangoEdad"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveRangoEdad") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property Auditado As Integer
|
||||
Get
|
||||
Return CType(ViewState("Auditado"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("Auditado") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveProspectoPadre As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveProspectoPadre"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveProspectoPadre") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property MesAnioIngreso As String
|
||||
Get
|
||||
Return ViewState("MesAnioIngreso").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("MesAnioIngreso") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
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
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
ViewState("Orden") = ""
|
||||
CveProspectoSeleccionado = -1 'UsuarioActual.CveProspecto
|
||||
CveSupervisor = IfNull(Request("CveSupervisor"), "-1").ToString.ToEntero
|
||||
CveCoordinador = IfNull(Request("CveCoordinador"), "-1").ToString.ToEntero
|
||||
CveMunicipio = IfNull(Request("CveMunicipio"), "-1").ToString.ToEntero
|
||||
CveProspectoClasificacion = IfNull(Request("CveProspectoClasificacion"), "-1").ToString.ToEntero
|
||||
Auditado = IfNull(Request("Auditado"), "-1").ToString.ToEntero
|
||||
CveProspectoPadre = IfNull(Request("CveProspectoPadre"), "-1").ToString.ToEntero
|
||||
CveEscolaridad = IfNull(Request("CveEscolaridad"), "-1").ToString.ToEntero
|
||||
IFE = IfNull(Request("IFE"), "-1").ToString.ToEntero
|
||||
Sexo = IfNull(Request("Sexo"), "-1").ToString.ToEntero
|
||||
CveRangoEdad = IfNull(Request("CveRangoEdad"), "-1").ToString.ToEntero
|
||||
MesAnioIngreso = IfNull(Request("MesAnioIng"), "-1").ToString
|
||||
CargaDatos()
|
||||
ImgPersonalizar.Attributes.Add("onclick", "$('#DivPersonalizar').show(1000); PosicionaObjeto(this.id,'DivPersonalizar');")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub CargaDatos()
|
||||
Dim ObjProspectos As New ClsProspectos
|
||||
If ObjProspectos.GetProspectosDetalle(CveProspectoClasificacion, CveEscolaridad, IFE, Sexo, CveSupervisor, CveCoordinador, CveMunicipio, -1, Auditado, CveRangoEdad, MesAnioIngreso, CveProspectoPadre, "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
|
||||
ViewState("DTProspectos") = ObjProspectos.DtResultados
|
||||
Else
|
||||
Me.GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
ObjProspectos.Dispose()
|
||||
UPDatos.Update()
|
||||
|
||||
If ViewState("Orden").ToString() <> String.Empty Then
|
||||
CargaGrid(ViewState("Orden").ToString())
|
||||
Else
|
||||
CargaGrid("")
|
||||
End If
|
||||
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()
|
||||
LtlNumRegistros.Text = GvDatos.Rows.Count.ToString.FormatoNumero(0)
|
||||
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.Cells(0).Width = Unit.Pixel(450)
|
||||
e.Row.Cells(1).Width = Unit.Pixel(100)
|
||||
|
||||
End If
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
If e.Row.DBCampo("CveSupervisor").ToEntero > 0 AndAlso e.Row.DBCampo("CveCoordinador").ToEntero = 0 AndAlso e.Row.DBCampo("CveAgrupador") = "" Then
|
||||
|
||||
e.Row.Cells(1).Text = e.Row.DBCampo("NumSupervisores")
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
||||
|
||||
|
||||
e.Row.CssClass = "Totales"
|
||||
e.Row.Height = 22
|
||||
' e.Row.Font.Size = 12
|
||||
e.Row.Cells(0).Font.Size = 12
|
||||
Else
|
||||
If e.Row.DBCampo("CveCoordinador").ToEntero > 0 AndAlso e.Row.DBCampo("NumSupervisores").ToEntero > 0 AndAlso e.Row.DBCampo("CveAgrupador") = "" Then
|
||||
|
||||
e.Row.Cells(1).Text = e.Row.DBCampo("NumCoordinadores")
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
|
||||
e.Row.CssClass = "SubTotales"
|
||||
e.Row.Height = 20
|
||||
End If
|
||||
End If
|
||||
|
||||
'e.Row.FCLiteral("LtlNombres").Text = "<a class=""Texto"" href=""/Prospectos/Prospectos.aspx?CveProspecto=" & e.Row.DBCampo("CveProspecto") & """>" & e.Row.FCLiteral("LtlNombres").Text & "</a>"
|
||||
'e.Row.FCLiteral("LtlRFC").Text = "<a class=""Texto"" href=""/Prospectos/Prospectos.aspx?CveProspecto=" & e.Row.DBCampo("CveProspecto") & """>" & e.Row.FCLiteral("LtlRFC").Text & "</a>"
|
||||
|
||||
'e.Row.FCLiteral("LtlTelefono").Text = "<a class=""Texto"" href=""/Ventas/Clientes.aspx?CveCliente=" & e.Row.DBCampo("CveCliente") & """>" & e.Row.FCLiteral("LtlTelefono").Text & "</a>"
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click
|
||||
GvDatos.Columns(0).Visible = ChkNombreCompleto.Checked
|
||||
GvDatos.Columns(1).Visible = ChkApellidoPaterno.Checked
|
||||
GvDatos.Columns(2).Visible = ChkApellidoMaterno.Checked
|
||||
GvDatos.Columns(3).Visible = ChkNombres.Checked
|
||||
GvDatos.Columns(4).Visible = ChkFechaNacimiento.Checked
|
||||
GvDatos.Columns(5).Visible = ChkSuperior.Checked
|
||||
GvDatos.Columns(6).Visible = ChkLugarNacimiento.Checked
|
||||
GvDatos.Columns(7).Visible = ChkSexo.Checked
|
||||
GvDatos.Columns(8).Visible = ChkRFC.Checked 'ddd
|
||||
GvDatos.Columns(9).Visible = ChkNacionalidad.Checked
|
||||
GvDatos.Columns(10).Visible = ChkCalle.Checked
|
||||
GvDatos.Columns(11).Visible = ChkNumero.Checked
|
||||
GvDatos.Columns(12).Visible = ChkColonia.Checked
|
||||
GvDatos.Columns(13).Visible = ChkCodigoPostal.Checked
|
||||
GvDatos.Columns(14).Visible = ChkPais.Checked
|
||||
GvDatos.Columns(15).Visible = ChkMunicipio.Checked
|
||||
GvDatos.Columns(16).Visible = ChkEstado.Checked
|
||||
GvDatos.Columns(17).Visible = ChkTelefono.Checked
|
||||
GvDatos.Columns(18).Visible = ChkFax.Checked
|
||||
GvDatos.Columns(19).Visible = ChkCorreo.Checked
|
||||
GvDatos.Columns(20).Visible = ChkEmpresaNombre.Checked
|
||||
GvDatos.Columns(21).Visible = ChkEmpresaGiro.Checked
|
||||
GvDatos.Columns(22).Visible = ChkEmpresaSector.Checked
|
||||
GvDatos.Columns(23).Visible = ChkEmpresaPagina.Checked
|
||||
GvDatos.Columns(24).Visible = ChkEmpresaCalle.Checked
|
||||
GvDatos.Columns(25).Visible = ChkEmpresaNumero.Checked
|
||||
GvDatos.Columns(26).Visible = ChkEmpresaColonia.Checked
|
||||
GvDatos.Columns(27).Visible = ChkEmpresaCodigoPostal.Checked
|
||||
GvDatos.Columns(28).Visible = ChkEmpresaPais.Checked
|
||||
GvDatos.Columns(29).Visible = ChkEmpresaMunicipio.Checked
|
||||
GvDatos.Columns(30).Visible = ChkEmpresaEstado.Checked
|
||||
GvDatos.Columns(31).Visible = ChkEmpresaTelefono.Checked
|
||||
GvDatos.Columns(32).Visible = ChkEmpresaFax.Checked
|
||||
GvDatos.Columns(33).Visible = ChkEmpresaCorreo.Checked
|
||||
GvDatos.Columns(34).Visible = ChkEmpresaPuesto.Checked
|
||||
GvDatos.Columns(35).Visible = ChkEmpresaEspecialidad.Checked
|
||||
GvDatos.Columns(36).Visible = ChkFechaIng.Checked
|
||||
UPDatos.Update()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user