Commit inicial Ventas Productivo

This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-08-14 16:40:54 -07:00
commit c35cf91883
13328 changed files with 3711549 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="BuscadorBD.aspx.vb" Inherits="Prospectos_BuscadorBD" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<table border="0" cellpadding="0">
<tr>
<td>Nombre</td>
<td>
<asp:TextBox ID="TxtBusqueda" runat="server" Width="550px"> </asp:TextBox>
<asp:RequiredFieldValidator ID="RFVBusqueda" runat="server" ControlToValidate="TxtBusqueda" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Texto a buscar''</b> es necesario, por favor ingréselo." ValidationGroup="GrpBusqueda"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEBusqueda" runat="server" HighlightCssClass="vco" TargetControlID="RFVBusqueda" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align:right;"><asp:Button ID="BtnBusqueda" runat="server" Text="Consultar" ValidationGroup="GrpBusqueda" /></td>
</tr>
<tr><td>F. Nacimiento</td><td><asp:TextBox ID="TxtFNacimiento" runat="server" Width="70px"> </asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgCalendario" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFNacimiento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFNacimiento" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="TxtFNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha Agenda''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="TxtFNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</td></tr>
<tr><td># Padron</td><td><asp:TextBox ID="TxPadron" runat="server" Width="100px"> </asp:TextBox></td></tr>
<tr>
<td colspan="3">
<div style="height: 600px; overflow-y: scroll; width: 1000px;">
<asp:GridView ID="GvBusq" runat="server" AutoGenerateColumns="False" DataKeyNames="Clave,APaterno,AMaterno,Nombres,FechaNacimiento,Calle,NumExterior,NumInterior, Sexo, Colonia,CP,Ocupacion,PadronMunicipio" CssClass="table table-striped table-advance table-hover" style="margin-top:-10px; text-align:center;" GridLines="None" >
<Columns>
<asp:HyperLinkField DataTextField="NombreCompleto" ControlStyle-CssClass="Texto" NavigateUrl="/Prospectos/ProspectoExpediente.aspx?CveProspecto=5265" HeaderText="Nombre">
<ItemStyle Width="250px" />
</asp:HyperLinkField>
<asp:BoundField DataField="FechaNacimiento" DataFormatString="{0:d}" HeaderText="F.Nac.">
<ItemStyle Width="70px" />
</asp:BoundField>
<asp:BoundField DataField="Sexo" HeaderText="Sexo" />
<asp:BoundField DataField="Colonia" HeaderText="Colonia">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="CP" HeaderText="CP">
<ItemStyle Width="50px" />
</asp:BoundField>
<asp:BoundField DataField="Clave" HeaderText="Padron">
<ItemStyle Width="150px" />
</asp:BoundField>
<asp:BoundField DataField="PadronMunicipio" HeaderText="Municipio">
<ItemStyle Width="100px" />
</asp:BoundField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,31 @@

Partial Class Prospectos_BuscadorBD
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Me.Form.DefaultButton = BtnBusqueda.UniqueID
TxtBusqueda.Focus()
End If
End Sub
Protected Sub BtnBusqueda_Click(sender As Object, e As EventArgs) Handles BtnBusqueda.Click
Dim Prosp As New ClsProspectos
Dim Busqueda As String = TxtBusqueda.Text.Trim.ToUpper
Busqueda = String.Format("%{0}%", Busqueda)
Dim FNac As String = "-1"
If TxtFNacimiento.Text <> "" Then FNac = TxtFNacimiento.Text
If Prosp.GetProspectosBusqueda("-1", "-1", "-1", Busqueda, FNac, -1, -1, -1, -1) Then
GvBusq.DataSource = Prosp.DtResultados
End If
Prosp.Dispose()
GvBusq.DataBind()
End Sub
End Class

View File

@@ -0,0 +1,117 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatAnfitriones.aspx.vb" Inherits="Prospectos_CatAnfitriones" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Anfitriones
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="250px">
<asp:LinkButton ID="LbAnfitrion" runat="server" CausesValidation="false" Text="" CommandArgument="Anfitrion" OnClick="LbOrden_Click">
Anfitrión
<asp:Literal ID="ImgAnfitrion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="161px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtAnfitrion" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAnfitrion" runat="server" ControlToValidate="TxtAnfitrion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Anfitrión''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOAnfitrion" runat="server" HighlightCssClass="vco" TargetControlID="RFVAnfitrion" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveAnfitrion" EmptyDataText="No se encontraron Anfitriones" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlAnfitrion" runat="server" Text='<%# Eval("Anfitrion", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtAnfitrion" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Anfitrion")%>' ValidationGroup="GrpEditGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAnfitrion" runat="server" ControlToValidate="TxtAnfitrion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Anfitrion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOAnfitrion" runat="server" HighlightCssClass="vco" TargetControlID="RFVAnfitrion" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If(Eval("Estatus").ToString = "Activo", True, False)%>' />
</EditItemTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpEditGuardar" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" ToolTip="Editar" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,167 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatAnfitriones
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjEvento As New ClsProspectos
If ObjEvento.GetProspectosAnfitriones(-1, UsuarioActual.CveEmpresa) Then
ViewState("DTAnfitriones") = ObjEvento.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEvento(-1, UsuarioActual.CveEmpresa) = ObjEvento.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
'ObjEvento.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjAnfitrion As New ClsProspectos
If ObjAnfitrion.AddProspectosAnfitriones(TxtAnfitrion.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtAnfitrion.Text = ""
Alert("El nuevo Anfitrión se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTAnfitriones") = ObjAnfitrion.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjAnfitrion.Dispose()
End Sub
#Region "G V D A T O S"
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(250)
e.Row.Cells(1).Width = Unit.Pixel(80)
e.Row.Cells(2).Width = Unit.Pixel(80)
e.Row.Cells(3).Width = Unit.Pixel(80)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(61)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjAnfitrion As New ClsProspectos
If ObjAnfitrion.RemoveProspectosAnfitriones(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTAnfitriones") = ObjAnfitrion.DtResultados
Alert("El Anfitrión se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjAnfitrion.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjAnfitrion As New ClsProspectos
Dim Anfitrion As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtAnfitrion"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveEvento As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjAnfitrion.UpdateProspectosAnfitriones(Anfitrion, Estatus, CveEvento) Then
GvDatos.EditIndex = -1
ViewState("DTAnfitriones") = ObjAnfitrion.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjAnfitrion.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTAnfitriones"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTAnfitriones"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,578 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatClasificacionesCaracteristicas.aspx.vb" Inherits="Prospectos_CatClasificacionesCaracteristicas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" Runat="Server">
Catálogo de Clasificaciones y Caracteristicas de Prospectos
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
<script language="javascript" type="text/javascript">
function C() {
return confirm('¿Está seguro que desea eliminar el Tipo de Característica de Prospectos?');
}
function CC() {
return confirm('¿Está seguro que desea eliminar la Característica de Prospecto?');
}
function CO() {
return confirm('¿Está seguro que desea eliminar la Opción para Característica de Prospecto?');
}
function Up() {
if ($("#ChkEsOpcion").Checked == false && $("hdnEsOpcion").value == 'Sí')
return confirm('¿Está cambiando la Característica para NO tener Opciones, eso generara que sus Opciones sean Eliminadas. Está Seguro de Continuar?');
else
return true;
}
</script>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding-top:20px;">
<tr>
<td align="left">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="1" Width="100%">
<ajax:TabPanel ID="TabClasificaciones" runat="server" HeaderText="Clasificaciones de Características de Prospectos">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<asp:UpdatePanel ID="UpTitulosCl" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="1" rules="all" style="border-collapse: collapse;">
<tr class="Titulos">
<td width="200px"><asp:LinkButton ID="LbCaracteristicaClasificacionCl" runat="server" Enabled="false" CausesValidation="false" Text="Clasificación"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCaracteristicaClasificacionCl" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="75px"><asp:LinkButton ID="LbOrdenCl" runat="server" CausesValidation="false" Text="Orden"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgOrdenCl" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbEstatusCl" runat="server" CausesValidation="false" Text="Estatus"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEstatusCl" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbFechaIngCl" runat="server" CausesValidation="false" Text="Fecha Ing."></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgFechaIngCl" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbUsuarioCl" runat="server" CausesValidation="false" Text="Usuario"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgUsuarioCl" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px">Comandos</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtCaracteristicaClasificacion" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarCl" Width="195px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCaracteristicaClasificacion" runat="server" ControlToValidate="TxtCaracteristicaClasificacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCl"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCaracteristicaClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristicaClasificacion" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtOrdenCl" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarCl" Width="75px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOrdenCl" runat="server" ControlToValidate="TxtOrdenCl" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCl"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOOrdenCl" runat="server" HighlightCssClass="vco" TargetControlID="RFVOrdenCl" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><asp:LinkButton ID="LbAgregarCl" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarCl"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatosCl" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosCl" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCaracteristicaClasificacion" EmptyDataText="No se encontraron Clasificaciones de Características Registrados" ToolTip="Listado de Clasificaciones para Características">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCaracteristicaClasificacion" runat="server" Text='<%# Eval("CaracteristicaClasificacion", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtCaracteristicaClasificacion" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("CaracteristicaClasificacion")%>' ValidationGroup="GrpEditGuardarCl" Width="100px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCaracteristicaClasificacion" runat="server" ControlToValidate="TxtCaracteristicaClasificacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardarCl"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCaracteristicaClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristicaClasificacion" Width="100px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlOrden" runat="server" Text='<%# Eval("Orden", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtOrdenCl" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Orden")%>' ValidationGroup="GrpEditGuardarCl" Width="100px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOrdenCl" runat="server" ControlToValidate="TxtOrdenCl" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardarCl"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOOrdenCl" runat="server" HighlightCssClass="vco" TargetControlID="RFVOrdenCl" Width="100px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="ImageButton5" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="ImageButton6" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="ImageButton7" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="ImageButton8" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return CO();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabCaracteristicaTipos" runat="server" HeaderText="Tipos de Características">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="1" rules="all" style="border-collapse: collapse;">
<tr class="Titulos">
<td width="250px"><asp:LinkButton ID="LbCaracteristicaTipo" runat="server" CausesValidation="false" Text="Tipo Característica"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCaracteristicaTipo" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbCaracteristicaClasificacion" runat="server" CausesValidation="false" Text="Caracteristica Clasificación"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCaracteristicaClasificacion" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="75px"><asp:LinkButton ID="LbOrden" runat="server" CausesValidation="false" Text="Orden"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgOrden" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="Estatus"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEstatus" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="Fecha Ing."></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgFechaIng" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="Usuario"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgUsuario" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="103">Comandos</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtCaracteristicaTipo" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="244px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCaracteristicaTipo" runat="server" ControlToValidate="TxtCaracteristicaTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Característica''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCCaracteristicaTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristicaTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:DropDownList ID="DdlCaracteristicaClasificacion" runat="server" AppendDataBoundItems="true" DataTextField="CaracteristicaClasificacion" DataValueField="CveCaracteristicaClasificacion" Width="100px">
<asp:ListItem Selected="True" Text="Sin Clasificación" Value="0"></asp:ListItem>
</asp:DropDownList></td>
<td>
<asp:TextBox ID="TxtOrden" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="75px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOrden" runat="server" ControlToValidate="TxtOrden" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOrden" runat="server" HighlightCssClass="vco" TargetControlID="RFVOrden" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCaracteristicaTipo" EmptyDataText="No se encontraron Tipos Caracteristicas Registrados" ToolTip="Listado de Tipos de Características">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCaracteristicaTipo" runat="server" Text='<%# Eval("CaracteristicaTipo", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtCaracteristicaTipo" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("CaracteristicaTipo") %>' ValidationGroup="GrpGV" Width="244px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCaracteristicaTipo" runat="server" ControlToValidate="TxtCaracteristicaTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Característica''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCTCaracteristicaTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristicaTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCaracteristicaClasificacion" runat="server" Text='<%# Eval("CaracteristicaClasificacion", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlCaracteristicaClasificacionEdit" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="CaracteristicaClasificacion" DataValueField="CveCaracteristicaClasificacion" Width="100px" ValidationGroup="GrpGuardarC">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlOrden" runat="server" Text='<%# Eval("Orden", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtOrden" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Orden") %>' ValidationGroup="GrpGV" Width="75px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOrden" runat="server" ControlToValidate="TxtOrden" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCTOrden" runat="server" HighlightCssClass="vco" TargetControlID="RFVOrden" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
<asp:ImageButton ID="imgDuplicar" Visible="false" runat="server" AlternateText="Duplicar" ToolTip="Duplicar" CausesValidation="False" OnClientClick="$get('divDuplicar').style.display = '';" ImageUrl="/Imagenes/Table-icon.png" Height="16" Width="16" />
<asp:HyperLink ID="HplMaq" runat="server" ClientIDMode="Static"><img alt="Maquinaria" width="20px" height="20px" src="/Imagenes/Table-icon.png" style="cursor:pointer;" onclick="$get('divDuplicar').style.display='';PosicionaObjeto('HplMaq','divDuplicar');$get('hdnCaracteristicaTipo').value=<%# Eval("CveCaracteristicaTipo")%>"/></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabCaracteristicas" runat="server" HeaderText="Características de Prospectos">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<asp:UpdatePanel ID="UpTitulosC" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="1" rules="all" style="border-collapse: collapse;">
<tr class="Titulos">
<td width="100px"><asp:LinkButton ID="LbCaracteristicaClasificacionC" runat="server" CausesValidation="false" Text="Caracteristica Clasificación"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCaracteristicaClasificacionC" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="150px"><asp:LinkButton ID="LbCaracteristicaTipoC" runat="server" CausesValidation="false" Text="Tipo Característica"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCaracteristicaTipoC" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="200px"><asp:LinkButton ID="LbCaracteristicaC" runat="server" CausesValidation="false" Text="Caracteristica"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCaracteristicaC" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="75px"><asp:LinkButton ID="LbOrdenC" runat="server" CausesValidation="false" Text="Orden"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgOrdenC" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbEsOpcionC" runat="server" CausesValidation="false" Text="Es Opcion"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEsOpcionC" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbEstatusC" runat="server" CausesValidation="false" Text="Estatus"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEstatusC" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbFechaIngC" runat="server" CausesValidation="false" Text="Fecha Ing."></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgFechaIngC" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbUsuarioC" runat="server" CausesValidation="false" Text="Usuario"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgUsuarioC" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px">Comandos</td>
</tr>
<tr>
<td>
<asp:DropDownList ID="DdlCaracteristicaClasificacionC" Visible="false" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="CaracteristicaClasificacion" DataValueField="CveCaracteristicaClasificacion" Width="100px" ValidationGroup="GrpGuardarC">
<asp:ListItem Selected="True" Text="Sin Clasificacion" Value="0"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCaracteristicaClasificacionC" runat="server" ControlToValidate="DdlCaracteristicaClasificacionC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificacion''</b> es necesario, por favor seleccione uno." InitialValue="0" ValidationGroup="GrpGuardarC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCaracteristicaClasificacionC" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristicaClasificacionC" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:DropDownList ID="DdlCaracteristicaTipo" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="CaracteristicaTipo" DataValueField="CveCaracteristicaTipo" Width="147px" ValidationGroup="GrpGuardarC">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCaracteristicaTipoC" runat="server" ControlToValidate="DdlCaracteristicaTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Caracteristica''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCaracteristicaTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristicaTipoC" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtCaracteristica" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarC" Width="197px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCaracteristica" runat="server" ControlToValidate="TxtCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCCaracteristica" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristica" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtOrdenC" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarC" Width="75px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOrdenC" runat="server" ControlToValidate="TxtOrdenC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOrdenC" runat="server" HighlightCssClass="vco" TargetControlID="RFVOrdenC" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td align="center">
<asp:DropDownList ID="DdlEsOpcionC" runat="server" AppendDataBoundItems="true" Width="97px">
<asp:ListItem Text="Texto" Value="0"></asp:ListItem>
<asp:ListItem Selected="True" Text="Listado" Value="1"></asp:ListItem>
<asp:ListItem Text="Radio" Value="2"></asp:ListItem>
<asp:ListItem Text="Fecha" Value="3"></asp:ListItem>
<asp:ListItem Text="Multiline" Value="4"></asp:ListItem>
</asp:DropDownList></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><asp:LinkButton ID="LbAgregarC" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarC"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatosC" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosCaracteristicas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCaracteristica" EmptyDataText="No se encontraron Caracteristica Registrados" ToolTip="Listado de Caracteristicas">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlClasificacion" runat="server" Text='<%# Eval("CaracteristicaClasificacion", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCaracteristicaTipo" runat="server" Text='<%# Eval("CaracteristicaTipo", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlCaracteristicaTipoEdit" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="CaracteristicaTipo" DataValueField="CveCaracteristicaTipo" Width="100px" ValidationGroup="GrpGuardarC">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCaracteristica" runat="server" Text='<%# Eval("Caracteristica", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtCaracteristica" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Caracteristica")%>' ValidationGroup="GrpEditGuardarC" Width="100px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCaracteristica" runat="server" ControlToValidate="TxtCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardarC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCaracteristica" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristica" Width="100px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlOrdenC" runat="server" Text='<%# Eval("Orden", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtOrdenC" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Orden")%>' ValidationGroup="GrpEditGuardarC" Width="100px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOrdenC" runat="server" ControlToValidate="TxtOrdenC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Orden''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardarC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOOrden" runat="server" HighlightCssClass="vco" TargetControlID="RFVOrdenC" Width="100px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEsOpcion" runat="server" Text='<%# Eval("EsOpcionD") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlEsOpcionEdit" runat="server" AppendDataBoundItems="true" Width="97px">
<asp:ListItem Text="Texto" Value="0"></asp:ListItem>
<asp:ListItem Text="Listado" Value="1"></asp:ListItem>
<asp:ListItem Text="Radio" Value="2"></asp:ListItem>
<asp:ListItem Text="Fecha" Value="3"></asp:ListItem>
<asp:ListItem Text="Multiline" Value="4"></asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="ImageButton1" runat="server" OnClientClick="javascript:return Up();" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="ImageButton2" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="ImageButton3" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="ImageButton4" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return CC();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabCaracteristicasOpciones" runat="server" HeaderText="Opciones para Caracteristicas de Prospectos">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<asp:UpdatePanel ID="UpTitulosO" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="1" rules="all" style="border-collapse: collapse;">
<tr class="Titulos">
<td width="100px"><asp:LinkButton ID="LbCaracteristicaTipoO" runat="server" Enabled="false" CausesValidation="false" Text="Tipo Característica"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImageButton9" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbCaracteristicaO" runat="server" CausesValidation="false" Text="Caracteristica"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCaracteristicaO" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="200px"><asp:LinkButton ID="LbOpcionO" runat="server" CausesValidation="false" Text="Opcion"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgOpcionO" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbEstatusO" runat="server" CausesValidation="false" Text="Estatus"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEstatusO" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbFechaIngO" runat="server" CausesValidation="false" Text="Fecha Ing."></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgFechaIngO" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbUsuarioO" runat="server" CausesValidation="false" Text="Usuario"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgUsuarioO" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px">Comandos</td>
</tr>
<tr>
<td>
<asp:DropDownList ID="DdlCaracteristicaTipoO" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="CaracteristicaTipo" DataValueField="CveCaracteristicaTipo" Width="100px" ValidationGroup="GrpGuardarO">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCaracteristicaTipoO" runat="server" ControlToValidate="DdlCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOCaracteristicaTipoO" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristicaTipoO" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:DropDownList ID="DdlCaracteristica" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Caracteristica" DataValueField="CveCaracteristica" Width="100px" ValidationGroup="GrpGuardarO">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCaracteristicaO" runat="server" ControlToValidate="DdlCaracteristica" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Caracteristica''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVCaracteristicaO" Width="100px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtOpcion" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardarO" Width="195px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOpcionO" runat="server" ControlToValidate="TxtOpcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Opción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOpcionO" runat="server" HighlightCssClass="vco" TargetControlID="RFVOpcionO" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><asp:LinkButton ID="LbAgregarO" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarO"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatosO" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosOpciones" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCaracteristicaOpcion" EmptyDataText="No se encontraron Opciones para Caracteristicas Registrados" ToolTip="Listado de Opciones para Caracteristicas">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCaracteristicaTipo" runat="server" Text='<%# Eval("CaracteristicaTipo", "{0}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlCaracteristica" runat="server" Text='<%# Eval("CaracteristicaOpcion", "{0}")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlCaracteristicaEdit" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="Caracteristica" DataValueField="CveCaracteristica" Width="100px" ValidationGroup="GrpGuardarO">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlOpcion" runat="server" Text='<%# Eval("Caracteristica", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtOpcion" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Caracteristica")%>' ValidationGroup="GrpEditGuardarO" Width="100px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVOpcion" runat="server" ControlToValidate="TxtOpcion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Opción''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardarO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOOpcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVOpcion" Width="100px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="Literal6" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="ImageButton5" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="ImageButton6" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="ImageButton7" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="ImageButton8" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return CO();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
<br />
<asp:HiddenField ID="hdnCaracteristicaTipo" Value="" ClientIDMode="Static" runat="server" />
<asp:Panel ID="divDuplicar" runat="server" ClientIDMode="Static" Width="300px" BackColor="White" Style="border: solid 1px black; color: Black; display: none; position: absolute;">
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UPPBuscar">
<ContentTemplate>
<table border="0" width="300px" cellpadding="0" cellspacing="1">
<tr class="Titulos">
<td colspan="2">
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="TbBuscar" style="cursor: move;">
<tr>
<td style="width: 510px">Duplicar Tipo de Caracteristica</td>
<td style="padding-right: 4px; padding-top: 4px" valign="top"><img alt="" src="/imagenes/cerrarX.jpg" style="cursor: pointer;" onclick="$get('divDuplicar').style.display='none';" /></td>
</tr>
</table>
</td>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr align="left">
<td style="width: 80px">Tipo Característica:</td>
<td>
<asp:TextBox runat="server" ID="TxtCaracteristicaTipoDuplicar"></asp:TextBox>
<asp:Button ID="BtnDuplicarCaracteristicaTipo" runat="server" Text="Aceptar" ValidationGroup="GrpBusqueda" />
</td>
</tr>
<tr>
<td colspan="2" align="center"></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
</asp:Content>

View File

@@ -0,0 +1,907 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatClasificacionesCaracteristicas
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("OrdenCl") = ""
ViewState("OCaracteristicaClasificacionCl") = "CaracteristicaClasificacion DESC"
ViewState("OEstatusCl") = "Estatus DESC"
ViewState("OFechaIngCl") = "FechaIng DESC"
ViewState("OUsuarioCl") = "Usuario DESC"
CargaDatosCl()
ViewState("Orden") = ""
ViewState("OCaracteristicaTipo") = "CaracteristicaTipo DESC"
ViewState("OEstatus") = "Estatus DESC"
ViewState("OFechaIng") = "FechaIng DESC"
ViewState("OUsuario") = "Usuario DESC"
CargaClasificaciones()
CargaDatos()
ViewState("OrdenC") = ""
ViewState("OCaracteristicaC") = "Caracteristica DESC"
ViewState("OCaracteristicaTipoC") = "CaracteristicaTipo DESC"
ViewState("OEsOpcionC") = "EsOpcion DESC"
ViewState("OEstatusC") = "Estatus DESC"
ViewState("OFechaIngC") = "FechaIng DESC"
ViewState("OUsuarioC") = "Usuario DESC"
CargaTiposCaracteristicas()
CargaDatosC()
ViewState("OrdenO") = ""
ViewState("OOpcionO") = "Opcion DESC"
ViewState("OCaracteristicaO") = "Caracteristica DESC"
ViewState("OEstatusO") = "Estatus DESC"
ViewState("OFechaIngO") = "FechaIng DESC"
ViewState("OUsuarioO") = "Usuario DESC"
CargaCaracteristicas()
CargaDatosO()
End If
End Sub
#Region " Características Clasificaciones "
Public Sub CargaDatosCl()
Dim ObjClasificaciones As New ClsProspectos
If ObjClasificaciones.GetCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) Then
ViewState("DTClasificacionesCaracteristicas") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
If (ViewState("DTClasificacionesCaracteristicas") Is Nothing) Then
ViewState("DTClasificacionesCaracteristicas") = ObjClasificaciones.DtResultados
End If
GlobalDTProspectosCaracteristicasClasificaciones = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Else
Me.GvDatosCl.DataSource = Nothing
End If
ObjClasificaciones.Dispose()
If ViewState("OrdenCl").ToString() <> String.Empty Then
CargaGridCl(ViewState("OrdenCl").ToString())
Else
CargaGridCl("")
End If
End Sub
Protected Sub LbAgregarCl_Click(sender As Object, e As System.EventArgs) Handles LbAgregarCl.Click
Dim ObjClasificaciones As New ClsProspectos
If ObjClasificaciones.AddClasificacionesCaracteristicas(TxtCaracteristicaClasificacion.Text.Trim, TxtOrdenCl.Text.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtCaracteristicaClasificacion.Text = ""
TxtOrdenCl.Text = ""
Alert("La nueva Clasificación de Tipo de Característica se guardó correctamente.", TipoMensaje.MsgInformacion)
'UpTitulos.Update()
ViewState("DTClasificacionesCaracteristicas") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCaracteristicasClasificaciones = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
CambioClasificacionesCaracteristicas()
End If
ObjClasificaciones.Dispose()
End Sub
#Region " O R D E N"
Protected Sub LbEstatusCl_Click(sender As Object, e As System.EventArgs) Handles LbEstatusCl.Click, ImgEstatusCl.Click
If ViewState("OEstatusCl").ToString() = "Estatus DESC" Then
ViewState("OEstatusCl") = "Estatus ASC"
ImgEstatusCl.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OEstatusCl") = "Estatus DESC"
ImgEstatusCl.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenCl") = ViewState("OEstatusCl")
CargaGridCl(ViewState("OrdenCl").ToString())
End Sub
Protected Sub LbFechaIngCl_Click(sender As Object, e As System.EventArgs) Handles LbFechaIngCl.Click, ImgFechaIngCl.Click
If ViewState("OFechaIngCl").ToString() = "FechaIng DESC" Then
ViewState("OFechaIngCl") = "FechaIng ASC"
ImgFechaIngCl.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OFechaIngCl") = "FechaIng DESC"
ImgFechaIngCl.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenCl") = ViewState("OFechaIngCl")
CargaGridCl(ViewState("OrdenCl").ToString())
End Sub
#End Region
#End Region
#Region " C A R A C T E R I S T I C A S - T I P O S "
#Region "O R D E N A R - T I P O - C A R A C T E R I S T I C A S"
Protected Sub LbCaracteristicaTipo_Click(sender As Object, e As System.EventArgs) Handles LbCaracteristicaTipo.Click, ImgCaracteristicaTipo.Click
If ViewState("OCaracteristicaTipo").ToString() = "CaracteristicaTipo DESC" Then
ViewState("OCaracteristicaTipo") = "CaracteristicaTipo ASC"
ImgCaracteristicaTipo.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OCaracteristicaTipo") = "CaracteristicaTipo DESC"
ImgCaracteristicaTipo.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("Orden") = ViewState("OCaracteristicaTipo")
CargaGrid(ViewState("Orden").ToString())
End Sub
Protected Sub LbCaracteristicaClasificacion_Click(sender As Object, e As System.EventArgs) Handles LbCaracteristicaClasificacion.Click, ImgCaracteristicaClasificacion.Click
If ViewState("OCaracteristicaClasificacionCl").ToString() = "CaracteristicaClasificacion DESC" Then
ViewState("OCaracteristicaClasificacionCl") = "CaracteristicaClasificacion ASC"
ImgCaracteristicaClasificacion.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OCaracteristicaClasificacionCl") = "CaracteristicaClasificacion DESC"
ImgCaracteristicaClasificacion.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenCl") = ViewState("OCaracteristicaClasificacionCl")
CargaGridCl(ViewState("OrdenCl").ToString())
End Sub
Protected Sub LbOrden_Click(sender As Object, e As System.EventArgs) Handles LbOrden.Click, ImgOrden.Click
If ViewState("Orden").ToString() = "Orden DESC" Then
ViewState("Orden") = "Orden ASC"
ImgOrden.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("Orden") = "Orden DESC"
ImgOrden.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("Orden") = ViewState("Orden")
CargaGridCl(ViewState("Orden").ToString())
End Sub
Protected Sub LbEstatus_Click(sender As Object, e As System.EventArgs) Handles LbEstatus.Click, ImgEstatus.Click
If ViewState("OEstatus").ToString() = "Estatus DESC" Then
ViewState("OEstatus") = "Estatus ASC"
ImgEstatus.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OEstatus") = "Estatus DESC"
ImgEstatus.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("Orden") = ViewState("OEstatus")
CargaGrid(ViewState("Orden").ToString())
End Sub
Protected Sub LbFechaIng_Click(sender As Object, e As System.EventArgs) Handles LbFechaIng.Click, ImgFechaIng.Click
If ViewState("OFechaIng").ToString() = "FechaIng DESC" Then
ViewState("OFechaIng") = "FechaIng ASC"
ImgFechaIng.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OFechaIng") = "FechaIng DESC"
ImgFechaIng.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("Orden") = ViewState("OFechaIng")
CargaGrid(ViewState("Orden").ToString())
End Sub
#End Region
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(250)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(50)
e.Row.Cells(6).Width = Unit.Pixel(53)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlCaracteristicaClasificacionEdit").DataSource = GlobalDTProspectosCaracteristicasClasificaciones.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlCaracteristicaClasificacionEdit").DataBind()
e.Row.FCDropDownList("DdlCaracteristicaClasificacionEdit").SelectedValue = e.Row.DBCampo("CveCaracteristicaClasificacion")
End If
'If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
' e.Row.FCDropDownList("DdlCaracteristicaClasificacionEdit").DataSource = GlobalDTProspectosTiposCaracteristicas(UsuarioActual.CveEmpresa).FiltraParametros("").FiltraParametros("Estatus = 'Activo'")
' e.Row.FCDropDownList("DdlCaracteristicaClasificacionEdit").DataBind()
' e.Row.FCDropDownList("DdlCaracteristicaClasificacionEdit").SelectedValue = e.Row.DBCampo("CveCaracteristicaClasificacion")
'End If
End If
End Sub
Private Sub CargaClasificaciones()
DdlCaracteristicaClasificacion.Items.Clear()
DdlCaracteristicaClasificacion.DataSource = GlobalDTProspectosCaracteristicasClasificaciones.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlCaracteristicaClasificacion.DataBind()
DdlCaracteristicaClasificacionC.Items.Clear()
DdlCaracteristicaClasificacionC.DataSource = GlobalDTProspectosCaracteristicasClasificaciones.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlCaracteristicaClasificacionC.DataBind()
End Sub
Protected Sub BtnDuplicarCaracteristicaTipo_Click(sender As Object, e As EventArgs) Handles BtnDuplicarCaracteristicaTipo.Click
Dim Sc As String = "$get('divDuplicar').style.display='none';"
Dim CveCaracteristicaTipo As Integer = hdnCaracteristicaTipo.Value.ToEntero
Dim CaracteristicaTipo As String = TxtCaracteristicaTipoDuplicar.Text.Trim
Dim ObjCaracteristicaTipo As New ClsProspectos
If ObjCaracteristicaTipo.CloneTiposCaracteristicas(CveCaracteristicaTipo, CaracteristicaTipo, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtCaracteristicaTipo.Text = ""
TxtOrden.Text = ""
Alert("El nuevo Tipo de Característica se guardó correctamente.", TipoMensaje.MsgInformacion)
'UpTitulos.Update()
ViewState("DTTiposCaracteristicas") = ObjCaracteristicaTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosTiposCaracteristicas = ObjCaracteristicaTipo.DtResultados
CambioCaracteristicaTipo()
End If
ObjCaracteristicaTipo.Dispose()
RegistraScript(Sc)
End Sub
#End Region
#Region " C A R A C T E R I S T I C A S - P R O S P E C T O S"
Public Sub CargaDatosC()
Dim ObjCaracteristicas As New ClsProspectos
If ObjCaracteristicas.GetCaracteristicas(UsuarioActual.CveEmpresa) Then
' ViewState("DTCaracteristicas") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
If (ViewState("DTCaracteristicas") Is Nothing) Then
ViewState("DTCaracteristicas") = ObjCaracteristicas.DtResultados
End If
GlobalDTProspectosCaracteristicas(UsuarioActual.CveEmpresa) = ObjCaracteristicas.DtResultados
Else
Me.GvDatosCaracteristicas.DataSource = Nothing
End If
ObjCaracteristicas.Dispose()
If ViewState("OrdenC").ToString() <> String.Empty Then
CargaGridC(ViewState("OrdenC").ToString())
Else
CargaGridC("")
End If
End Sub
Protected Sub LbAgregarC_Click(sender As Object, e As System.EventArgs) Handles LbAgregarC.Click
Dim ObjCaracteristicas As New ClsProspectos
If ObjCaracteristicas.AddCaracteristicas(TxtCaracteristica.Text.Trim, DdlCaracteristicaTipo.SelectedValue.ToEntero, DdlEsOpcionC.SelectedValue.ToEntero, TxtOrdenC.Text.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtCaracteristica.Text = ""
TxtOrdenC.Text = ""
Alert("La nueva Característica se guardó correctamente.", TipoMensaje.MsgInformacion)
ViewState("DTCaracteristicas") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCaracteristicas(UsuarioActual.CveEmpresa) = ObjCaracteristicas.DtResultados
CambioCaracteristicas()
End If
ObjCaracteristicas.Dispose()
End Sub
Protected Sub LbCaracteristicaTipoC_Click(sender As Object, e As System.EventArgs) Handles LbCaracteristicaTipoC.Click, ImgCaracteristicaTipoC.Click
If ViewState("OCaracteristicaTipoC").ToString() = "CaracteristicaTipo DESC" Then
ViewState("OCaracteristicaTipoC") = "CaracteristicaTipo ASC"
ImgCaracteristicaTipoC.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OCaracteristicaTipoC") = "CaracteristicaTipo DESC"
ImgCaracteristicaTipoC.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenC") = ViewState("OCaracteristicaTipoC")
CargaGridC(ViewState("OrdenC").ToString())
End Sub
Protected Sub LbCaracteristicaC_Click(sender As Object, e As System.EventArgs) Handles LbCaracteristicaC.Click, ImgCaracteristicaC.Click
If ViewState("OCaracteristicaC").ToString() = "Caracteristica DESC" Then
ViewState("OCaracteristicaC") = "Caracteristica ASC"
ImgCaracteristicaC.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OCaracteristicaC") = "Caracteristica DESC"
ImgCaracteristicaC.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenC") = ViewState("OCaracteristicaC")
CargaGridC(ViewState("OrdenC").ToString())
End Sub
Private Sub CargaTiposCaracteristicas()
DdlCaracteristicaTipo.Items.Clear()
DdlCaracteristicaTipo.DataSource = GlobalDTProspectosTiposCaracteristicas.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlCaracteristicaTipo.DataBind()
DdlCaracteristicaTipoO.Items.Clear()
DdlCaracteristicaTipoO.DataSource = GlobalDTProspectosTiposCaracteristicas.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlCaracteristicaTipoO.DataBind()
End Sub
Protected Sub GvDatosCaracteristicas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosCaracteristicas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(100)
e.Row.Cells(1).Width = Unit.Pixel(150)
e.Row.Cells(2).Width = Unit.Pixel(200)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(100)
e.Row.Cells(7).Width = Unit.Pixel(50)
e.Row.Cells(8).Width = Unit.Pixel(50)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlCaracteristicaTipoEdit").DataSource = GlobalDTProspectosTiposCaracteristicas.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlCaracteristicaTipoEdit").DataBind()
e.Row.FCDropDownList("DdlCaracteristicaTipoEdit").SelectedValue = e.Row.DBCampo("CveCaracteristicaTipo")
e.Row.FCDropDownList("DdlEsOpcionEdit").SelectedIndex = e.Row.DBCampo("EsOpcion").ToEntero
End If
End If
End Sub
#Region "O R D E N A R - C A R A C T E R I S T I C A S - P R O S P E C T O S"
Protected Sub LbEstatusC_Click(sender As Object, e As System.EventArgs) Handles LbEstatusC.Click, ImgEstatusC.Click
If ViewState("OEstatusC").ToString() = "Estatus DESC" Then
ViewState("OEstatusC") = "Estatus ASC"
ImgEstatusC.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OEstatusC") = "Estatus DESC"
ImgEstatusC.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenC") = ViewState("OEstatusC")
CargaGridC(ViewState("OrdenC").ToString())
End Sub
Protected Sub LbEsOpcionC_Click(sender As Object, e As System.EventArgs) Handles LbEsOpcionC.Click, ImgEsOpcionC.Click
If ViewState("OEsOpcionC").ToString() = "EsOpcion DESC" Then
ViewState("OEsOpcionC") = "EsOpcion ASC"
ImgEsOpcionC.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OEsOpcionC") = "EsOpcion DESC"
ImgEsOpcionC.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenC") = ViewState("OEsOpcionC")
CargaGridC(ViewState("OrdenC").ToString())
End Sub
Protected Sub LbFechaIngC_Click(sender As Object, e As System.EventArgs) Handles LbFechaIngC.Click, ImgFechaIngC.Click
If ViewState("OFechaIngC").ToString() = "FechaIng DESC" Then
ViewState("OFechaIngC") = "FechaIng ASC"
ImgFechaIngC.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OFechaIngC") = "FechaIng DESC"
ImgFechaIngC.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenC") = ViewState("OFechaIngC")
CargaGridC(ViewState("OrdenC").ToString())
End Sub
Protected Sub LbUsuarioC_Click(sender As Object, e As System.EventArgs) Handles LbUsuarioC.Click, ImgUsuarioC.Click
If ViewState("OUsuarioC").ToString() = "Usuario DESC" Then
ViewState("OUsuarioC") = "Usuario ASC"
ImgUsuarioC.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OUsuarioC") = "Usuario DESC"
ImgUsuarioC.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenC") = ViewState("OUsuarioC")
CargaGridC(ViewState("OrdenC").ToString())
End Sub
#End Region
#End Region
Public Sub CargaDatos()
Dim ObjCaracteristicaTipo As New ClsProspectos
If ObjCaracteristicaTipo.GetTiposCaracteristicas(UsuarioActual.CveEmpresa) Then
ViewState("DTTiposCaracteristicas") = ObjCaracteristicaTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
If (ViewState("DTTiposCaracteristicas") Is Nothing) Then
ViewState("DTTiposCaracteristicas") = ObjCaracteristicaTipo.DtResultados
End If
GlobalDTProspectosTiposCaracteristicas = ObjCaracteristicaTipo.DtResultados.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa)
Else
Me.GvDatos.DataSource = Nothing
End If
ObjCaracteristicaTipo.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Public Sub CargaDatosO()
Dim ObjCaracteristicasOpciones As New ClsProspectos
If ObjCaracteristicasOpciones.GetCaracteristicasOpciones(-1, UsuarioActual.CveEmpresa) Then
ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
If CType(ViewState("DTCaracteristicasOpciones"), DataTable).Columns.Count = 0 Then
ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados
End If
GlobalDTProspectosCaracteristicasOpciones() = ObjCaracteristicasOpciones.DtResultados
Else
GvDatosOpciones.DataSource = Nothing
End If
ObjCaracteristicasOpciones.Dispose()
If ViewState("OrdenO").ToString() <> String.Empty Then
CargaGridO(ViewState("OrdenO").ToString())
Else
CargaGridO("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjTiposCaracteristicas As New ClsProspectos
If ObjTiposCaracteristicas.AddTiposCaracteristicas(TxtCaracteristicaTipo.Text.Trim, DdlCaracteristicaClasificacion.SelectedValue.ToEntero, TxtOrden.Text.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtCaracteristicaTipo.Text = ""
TxtOrden.Text = ""
Alert("El nuevo Tipo de Característica se guardó correctamente.", TipoMensaje.MsgInformacion)
'UpTitulos.Update()
ViewState("DTTiposCaracteristicas") = ObjTiposCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosTiposCaracteristicas = ObjTiposCaracteristicas.DtResultados.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa)
CambioCaracteristicaTipo()
End If
ObjTiposCaracteristicas.Dispose()
End Sub
Protected Sub LbAgregarO_Click(sender As Object, e As System.EventArgs) Handles LbAgregarO.Click
Dim ObjCaracteristicasOpciones As New ClsProspectos
If ObjCaracteristicasOpciones.AddCaracteristicasOpciones(TxtOpcion.Text.Trim, DdlCaracteristica.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
TxtOpcion.Text = ""
Alert("La nueva Opción para Característica se guardó correctamente.", TipoMensaje.MsgInformacion)
ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados
GlobalDTProspectosCaracteristicasOpciones() = ObjCaracteristicasOpciones.DtResultados
CambioCaracteristicasOpciones()
End If
ObjCaracteristicasOpciones.Dispose()
End Sub
Protected Sub LbCaracteristicaO_Click(sender As Object, e As System.EventArgs) Handles LbCaracteristicaO.Click, ImgCaracteristicaO.Click
If ViewState("OCaracteristicaO").ToString() = "Caracteristica DESC" Then
ViewState("OCaracteristicaO") = "Caracteristica ASC"
ImgCaracteristicaO.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OCaracteristicaO") = "Caracteristica DESC"
ImgCaracteristicaO.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenO") = ViewState("OCaracteristicaO")
CargaGridO(ViewState("OrdenO").ToString())
End Sub
Protected Sub LbOpcionO_Click(sender As Object, e As System.EventArgs) Handles LbOpcionO.Click, ImgOpcionO.Click
If ViewState("OOpcionO").ToString() = "Opcion DESC" Then
ViewState("OOpcionO") = "Opcion ASC"
ImgOpcionO.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OOpcionO") = "Opcion DESC"
ImgOpcionO.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenO") = ViewState("OOpcionO")
CargaGridO(ViewState("OrdenO").ToString())
End Sub
Protected Sub LbEstatusO_Click(sender As Object, e As System.EventArgs) Handles LbEstatusO.Click, ImgEstatusO.Click
If ViewState("OEstatusO").ToString() = "Estatus DESC" Then
ViewState("OEstatusO") = "Estatus ASC"
ImgEstatusO.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OEstatusO") = "Estatus DESC"
ImgEstatusO.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenO") = ViewState("OEstatusO")
CargaGridO(ViewState("OrdenO").ToString())
End Sub
Protected Sub LbFechaIngO_Click(sender As Object, e As System.EventArgs) Handles LbFechaIngO.Click, ImgFechaIngO.Click
If ViewState("OFechaIngO").ToString() = "FechaIng DESC" Then
ViewState("OFechaIngO") = "FechaIng ASC"
ImgFechaIngO.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OFechaIngO") = "FechaIng DESC"
ImgFechaIngO.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenO") = ViewState("OFechaIngO")
CargaGridO(ViewState("OrdenO").ToString())
End Sub
Protected Sub LbUsuarioCl_Click(sender As Object, e As System.EventArgs) Handles LbUsuarioCl.Click, ImgUsuarioCl.Click
If ViewState("OUsuarioCl").ToString() = "Usuario DESC" Then
ViewState("OUsuarioCl") = "Usuario ASC"
ImgUsuarioCl.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OUsuarioCl") = "Usuario DESC"
ImgUsuarioCl.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenCl") = ViewState("OUsuarioCl")
CargaGridCl(ViewState("OrdenCl").ToString())
End Sub
Protected Sub LbUsuario_Click(sender As Object, e As System.EventArgs) Handles LbUsuario.Click, ImgUsuario.Click
If ViewState("OUsuario").ToString() = "Usuario DESC" Then
ViewState("OUsuario") = "Usuario ASC"
ImgUsuario.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OUsuario") = "Usuario DESC"
ImgUsuario.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("Orden") = ViewState("OUsuario")
CargaGrid(ViewState("Orden").ToString())
End Sub
Protected Sub LbUsuarioO_Click(sender As Object, e As System.EventArgs) Handles LbUsuarioO.Click, ImgUsuarioO.Click
If ViewState("OUsuarioO").ToString() = "Usuario DESC" Then
ViewState("OUsuarioO") = "Usuario ASC"
ImgUsuarioO.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OUsuarioO") = "Usuario DESC"
ImgUsuarioO.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OrdenO") = ViewState("OUsuarioO")
CargaGridO(ViewState("OrdenO").ToString())
End Sub
Protected Sub GvDatosCl_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosCl.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(200)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(50)
e.Row.Cells(5).Width = Unit.Pixel(50)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub GvDatosOpciones_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosOpciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(100)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(200)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(50)
e.Row.Cells(7).Width = Unit.Pixel(50)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlCaracteristicaEdit").DataSource = GlobalDTProspectosCaracteristicas(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'Activo'")
e.Row.FCDropDownList("DdlCaracteristicaEdit").DataBind()
e.Row.FCDropDownList("DdlCaracteristicaEdit").SelectedValue = e.Row.DBCampo("CveCaracteristica")
End If
End If
End Sub
Protected Sub GvDatosCl_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosCl.RowDeleting
Dim ObjClasificaciones As New ClsProspectos
If ObjClasificaciones.RemoveClasificacionesCaracteristicas(GvDatosCl.DataKeys(e.RowIndex).Value.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
GvDatosCl.EditIndex = -1
ViewState("DTClasificacionesCaracteristicas") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCaracteristicasClasificaciones = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Alert("La Clasificacion de Tipo de Caracteristica se eliminó correctamente.", TipoMensaje.MsgInformacion)
CambioClasificacionesCaracteristicas()
End If
ObjClasificaciones.Dispose()
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjTiposCaracteristicas As New ClsProspectos
If ObjTiposCaracteristicas.RemoveTiposCaracteristicas(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
GvDatos.EditIndex = -1
ViewState("DTTiposCaracteristicas") = ObjTiposCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosTiposCaracteristicas = ObjTiposCaracteristicas.DtResultados.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa)
Alert("El Tipo de Característica se eliminó correctamente.", TipoMensaje.MsgInformacion)
CambioCaracteristicaTipo()
End If
ObjTiposCaracteristicas.Dispose()
End Sub
Protected Sub GvDatosCaracteristicas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosCaracteristicas.RowDeleting
Dim ObjCaracteristicas As New ClsProspectos
If ObjCaracteristicas.RemoveCaracteristica(GvDatosCaracteristicas.DataKeys(e.RowIndex).Value.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
GvDatosCaracteristicas.EditIndex = -1
ViewState("DTCaracteristicas") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCaracteristicas(UsuarioActual.CveEmpresa) = ObjCaracteristicas.DtResultados
Alert("La Caracteristica se eliminó correctamente.", TipoMensaje.MsgInformacion)
CambioCaracteristicas()
End If
ObjCaracteristicas.Dispose()
End Sub
Protected Sub GvDatosOpciones_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosOpciones.RowDeleting
Dim ObjCaracteristicasOpciones As New ClsProspectos
If ObjCaracteristicasOpciones.RemoveCaracteristicasOpciones(GvDatosOpciones.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatosOpciones.EditIndex = -1
ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados
GlobalDTProspectosCaracteristicasOpciones() = ObjCaracteristicasOpciones.DtResultados
Alert("La Opción para Característica se eliminó correctamente.", TipoMensaje.MsgInformacion)
CambioCaracteristicasOpciones()
End If
ObjCaracteristicasOpciones.Dispose()
End Sub
Protected Sub GvDatosCl_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosCl.RowCancelingEdit
GvDatosCl.EditIndex = -1
If ViewState("OrdenCl").ToString() <> String.Empty Then
CargaGridCl(ViewState("OrdenCl").ToString())
Else
CargaGridCl("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatosCaracteristicas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosCaracteristicas.RowCancelingEdit
GvDatosCaracteristicas.EditIndex = -1
If ViewState("OrdenC").ToString() <> String.Empty Then
CargaGridC(ViewState("OrdenC").ToString())
Else
CargaGridC("")
End If
End Sub
Protected Sub GvDatosOpciones_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosOpciones.RowCancelingEdit
GvDatosOpciones.EditIndex = -1
If ViewState("OrdenO").ToString() <> String.Empty Then
CargaGridO(ViewState("OrdenO").ToString())
Else
CargaGridO("")
End If
End Sub
Protected Sub GvDatosCl_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosCl.RowUpdating
Dim ObjClasificaciones As New ClsProspectos
Dim CaracteristicaClasificacion As String = DirectCast(GvDatosCl.Rows(e.RowIndex).FindControl("TxtCaracteristicaClasificacion"), TextBox).Text.Trim
Dim Orden As Integer = DirectCast(GvDatosCl.Rows(e.RowIndex).FindControl("TxtOrdenCl"), TextBox).Text.ToEntero
Dim Estatus As Boolean = GvDatosCl.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveCaracteristicaClasificacion As Integer = GvDatosCl.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjClasificaciones.UpdateClasificacionesCaracteristicas(CaracteristicaClasificacion, Orden, Estatus, UsuarioActual.CveEmpresa, CveCaracteristicaClasificacion) Then
GvDatosCl.EditIndex = -1
ViewState("DTClasificacionesCaracteristicas") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCaracteristicasClasificaciones = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
CambioClasificacionesCaracteristicas()
End If
ObjClasificaciones.Dispose()
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjTiposCaracteristicas As New ClsProspectos
Dim CaracteristicaTipo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtCaracteristicaTipo"), TextBox).Text.Trim
Dim Orden As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtOrden"), TextBox).Text.ToEntero
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveCaracteristicaTipo As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
Dim CveCaracteristicaClasificacion As Integer = GvDatos.Rows(e.RowIndex).FCDropDownList("DdlCaracteristicaClasificacionEdit").SelectedValue.ToEntero
If ObjTiposCaracteristicas.UpdateTiposCaracteristicas(CaracteristicaTipo, CveCaracteristicaClasificacion, Orden, Estatus, UsuarioActual.CveEmpresa, CveCaracteristicaTipo) Then
GvDatos.EditIndex = -1
ViewState("DTTiposCaracteristicas") = ObjTiposCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosTiposCaracteristicas = ObjTiposCaracteristicas.DtResultados.FiltraParametros("Estatus = 'Activo' AND CveEmpresa = " & UsuarioActual.CveEmpresa)
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
CambioCaracteristicaTipo()
End If
ObjTiposCaracteristicas.Dispose()
End Sub
Protected Sub GvDatosCaracteristicas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosCaracteristicas.RowUpdating
Dim ObjCaracteristicas As New ClsProspectos
Dim CveCaracteristicaTipo As Integer = DirectCast(GvDatosCaracteristicas.Rows(e.RowIndex).FindControl("DdlCaracteristicaTipoEdit"), DropDownList).SelectedValue.ToEntero
Dim CveCaracteristica As Integer = GvDatosCaracteristicas.DataKeys(e.RowIndex).Value.ToString.ToEntero
Dim Caracteristica As String = DirectCast(GvDatosCaracteristicas.Rows(e.RowIndex).FindControl("TxtCaracteristica"), TextBox).Text.Trim
Dim Orden As Integer = DirectCast(GvDatosCaracteristicas.Rows(e.RowIndex).FindControl("TxtOrdenC"), TextBox).Text.ToEntero
Dim EsOpcion As Integer = GvDatosCaracteristicas.Rows(e.RowIndex).FCDropDownList("DdlEsOpcionEdit").SelectedValue.ToEntero
Dim Estatus As Boolean = GvDatosCaracteristicas.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
If ObjCaracteristicas.UpdateCaracteristica(Caracteristica, CveCaracteristicaTipo, EsOpcion, Orden, Estatus, UsuarioActual.CveEmpresa, CveCaracteristica) Then
GvDatosCaracteristicas.EditIndex = -1
ViewState("DTCaracteristicas") = ObjCaracteristicas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCaracteristicas(UsuarioActual.CveEmpresa) = ObjCaracteristicas.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
CambioCaracteristicas()
End If
ObjCaracteristicas.Dispose()
End Sub
Protected Sub GvDatosOpciones_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosOpciones.RowUpdating
Dim ObjCaracteristicasOpciones As New ClsProspectos
Dim CveCaracteristica As Integer = DirectCast(GvDatosOpciones.Rows(e.RowIndex).FindControl("DdlCaracteristicaEdit"), DropDownList).SelectedValue.ToEntero
Dim CveCaracteristicaOpcion As Integer = GvDatosOpciones.DataKeys(e.RowIndex).Value.ToString.ToEntero
Dim CaracteristicaOpcion As String = DirectCast(GvDatosOpciones.Rows(e.RowIndex).FindControl("TxtOpcion"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatosOpciones.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
If ObjCaracteristicasOpciones.UpdateCaracteristicasOpciones(CaracteristicaOpcion, CveCaracteristica, Estatus, CveCaracteristicaOpcion) Then
GvDatosOpciones.EditIndex = -1
ViewState("DTCaracteristicasOpciones") = ObjCaracteristicasOpciones.DtResultados
GlobalDTProspectosCaracteristicasOpciones() = ObjCaracteristicasOpciones.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
CambioCaracteristicasOpciones()
End If
ObjCaracteristicasOpciones.Dispose()
End Sub
Protected Sub GvDatosCl_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosCl.RowEditing
GvDatosCl.EditIndex = e.NewEditIndex
If ViewState("OrdenCl").ToString() <> String.Empty Then
CargaGridCl(ViewState("OrdenCl").ToString())
Else
CargaGridCl("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatosCaracteristicas_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosCaracteristicas.RowEditing
GvDatosCaracteristicas.EditIndex = e.NewEditIndex
If ViewState("OrdenC").ToString() <> String.Empty Then
CargaGridC(ViewState("OrdenC").ToString())
Else
CargaGridC("")
End If
End Sub
Protected Sub GvDatosOpciones_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosOpciones.RowEditing
GvDatosOpciones.EditIndex = e.NewEditIndex
If ViewState("OrdenO").ToString() <> String.Empty Then
CargaGridO(ViewState("OrdenO").ToString())
Else
CargaGridO("")
End If
End Sub
Private Sub CargaGridCl(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTClasificacionesCaracteristicas"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatosCl.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatosCl.DataSource = CType(ViewState("DTClasificacionesCaracteristicas"), DataTable)
End If
GvDatosCl.DataBind()
UpDatosCl.Update()
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTTiposCaracteristicas"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTTiposCaracteristicas"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
Private Sub CargaGridC(Orden As String)
'Dim Filtro As String = If(DdlCaracteristicaTipo.SelectedValue > "0", "CveCaracteristicaTipo = 1", "")
Dim Filtro As String = If(DdlCaracteristicaTipo.SelectedValue > "0", "CveCaracteristicaTipo = " + DdlCaracteristicaTipo.SelectedItem.Value.ToString, "")
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTCaracteristicas"), DataTable), Filtro, Orden, DataViewRowState.CurrentRows)
GvDatosCaracteristicas.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatosCaracteristicas.DataSource = New DataView(CType(ViewState("DTCaracteristicas"), DataTable), Filtro, "", DataViewRowState.CurrentRows)
End If
GvDatosCaracteristicas.DataBind()
UpDatosC.Update()
End Sub
Private Sub CargaGridO(Orden As String)
Dim Filtro As String = ""
If Not DdlCaracteristica.SelectedItem Is Nothing Then
Filtro = "CveCaracteristica = " + DdlCaracteristica.SelectedItem.Value.ToString
Else
Filtro = "1 = 2"
End If
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTCaracteristicasOpciones"), DataTable), Filtro, Orden, DataViewRowState.CurrentRows)
GvDatosOpciones.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatosOpciones.DataSource = New DataView(CType(ViewState("DTCaracteristicasOpciones"), DataTable), Filtro, "", DataViewRowState.CurrentRows)
End If
GvDatosOpciones.DataBind()
UpDatosO.Update()
End Sub
Private Sub CargaCaracteristicas()
DdlCaracteristica.Items.Clear()
DdlCaracteristica.DataSource = GlobalDTProspectosCaracteristicas(UsuarioActual.CveEmpresa).FiltraParametros("EsOpcion in (1, 2) AND Estatus = 'Activo' " + If(DdlCaracteristicaTipoO.SelectedValue > "0", "AND CveCaracteristicaTipo = " + DdlCaracteristicaTipoO.SelectedItem.Value.ToString, ""))
DdlCaracteristica.DataBind()
End Sub
Protected Sub DdlCaracteristicaTipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCaracteristicaTipo.SelectedIndexChanged
If ViewState("OrdenC").ToString() <> String.Empty Then
CargaGridC(ViewState("OrdenC").ToString())
Else
CargaGridC("")
End If
End Sub
Protected Sub DdlCaracteristica_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCaracteristica.SelectedIndexChanged
If ViewState("OrdenO").ToString() <> String.Empty Then
CargaGridO(ViewState("OrdenO").ToString())
Else
CargaGridO("")
End If
End Sub
Protected Sub DdlCaracteristicaTipoO_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCaracteristicaTipoO.SelectedIndexChanged
CargaCaracteristicas()
If ViewState("OrdenO").ToString() <> String.Empty Then
CargaGridO(ViewState("OrdenO").ToString())
Else
CargaGridO("")
End If
End Sub
Protected Sub CambioClasificacionesCaracteristicas()
CargaClasificaciones()
UpTitulosCl.Update()
CargaDatosCl()
CambioCaracteristicaTipo()
End Sub
Protected Sub CambioCaracteristicaTipo()
CargaTiposCaracteristicas()
UpTitulos.Update()
'UpTitulosC.Update()
'UpTitulosO.Update()
CargaDatos()
CambioCaracteristicas()
End Sub
Protected Sub CambioCaracteristicas()
CargaCaracteristicas()
UpTitulosC.Update()
'UpTitulosO.Update()
CargaDatosC()
CambioCaracteristicasOpciones()
End Sub
Protected Sub CambioCaracteristicasOpciones()
UpTitulosO.Update()
CargaDatosO()
End Sub
End Class

View File

@@ -0,0 +1,182 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatCoordinadores.aspx.vb" Inherits="Prospectos_CatCoordinadores" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content4" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="E" runat="Server">
Catálogo de Coordinadores
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content9" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="160px">
<asp:LinkButton ID="LbCoordinador" runat="server" CausesValidation="false" Text="" CommandArgument="Coordinador" OnClick="LbOrden_Click">
Coordinador
<asp:Literal ID="ImgCoordinador" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="160px">
<asp:LinkButton ID="LbRepresentante" runat="server" CausesValidation="false" Text="" CommandArgument="Representante" OnClick="LbOrden_Click">
Representante
<asp:Literal ID="ImgRepresentante" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="170px">
<asp:LinkButton ID="LbSupervisor" runat="server" CausesValidation="false" Text="" CommandArgument="Supervisor" OnClick="LbOrden_Click">
Supervisor
<asp:Literal ID="ImgSupervisor" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbMeta" runat="server" CausesValidation="false" Text="" CommandArgument="Meta" OnClick="LbOrden_Click">
Meta
<asp:Literal ID="ImgMeta" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="161px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtCoordinador" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="144px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCoordinador" runat="server" ControlToValidate="TxtCoordinador" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Coordinador''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCCoordinador" runat="server" HighlightCssClass="vco" TargetControlID="RFVCoordinador" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtRepresentante" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="144px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRepresentante" runat="server" ControlToValidate="TxtRepresentante" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Representante''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRepresentante" runat="server" HighlightCssClass="vco" TargetControlID="RFVRepresentante" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlSupervisor" runat="server" AppendDataBoundItems="true" DataValueField="CveSupervisor" DataTextField="Supervisor" ValidationGroup="GrpGuardar" style="width:154px !important;" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVSupervisor" runat="server" ControlToValidate="DdlSupervisor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Supervisor''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOSupervisor" runat="server" HighlightCssClass="vco" TargetControlID="RFVSupervisor" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtMeta" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="64px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVMeta" runat="server" ControlToValidate="TxtMeta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Meta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVMeta" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCoordinador" EmptyDataText="No se encontraron Coordinadores Registrados" ToolTip="Listado de Coordinadores" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCoordinador" runat="server" Text='<%# Eval("Coordinador", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtCoordinador" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Coordinador") %>' ValidationGroup="GrpGV" Width="144px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCoordinador" runat="server" ControlToValidate="TxtCoordinador" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Coordinador''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCCoordinador" runat="server" HighlightCssClass="vco" TargetControlID="RFVCoordinador" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlRepresentante" runat="server" Text='<%# Eval("Representante", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtRepresentante" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Representante") %>' ValidationGroup="GrpGV" Width="144px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRepresentante" runat="server" ControlToValidate="TxtRepresentante" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Representante''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRepresentante" runat="server" HighlightCssClass="vco" TargetControlID="RFVRepresentante" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSupervisor" runat="server" Text='<%# Eval("Supervisor", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlSupervisor" runat="server" DataValueField="CveSupervisor" DataTextField="Supervisor" Class="table-group-action-input form-control input-inline input-small input-sm" style="width:154px !important;"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMeta" runat="server" Text='<%# Eval("Meta", "{0}")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtMeta" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Meta") %>' ValidationGroup="GrpGV" Width="64px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVMeta" runat="server" ControlToValidate="TxtMeta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Meta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCMeta" runat="server" HighlightCssClass="vco" TargetControlID="RFVMeta" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If(Eval("Estatus").ToString = "Activo", True, False)%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content10" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,191 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatCoordinadores
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaSupervisor()
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjCoordinador As New ClsProspectos
If ObjCoordinador.GetCoordinadores(-1) Then
ViewState("DTCoordinador") = ObjCoordinador.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCoordinadores(-1, UsuarioActual.CveEmpresa) = ObjCoordinador.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjCoordinador.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjCoordinador As New ClsProspectos
If ObjCoordinador.AddCoordinadores(TxtCoordinador.Text.Trim, TxtRepresentante.Text.Trim, DdlSupervisor.SelectedValue.ToEntero, TxtMeta.Text.Trim.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtCoordinador.Text = ""
TxtRepresentante.Text = ""
TxtMeta.Text = ""
Alert("El nuevo Coordinador se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTCoordinador") = ObjCoordinador.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCoordinadores(-1, UsuarioActual.CveEmpresa) = ObjCoordinador.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjCoordinador.Dispose()
End Sub
Private Sub CargaSupervisor()
DdlSupervisor.DataSource = GlobalDTProspectosSupervisores(UsuarioActual.CveEmpresa)
DdlSupervisor.DataBind()
End Sub
#Region "G V D A T O S"
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(160)
e.Row.Cells(1).Width = Unit.Pixel(160)
e.Row.Cells(2).Width = Unit.Pixel(170)
e.Row.Cells(3).Width = Unit.Pixel(80)
e.Row.Cells(4).Width = Unit.Pixel(80)
e.Row.Cells(5).Width = Unit.Pixel(80)
e.Row.Cells(6).Width = Unit.Pixel(80)
e.Row.Cells(7).Width = Unit.Pixel(100)
e.Row.Cells(8).Width = Unit.Pixel(61)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Center
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlSupervisor").DataSource = GlobalDTProspectosSupervisores(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlSupervisor").DataBind()
e.Row.FCDropDownList("DdlSupervisor").SelectedValue = e.Row.DBCampo("CveSupervisor")
End If
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjCoordinador As New ClsProspectos
If ObjCoordinador.RemoveCoordinador(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTCoordinador") = ObjCoordinador.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCoordinadores(-1, -1) = ObjCoordinador.DtResultados
Alert("El Coordinador se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjCoordinador.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjCoordinador As New ClsProspectos
Dim Coordinador As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtCoordinador"), TextBox).Text.Trim
Dim Representante As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtRepresentante"), TextBox).Text.Trim
Dim CveSupervisor As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlSupervisor"), DropDownList).SelectedValue.ToEntero
Dim Meta As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtMeta"), TextBox).Text.Trim.ToEntero
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveCoordinador As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjCoordinador.UpdateCoordinadores(Coordinador, Representante, CveSupervisor, Meta, Estatus, CveCoordinador) Then
GvDatos.EditIndex = -1
ViewState("DTCoordinador") = ObjCoordinador.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCoordinadores(-1, -1) = ObjCoordinador.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjCoordinador.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTCoordinador"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTCoordinador"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,528 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatEncuestas.aspx.vb" Inherits="Prospectos_Encuestas_CatEncuestas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Encuestas
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" Width="100%" CssClass="tabBodyOverride">
<ajax:TabPanel ID="TabEncunestas" runat="server" HeaderText="Encuestas">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<div>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="250px">
<asp:LinkButton ID="LbEncuesta0" runat="server" CausesValidation="false" Text="" CommandArgument="Encuesta0;0" OnClick="LbOrden_Click">
Encuesta
<asp:Literal ID="ImgEncuesta0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="250px">
<asp:LinkButton ID="LbEncuestaTipo0" runat="server" CausesValidation="false" Text="" CommandArgument="EncuestaTipo0;0" OnClick="LbOrden_Click">
Tipo Encuesta
<asp:Literal ID="ImgEncuestaTipo0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus0" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus0;0" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng0" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng0;0" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario0" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario0;0" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario0" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="165px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtEncuesta" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="240px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEncuesta" runat="server" ControlToValidate="TxtEncuesta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Encuesta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEncuesta" runat="server" HighlightCssClass="vco" TargetControlID="RFVEncuesta" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlEncuestaTipo" runat="server" AppendDataBoundItems="true" DataValueField="CveEncuestaTipo" DataTextField="EncuestaTipo" ValidationGroup="GrpGuardar" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 240px !important;">
<%--<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>--%>
<asp:ListItem Text="Manual(Papel)" Value="0"></asp:ListItem>
<asp:ListItem Text="CallCenter" Value="1"></asp:ListItem>
<asp:ListItem Text="Web" Value="2"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVEncuestaTipo" runat="server" ControlToValidate="DdlEncuestaTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Encuesta Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOEEncuestaTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVEncuestaTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton>
</td>
</tr>
</table>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosEncuesta" runat="server" AutoGenerateColumns="False" DataKeyNames="CveEncuesta" EmptyDataText="No se encontraron Encuestas Registradas" ToolTip="Listado de Encuestas" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEncuesta" runat="server" Text='<%# Eval("Encuesta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtEncuesta" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Encuesta") %>' ValidationGroup="GrpGuardar" Width="240px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtEncuesta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Encuesta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEncuestaTipo" runat="server" Text='<%# Eval("EncuestaTipo", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlEncuestaTipo" runat="server" DataValueField="CveEncuestaTipo" DataTextField="EncuestaTipo" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 230px !important;">
<asp:ListItem Text="Manual(Papel)" Value="0"></asp:ListItem>
<asp:ListItem Text="CallCenter" Value="1"></asp:ListItem>
<asp:ListItem Text="Web" Value="2"></asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabEncuestasPreguntas" runat="server" HeaderText="Encuestas Preguntas">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<div>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th style="width: 190px !important;">
<asp:LinkButton ID="LbPregunta1" runat="server" CausesValidation="false" Text="" CommandArgument="Pregunta1;1" OnClick="LbOrden_Click">
Pregunta
<asp:Literal ID="ImgPregunta1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbOrden1" runat="server" CausesValidation="false" Text="" CommandArgument="Orden1;1" OnClick="LbOrden_Click">
Orden
<asp:Literal ID="ImgOrden1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEncuesta1" runat="server" CausesValidation="false" Text="" CommandArgument="Encuesta1;1" OnClick="LbOrden_Click">
Encuesta
<asp:Literal ID="ImgEncuesta1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbPreguntaTipoTexto1" runat="server" CausesValidation="false" Text="" CommandArgument="PreguntaTipoTexto1;1" OnClick="LbOrden_Click">
Tipo Pregunta
<asp:Literal ID="ImgPreguntaTipoTexto1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="120px">
<asp:LinkButton ID="LbPiedePregunta1" runat="server" CausesValidation="false" Text="" CommandArgument="PiedePregunta1;1" OnClick="LbOrden_Click">
Pie Pregunta
<asp:Literal ID="ImgPiedePregunta1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="89px">
<asp:LinkButton ID="LbEstatus1" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus1;1" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="95px">
<asp:LinkButton ID="LbFechaIng1" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng1;1" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="91px">
<asp:LinkButton ID="LbUsuario1" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario1;1" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario1" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="159px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtPreguntaA" runat="server" CausesValidation="true" MaxLength="250" ValidationGroup="GrpGuardara" Width="180px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPreguntaA" runat="server" ControlToValidate="TxtPreguntaA" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardara"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCPreguntaA" runat="server" HighlightCssClass="vco" TargetControlID="RFVPreguntaA" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtOrdenA" runat="server" CausesValidation="true" MaxLength="2" ValidationGroup="GrpGuardara" Width="90px"></asp:TextBox>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlEncuesta" runat="server" AppendDataBoundItems="true" AutoPostBack="True" DataValueField="CveEncuesta" DataTextField="Encuesta" ValidationGroup="GrpGuardara" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVEncuestaA" runat="server" ControlToValidate="DdlEncuesta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Encuesta''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardara"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOEncuestaA" runat="server" HighlightCssClass="vco" TargetControlID="RFVEncuestaA" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DDlPreguntaTipoA" runat="server" AppendDataBoundItems="true" DataValueField="PreguntaTipo" ValidationGroup="GrpGuardara" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 90px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Texto" Value="0"></asp:ListItem>
<asp:ListItem Text="Listado" Value="1"></asp:ListItem>
<asp:ListItem Text="Opciones" Value="2"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtPiedePreguntaA" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardara" Width="110px"></asp:TextBox>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregarEncuestaPegunta" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardara"></asp:LinkButton>
</td>
</tr>
</table>
<asp:UpdatePanel ID="UpDatosEncuestasPreguntas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosPregunta" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePregunta" EmptyDataText="No se encontraron Preguntas Registradas" ToolTip="Listado de Preguntas" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPregunta" runat="server" Text='<%# Eval("Pregunta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtPreguntaA" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Pregunta") %>' ValidationGroup="GrpGuardara" Width="180px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPreguntaA" runat="server" ControlToValidate="TxtPreguntaA" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardara"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOEPreguntaA" runat="server" HighlightCssClass="vco" TargetControlID="RFVPreguntaA" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlOrdenA" runat="server" Text='<%# Eval("Orden", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtOrdenA" runat="server" CausesValidation="true" MaxLength="2" Text='<%# Eval("Orden") %>' ValidationGroup="GrpGuardara" Width="90px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEncuesta" runat="server" Text='<%# Eval("Encuesta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlEncuesta" runat="server" DataValueField="CveEncuesta" DataTextField="Encuesta" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 85px !important;"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPreguntaTipoA" runat="server" Text='<%# Eval("PreguntaTipoTexto", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DDlPreguntaTipoA" runat="server" AppendDataBoundItems="true" DataValueField="PreguntaTipo" ValidationGroup="GrpGuardara" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 85px !important;">
<asp:ListItem Text="Texto" Value="0"></asp:ListItem>
<asp:ListItem Text="Listado" Value="1"></asp:ListItem>
<asp:ListItem Text="Opciones" Value="2"></asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPiedePreguntaA" runat="server" Text='<%# Eval("PiedePregunta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtPiedePreguntaA" runat="server" CausesValidation="true" MaxLength="2" Text='<%# Eval("PiedePregunta") %>' ValidationGroup="GrpGuardara" Width="110px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabEncuestasPreguntasRespuestas" runat="server" HeaderText="Encuestas Preguntas - Respuestas">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<div>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="150px">
<asp:LinkButton ID="LbRespuesta2" runat="server" CausesValidation="false" Text="" CommandArgument="Respuesta2;2" OnClick="LbOrden_Click">
Respuesta
<asp:Literal ID="ImgRespuesta2" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="150px">
<asp:LinkButton ID="LbOrden2" runat="server" CausesValidation="false" Text="" CommandArgument="Orden2;2" OnClick="LbOrden_Click">
Orden
<asp:Literal ID="ImgOrden2" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="170px">
<asp:LinkButton ID="LbPregunta2" runat="server" CausesValidation="false" Text="" CommandArgument="Pregunta2;2" OnClick="LbOrden_Click">
Pregunta
<asp:Literal ID="ImgPregunta2" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="170px">
<asp:LinkButton ID="LbPreguntaSiguiente2" runat="server" CausesValidation="false" Text="" CommandArgument="PreguntaSiguiente2;2" OnClick="LbOrden_Click">
Pregunta Sig.
<asp:Literal ID="ImgPreguntaSiguiente2" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="84px">
<asp:LinkButton ID="LbEstatus2" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus2;2" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus2" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="95px">
<asp:LinkButton ID="LbFechaIng2" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng2;2" OnClick="LbOrden_Click">
Fecha Ing
<asp:Literal ID="ImgFechaIng2" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="86px">
<asp:LinkButton ID="LbUsuario2" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario2;2" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario2" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="135px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtRespuestaB" runat="server" CausesValidation="true" MaxLength="250" ValidationGroup="GrpGuardarB" Width="140px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRespuestaB" runat="server" ControlToValidate="TxtRespuestaB" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarB"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRespuestaB" runat="server" HighlightCssClass="vco" TargetControlID="RFVRespuestaB" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtOrdenB" runat="server" CausesValidation="true" MaxLength="2" ValidationGroup="GrpGuardarB" Width="140px"></asp:TextBox>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlPreguntaB" runat="server" AppendDataBoundItems="true" DataValueField="CvePregunta" DataTextField="Pregunta" ValidationGroup="GrpGuardarB" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 160px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVPreguntaB" runat="server" ControlToValidate="DdlPreguntaB" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardarB"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOPreguntaB" runat="server" HighlightCssClass="vco" TargetControlID="RFVPreguntaB" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DDlPreguntaSiguienteB" runat="server" AppendDataBoundItems="true" DataValueField="CvePregunta" DataTextField="Pregunta" ValidationGroup="GrpGuardarB" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 160px !important;">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregarEncuestaPeguntasRespuestas" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarB"></asp:LinkButton>
</td>
</tr>
</table>
<asp:UpdatePanel ID="UpDatosPreguntasRespuestas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosPreguntasRespuestas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveRespuesta" EmptyDataText="No se encontraron Preguntas Registradas" ToolTip="Listado de Preguntas" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlRespuestaB" runat="server" Text='<%# Eval("Respuesta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtRespuestaB" runat="server" CausesValidation="true" MaxLength="250" Text='<%# Eval("Respuesta") %>' ValidationGroup="GrpGuardarB" Width="140px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRespuestaB" runat="server" ControlToValidate="TxtRespuestaB" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarB"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOERespuestaB" runat="server" HighlightCssClass="vco" TargetControlID="RFVRespuestaB" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlOrdenB" runat="server" Text='<%# Eval("Orden", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtOrdenB" runat="server" CausesValidation="true" MaxLength="2" Text='<%# Eval("Orden") %>' ValidationGroup="GrpGuardarB" Width="140px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPreguntaB" runat="server" Text='<%# Eval("Pregunta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlPreguntaB" runat="server" DataValueField="CvePregunta" DataTextField="Pregunta" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPreguntaSiguienteB" runat="server" Text='<%# Eval("PreguntaSiguiente", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlPreguntaSiguienteB" runat="server" DataValueField="CvePregunta" DataTextField="Pregunta" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatusB" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatusB" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIngB" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuarioB" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="confirmar" data-btn-ok-label="si" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script language="javascript" type="text/javascript">
function C() {
return confirm('¿Está seguro que lo Desea Eliminar?');
}
</script>
</asp:Content>

View File

@@ -0,0 +1,487 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_Encuestas_CatEncuestas
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("OrdenE") = ""
ViewState("OrdenP") = ""
ViewState("OrdenPR") = ""
CargaDatosEncuestas()
CargaEncuesta()
CargaDatosPreguntas()
CargaDatosPreguntasRespuestas()
CargaPreguntas()
End If
End Sub
#Region "C A R G A S"
Private Sub CargaEncuesta()
DdlEncuesta.DataSource = GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa) '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlEncuesta.DataBind()
End Sub
Private Sub CargaPreguntas()
DdlPreguntaB.DataSource = GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa)
DdlPreguntaB.DataBind()
DDlPreguntaSiguienteB.DataSource = GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa)
DDlPreguntaSiguienteB.DataBind()
End Sub
Protected Sub DdlEncuesta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEncuesta.SelectedIndexChanged
CargaDatosPreguntas()
UpDatosEncuestasPreguntas.Update()
End Sub
#End Region
#Region "C A R G A D A T O S"
Public Sub CargaDatosEncuestas()
Dim ObjProsEncuestas As New ClsProspectos
If ObjProsEncuestas.GetEncuestas(-1, UsuarioActual.CveEmpresa) Then
ViewState("DTEncuestas") = ObjProsEncuestas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa) = ObjProsEncuestas.DtResultados
Else
Me.GvDatosEncuesta.DataSource = Nothing
End If
ObjProsEncuestas.Dispose()
If ViewState("OrdenE").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenE").ToString(), 0)
Else
CargaGrid("", 0)
End If
End Sub
Public Sub CargaDatosPreguntas()
Dim ObjProsPreguntas As New ClsProspectos
If ObjProsPreguntas.GetPreguntas(DdlEncuesta.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ViewState("DTPreguntas") = ObjProsPreguntas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntas.DtResultados
Else
Me.GvDatosPregunta.DataSource = Nothing
End If
ObjProsPreguntas.Dispose()
If ViewState("OrdenP").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenP").ToString(), 1)
Else
CargaGrid("", 1)
End If
End Sub
Public Sub CargaDatosPreguntasRespuestas()
Dim ObjProsPreguntasRespuestas As New ClsProspectos
If ObjProsPreguntasRespuestas.GetRespuestas() Then
ViewState("DTPreguntasRespuestas") = ObjProsPreguntasRespuestas.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
'comente este renglon RMF, marca error
' GlobalDTProspectosEncuestasRespuestas(-1, -1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
'GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
Else
Me.GvDatosPreguntasRespuestas.DataSource = Nothing
End If
ObjProsPreguntasRespuestas.Dispose()
If ViewState("OrdenPR").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenPR").ToString(), 2)
Else
CargaGrid("", 2)
End If
End Sub
#End Region
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjProsEncuestas As New ClsProspectos
If ObjProsEncuestas.AddEncuestas(TxtEncuesta.Text.Trim, DdlEncuestaTipo.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtEncuesta.Text = ""
Alert("La nueva Encuesta se guardó correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTEncuestas") = ObjProsEncuestas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa) = ObjProsEncuestas.DtResultados
If ViewState("OrdenE").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenE").ToString(), 0)
Else
CargaGrid("", 0)
End If
End If
ObjProsEncuestas.Dispose()
End Sub
Protected Sub LbAgregarEncuestaPegunta_Click(sender As Object, e As System.EventArgs) Handles LbAgregarEncuestaPegunta.Click
Dim ObjProsPreguntas As New ClsProspectos
If ObjProsPreguntas.AddPreguntas(TxtPreguntaA.Text.Trim, DdlEncuesta.SelectedValue.ToEntero, DDlPreguntaTipoA.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
TxtPreguntaA.Text = ""
Alert("El nuevo Pregunta se guardó correctamente.", TipoMensaje.MsgInformacion)
UpDatosEncuestasPreguntas.Update()
ViewState("DTPreguntas") = ObjProsPreguntas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntas.DtResultados
If ViewState("OrdenP").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenP").ToString(), 1)
Else
CargaGrid("", 1)
End If
End If
ObjProsPreguntas.Dispose()
End Sub
Protected Sub LbAgregarEncuestaPeguntasRespuestas_Click(sender As Object, e As System.EventArgs) Handles LbAgregarEncuestaPeguntasRespuestas.Click
Dim ObjProsPreguntasRespuestas As New ClsProspectos
If ObjProsPreguntasRespuestas.AddRespuesta(TxtRespuestaB.Text.Trim, DdlPreguntaB.SelectedValue.ToEntero, TxtOrdenB.Text.Trim.ToEntero, DDlPreguntaSiguienteB.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
TxtRespuestaB.Text = ""
TxtOrdenB.Text = ""
DdlPreguntaB.SelectedValue = "-1"
DDlPreguntaSiguienteB.SelectedValue = "-1"
Alert("La Nueva Respuesta se guardó correctamente.", TipoMensaje.MsgInformacion)
UpDatosPreguntasRespuestas.Update()
ViewState("DTPreguntasRespuestas") = ObjProsPreguntasRespuestas.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
If ViewState("OrdenPR").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenPR").ToString(), 2)
Else
CargaGrid("", 2)
End If
End If
ObjProsPreguntasRespuestas.Dispose()
End Sub
#Region "G V E N C U E S T A S"
Protected Sub GvDatosEncuesta_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosEncuesta.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(256)
e.Row.Cells(1).Width = Unit.Pixel(256)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(65)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub GvDatosEncuesta_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosEncuesta.RowDeleting
Dim ObjProsEncuestas As New ClsProspectos
If ObjProsEncuestas.RemoveEncuestas(GvDatosEncuesta.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatosEncuesta.EditIndex = -1
ViewState("DTEncuestas") = ObjProsEncuestas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa) = ObjProsEncuestas.DtResultados
Alert("La Encuesta se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsEncuestas.Dispose()
If ViewState("OrdenE").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenE").ToString(), 0)
Else
CargaGrid("", 0)
End If
End Sub
Protected Sub GvDatosEncuesta_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosEncuesta.RowCancelingEdit
GvDatosEncuesta.EditIndex = -1
If ViewState("OrdenE").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenE").ToString(), 0)
Else
CargaGrid("", 0)
End If
End Sub
Protected Sub GvDatosEncuesta_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosEncuesta.RowUpdating
Dim ObjProsEncuestas As New ClsProspectos
Dim Encuesta As String = DirectCast(GvDatosEncuesta.Rows(e.RowIndex).FindControl("TxtEncuesta"), TextBox).Text.Trim
Dim EncuestaTipo As Integer = DirectCast(GvDatosEncuesta.Rows(e.RowIndex).FindControl("DdlEncuestaTipo"), DropDownList).SelectedValue.ToEntero
Dim Estatus As Boolean = GvDatosEncuesta.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveEncuesta As Integer = GvDatosEncuesta.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjProsEncuestas.UpdateEncuestas(Encuesta, EncuestaTipo, Estatus, CveEncuesta) Then
GvDatosEncuesta.EditIndex = -1
ViewState("DTEncuestas") = ObjProsEncuestas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa) = ObjProsEncuestas.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsEncuestas.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString(), 0)
Else
CargaGrid("", 0)
End If
End Sub
Protected Sub GvDatosEncuesta_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosEncuesta.RowEditing
GvDatosEncuesta.EditIndex = e.NewEditIndex
If ViewState("OrdenE").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenE").ToString(), 0)
Else
CargaGrid("", 0)
End If
End Sub
#End Region
#Region "G V P R E G U N T A S"
Protected Sub GvDatosPregunta_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosPregunta.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(196)
e.Row.Cells(1).Width = Unit.Pixel(106)
e.Row.Cells(2).Width = Unit.Pixel(106)
e.Row.Cells(3).Width = Unit.Pixel(106)
e.Row.Cells(4).Width = Unit.Pixel(126)
e.Row.Cells(5).Width = Unit.Pixel(89)
e.Row.Cells(6).Width = Unit.Pixel(95)
e.Row.Cells(7).Width = Unit.Pixel(91)
e.Row.Cells(8).Width = Unit.Pixel(94)
e.Row.Cells(9).Width = Unit.Pixel(65)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlEncuesta").DataSource = GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa) '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlEncuesta").DataBind()
e.Row.FCDropDownList("DdlEncuesta").SelectedValue = e.Row.DBCampo("CveEncuesta")
e.Row.FCDropDownList("DDlPreguntaTipoA").SelectedValue = e.Row.DBCampo("PreguntaTipo")
End If
End If
End Sub
Protected Sub GvDatosPregunta_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosPregunta.RowDeleting
Dim ObjProsPreguntas As New ClsProspectos
If ObjProsPreguntas.RemovePreguntas(GvDatosPregunta.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatosPregunta.EditIndex = -1
ViewState("DTPreguntas") = ObjProsPreguntas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntas.DtResultados
Alert("El Pregunta se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsPreguntas.Dispose()
If ViewState("OrdenP").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenP").ToString(), 1)
Else
CargaGrid("", 1)
End If
End Sub
Protected Sub GvDatosPregunta_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosPregunta.RowCancelingEdit
GvDatosPregunta.EditIndex = -1
If ViewState("OrdenP").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenP").ToString(), 1)
Else
CargaGrid("", 1)
End If
End Sub
Protected Sub GvDatosPregunta_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosPregunta.RowUpdating
Dim ObjProsPreguntas As New ClsProspectos
Dim Pregunta As String = DirectCast(GvDatosPregunta.Rows(e.RowIndex).FindControl("TxtPreguntaA"), TextBox).Text.Trim
Dim Encuesta As Integer = DirectCast(GvDatosPregunta.Rows(e.RowIndex).FindControl("DdlEncuesta"), DropDownList).SelectedValue.ToEntero
Dim PreguntaTipo As Integer = DirectCast(GvDatosPregunta.Rows(e.RowIndex).FindControl("DdlEncuesta"), DropDownList).SelectedValue.ToEntero
Dim PiePregunta As String = DirectCast(GvDatosPregunta.Rows(e.RowIndex).FindControl("TxtPiePregunta"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatosPregunta.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim Orden As Integer = 1
Dim CvePregunta As Integer = GvDatosPregunta.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjProsPreguntas.UpdatePreguntas(Pregunta, Encuesta, PreguntaTipo, PiePregunta, Estatus, Orden, CvePregunta) Then
GvDatosPregunta.EditIndex = -1
ViewState("DTPreguntas") = ObjProsPreguntas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntas.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsPreguntas.Dispose()
If ViewState("OrdenP").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenP").ToString(), 1)
Else
CargaGrid("", 1)
End If
End Sub
Protected Sub GvDatosPregunta_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosPregunta.RowEditing
GvDatosPregunta.EditIndex = e.NewEditIndex
If ViewState("OrdenP").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenP").ToString(), 1)
Else
CargaGrid("", 1)
End If
End Sub
#End Region
#Region "G V P R E G U N T A S - R E S P U E S T A S"
Protected Sub GvDatosPreguntasRespuestas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosPreguntasRespuestas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
End If
e.Row.Cells(0).Width = Unit.Pixel(156) 'respuesta
e.Row.Cells(1).Width = Unit.Pixel(156) 'orden
e.Row.Cells(2).Width = Unit.Pixel(176) 'pregunta
e.Row.Cells(3).Width = Unit.Pixel(176) 'pregunta siguiente
e.Row.Cells(4).Width = Unit.Pixel(84) 'estatus
e.Row.Cells(5).Width = Unit.Pixel(95) 'fecha ing
e.Row.Cells(6).Width = Unit.Pixel(86) 'usuario
e.Row.Cells(7).Width = Unit.Pixel(74)
e.Row.Cells(8).Width = Unit.Pixel(61)
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlPreguntaB").DataSource = GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlPreguntaB").DataBind()
e.Row.FCDropDownList("DdlPreguntaB").SelectedValue = e.Row.DBCampo("CvePregunta")
e.Row.FCDropDownList("DdlPreguntaSiguienteB").DataSource = GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlPreguntaSiguienteB").DataBind()
e.Row.FCDropDownList("DDlPreguntaSiguienteB").SelectedValue = e.Row.DBCampo("CvePreguntaSiguiente")
End If
End If
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosPreguntasRespuestas.RowDeleting
Dim ObjProsPreguntasRespuestas As New ClsProspectos
If ObjProsPreguntasRespuestas.RemoveRespuesta(GvDatosPreguntasRespuestas.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatosPreguntasRespuestas.EditIndex = -1
ViewState("DTPreguntasRespuestas") = ObjProsPreguntasRespuestas.DtResultados ' .FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
Alert("La Respuesta se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsPreguntasRespuestas.Dispose()
If ViewState("OrdenPR").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenPR").ToString(), 2)
Else
CargaGrid("", 2)
End If
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosPreguntasRespuestas.RowCancelingEdit
GvDatosPreguntasRespuestas.EditIndex = -1
If ViewState("OrdenPR").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenPR").ToString(), 2)
Else
CargaGrid("", 2)
End If
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosPreguntasRespuestas.RowUpdating
Dim ObjProsPreguntasRespuestas As New ClsProspectos
Dim Respuesta As String = DirectCast(GvDatosPreguntasRespuestas.Rows(e.RowIndex).FindControl("TxtRespuestaB"), TextBox).Text.Trim
Dim CvePregunta As Integer = DirectCast(GvDatosPreguntasRespuestas.Rows(e.RowIndex).FindControl("DdlPreguntaB"), DropDownList).SelectedValue.ToEntero
Dim CvePreguntaSiguiente As Integer = DirectCast(GvDatosPreguntasRespuestas.Rows(e.RowIndex).FindControl("DDlPreguntaSiguienteB"), DropDownList).SelectedValue.ToEntero
Dim Estatus As Boolean = GvDatosPreguntasRespuestas.Rows(e.RowIndex).FCCheckBox("ChkEstatusB").Checked
Dim Orden As Integer = DirectCast(GvDatosPreguntasRespuestas.Rows(e.RowIndex).FindControl("TxtOrdenB"), TextBox).Text.Trim.ToEntero
Dim CveRespuesta As Integer = GvDatosPreguntasRespuestas.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjProsPreguntasRespuestas.UpdateRespuesta(Respuesta, CvePregunta, Estatus, Orden, CvePreguntaSiguiente, CveRespuesta) Then
GvDatosPreguntasRespuestas.EditIndex = -1
ViewState("DTPreguntasRespuestas") = ObjProsPreguntasRespuestas.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
' GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
GlobalDTProspectosEncuestasRespuestas(CvePregunta, CveRespuesta, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsPreguntasRespuestas.Dispose()
If ViewState("OrdenPR").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenPR").ToString(), 2)
Else
CargaGrid("", 2)
End If
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosPreguntasRespuestas.RowEditing
GvDatosPreguntasRespuestas.EditIndex = e.NewEditIndex
If ViewState("OrdenPR").ToString() <> String.Empty Then
CargaGrid(ViewState("OrdenPR").ToString(), 2)
Else
CargaGrid("", 2)
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim gvi As Integer = 0
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
gvi = Arg(1).ToEntero
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
Campo = Campo.Substring(0, Campo.Length - 1)
If ViewState(String.Format("O{0}", Campo, gvi)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo, gvi)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo, gvi)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo, gvi)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden, gvi)
End Sub
Private Sub CargaGrid(Orden As String, gvi As Integer)
If gvi = 0 Then
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTEncuestas"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatosEncuesta.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatosEncuesta.DataSource = CType(ViewState("DTEncuestas"), DataTable)
End If
ViewState("OrdenE") = Orden
GvDatosEncuesta.DataBind()
UpDatos.Update()
ElseIf gvi = 1 Then
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTPreguntas"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatosPregunta.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatosPregunta.DataSource = CType(ViewState("DTPreguntas"), DataTable)
End If
ViewState("OrdenP") = Orden
GvDatosPregunta.DataBind()
UpDatosEncuestasPreguntas.Update()
ElseIf gvi = 2 Then
If Orden <> String.Empty Then
Dim DVRespuestas As New DataView(CType(ViewState("DTPreguntasRespuestas"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatosPreguntasRespuestas.DataSource = DVRespuestas.ToTable()
DVRespuestas.Dispose()
Else
GvDatosPreguntasRespuestas.DataSource = CType(ViewState("DTPreguntasRespuestas"), DataTable)
End If
ViewState("OrdenPR") = Orden
GvDatosPreguntasRespuestas.DataBind()
UpDatosEncuestasPreguntas.Update()
End If
End Sub
#End Region
End Class

211
Prospectos/CatEventos.aspx Normal file
View File

@@ -0,0 +1,211 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatEventos.aspx.vb" Inherits="Prospectos_CatEventos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Fuente
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="120px">
<asp:LinkButton ID="LbEvento" runat="server" CausesValidation="false" Text="" CommandArgument="Evento" OnClick="LbOrden_Click">
Fuente
<asp:Literal ID="ImgEvento" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="140px">
<asp:LinkButton ID="LbEventoTipo" runat="server" CausesValidation="false" Text="EventoTipo" CommandArgument="" OnClick="LbOrden_Click">
Tipo de Fuente
<asp:Literal ID="ImgEventoTipo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="140px">
<asp:LinkButton ID="LbFechaEvento" runat="server" CausesValidation="false" Text="FechaEvento" CommandArgument="" OnClick="LbOrden_Click">
Fecha Fuente
<asp:Literal ID="ImgFechaEvento" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="140px">
<asp:LinkButton ID="LbSupervisor" runat="server" CausesValidation="false" Text="Supervisor" CommandArgument="" OnClick="LbOrden_Click">
Supervisor
<asp:Literal ID="ImgSupervisor" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="140px">
<asp:LinkButton ID="LbAnfitrion" runat="server" CausesValidation="false" Text="Anfitrion" CommandArgument="" OnClick="LbOrden_Click">
Anfitrión
<asp:Literal ID="ImgAnfitrion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="161px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtEvento" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="104px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEvento" runat="server" ControlToValidate="TxtEvento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fuente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOEvento" runat="server" HighlightCssClass="vco" TargetControlID="RFVEvento" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlEventoTIpo" runat="server" AppendDataBoundItems="true" DataValueField="CveEventoTIpo" DataTextField="EventoTipo" ValidationGroup="GrpGuardar" style="width:124px !important;" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVEventoTIpo" runat="server" ControlToValidate="DdlEventoTIpo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Fuente''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOEventoTIpo" runat="server" HighlightCssClass="vco" TargetControlID="RFVEventoTIpo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtFechaEvento" runat="server" MaxLength="10" Width="84px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaEvento2" ImageUrl="~/Imagenes/Imagenes42/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaEvento" runat="server" TargetControlID="TxtFechaEvento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaEvento" TargetControlID="TxtFechaEvento" PopupButtonID="ImgFechaEvento2" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaEvento" runat="server" ControlToValidate="TxtFechaEvento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fuente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaEvento" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaEvento" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlSupervisor" runat="server" AppendDataBoundItems="true" DataValueField="CveSupervisor" DataTextField="Supervisor" ValidationGroup="GrpGuardar" style="width:124px !important;" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVSupervisor" runat="server" ControlToValidate="DdlSupervisor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Supervisor''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOSupervisor" runat="server" HighlightCssClass="vco" TargetControlID="RFVSupervisor" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlAnfitrion" runat="server" AppendDataBoundItems="true" DataValueField="CveAnfitrion" DataTextField="Anfitrion" ValidationGroup="GrpGuardar" style="width:124px !important;" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVAnfitrion" runat="server" ControlToValidate="DdlAnfitrion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Anfitrion''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEAnfitrion" runat="server" HighlightCssClass="vco" TargetControlID="RFVAnfitrion" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveEvento" EmptyDataText="No se encontraron Fuentes" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlEvento" runat="server" Text='<%# Eval("Evento", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtEvento" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Evento")%>' ValidationGroup="GrpEditGuardar" Width="104px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEvento" runat="server" ControlToValidate="TxtEvento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fuente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOEvento" runat="server" HighlightCssClass="vco" TargetControlID="RFVEvento" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlEventoTipo" runat="server" Text='<%# Eval("EventoTipo", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlEventoTipo" runat="server" DataValueField="CveEventoTipo" DataTextField="EventoTipo" style="width:124px !important;" Class="table-group-action-input form-control input-inline input-small input-sm"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaEvento" runat="server" Text='<%# Eval("FechaEvento", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtFechaEvento" runat="server" MaxLength="10" Width="84px" Text='<%# Eval("FechaEvento", "{0:d}") %>'></asp:TextBox>&nbsp;
<asp:ImageButton runat="server" ID="ImgFechaEvento" ImageUrl="~/Imagenes/Imagenes42/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaEvento" runat="server" TargetControlID="TxtFechaEvento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaEvento" TargetControlID="TxtFechaEvento" PopupButtonID="ImgFechaEvento" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaEvento" runat="server" ControlToValidate="TxtFechaEvento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fuente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaEvento" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaEvento" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSupervisor" runat="server" Text='<%# Eval("Supervisor", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlSupervisor" runat="server" DataValueField="CveSupervisor" DataTextField="Supervisor" style="width:124px !important;" Class="table-group-action-input form-control input-inline input-small input-sm"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlAnfitrion" runat="server" Text='<%# Eval("Anfitrion", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlAnfitrion" runat="server" AppendDataBoundItems="true" DataValueField="CveAnfitrion" DataTextField="Anfitrion" ValidationGroup="GrpGuardar" style="width:124px !important;" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="Selecione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If(Eval("Estatus").ToString = "Activo", "True", "False") %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpEditGuardar" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" ToolTip="Editar" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,217 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatEventos
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaEventoTipo()
CargaSupervisor()
CargaDatos()
CargaAnfitrion(DdlAnfitrion)
End If
End Sub
Private Sub CargaSupervisor()
DdlSupervisor.DataSource = GlobalDTProspectosSupervisores(UsuarioActual.CveEmpresa)
DdlSupervisor.DataBind()
DdlSupervisor.SelectedItem.Text = "Ninguno"
End Sub
Private Sub CargaEventoTipo()
DdlEventoTIpo.DataSource = GlobalDTProspectosEventosTipo(UsuarioActual.CveEmpresa)
DdlEventoTipo.DataBind()
End Sub
Private Sub CargaAnfitrion(ddl As DropDownList)
Dim Anf As New ClsProspectos
If Anf.GetProspectosAnfitriones(-1, UsuarioActual.CveEmpresa) Then
ddl.DataSource = Anf.DtResultados
ddl.SelectedItem.Text = "Ninguno"
End If
Anf.Dispose()
ddl.DataBind()
End Sub
Public Sub CargaDatos()
Dim ObjEvento As New ClsProspectos
If ObjEvento.GetProspectosEventos(-1, UsuarioActual.CveEmpresa) Then
ViewState("DTEvento") = ObjEvento.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEvento(-1, UsuarioActual.CveEmpresa) = ObjEvento.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
'ObjEvento.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjAnfitrion As New ClsProspectos
If ObjAnfitrion.AddProspectosEventos(TxtEvento.Text.Trim, DdlEventoTIpo.SelectedValue.ToEntero, TxtFechaEvento.Text.ToDateTime, DdlSupervisor.SelectedValue.ToEntero, DdlAnfitrion.SelectedValue.ToEntero, "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
DdlEventoTIpo.SelectedIndex = 0
TxtEvento.Text = ""
DdlAnfitrion.SelectedValue = "-1"
Alert("La nueva Fuente se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTEvento") = ObjAnfitrion.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjAnfitrion.Dispose()
End Sub
#Region "G V D A T O S"
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(120)
e.Row.Cells(1).Width = Unit.Pixel(140)
e.Row.Cells(2).Width = Unit.Pixel(140)
e.Row.Cells(3).Width = Unit.Pixel(140)
e.Row.Cells(4).Width = Unit.Pixel(140)
e.Row.Cells(5).Width = Unit.Pixel(80)
e.Row.Cells(6).Width = Unit.Pixel(80)
e.Row.Cells(7).Width = Unit.Pixel(80)
e.Row.Cells(8).Width = Unit.Pixel(100)
e.Row.Cells(9).Width = Unit.Pixel(61)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Center
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlEventoTipo").DataSource = GlobalDTProspectosEventosTipo(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlEventoTipo").DataBind()
e.Row.FCDropDownList("DdlEventoTipo").SelectedValue = e.Row.DBCampo("CveEventoTipo")
e.Row.FCDropDownList("DdlSupervisor").DataSource = GlobalDTProspectosSupervisores(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlSupervisor").DataBind()
e.Row.FCDropDownList("DdlSupervisor").SelectedValue = e.Row.DBCampo("CveSupervisor")
CargaAnfitrion(e.Row.FCDropDownList("DdlAnfitrion"))
e.Row.FCDropDownList("DdlAnfitrion").SelectedValue = e.Row.DBCampo("CveAnfitrion")
End If
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjAnfitrion As New ClsProspectos
If ObjAnfitrion.RemoveProspectosEventos(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTEvento") = ObjAnfitrion.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Alert("La Fuente se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjAnfitrion.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjAnfitrion As New ClsProspectos
Dim Evento As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtEvento"), TextBox).Text.Trim
Dim CveEventoTipo As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlEventoTipo"), DropDownList).SelectedValue.ToEntero
'Dim Anfitrion As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtAnfitrion"), TextBox).Text.Trim
Dim FechaEvento As DateTime = CDate(DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFechaEvento"), TextBox).Text.Trim)
Dim CveSupervisor As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlSupervisor"), DropDownList).SelectedValue.ToEntero
Dim CveAnfitrion As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlAnfitrion"), DropDownList).SelectedValue.ToEntero
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveEvento As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjAnfitrion.UpdateProspectosEventos(Evento, CveEventoTipo, FechaEvento, CveSupervisor, CveAnfitrion, "", -1, Estatus, CveEvento) Then
GvDatos.EditIndex = -1
ViewState("DTEvento") = ObjAnfitrion.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEvento(-1, -1) = ObjAnfitrion.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjAnfitrion.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTEvento"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTEvento"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,211 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatEventosEstructuras.aspx.vb" Inherits="Prospectos_CatEventosEstructuras" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Eventos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="100px">
<asp:LinkButton ID="LbEvento" runat="server" CausesValidation="false" Text="" CommandArgument="Evento" OnClick="LbOrden_Click">
Evento
<asp:Literal ID="ImgEvento" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="150px">
<asp:LinkButton ID="LbEventoTipo" runat="server" CausesValidation="false" Text="" CommandArgument="EventoTipo" OnClick="LbOrden_Click">
Tipo Evento
<asp:Literal ID="ImgEventoTipo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="130px">
<asp:LinkButton ID="LbFechaEvento" runat="server" CausesValidation="false" Text="" CommandArgument="FechaEvento" OnClick="LbOrden_Click">
Fecha Evento
<asp:Literal ID="ImgFechaEvento" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="160px">
<asp:LinkButton ID="LbAnfitrion" runat="server" CausesValidation="false" Text="" CommandArgument="Anfitrion" OnClick="LbOrden_Click">
Lugar
<asp:Literal ID="ImgAnfitrion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="150">
<asp:LinkButton ID="LbMunicipio" runat="server" CausesValidation="false" Text="" CommandArgument="Municipio" OnClick="LbOrden_Click">
Municipio
<asp:Literal ID="imgMunicipio" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="80px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="161px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtEvento" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEvento" runat="server" ControlToValidate="TxtEvento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Evento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOEvento" runat="server" HighlightCssClass="vco" TargetControlID="RFVEvento" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlEventoTIpo" runat="server" AppendDataBoundItems="true" DataValueField="CveEventoTIpo" DataTextField="EventoTipo" ValidationGroup="GrpGuardar" style="width:134px !important;" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVEventoTIpo" runat="server" ControlToValidate="DdlEventoTIpo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''EventoTipo''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOEventoTIpo" runat="server" HighlightCssClass="vco" TargetControlID="RFVEventoTIpo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtFechaEvento" runat="server" MaxLength="10" Width="74px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaEvento2" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaEvento" runat="server" TargetControlID="TxtFechaEvento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaEvento" TargetControlID="TxtFechaEvento" PopupButtonID="ImgFechaEvento2" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaEvento" runat="server" ControlToValidate="TxtFechaEvento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Evento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaEvento" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaEvento" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlAnfitrion" runat="server" AppendDataBoundItems="true" DataValueField="CveAnfitrion" DataTextField="Anfitrion" ValidationGroup="GrpGuardar" style="width:144px !important;" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVAnfitrion" runat="server" ControlToValidate="DdlAnfitrion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lugar''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEAnfitrion" runat="server" HighlightCssClass="vco" TargetControlID="RFVAnfitrion" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlMunicipio" runat="server" AppendDataBoundItems="true" DataValueField="CveMunicipio" DataTextField="Municipio" ValidationGroup="GrpGuardar" style="width:134px !important;" Class="table-group-action-input form-control input-inline input-small input-sm">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVMunicipio" runat="server" ControlToValidate="DdlMunicipio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Municipio''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMunicipio" runat="server" HighlightCssClass="vco" TargetControlID="RFVMunicipio" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveEvento" EmptyDataText="No se encontraron Eventos" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlEvento" runat="server" Text='<%# Eval("Evento", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtEvento" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Evento")%>' ValidationGroup="GrpEditGuardar" Width="84px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEvento" runat="server" ControlToValidate="TxtEvento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Evento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOEvento" runat="server" HighlightCssClass="vco" TargetControlID="RFVEvento" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlEventoTipo" runat="server" Text='<%# Eval("EventoTipo", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlEventoTipo" runat="server" DataValueField="CveEventoTipo" DataTextField="EventoTipo" style="width:134px !important;" Class="table-group-action-input form-control input-inline input-small input-sm"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaEvento" runat="server" Text='<%# Eval("FechaEvento", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtFechaEvento" runat="server" MaxLength="10" Width="74px" Text='<%# Eval("FechaEvento", "{0:d}") %>'></asp:TextBox>&nbsp;
<asp:ImageButton runat="server" ID="ImgFechaEvento" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaEvento" runat="server" TargetControlID="TxtFechaEvento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaEvento" TargetControlID="TxtFechaEvento" PopupButtonID="ImgFechaEvento" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaEvento" runat="server" ControlToValidate="TxtFechaEvento" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Evento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaEvento" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaEvento" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlAnfitrion" runat="server" Text='<%# Eval("Anfitrion", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlAnfitrion" runat="server" AppendDataBoundItems="true" DataValueField="CveAnfitrion" DataTextField="Anfitrion" ValidationGroup="GrpGuardar" style="width:144px !important;" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="Selecione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlMunicipio" runat="server" Text='<%# Eval("Municipio", "{0}")%>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlMunicipio" runat="server" AppendDataBoundItems="true" DataValueField="CveMunicipio" DataTextField="Municipio" ValidationGroup="GrpGuardar" style="width:134px !important;" Class="table-group-action-input form-control input-inline input-small input-sm">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If(Eval("Estatus").ToString = "Activo", "True", "False") %>' />
</EditItemTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpEditGuardar" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" ToolTip="Editar" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,217 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatEventosEstructuras
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaEventoTipo()
CargaDatos()
CargaAnfitrion(DdlAnfitrion)
DdlMunicipio.DataSource = GlobalDTGralMunicipios(26)
DdlMunicipio.DataBind()
End If
End Sub
Private Sub CargaEventoTipo()
DdlEventoTIpo.DataSource = GlobalDTProspectosEventosTipo(UsuarioActual.CveEmpresa)
DdlEventoTipo.DataBind()
End Sub
Private Sub CargaAnfitrion(ddl As DropDownList)
Dim Anf As New ClsProspectos
If Anf.GetProspectosAnfitriones(-1, UsuarioActual.CveEmpresa) Then
ddl.DataSource = Anf.DtResultados
End If
Anf.Dispose()
ddl.DataBind()
End Sub
Public Sub CargaDatos()
Dim ObjEvento As New ClsProspectos
If ObjEvento.GetProspectosEventos(-1, UsuarioActual.CveEmpresa) Then
ViewState("DTEvento") = ObjEvento.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEvento(-1, UsuarioActual.CveEmpresa) = ObjEvento.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
'ObjEvento.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjAnfitrion As New ClsProspectos
If ObjAnfitrion.AddProspectosEventos(TxtEvento.Text.Trim, DdlEventoTIpo.SelectedValue.ToEntero, TxtFechaEvento.Text.ToDateTime, -1, DdlAnfitrion.SelectedValue.ToEntero, "", DdlMunicipio.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
DdlEventoTIpo.SelectedIndex = 0
TxtEvento.Text = ""
DdlAnfitrion.SelectedValue = "-1"
Alert("El nuevo Evento se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTEvento") = ObjAnfitrion.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjAnfitrion.Dispose()
End Sub
#Region "G V D A T O S"
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(100)
e.Row.Cells(1).Width = Unit.Pixel(150)
e.Row.Cells(2).Width = Unit.Pixel(130)
e.Row.Cells(3).Width = Unit.Pixel(160)
e.Row.Cells(4).Width = Unit.Pixel(150)
e.Row.Cells(5).Width = Unit.Pixel(80)
e.Row.Cells(6).Width = Unit.Pixel(80)
e.Row.Cells(7).Width = Unit.Pixel(80)
e.Row.Cells(8).Width = Unit.Pixel(100)
e.Row.Cells(9).Width = Unit.Pixel(61)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Center
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlEventoTipo").DataSource = GlobalDTProspectosEventosTipo(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlEventoTipo").DataBind()
e.Row.FCDropDownList("DdlEventoTipo").SelectedValue = e.Row.DBCampo("CveEventoTipo")
e.Row.FCDropDownList("DdlMunicipio").DataSource = GlobalDTGralMunicipios(26)
e.Row.FCDropDownList("DdlMunicipio").DataBind()
e.Row.FCDropDownList("DdlMunicipio").SelectedValue = e.Row.DBCampo("CveMunicipio")
CargaAnfitrion(e.Row.FCDropDownList("DdlAnfitrion"))
e.Row.FCDropDownList("DdlAnfitrion").SelectedValue = e.Row.DBCampo("CveAnfitrion")
End If
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjAnfitrion As New ClsProspectos
If ObjAnfitrion.RemoveProspectosEventos(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTEvento") = ObjAnfitrion.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Alert("El Anfitrión se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjAnfitrion.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjAnfitrion As New ClsProspectos
Dim Evento As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtEvento"), TextBox).Text.Trim
Dim CveEventoTipo As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlEventoTipo"), DropDownList).SelectedValue.ToEntero
'Dim Anfitrion As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtAnfitrion"), TextBox).Text.Trim
Dim FechaEvento As DateTime = CDate(DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFechaEvento"), TextBox).Text.Trim)
Dim CveSupervisor As Integer = -1 ' DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlSupervisor"), DropDownList).SelectedValue.ToEntero
Dim CveAnfitrion As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlAnfitrion"), DropDownList).SelectedValue.ToEntero
Dim CveMunicipio As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlMunicipio"), DropDownList).SelectedValue.ToEntero
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveEvento As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjAnfitrion.UpdateProspectosEventos(Evento, CveEventoTipo, FechaEvento, CveSupervisor, CveAnfitrion, "", CveMunicipio, Estatus, CveEvento) Then
GvDatos.EditIndex = -1
ViewState("DTEvento") = ObjAnfitrion.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEvento(-1, -1) = ObjAnfitrion.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjAnfitrion.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTEvento"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTEvento"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,119 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatEventosTipos.aspx.vb" Inherits="Prospectos_CatEventosTipos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Prospectos Tipos de Fuentes
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="250px">
<asp:LinkButton ID="LbEventoTipo" runat="server" CausesValidation="false" Text="" CommandArgument="EventoTipo" OnClick="LbOrden_Click">
Tipo de Fuente
<asp:Literal ID="ImgEventoTipo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="161px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtEventoTipo" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEventoTipo" runat="server" ControlToValidate="TxtEventoTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Fuente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEventoTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVEventoTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveEventoTipo" EmptyDataText="No se encontraron Tipos de Solicitudes Registrados" ToolTip="Listado de Tipos de Solicitudes" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlEventoTipo" runat="server" Text='<%# Eval("EventoTipo", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtEventoTipo" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("EventoTipo") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEventoTipo" runat="server" ControlToValidate="TxtEventoTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Fuente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEventoTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVEventoTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,170 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatEventosTipos
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjEventoTipo As New ClsProspectos
If ObjEventoTipo.GetEventosTipo(UsuarioActual.CveEmpresa) Then
ViewState("DTEventoTipo") = ObjEventoTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEventosTipo(UsuarioActual.CveEmpresa) = ObjEventoTipo.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjEventoTipo.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjEventoTipo As New ClsProspectos
If ObjEventoTipo.AddEventosTipo(TxtEventoTipo.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtEventoTipo.Text = ""
Alert("El nuevo Tipo de Fuente se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTEventoTipo") = ObjEventoTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEventosTipo(UsuarioActual.CveEmpresa) = ObjEventoTipo.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjEventoTipo.Dispose()
End Sub
#Region "G V D A T O S"
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(250)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(61)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjEventoTipo As New ClsProspectos
If ObjEventoTipo.RemoveEventosTipo(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTEventoTipo") = ObjEventoTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosSolicitudesTipos(UsuarioActual.CveEmpresa) = ObjEventoTipo.DtResultados
Alert("El Tipo de Fuente se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjEventoTipo.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjEventoTipo As New ClsProspectos
Dim EventoTipo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtEventoTipo"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveEventoTipo As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjEventoTipo.UpdateEventosTipo(EventoTipo, Estatus, CveEventoTipo) Then
GvDatos.EditIndex = -1
ViewState("DTEventoTipo") = ObjEventoTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosSolicitudesTipos(UsuarioActual.CveEmpresa) = ObjEventoTipo.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjEventoTipo.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTEventoTipo"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTEventoTipo"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,161 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPromotores.aspx.vb" Inherits="Prospectos_CatPromotores" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Promotores
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="200px">
<asp:LinkButton ID="LbCoordinador" runat="server" CausesValidation="false" Text="" CommandArgument="Coordinador" OnClick="LbOrden_Click">
Promotor
<asp:Literal ID="ImgCoordinador" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="200px" style="display: none;">
<asp:LinkButton ID="LbRepresentante" runat="server" CausesValidation="false" Text="" CommandArgument="Representante" OnClick="LbOrden_Click">
Representante
<asp:Literal ID="ImgRepresentante" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="160px">
<asp:LinkButton ID="LbSupervisor" runat="server" CausesValidation="false" Text="" CommandArgument="Supervisor" OnClick="LbOrden_Click">
Responsable
<asp:Literal ID="ImgSupervisor" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha Ing
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="161px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtCoordinador" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="184px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCoordinador" runat="server" ControlToValidate="TxtCoordinador" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Promotor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCCoordinador" runat="server" HighlightCssClass="vco" TargetControlID="RFVCoordinador" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="display: none;">
<asp:TextBox ID="TxtRepresentante" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="184px"></asp:TextBox>
</td>
<td style="text-align: center">
<asp:DropDownList ID="DdlSupervisor" runat="server" AppendDataBoundItems="true" DataValueField="CveSupervisor" DataTextField="Supervisor" ValidationGroup="GrpGuardar" style="width:144px !important;" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVSupervisor" runat="server" ControlToValidate="DdlSupervisor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Responsable''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOSupervisor" runat="server" HighlightCssClass="vco" TargetControlID="RFVSupervisor" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCoordinador" EmptyDataText="No se encontraron Promotores Registrados" ToolTip="Listado de Promotores" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCoordinador" runat="server" Text='<%# Eval("Coordinador", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtCoordinador" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Coordinador") %>' ValidationGroup="GrpGV" Width="184px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVCoordinador" runat="server" ControlToValidate="TxtCoordinador" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Coordinador''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCCoordinador" runat="server" HighlightCssClass="vco" TargetControlID="RFVCoordinador" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<ItemTemplate>
<asp:Literal ID="LtlRepresentante" runat="server" Text='<%# Eval("Representante", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtRepresentante" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Representante") %>' ValidationGroup="GrpGV" Width="184px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSupervisor" runat="server" Text='<%# Eval("Supervisor", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlSupervisor" runat="server" DataValueField="CveSupervisor" DataTextField="Supervisor" Class="table-group-action-input form-control input-inline input-small input-sm" style="width:144px !important;"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If(Eval("Estatus").ToString = "Activo", True, False)%>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-CssClass="Usuario">
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
<%--<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />--%>
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
<%-- <asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />--%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
<%-- <asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />--%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,182 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Prospectos_CatPromotores
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaSupervisor()
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjCoordinador As New ClsProspectos
If ObjCoordinador.GetCoordinadores(-1) Then
ViewState("DTCoordinador") = ObjCoordinador.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCoordinadores(-1, UsuarioActual.CveEmpresa) = ObjCoordinador.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjCoordinador.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Private Sub CargaSupervisor()
DdlSupervisor.DataSource = GlobalDTProspectosSupervisores(UsuarioActual.CveEmpresa)
DdlSupervisor.DataBind()
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjCoordinador As New ClsProspectos
If ObjCoordinador.AddCoordinadores(TxtCoordinador.Text.Trim, TxtRepresentante.Text.Trim, DdlSupervisor.SelectedValue.ToEntero, 0, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtCoordinador.Text = ""
TxtRepresentante.Text = ""
Alert("El nuevo Coordinador se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTCoordinador") = ObjCoordinador.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCoordinadores(-1, UsuarioActual.CveEmpresa) = ObjCoordinador.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjCoordinador.Dispose()
End Sub
#Region "G V D A T O S"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).Width = Unit.Pixel(200) 'PROMOTOR
e.Row.Cells(1).Width = Unit.Pixel(160) 'REPRESENTANTE
e.Row.Cells(2).Width = Unit.Pixel(160) 'RESPONSABLE
e.Row.Cells(3).Width = Unit.Pixel(100) 'ESTATUS
e.Row.Cells(4).Width = Unit.Pixel(100) 'FECHAING
e.Row.Cells(5).Width = Unit.Pixel(100) 'USUARIO
e.Row.Cells(6).Width = Unit.Pixel(100)
e.Row.Cells(7).Width = Unit.Pixel(61)
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Center
e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Center
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlSupervisor").DataSource = GlobalDTProspectosSupervisores(UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlSupervisor").DataBind()
'e.Row.FCDropDownList("DdlSupervisor").SelectedValue = e.Row.DBCampo("CveSupervisor")
End If
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjCoordinador As New ClsProspectos
If ObjCoordinador.RemoveCoordinador(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTCoordinador") = ObjCoordinador.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCoordinadores(-1, -1) = ObjCoordinador.DtResultados
Alert("El Coordinador se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjCoordinador.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjCoordinador As New ClsProspectos
Dim Coordinador As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtCoordinador"), TextBox).Text.Trim
Dim Representante As String = "" ' DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtRepresentante"), TextBox).Text.Trim
Dim CveSupervisor As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlSupervisor"), DropDownList).SelectedValue.ToEntero
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveCoordinador As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjCoordinador.UpdateCoordinadores(Coordinador, Representante, CveSupervisor, 0, Estatus, CveCoordinador) Then
GvDatos.EditIndex = -1
ViewState("DTCoordinador") = ObjCoordinador.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosCoordinadores(-1, -1) = ObjCoordinador.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjCoordinador.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTCoordinador"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTCoordinador"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,482 @@
<%@ Page Title="Prospectos - Catálogo de Prospectos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProspectos.aspx.vb" Inherits="Prospectos_CatProspectos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
&nbsp;
<img alt="Nuevo Prospecto" onclick="document.location.href='/Prospectos/ProspectosSIP.aspx'" src="/Imagenes/BotonAgregar.gif" style="cursor: pointer;" />
<%--<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" />--%>
&nbsp;
<asp:Image ID="ImgPersonalizar" ToolTip="Personalizar Listado" Height="22px" runat="server" ImageUrl="/Imagenes/Table-icon.png" Style="cursor: pointer;" />
&nbsp;
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Prospectos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" ToolTip="Listado de Prospectos" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Nombre</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplNombreCompleto" CssClass="Texto" runat="server" Text='<%# Eval("NombreCompleto")%>' NavigateUrl='<%# Eval("CveProspecto", "ProspectosSIP.aspx?CveProspecto={0}")%>'></asp:HyperLink></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>ApellidoPaterno</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlApellidoPaterno" runat="server" Text='<%# Eval("ApellidoPaterno")%>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>ApellidoMaterno</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlApellidoMaterno" runat="server" Text='<%# Eval("ApellidoMaterno") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Nombres</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombres" runat="server" Text='<%# Eval("Nombres")%>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>F.Nacimiento</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaNacimiento" runat="server" Text='<%# Eval("FechaNacimiento","{0:d}") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Lugar Nacimiento</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlLugarNacimiento" runat="server" Text='<%# Eval("LugarNacimiento") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>RFC</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRFC" runat="server" Text='<%# Eval("RFC") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Nacionalidad</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNacionalidad" runat="server" Text='<%# Eval("Nacionalidad") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Calle</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCalle" runat="server" Text='<%# Eval("Calle") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Número</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNumero" runat="server" Text='<%# Eval("Numero") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Colonia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlColonia" runat="server" Text='<%# Eval("Colonia") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Código Postal</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCodigoPostal" runat="server" Text='<%# Eval("CodigoPostal") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>País</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPais" runat="server" Text='<%# Eval("Pais") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Municipio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMunicipio" runat="server" Text='<%# Eval("Municipio") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Estado</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estado") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Teléfono</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTelefono" runat="server" Text='<%# Eval("Telefono") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Fax</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFax" runat="server" Text='<%# Eval("Fax") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Correo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCorreo" runat="server" Text='<%# Eval("Correo") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Empresa</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaNombre" runat="server" Text='<%# Eval("EmpresaNombre") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Empresa Giro</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaGiro" runat="server" Text='<%# Eval("EmpresaGiro") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa Sector</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaSector" runat="server" Text='<%# Eval("EmpresaSector") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa Página</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaPagina" runat="server" Text='<%# Eval("EmpresaPagina") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa Calle</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaCalle" runat="server" Text='<%# Eval("EmpresaCalle") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa Número</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaNumero" runat="server" Text='<%# Eval("EmpresaNumero") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa Colonia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaColonia" runat="server" Text='<%# Eval("EmpresaColonia") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa Código Postal</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaCodigoPostal" runat="server" Text='<%# Eval("EmpresaCodigoPostal") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa País</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaPais" runat="server" Text='<%# Eval("EmpresaPais") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa Municipio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaMunicipio" runat="server" Text='<%# Eval("EmpresaMunicipio") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa Estado</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaEstado" runat="server" Text='<%# Eval("EmpresaEstado") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa Teléfono</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaTelefono" runat="server" Text='<%# Eval("EmpresaTelefono") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa Fax</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaFax" runat="server" Text='<%# Eval("EmpresaFax") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa Correo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaCorreo" runat="server" Text='<%# Eval("EmpresaCorreo") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa Puesto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaPuesto" runat="server" Text='<%# Eval("EmpresaPuesto") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Empresa Especialidad</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaEspecialidad" runat="server" Text='<%# Eval("EmpresaEspecialidad") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Envio Correspondencia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEnvioCorrespondencia" runat="server" Text='<%# Eval("EnvioCorrespondencia") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Fiscal Razón Social</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFiscalRazonSocial" runat="server" Text='<%# Eval("FiscalRazonSocial") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Fiscal Domicilio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFiscalDomicilio" runat="server" Text='<%# Eval("FiscalDomicilio") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Fiscal Colonia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFiscalColonia" runat="server" Text='<%# Eval("FiscalColonia") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Fiscal Código Postal</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFiscalCodigoPostal" runat="server" Text='<%# Eval("FiscalCodigoPostal") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Fiscal Municipio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFiscalMunicipio" runat="server" Text='<%# Eval("FiscalMunicipio") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Fiscal Estado</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFiscalEstado" runat="server" Text='<%# Eval("FiscalEstado") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Fiscal RFC</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFiscalRFC" runat="server" Text='<%# Eval("FiscalRFC") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="false">
<HeaderTemplate>Fecha Ingreso</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<%--<asp:TemplateField Visible="false"><HeaderTemplate>Usuario</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlCveUsuario" runat="server" Text='<%# Eval("CveUsuario") %>'></asp:Literal></ItemTemplate></asp:TemplateField>--%>
<%--<asp:TemplateField Visible="false"><HeaderTemplate>CveEmpresa</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlCveEmpresa" runat="server" Text='<%# Eval("CveEmpresa") %>'></asp:Literal></ItemTemplate></asp:TemplateField>--%>
</Columns>
<HeaderStyle CssClass="Titulos" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UPPersonalizar" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivPersonalizar" style="width: 500px; background-color: White; border: solid 1px black; color: Black; display: none; position: absolute;">
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th style="width: 380px">
<asp:Label ID="LblTitulo1" runat="server" ClientIDMode="Static" Text="Personalizar Columnas"></asp:Label>
</th>
<th style="padding-right: 4px; padding-top: 4px" valign="top">
<img alt="" src="/Imagenes/close.gif" style="cursor: pointer;" onclick="$('#DivPersonalizar').hide(1000);" />
</th>
</tr>
</thead>
<tr align="left">
<td colspan="2" style="width: 500px;">
<table class="table table-striped table-advance table-hover">
<tr>
<th valign="top" style="width: 200px;">
<fieldset>
<b>PROSPECTO</b><br />
<table class="table table-striped table-advance table-hover">
<thead>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkNombreCompleto" runat="server" Text="Nombre Completo" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkApellidoPaterno" runat="server" Text="Apellido Paterno" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkApellidoMaterno" runat="server" Text="Apellido Materno" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkNombres" runat="server" Text="Nombres" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkFechaNacimiento" runat="server" Text="Fecha Nacimiento" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkLugarNacimiento" runat="server" Text="Lugar Nacimiento" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkRFC" runat="server" Text="RFC" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkNacionalidad" runat="server" Text="Nacionalidad" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkCalle" runat="server" Text="Calle" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkNumero" runat="server" Text="Número" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkColonia" runat="server" Text="Colonia" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkCodigoPostal" runat="server" Text="Código Postal" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkPais" runat="server" Text="País" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkMunicipio" runat="server" Text="Municipio" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEstado" runat="server" Text="Estado" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkTelefono" runat="server" Text="Télefono" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkFax" runat="server" Text="Fax" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkCorreo" runat="server" Text="Correo" /></th>
</tr>
</thead>
</table>
</fieldset>
</th>
<td valign="top" style="width: 150px;">
<fieldset style="text-align: center;">
<b>EMPRESA</b>
<table class="table table-striped table-advance table-hover">
<thead>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaNombre" runat="server" Text="Nombre" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaGiro" runat="server" Text="Giro" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaSector" runat="server" Text="Sector" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaPagina" runat="server" Text="Página" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaCalle" runat="server" Text="Calle" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaNumero" runat="server" Text="Número" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaColonia" runat="server" Text="Colonia" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaCodigoPostal" runat="server" Text="C.P." /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaPais" runat="server" Text="País" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaMunicipio" runat="server" Text="Municipio" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaEstado" runat="server" Text="Estado" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaTelefono" runat="server" Text="Teléfono" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaFax" runat="server" Text="Fax" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaCorreo" runat="server" Text="Correo" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaPuesto" runat="server" Text="Puesto" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaEspecialidad" runat="server" Text="Especialidad" /></th>
</tr>
</thead>
</table>
</fieldset>
</td>
<td valign="top" style="width: 150px;">
<fieldset style="text-align: center;">
<b>EMPRESA</b>
<table class="table table-striped table-advance table-hover">
<thead>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEnvioCorrespondencia" runat="server" Checked="true" Text="Corresp." /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkFiscalRazonSocial" runat="server" Text="Razón Social" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkFiscalDomicilio" runat="server" Text="Domicilio" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkFiscalColonia" runat="server" Text="Colonia" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkFiscalCodigoPostal" runat="server" Text="C.P." /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkFiscalMunicipio" runat="server" Text="Municipio" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkFiscalEstado" runat="server" Text="Estado" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkFiscalRFC" runat="server" Text="RFC" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkFechaIng" runat="server" Text="Fecha Ing." />
</th>
</tr>
</thead>
</table>
</fieldset>
</fieldset>
</td>
</tr>
</table>
</td>
</tr>
<tr style="height: 25px;" align="center">
<td colspan="3">
<asp:Button ID="BtnPersonalizar" runat="server" Text="Personalizar" class="btn btn-primary" /><input type="button" value="Cancelar" onclick="$('#DivPersonalizar').hide(1000);" class="btn btn-primary" /></td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,160 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Prospectos_CatProspectos
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
ViewState("Orden") = ""
CargaDatos()
ImgPersonalizar.Attributes.Add("onclick", "$('#DivPersonalizar').show(1000); PosicionaObjeto(this.id,'DivPersonalizar');")
End Sub
Public Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetProspectos(-1, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
ViewState("DTProspectos") = 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
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 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 = ChkLugarNacimiento.Checked
GvDatos.Columns(6).Visible = ChkRFC.Checked
GvDatos.Columns(7).Visible = ChkNacionalidad.Checked
GvDatos.Columns(8).Visible = ChkCalle.Checked
GvDatos.Columns(9).Visible = ChkNumero.Checked
GvDatos.Columns(10).Visible = ChkColonia.Checked
GvDatos.Columns(11).Visible = ChkCodigoPostal.Checked
GvDatos.Columns(12).Visible = ChkPais.Checked
GvDatos.Columns(13).Visible = ChkMunicipio.Checked
GvDatos.Columns(14).Visible = ChkEstado.Checked
GvDatos.Columns(15).Visible = ChkTelefono.Checked
GvDatos.Columns(16).Visible = ChkFax.Checked
GvDatos.Columns(17).Visible = ChkCorreo.Checked
GvDatos.Columns(18).Visible = ChkEmpresaNombre.Checked
GvDatos.Columns(19).Visible = ChkEmpresaGiro.Checked
GvDatos.Columns(20).Visible = ChkEmpresaSector.Checked
GvDatos.Columns(21).Visible = ChkEmpresaPagina.Checked
GvDatos.Columns(22).Visible = ChkEmpresaCalle.Checked
GvDatos.Columns(23).Visible = ChkEmpresaNumero.Checked
GvDatos.Columns(24).Visible = ChkEmpresaColonia.Checked
GvDatos.Columns(25).Visible = ChkEmpresaCodigoPostal.Checked
GvDatos.Columns(26).Visible = ChkEmpresaPais.Checked
GvDatos.Columns(27).Visible = ChkEmpresaMunicipio.Checked
GvDatos.Columns(28).Visible = ChkEmpresaEstado.Checked
GvDatos.Columns(29).Visible = ChkEmpresaTelefono.Checked
GvDatos.Columns(30).Visible = ChkEmpresaFax.Checked
GvDatos.Columns(31).Visible = ChkEmpresaCorreo.Checked
GvDatos.Columns(32).Visible = ChkEmpresaPuesto.Checked
GvDatos.Columns(33).Visible = ChkEmpresaEspecialidad.Checked
GvDatos.Columns(34).Visible = ChkEnvioCorrespondencia.Checked
GvDatos.Columns(35).Visible = ChkFiscalRazonSocial.Checked
GvDatos.Columns(36).Visible = ChkFiscalDomicilio.Checked
GvDatos.Columns(37).Visible = ChkFiscalColonia.Checked
GvDatos.Columns(38).Visible = ChkFiscalCodigoPostal.Checked
GvDatos.Columns(39).Visible = ChkFiscalMunicipio.Checked
GvDatos.Columns(40).Visible = ChkFiscalEstado.Checked
GvDatos.Columns(41).Visible = ChkFiscalRFC.Checked
GvDatos.Columns(42).Visible = ChkFechaIng.Checked
UPDatos.Update()
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(250)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(180)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(60)
e.Row.Cells(5).Width = Unit.Pixel(70)
e.Row.Cells(6).Width = Unit.Pixel(100)
e.Row.Cells(7).Width = Unit.Pixel(100)
e.Row.Cells(8).Width = Unit.Pixel(100)
e.Row.Cells(9).Width = Unit.Pixel(100)
e.Row.Cells(10).Width = Unit.Pixel(100)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.FCLiteral("LtlNombres").Text = "<a class=""Texto"" href=""/Prospectos/ProspectosSIP.aspx?CveProspecto=" & e.Row.DBCampo("CveProspecto") & """>" & e.Row.FCLiteral("LtlNombres").Text & "</a>"
e.Row.FCLiteral("LtlRFC").Text = "<a class=""Texto"" href=""/Prospectos/ProspectosSIP.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
End Class

View File

@@ -0,0 +1,120 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProspectosApoyos.aspx.vb" Inherits="Prospectos_CatProspectosApoyos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Prospectos Apoyos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="250px">
<asp:LinkButton ID="LbProspectoApoyo" runat="server" CausesValidation="false" Text="" CommandArgument="ProspectoApoyo" OnClick="LbOrden_Click">
Apoyo
<asp:Literal ID="ImgProspectoApoyo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="165px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtProspectoApoyo" runat="server" CausesValidation="true" MaxLength="100" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVProspectoApoyo" runat="server" ControlToValidate="TxtProspectoApoyo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Apoyo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCProspectoApoyo" runat="server" HighlightCssClass="vco" TargetControlID="RFVProspectoApoyo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveProspectoApoyo" EmptyDataText="No se encontraron Apoyos Registrados" ToolTip="Listado de Apoyos" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlProspectoApoyo" runat="server" Text='<%# Eval("ProspectoApoyo", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtProspectoApoyo" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("ProspectoApoyo") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVProspectoApoyo" runat="server" ControlToValidate="TxtProspectoApoyo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Apoyo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCProspectoApoyo" runat="server" HighlightCssClass="vco" TargetControlID="RFVProspectoApoyo" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,165 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatProspectosApoyos
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjProspectosApoyos As New ClsProspectos
If ObjProspectosApoyos.GetProspectoApoyo() Then
ViewState("DTProspectosApoyos") = ObjProspectosApoyos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa) = ObjProspectosApoyos.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjProspectosApoyos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjProspectosApoyos As New ClsProspectos
If ObjProspectosApoyos.AddProspectoApoyo(TxtProspectoApoyo.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtProspectoApoyo.Text = ""
Alert("El nuevo Apoyo se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTProspectosApoyos") = ObjProspectosApoyos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa) = ObjProspectosApoyos.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjProspectosApoyos.Dispose()
End Sub
#Region "G V D A T O S"
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(250)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(65)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjProspectosApoyos As New ClsProspectos
If ObjProspectosApoyos.RemoveProspectoApoyo(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTProspectosApoyos") = ObjProspectosApoyos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa) = ObjProspectosApoyos.DtResultados
Alert("El Apoyo se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProspectosApoyos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjProspectosApoyos As New ClsProspectos
Dim ProspectoApoyo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtProspectoApoyo"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveProspectoApoyo As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjProspectosApoyos.UpdateProspectoApoyo(ProspectoApoyo, Estatus, CveProspectoApoyo) Then
GvDatos.EditIndex = -1
ViewState("DTProspectosApoyos") = ObjProspectosApoyos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa) = ObjProspectosApoyos.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProspectosApoyos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTProspectosApoyos"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTProspectosApoyos"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,120 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProspectosApoyosTipos.aspx.vb" Inherits="Prospectos_CatProspectosApoyosTipos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Prospectos Tipos de Apoyos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="250px">
<asp:LinkButton ID="LbApoyoTipo" runat="server" CausesValidation="false" Text="" CommandArgument="ApoyoTipo" OnClick="LbOrden_Click">
Tipo de Apoyo
<asp:Literal ID="ImgApoyoTipo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="165px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtApoyoTipo" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVApoyoTipo" runat="server" ControlToValidate="TxtApoyoTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Apoyo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCApoyoTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVApoyoTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveApoyoTipo" EmptyDataText="No se encontraron Tipos de Apoyos Registrados" ToolTip="Listado de Tipos de Apoyos" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlApoyoTipo" runat="server" Text='<%# Eval("ApoyoTipo", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtApoyoTipo" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("ApoyoTipo") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVApoyoTipo" runat="server" ControlToValidate="TxtApoyoTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Apoyo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCApoyoTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVApoyoTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,164 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatProspectosApoyosTipos
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjApoyoTipo As New ClsProspectos
If ObjApoyoTipo.GetApoyoTipo() Then
ViewState("DTApoyoTipo") = ObjApoyoTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa) = ObjApoyoTipo.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjApoyoTipo.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjApoyoTipo As New ClsProspectos
If ObjApoyoTipo.AddApoyoTipo(TxtApoyoTipo.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtApoyoTipo.Text = ""
Alert("El nuevo Tipo de Apoyo se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTApoyoTipo") = ObjApoyoTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa) = ObjApoyoTipo.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjApoyoTipo.Dispose()
End Sub
#Region "G V D A T O S"
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(250)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(65)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjApoyoTipo As New ClsProspectos
If ObjApoyoTipo.RemoveApoyoTipo(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTApoyoTipo") = ObjApoyoTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa) = ObjApoyoTipo.DtResultados
Alert("El Tipo de Apoyo se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjApoyoTipo.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjApoyoTipo As New ClsProspectos
Dim ApoyoTipo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtApoyoTipo"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveApoyoTipo As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjApoyoTipo.UpdateApoyoTipo(ApoyoTipo, Estatus, CveApoyoTipo) Then
GvDatos.EditIndex = -1
ViewState("DTApoyoTipo") = ObjApoyoTipo.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa) = ObjApoyoTipo.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjApoyoTipo.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTApoyoTipo"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTApoyoTipo"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,119 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProspectosClasificaciones.aspx.vb" Inherits="Prospectos_CatProspectosClasificaciones" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Prospectos Clasificaciones
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="250px">
<asp:LinkButton ID="LbProspectoClasificacion" runat="server" CausesValidation="false" Text="" CommandArgument="ProspectoClasificacion" OnClick="LbOrden_Click">
Clasificación
<asp:Literal ID="ImgProspectoClasificacion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="165px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtProspectoClasificacion" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVProspectoClasificacion" runat="server" ControlToValidate="TxtProspectoClasificacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCProspectoClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVProspectoClasificacion" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveProspectoClasificacion" EmptyDataText="No se encontraron Clasificaciones Registradas" ToolTip="Listado de Clasificaciones" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlProspectoClasificacion" runat="server" Text='<%# Eval("ProspectoClasificacion", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtProspectoClasificacion" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("ProspectoClasificacion") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVProspectoClasificacion" runat="server" ControlToValidate="TxtProspectoClasificacion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Clasificación''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCProspectoClasificacion" runat="server" HighlightCssClass="vco" TargetControlID="RFVProspectoClasificacion" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,163 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatProspectosClasificaciones
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjProspectosClasificaciones As New ClsProspectos
If ObjProspectosClasificaciones.GetProspectoClasificacion() Then
ViewState("DTProspectosClasificaciones") = ObjProspectosClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosClasificaciones(UsuarioActual.CveEmpresa) = ObjProspectosClasificaciones.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjProspectosClasificaciones.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjProspectosClasificaciones As New ClsProspectos
If ObjProspectosClasificaciones.AddProspectoClasificacion(TxtProspectoClasificacion.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtProspectoClasificacion.Text = ""
Alert("La nueva Clasificación se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTProspectosClasificaciones") = ObjProspectosClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosClasificaciones(UsuarioActual.CveEmpresa) = ObjProspectosClasificaciones.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjProspectosClasificaciones.Dispose()
End Sub
#Region "G V D A T O S"
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(250)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(65)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjProspectosClasificaciones As New ClsProspectos
If ObjProspectosClasificaciones.RemoveProspectoClasificacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTProspectosClasificaciones") = ObjProspectosClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosClasificaciones(UsuarioActual.CveEmpresa) = ObjProspectosClasificaciones.DtResultados
Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProspectosClasificaciones.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjProspectosClasificaciones As New ClsProspectos
Dim ProspectoClasificacion As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtProspectoClasificacion"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveProspectoClasificacion As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjProspectosClasificaciones.UpdateProspectoClasificacion(ProspectoClasificacion, Estatus, CveProspectoClasificacion) Then
GvDatos.EditIndex = -1
ViewState("DTProspectosClasificaciones") = ObjProspectosClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosClasificaciones(UsuarioActual.CveEmpresa) = ObjProspectosClasificaciones.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProspectosClasificaciones.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTProspectosClasificaciones"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTProspectosClasificaciones"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,135 @@
<%@ Page Title="Prospectos - Catálogo de Prospectos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProspectosDetalle.aspx.vb" Inherits="Prospectos_CatProspectosDetalle" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<%--<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" />--%>
<asp:Image ID="ImgPersonalizar" ToolTip="Personalizar Listado" runat="server" ImageUrl="/Imagenes/Table-icon.png" Style="cursor:pointer; height:23px;" />&nbsp;
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Detalle de Redes
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
Número de registros:&nbsp;&nbsp;&nbsp;&nbsp;<b><asp:Literal ID="LtlNumRegistros" runat="server" Text="0"></asp:Literal></b>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" CssClass="table table-striped table-advance table-hover" style="margin-top:-10px; text-align:center;" GridLines="None" >
<Columns>
<asp:TemplateField><HeaderTemplate>Nombre</HeaderTemplate><ItemTemplate><asp:HyperLink ID="HplNombreCompleto" CssClass="Texto" runat="server" Text='<%# Eval("NombreCompleto")%>' NavigateUrl='<%# Eval("CveProspecto", "ProspectosRedes.aspx?CveProspecto={0}")%>'></asp:HyperLink></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Apellido Paterno</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlApellidoPaterno" runat="server" Text='<%# Eval("ApellidoPaterno")%>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Apellido Materno</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlApellidoMaterno" runat="server" Text='<%# Eval("ApellidoMaterno") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Nombres</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlNombres" runat="server" Text='<%# Eval("Nombres")%>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField><HeaderTemplate>F.Nacimiento</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlFechaNacimiento" runat="server" Text='<%# Eval("FechaNacimiento","{0:d}") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField><HeaderTemplate>Superior</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlSuperior" runat="server" Text='<%# Eval("SuperiorNombreCompleto")%>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Lugar Nacimiento</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlLugarNacimiento" runat="server" Text='<%# Eval("LugarNacimiento") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField><HeaderTemplate>Sexo</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlSexo" runat="server" Text='<%# If(Eval("Sexo").ToString <> "",If(Eval("Sexo").ToString="True","H","M"),"")%>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>RFC</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlRFC" runat="server" Text='<%# Eval("RFC") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Nacionalidad</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlNacionalidad" runat="server" Text='<%# Eval("Nacionalidad") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField><HeaderTemplate>Calle</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlCalle" runat="server" Text='<%# Eval("Calle") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField><HeaderTemplate>Número</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlNumero" runat="server" Text='<%# Eval("Numero") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField><HeaderTemplate>Colonia</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlColonia" runat="server" Text='<%# Eval("Colonia") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField><HeaderTemplate>CódigoPostal</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlCodigoPostal" runat="server" Text='<%# Eval("CodigoPostal") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>País</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlPais" runat="server" Text='<%# Eval("Pais") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField><HeaderTemplate>Municipio</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlMunicipio" runat="server" Text='<%# Eval("Municipio") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField><HeaderTemplate>Estado</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estado") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField><HeaderTemplate>Teléfono</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlTelefono" runat="server" Text='<%# Eval("Telefono") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Fax</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlFax" runat="server" Text='<%# Eval("Fax") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField><HeaderTemplate>Correo</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlCorreo" runat="server" Text='<%# Eval("Correo") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField><HeaderTemplate>Celular</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlCorreo" runat="server" Text='<%# Eval("Celular") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>IFE</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlIFE" runat="server" Text='<%# Eval("IFE") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaNombre" runat="server" Text='<%# Eval("EmpresaNombre") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Giro</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaGiro" runat="server" Text='<%# Eval("EmpresaGiro") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Sector</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaSector" runat="server" Text='<%# Eval("EmpresaSector") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Pagina</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaPagina" runat="server" Text='<%# Eval("EmpresaPagina") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Calle</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaCalle" runat="server" Text='<%# Eval("EmpresaCalle") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Número</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaNumero" runat="server" Text='<%# Eval("EmpresaNumero") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Colonia</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaColonia" runat="server" Text='<%# Eval("EmpresaColonia") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa CodigoPostal</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaCodigoPostal" runat="server" Text='<%# Eval("EmpresaCodigoPostal") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Pais</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaPais" runat="server" Text='<%# Eval("EmpresaPais") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Municipio</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaMunicipio" runat="server" Text='<%# Eval("EmpresaMunicipio") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Estado</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaEstado" runat="server" Text='<%# Eval("EmpresaEstado") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Telefono</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaTelefono" runat="server" Text='<%# Eval("EmpresaTelefono") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Fax</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaFax" runat="server" Text='<%# Eval("EmpresaFax") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Correo</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaCorreo" runat="server" Text='<%# Eval("EmpresaCorreo") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Puesto</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaPuesto" runat="server" Text='<%# Eval("EmpresaPuesto") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Empresa Especialidad</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlEmpresaEspecialidad" runat="server" Text='<%# Eval("EmpresaEspecialidad") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
<asp:TemplateField Visible="False"><HeaderTemplate>Fecha Ing</HeaderTemplate><ItemTemplate><asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng","{0:d}") %>'></asp:Literal></ItemTemplate></asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UPPersonalizar" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivPersonalizar" style="width: 185px; background-color: White; border: solid 1px black; color: Black; display: none; position: absolute;">
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<td style="width: 310px"><asp:Label ID="LblTitulo1" runat="server" ClientIDMode="Static" Text="Personalizar Columnas"></asp:Label></td>
<td style="padding-right: 4px; padding-top: 4px" valign="top"><img alt="" src="/Imagenes/close.gif" style="cursor: pointer;" onclick="$('#DivPersonalizar').hide(1000);" /></td>
</tr>
</thead>
<tr align="left">
<td colspan="2">
<table class="table table-striped table-advance table-hover">
<thead>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkNombreCompleto" runat="server" Text="Nombre Completo" Checked="true"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkApellidoPaterno" runat="server" Text="ApellidoPaterno" /></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkApellidoMaterno" runat="server" Text="ApellidoMaterno" /></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkNombres" runat="server" Text="Nombres" /></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkFechaNacimiento" runat="server" Text="FechaNacimiento" Checked="true" /></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkSuperior" runat="server" Text="Superior" Checked="true"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkLugarNacimiento" runat="server" Text="LugarNacimiento"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkSexo" runat="server" Text="Sexo"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkRFC" runat="server" Text="RFC"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkNacionalidad" runat="server" Text="Nacionalidad"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkCalle" runat="server" Text="Calle"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkNumero" runat="server" Text="Número"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkColonia" runat="server" Text="Colonia"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkCodigoPostal" runat="server" Text="CodigoPostal"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkPais" runat="server" Text="Pais"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkMunicipio" runat="server" Text="Municipio" Checked="true" /></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEstado" runat="server" Text="Estado" Checked="true" /></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkTelefono" runat="server" Text="Telefono" Checked="true" /></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkFax" runat="server" Text="Fax"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkCorreo" runat="server" Checked="True" Text="Correo"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkCelular" runat="server" Checked="True" Text="Celular"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaNombre" runat="server" Text="EmpresaNombre" Checked="true" /></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaGiro" runat="server" Text="EmpresaGiro" Checked="true" /></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaSector" runat="server" Text="EmpresaSector"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaPagina" runat="server" Text="EmpresaPagina"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaCalle" runat="server" Text="EmpresaCalle"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaNumero" runat="server" Text="Empresa Número"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaColonia" runat="server" Text="EmpresaColonia"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaCodigoPostal" runat="server" Text="EmpresaCodigoPostal"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaPais" runat="server" Text="EmpresaPais"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaMunicipio" runat="server" Text="EmpresaMunicipio"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaEstado" runat="server" Text="EmpresaEstado"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaTelefono" runat="server" Text="EmpresaTelefono"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaFax" runat="server" Text="EmpresaFax"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaCorreo" runat="server" Text="EmpresaCorreo"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaPuesto" runat="server" Text="EmpresaPuesto"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkEmpresaEspecialidad" runat="server" Text="EmpresaEspecialidad"/></th></tr>
<tr><th style="text-align:left;"><asp:CheckBox ID="ChkFechaIng" runat="server" Text="FechaIngreso"/></th></tr>
</thead>
</table
</td>
</tr>
<tr style="height:25px">
<td colspan="2"><asp:Button ID="BtnPersonalizar" runat="server" Text="Personalizar" class="btn btn-primary"/><input type="button" value="Cancelar" onclick="$('#DivPersonalizar').hide(1000);" class="btn btn-primary"/></td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View 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

View File

@@ -0,0 +1,119 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProspectosEstatus.aspx.vb" Inherits="Prospectos_CatProspectosEstatus" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Estatus de Prospectos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="250px">
<asp:LinkButton ID="LbProspectoEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="ProspectoEstatus" OnClick="LbOrden_Click">
Estatus de Prospecto
<asp:Literal ID="ImgProspectoEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="165px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtProspectoEstatus" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVProspectoEstatus" runat="server" ControlToValidate="TxtProspectoEstatus" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''ProspectoEstatus''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCProspectoEstatus" runat="server" HighlightCssClass="vco" TargetControlID="RFVProspectoEstatus" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveProspectoEstatus" EmptyDataText="No se encontraron Estatus de Prospectos Registrados" ToolTip="Listado de Estatus de Prospectos" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlProspectoEstatus" runat="server" Text='<%# Eval("ProspectoEstatus", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtProspectoEstatus" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("ProspectoEstatus") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVProspectoEstatus" runat="server" ControlToValidate="TxtProspectoEstatus" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''ProspectoEstatus''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCProspectoEstatus" runat="server" HighlightCssClass="vco" TargetControlID="RFVProspectoEstatus" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,167 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatProspectosEstatus
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
''Permiso Registro
'If PermisoRegistro Then
' LbAgregar.Enabled = True
'Else
' LbAgregar.Enabled = False
'End If
End If
End Sub
Public Sub CargaDatos()
Dim ObjProspectosEstatus As New ClsProspectos
If ObjProspectosEstatus.GetProspectosEstatus() Then
ViewState("DTProspectosEstatus") = ObjProspectosEstatus.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEstatus(UsuarioActual.CveEmpresa) = ObjProspectosEstatus.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjProspectosEstatus.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjProspectosEstatus As New ClsProspectos
If ObjProspectosEstatus.AddProspectoEstatus(TxtProspectoEstatus.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtProspectoEstatus.Text = ""
Alert("El nuevo Estatus del Prospecto se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTProspectosEstatus") = ObjProspectosEstatus.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEstatus(UsuarioActual.CveEmpresa) = ObjProspectosEstatus.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjProspectosEstatus.Dispose()
End Sub
#Region "G V D A T O S"
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(250)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(65)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjProspectosEstatus As New ClsProspectos
If ObjProspectosEstatus.RemoveProspectoEstatus(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTProspectosEstatus") = ObjProspectosEstatus.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEstatus(UsuarioActual.CveEmpresa) = ObjProspectosEstatus.DtResultados
Alert("El Estatus del Prospecto se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProspectosEstatus.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjProspectosEstatus As New ClsProspectos
Dim ProspectoEstatus As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtProspectoEstatus"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveProspectoEstatus As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjProspectosEstatus.UpdateProspectoEstatus(ProspectoEstatus, Estatus, CveProspectoEstatus) Then
GvDatos.EditIndex = -1
ViewState("DTProspectosEstatus") = ObjProspectosEstatus.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEstatus(UsuarioActual.CveEmpresa) = ObjProspectosEstatus.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProspectosEstatus.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTProspectosEstatus"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTProspectosEstatus"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,267 @@
<%@ Page Title="Prospectos - Catálogo de Prospectos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProspectosG15.aspx.vb" Inherits="Prospectos_CatProspectosG15" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<img alt="Nuevo Prospecto" onclick="document.location.href='/Prospectos/ProspectosG15.aspx'" src="../Imagenes/Imagenes42/BotonAgregar.png" style="cursor: pointer; height: 22px;" />&nbsp;
<asp:ImageButton ID="ImgExcel" ToolTip="Excel" runat="server" ImageUrl="../Imagenes/Imagenes42/IconoExcel.png" Height="20px" />&nbsp;
<asp:Image ID="ImgPersonalizar" ToolTip="Personalizar Listado" runat="server" ImageUrl="~/Imagenes/Imagenes42/Table-icon.png" Style="cursor: pointer; height: 22px;" />&nbsp;
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Prospectos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline">
<li>Tipo Evento
<asp:DropDownList ID="DdlTipoEvento" runat="server" AppendDataBoundItems="true" DataTextField="EventoTipo" DataValueField="CveEventoTipo" Width="140px" AutoPostBack="True">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Evento
<asp:DropDownList ID="DdlEvento" runat="server" AppendDataBoundItems="true" DataTextField="Evento" DataValueField="CveEvento" Width="140px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Responsable
<asp:DropDownList ID="DdlResponsable" runat="server" AppendDataBoundItems="true" DataTextField="Supervisor" DataValueField="CveSupervisor" Width="140px" AutoPostBack="True">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Promotor
<asp:DropDownList ID="DdlPromotor" runat="server" AppendDataBoundItems="true" DataTextField="Coordinador" DataValueField="CveCoordinador" Width="140px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
<ul class="list-inline">
<li style="width:218px;">F.I.:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:TextBox ID="txtFechaI" runat="server" Width="80px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="imgCalendario" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</li>
<li>F.F.:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:TextBox ID="txtFechaF" runat="server" Width="80px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="imgCalendarioF" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</li>
</ul>
</div>
<div class="tools">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<%-- <asp:LinkButton ID="LnkDatos" runat="server">Datos</asp:LinkButton>
<asp:LinkButton ID="LnkArbol" runat="server">Arbol</asp:LinkButton>--%>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" ToolTip="Listado de Prospectos" Width="100%" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Nombre</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplNombreCompleto" CssClass="Texto" runat="server" Text='<%# Eval("NombreCompleto")%>' NavigateUrl='<%# Eval("CveProspecto", "ProspectosG15.aspx?CveProspecto={0}")%>'></asp:HyperLink></ItemTemplate>
</asp:TemplateField>
<asp:BoundField Visible="False" HeaderText="ApellidoPaterno" DataField="Apellido Paterno" />
<asp:BoundField Visible="False" HeaderText="ApellidoMaterno" DataField="Apellido Materno" />
<asp:BoundField Visible="False" HeaderText="Nombres" DataField="Nombres" />
<asp:BoundField HeaderText="Edad" DataField="Edad" />
<asp:BoundField Visible="False" HeaderText="F. Nacimiento" DataField="FechaNacimiento" DataFormatString="{0:d}" />
<asp:BoundField Visible="False" HeaderText="Lugar Nacimiento" DataField="LugarNacimiento" />
<asp:BoundField Visible="False" HeaderText="Escolaridad" DataField="Escolaridad" />
<asp:BoundField Visible="False" HeaderText="Estado Civil" DataField="EstadoCivil" />
<asp:BoundField HeaderText="Evento" DataField="Evento" />
<asp:BoundField Visible="False" HeaderText="IFE" DataField="IFE" />
<asp:BoundField Visible="False" HeaderText="Sección" DataField="Seccion" DataFormatString="{0:###}" />
<asp:BoundField HeaderText="Responsable" DataField="Supervisor" />
<asp:BoundField HeaderText="Promotor" DataField="Coordinador" />
<asp:BoundField Visible="False" HeaderText="Depend." DataField="Dependientes" />
<asp:BoundField HeaderText="Calle" DataField="Calle" />
<asp:BoundField HeaderText="#" DataField="Numero" />
<asp:BoundField Visible="False" HeaderText="Entre Calles" DataField="EntreCalle1" />
<asp:BoundField HeaderText="Colonia" DataField="Colonia" />
<asp:BoundField HeaderText="Municipio" DataField="Municipio" />
<asp:TemplateField>
<HeaderTemplate>Verificado</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlVerificador" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField Visible="False" HeaderText="Estado" DataField="Estado" />
<asp:BoundField Visible="False" HeaderText="Teléfono" DataField="Telefono" />
<asp:BoundField Visible="False" HeaderText="Celular" DataField="Celular" />
<asp:BoundField Visible="False" HeaderText="Correo" DataField="Correo" />
<asp:BoundField Visible="False" HeaderText="Fecha Ing" DataField="FechaIng" DataFormatString="{0:d}" />
</Columns>
<HeaderStyle CssClass="Titulos" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UPPersonalizar" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivPersonalizar" style="width: 318px; background-color: White; border: solid 1px black; color: Black; display: none; position: absolute;">
<table class="table table-striped table-advance table-hover" style="width: 318px;">
<thead>
<tr class="Titulos">
<th style="width: 200px">
<asp:Label ID="LblTitulo1" runat="server" ClientIDMode="Static" Text="Personalizar Columnas"></asp:Label>
</th>
<th style="padding-right: 4px; padding-top: 4px" valign="top">
<img alt="" src="/Imagenes/close.gif" style="cursor: pointer;" onclick="$('#DivPersonalizar').hide(1000);" />
</th>
</tr>
</thead>
<tr align="left">
<td colspan="2">
<table class="table table-striped table-advance table-hover" style="width: 318px;">
<thead>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkNombreCompleto" runat="server" Text="Nombre Completo" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkApellidoPaterno" runat="server" Text="ApellidoPaterno" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkApellidoMaterno" runat="server" Text="ApellidoMaterno" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkNombres" runat="server" Text="Nombres" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkEdad" runat="server" Text="Edad" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkFechaNacimiento" runat="server" Text="FechaNacimiento" Checked="false" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkLugarNacimiento" runat="server" Text="LugarNacimiento" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkEscolaridad" runat="server" Text="Escolaridad" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkEstadoCivil" runat="server" Text="Estado Civil" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkEvento" runat="server" Text="Evento" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkIFE" runat="server" Text="IFE" Checked="false" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkSeccion" runat="server" Text="Sección" Checked="false" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkResponsable" runat="server" Text="Responsable" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkPromotor" runat="server" Text="Promotor" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkDependientes" runat="server" Text="Dependientes" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkCalle" runat="server" Text="Calle" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkNumero" runat="server" Text="Número" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkEntre" runat="server" Text="Entre Calles" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkColonia" runat="server" Text="Colonia" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkMunicipio" runat="server" Text="Municipio" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkFueAuditado" runat="server" Text="Verificado" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkEstado" runat="server" Text="Estado" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkTelefono" runat="server" Text="Teléfono" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkCelular" runat="server" Text="Celular" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkCorreo" runat="server" Text="Correo" /></th>
</tr>
<tr>
<th style="text-align: left">
<asp:CheckBox ID="ChkFechaIng" runat="server" Text="Fecha Ingreso" /></th>
</tr>
</thead>
</table>
</td>
</tr>
<tr style="height: 25px">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<td colspan="2" style="text-align: center;">
<asp:Button ID="BtnPersonalizar" runat="server" Text="Personalizar" class="btn btn-primary" /><input type="button" value="Cancelar" onclick="$('#DivPersonalizar').hide(1000);" class="btn btn-primary" /></td>
</ContentTemplate>
</asp:UpdatePanel>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,178 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Prospectos_CatProspectosG15
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
DdlTipoEvento.DataSource = GlobalDTProspectosEventosTipo(UsuarioActual.CveEmpresa) : DdlTipoEvento.DataBind()
DdlEvento.DataSource = GlobalDTProspectosEvento(DdlTipoEvento.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) : DdlEvento.DataBind()
DdlResponsable.DataSource = GlobalDTProspectosSupervisores(UsuarioActual.CveEmpresa) : DdlResponsable.DataBind()
DdlPromotor.DataSource = GlobalDTProspectosCoordinadores(DdlResponsable.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) : DdlPromotor.DataBind()
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.GetProspectos(-1, "-1", "-1", DdlTipoEvento.SelectedValue.ToEntero, DdlEvento.SelectedValue.ToEntero, -1, DdlResponsable.SelectedValue.ToEntero, DdlPromotor.SelectedValue.ToEntero, -1, 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()
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()
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(250)
'e.Row.Cells(1).Width = Unit.Pixel(100)
'e.Row.Cells(2).Width = Unit.Pixel(180)
'e.Row.Cells(3).Width = Unit.Pixel(100)
'e.Row.Cells(4).Width = Unit.Pixel(60)
'e.Row.Cells(5).Width = Unit.Pixel(220)
'e.Row.Cells(6).Width = Unit.Pixel(100)
'e.Row.Cells(7).Width = Unit.Pixel(50)
'e.Row.Cells(8).Width = Unit.Pixel(100)
e.Row.Cells(9).Width = Unit.Pixel(150)
'e.Row.Cells(10).Width = Unit.Pixel(100)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
If e.Row.DBCampo("FueAuditado") = "0" Then
e.Row.FCLiteral("LtlVerificador").Text = "Sin verificar"
ElseIf e.Row.DBCampo("FueAuditado") = "1" Then
e.Row.FCLiteral("LtlVerificador").Text = "Verificado Negativo"
ElseIf e.Row.DBCampo("FueAuditado") = "2" Then
e.Row.FCLiteral("LtlVerificador").Text = "Verificado Positivo"
End If
'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 LnkDatos_Click(sender As Object, e As EventArgs) Handles LnkDatos.Click
' PnlDatos.Visible = True
' PnlArbol.Visible = False
'End Sub
'Protected Sub LnkArbol_Click(sender As Object, e As EventArgs) Handles LnkArbol.Click
' PnlDatos.Visible = False
' PnlArbol.Visible = True
'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 = ChkEdad.Checked
GvDatos.Columns(5).Visible = ChkFechaNacimiento.Checked
GvDatos.Columns(6).Visible = ChkLugarNacimiento.Checked
GvDatos.Columns(7).Visible = ChkEscolaridad.Checked
GvDatos.Columns(8).Visible = ChkEstadoCivil.Checked
GvDatos.Columns(9).Visible = ChkEvento.Checked
GvDatos.Columns(10).Visible = ChkIFE.Checked
GvDatos.Columns(11).Visible = ChkSeccion.Checked
GvDatos.Columns(12).Visible = ChkResponsable.Checked
GvDatos.Columns(13).Visible = ChkPromotor.Checked
GvDatos.Columns(14).Visible = ChkDependientes.Checked
GvDatos.Columns(15).Visible = ChkCalle.Checked
GvDatos.Columns(16).Visible = ChkNumero.Checked
GvDatos.Columns(17).Visible = ChkEntre.Checked
GvDatos.Columns(18).Visible = ChkColonia.Checked
GvDatos.Columns(19).Visible = ChkMunicipio.Checked
GvDatos.Columns(20).Visible = ChkFueAuditado.Checked
GvDatos.Columns(21).Visible = ChkEstado.Checked
GvDatos.Columns(22).Visible = ChkTelefono.Checked
GvDatos.Columns(23).Visible = ChkCelular.Checked
GvDatos.Columns(24).Visible = ChkCorreo.Checked
GvDatos.Columns(25).Visible = ChkFechaIng.Checked
UPDatos.Update()
CargaDatos()
End Sub
Protected Sub DdlTipoEvento_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoEvento.SelectedIndexChanged
DdlEvento.Items.Clear()
DdlEvento.Items.Add(New ListItem("Todos", "-1"))
DdlEvento.DataSource = GlobalDTProspectosEvento(DdlTipoEvento.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) : DdlEvento.DataBind()
End Sub
Protected Sub DdlResponsable_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlResponsable.SelectedIndexChanged
DdlPromotor.Items.Clear()
DdlPromotor.Items.Add(New ListItem("Todos", "-1"))
DdlPromotor.DataSource = GlobalDTProspectosCoordinadores(DdlResponsable.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) : DdlPromotor.DataBind()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As ImageClickEventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("Listado")
End Sub
End Class

View File

@@ -0,0 +1,452 @@
<%@ Page Title="Prospectos - Catálogo de Prospectos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProspectosRedes.aspx.vb" Inherits="Prospectos_CatProspectos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<img alt="Nuevo Prospecto" onclick="document.location.href='/Prospectos/ProspectosRedes.aspx'" src="/Imagenes/BotonAgregar.gif" style="cursor: pointer;" />&nbsp;
<%--<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" />--%>
<asp:Image ID="ImgPersonalizar" ToolTip="Personalizar Listado" runat="server" ImageUrl="/Imagenes/Table-icon.png" Style="cursor: pointer; height: 23px;" />&nbsp;
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Prospectos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline">
<li>Clasificación
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" DataTextField="ProspectoClasificacion" DataValueField="CveProspectoClasificacion" Width="100px" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Zona
<asp:DropDownList ID="DdlZona" runat="server" AppendDataBoundItems="true" DataTextField="Supervisor" DataValueField="CveSupervisor" Width="100px" AutoPostBack="True" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Región
<asp:DropDownList ID="DdlRegion" runat="server" AppendDataBoundItems="true" DataTextField="Coordinador" DataValueField="CveCoordinador" Width="100px" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Municipio
<asp:DropDownList ID="DdlMunicipioFiltro" runat="server" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio" Width="100px" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
<ul class="list-inline">
<li>Auditado&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:DropDownList ID="DdlAuditado" runat="server" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio" Width="35px" Class="table-group-action-input form-control input-inline input-small input-sm">
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
<div class="tools">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="portlet-body">
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<%-- <asp:LinkButton ID="LnkDatos" runat="server">Datos</asp:LinkButton>
<asp:LinkButton ID="LnkArbol" runat="server">Arbol</asp:LinkButton>--%>
<asp:Panel ID="PnlDatos" runat="server">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" ToolTip="Listado de Prospectos" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Nombre</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplNombreCompleto" CssClass="Texto" runat="server" Text='<%# Eval("NombreCompleto")%>' NavigateUrl='<%# Eval("CveProspecto", "ProspectosRedes.aspx?CveProspecto={0}")%>'></asp:HyperLink></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Apellido Paterno</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlApellidoPaterno" runat="server" Text='<%# Eval("ApellidoPaterno")%>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Apellido Materno</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlApellidoMaterno" runat="server" Text='<%# Eval("ApellidoMaterno") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Nombres</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombres" runat="server" Text='<%# Eval("Nombres")%>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>F.Nacimiento</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaNacimiento" runat="server" Text='<%# Eval("FechaNacimiento","{0:d}") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Superior</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSuperior" runat="server" Text='<%# Eval("SuperiorNombreCompleto")%>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Lugar Nacimiento</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlLugarNacimiento" runat="server" Text='<%# Eval("LugarNacimiento") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Sexo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSexo" runat="server" Text='<%# If(Eval("Sexo").ToString <> "",If(Eval("Sexo").ToString="True","H","M"),"")%>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>RFC</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlRFC" runat="server" Text='<%# Eval("RFC") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Nacionalidad</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNacionalidad" runat="server" Text='<%# Eval("Nacionalidad") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Calle</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCalle" runat="server" Text='<%# Eval("Calle") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Número</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNumero" runat="server" Text='<%# Eval("Numero") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Colonia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlColonia" runat="server" Text='<%# Eval("Colonia") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>CodigoPostal</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCodigoPostal" runat="server" Text='<%# Eval("CodigoPostal") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Pais</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPais" runat="server" Text='<%# Eval("Pais") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Municipio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMunicipio" runat="server" Text='<%# Eval("Municipio") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Estado</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEstado" runat="server" Text='<%# Eval("Estado") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Telefono</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTelefono" runat="server" Text='<%# Eval("Telefono") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Fax</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFax" runat="server" Text='<%# Eval("Fax") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Correo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCorreo" runat="server" Text='<%# Eval("Correo") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaNombre" runat="server" Text='<%# Eval("EmpresaNombre") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Giro</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaGiro" runat="server" Text='<%# Eval("EmpresaGiro") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Sector</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaSector" runat="server" Text='<%# Eval("EmpresaSector") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Pagina</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaPagina" runat="server" Text='<%# Eval("EmpresaPagina") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Calle</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaCalle" runat="server" Text='<%# Eval("EmpresaCalle") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Número</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaNumero" runat="server" Text='<%# Eval("EmpresaNumero") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Colonia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaColonia" runat="server" Text='<%# Eval("EmpresaColonia") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa CodigoPostal</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaCodigoPostal" runat="server" Text='<%# Eval("EmpresaCodigoPostal") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Pais</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaPais" runat="server" Text='<%# Eval("EmpresaPais") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Municipio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaMunicipio" runat="server" Text='<%# Eval("EmpresaMunicipio") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Estado</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaEstado" runat="server" Text='<%# Eval("EmpresaEstado") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Telefono</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaTelefono" runat="server" Text='<%# Eval("EmpresaTelefono") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Fax</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaFax" runat="server" Text='<%# Eval("EmpresaFax") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Correo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaCorreo" runat="server" Text='<%# Eval("EmpresaCorreo") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Puesto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaPuesto" runat="server" Text='<%# Eval("EmpresaPuesto") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Empresa Especialidad</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresaEspecialidad" runat="server" Text='<%# Eval("EmpresaEspecialidad") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<HeaderTemplate>Fecha Ing</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng","{0:d}") %>'></asp:Literal></ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
</asp:GridView>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UPPersonalizar" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivPersonalizar" style="width: 315px; background-color: White; border: solid 1px black; color: Black; display: none; position: absolute;">
<table style="width: 315px;" class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th style="width: 310px">
<asp:Label ID="LblTitulo1" runat="server" ClientIDMode="Static" Text="Personalizar Columnas"></asp:Label></th>
<th style="padding-right: 4px; padding-top: 4px" valign="top">
<img alt="" src="/Imagenes/close.gif" style="cursor: pointer;" onclick="$('#DivPersonalizar').hide(1000);" /></th>
</tr>
</thead>
<tr align="left">
<th colspan="2">
<table style="width: 315px;" class="table table-striped table-advance table-hover">
<thead>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkNombreCompleto" runat="server" Text="Nombre Completo" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkApellidoPaterno" runat="server" Text="ApellidoPaterno" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkApellidoMaterno" runat="server" Text="ApellidoMaterno" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkNombres" runat="server" Text="Nombres" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkFechaNacimiento" runat="server" Text="FechaNacimiento" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkSuperior" runat="server" Text="Superior" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkLugarNacimiento" runat="server" Text="LugarNacimiento" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkSexo" runat="server" Text="Sexo" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkRFC" runat="server" Text="RFC" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkNacionalidad" runat="server" Text="Nacionalidad" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkCalle" runat="server" Text="Calle" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkNumero" runat="server" Text="Número" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkColonia" runat="server" Text="Colonia" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkCodigoPostal" runat="server" Text="CodigoPostal" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkPais" runat="server" Text="Pais" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkMunicipio" runat="server" Text="Municipio" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEstado" runat="server" Text="Estado" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkTelefono" runat="server" Text="Telefono" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkFax" runat="server" Text="Fax" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkCorreo" runat="server" Text="Correo" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaNombre" runat="server" Text="EmpresaNombre" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaGiro" runat="server" Text="EmpresaGiro" Checked="true" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaSector" runat="server" Text="EmpresaSector" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaPagina" runat="server" Text="EmpresaPagina" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaCalle" runat="server" Text="EmpresaCalle" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaNumero" runat="server" Text="Empresa Número" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaColonia" runat="server" Text="EmpresaColonia" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaCodigoPostal" runat="server" Text="EmpresaCodigoPostal" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaPais" runat="server" Text="EmpresaPais" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaMunicipio" runat="server" Text="EmpresaMunicipio" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaEstado" runat="server" Text="EmpresaEstado" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaTelefono" runat="server" Text="EmpresaTelefono" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaFax" runat="server" Text="EmpresaFax" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaCorreo" runat="server" Text="EmpresaCorreo" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaPuesto" runat="server" Text="EmpresaPuesto" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkEmpresaEspecialidad" runat="server" Text="EmpresaEspecialidad" /></th>
</tr>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="ChkFechaIng" runat="server" Text="FechaIngreso" /></th>
</tr>
</thead>
</table>
</th>
</tr>
<tr style="height: 25px">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<td colspan="2" style="text-align: center;">
<asp:Button ID="BtnPersonalizar" runat="server" Text="Personalizar" class="btn btn-primary" /><input type="button" value="Cancelar" onclick="$('#DivPersonalizar').hide(1000);" class="btn btn-primary" /></td>
</ContentTemplate>
</asp:UpdatePanel>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,332 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Prospectos_CatProspectos
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()
CargaDatos(True)
ImgPersonalizar.Attributes.Add("onclick", "$('#DivPersonalizar').show(1000); PosicionaObjeto(this.id,'DivPersonalizar');")
End If
End Sub
Public Sub CargaDatos(Optional RecargaArbol As Boolean = False)
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetProspectosAgrupados(-1, DdlClasificacion.SelectedValue.ToEntero, DdlZona.SelectedValue.ToEntero, DdlRegion.SelectedValue.ToEntero, _
DdlMunicipioFiltro.SelectedValue.ToEntero, -1, DdlAuditado.SelectedValue.ToEntero, CveProspectoSeleccionado, 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.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.Cells(2).Width = Unit.Pixel(180)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(60)
e.Row.Cells(5).Width = Unit.Pixel(220)
e.Row.Cells(6).Width = Unit.Pixel(100)
e.Row.Cells(7).Width = Unit.Pixel(50)
e.Row.Cells(8).Width = Unit.Pixel(100)
e.Row.Cells(9).Width = Unit.Pixel(100)
e.Row.Cells(10).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 Then
e.Row.Cells(0).Text = e.Row.DBCampo("NombreCompleto") 'String.Format("{0} ({1})", e.Row.DBCampo("NombreCompleto"), e.Row.DBCampo("NumSupervisores"))
e.Row.Cells(4).Text = e.Row.DBCampo("NumSupervisores")
e.Row.Cells(4).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 Then
e.Row.Cells(0).Text = e.Row.DBCampo("NombreCompleto") 'String.Format("{0} ({1})", e.Row.DBCampo("NombreCompleto"), e.Row.DBCampo("NumCoordinadores"))
e.Row.Cells(4).Text = e.Row.DBCampo("NumCoordinadores")
e.Row.Cells(4).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
If ChkNombreCompleto.Checked Then
GvDatos.Columns(0).Visible = True
Else
GvDatos.Columns(0).Visible = False
End If
If ChkApellidoPaterno.Checked Then
GvDatos.Columns(1).Visible = True
Else
GvDatos.Columns(1).Visible = False
End If
If ChkApellidoMaterno.Checked Then
GvDatos.Columns(2).Visible = True
Else
GvDatos.Columns(2).Visible = False
End If
If ChkNombres.Checked Then
GvDatos.Columns(3).Visible = True
Else
GvDatos.Columns(3).Visible = False
End If
If ChkFechaNacimiento.Checked Then
GvDatos.Columns(4).Visible = True
Else
GvDatos.Columns(4).Visible = False
End If
If Chksuperior.Checked Then
GvDatos.Columns(5).Visible = True
Else
GvDatos.Columns(5).Visible = False
End If
If ChkLugarNacimiento.Checked Then
GvDatos.Columns(6).Visible = True
Else
GvDatos.Columns(6).Visible = False
End If
If ChkSexo.Checked Then
GvDatos.Columns(7).Visible = True
Else
GvDatos.Columns(7).Visible = False
End If
If ChkRFC.Checked Then
GvDatos.Columns(8).Visible = True
Else
GvDatos.Columns(8).Visible = False
End If
If ChkNacionalidad.Checked Then
GvDatos.Columns(9).Visible = True
Else
GvDatos.Columns(9).Visible = False
End If
If ChkCalle.Checked Then
GvDatos.Columns(10).Visible = True
Else
GvDatos.Columns(10).Visible = False
End If
If ChkNumero.Checked Then
GvDatos.Columns(11).Visible = True
Else
GvDatos.Columns(11).Visible = False
End If
If ChkColonia.Checked Then
GvDatos.Columns(12).Visible = True
Else
GvDatos.Columns(12).Visible = False
End If
If ChkCodigoPostal.Checked Then
GvDatos.Columns(13).Visible = True
Else
GvDatos.Columns(13).Visible = False
End If
If ChkPais.Checked Then
GvDatos.Columns(14).Visible = True
Else
GvDatos.Columns(14).Visible = False
End If
If ChkMunicipio.Checked Then
GvDatos.Columns(15).Visible = True
Else
GvDatos.Columns(15).Visible = False
End If
If ChkEstado.Checked Then
GvDatos.Columns(16).Visible = True
Else
GvDatos.Columns(16).Visible = False
End If
If ChkTelefono.Checked Then
GvDatos.Columns(17).Visible = True
Else
GvDatos.Columns(17).Visible = False
End If
If ChkFax.Checked Then
GvDatos.Columns(18).Visible = True
Else
GvDatos.Columns(18).Visible = False
End If
If ChkCorreo.Checked Then
GvDatos.Columns(19).Visible = True
Else
GvDatos.Columns(19).Visible = False
End If
If ChkEmpresaNombre.Checked Then
GvDatos.Columns(20).Visible = True
Else
GvDatos.Columns(20).Visible = False
End If
If ChkEmpresaGiro.Checked Then
GvDatos.Columns(21).Visible = True
Else
GvDatos.Columns(21).Visible = False
End If
If ChkEmpresaSector.Checked Then
GvDatos.Columns(22).Visible = True
Else
GvDatos.Columns(22).Visible = False
End If
If ChkEmpresaPagina.Checked Then
GvDatos.Columns(23).Visible = True
Else
GvDatos.Columns(23).Visible = False
End If
If ChkEmpresaCalle.Checked Then
GvDatos.Columns(24).Visible = True
Else
GvDatos.Columns(24).Visible = False
End If
If ChkEmpresaNumero.Checked Then
GvDatos.Columns(25).Visible = True
Else
GvDatos.Columns(25).Visible = False
End If
If ChkEmpresaColonia.Checked Then
GvDatos.Columns(26).Visible = True
Else
GvDatos.Columns(26).Visible = False
End If
If ChkEmpresaCodigoPostal.Checked Then
GvDatos.Columns(27).Visible = True
Else
GvDatos.Columns(27).Visible = False
End If
If ChkEmpresaPais.Checked Then
GvDatos.Columns(28).Visible = True
Else
GvDatos.Columns(28).Visible = False
End If
If ChkEmpresaMunicipio.Checked Then
GvDatos.Columns(29).Visible = True
Else
GvDatos.Columns(29).Visible = False
End If
If ChkEmpresaEstado.Checked Then
GvDatos.Columns(30).Visible = True
Else
GvDatos.Columns(30).Visible = False
End If
If ChkEmpresaTelefono.Checked Then
GvDatos.Columns(31).Visible = True
Else
GvDatos.Columns(31).Visible = False
End If
If ChkEmpresaFax.Checked Then
GvDatos.Columns(32).Visible = True
Else
GvDatos.Columns(32).Visible = False
End If
If ChkEmpresaCorreo.Checked Then
GvDatos.Columns(33).Visible = True
Else
GvDatos.Columns(33).Visible = False
End If
If ChkEmpresaPuesto.Checked Then
GvDatos.Columns(34).Visible = True
Else
GvDatos.Columns(34).Visible = False
End If
If ChkEmpresaEspecialidad.Checked Then
GvDatos.Columns(35).Visible = True
Else
GvDatos.Columns(35).Visible = False
End If
If ChkFechaIng.Checked Then
GvDatos.Columns(36).Visible = True
Else
GvDatos.Columns(36).Visible = False
End If
UPDatos.Update()
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

View File

@@ -0,0 +1,133 @@
<%@ Page Title="Prospectos - Catálogo de Prospectos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProspectosRedesMetas.aspx.vb" Inherits="Prospectos_CatProspectosRedesMetas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Metas
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline">
<li>Clasificación
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" DataTextField="ProspectoClasificacion" DataValueField="CveProspectoClasificacion" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Zona&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:DropDownList ID="DdlZona" runat="server" AppendDataBoundItems="true" DataTextField="Supervisor" DataValueField="CveSupervisor" Width="100px" AutoPostBack="True">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Región
<asp:DropDownList ID="DdlRegion" runat="server" AppendDataBoundItems="true" DataTextField="Coordinador" DataValueField="CveCoordinador" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Municipio&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:DropDownList ID="DdlMunicipioFiltro" runat="server" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Auditado&nbsp;&nbsp;&nbsp;
<asp:DropDownList ID="DdlAuditado" runat="server" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio" Width="100px">
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:DropDownList>
</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
</li>
</ul>
<ul class="list-inline">
<li>Escolaridad &nbsp;
<asp:DropDownList ID="DdlEscolaridad" runat="server" AppendDataBoundItems="true" DataTextField="Escolaridad" DataValueField="CveEscolaridad" Width="100px">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Con Padrón
<asp:DropDownList ID="DdlIFE" runat="server" AppendDataBoundItems="true" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Con Padrón" Value="1"></asp:ListItem>
<asp:ListItem Text="Sin Padrón" Value="0"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Sexo&nbsp;&nbsp;&nbsp;&nbsp;
<asp:DropDownList ID="DdlSexo" runat="server" AppendDataBoundItems="true" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Masculino" Value="1"></asp:ListItem>
<asp:ListItem Text="Femenino" Value="0"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Simpatizante
<asp:DropDownList ID="DdlSimpatizante" runat="server" AppendDataBoundItems="true" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Simpatizante" Value="1"></asp:ListItem>
<asp:ListItem Text="No Simpatizante" Value="0"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Agrupador
<asp:DropDownList ID="DdlAgrupador" runat="server" Width="100px">
<asp:ListItem Text="Clasificacion" Value="1"></asp:ListItem>
<asp:ListItem Text="Escolaridad" Value="2"></asp:ListItem>
<asp:ListItem Text="Mes" Value="2" Enabled="false"></asp:ListItem>
<asp:ListItem Text="Municipio" Value="3"></asp:ListItem>
<asp:ListItem Text="Fecha" Value="4" Enabled="false"></asp:ListItem>
<asp:ListItem Text="Auditado" Value="6"></asp:ListItem>
<asp:ListItem Text="IFE" Value="7"></asp:ListItem>
<asp:ListItem Text="Sexo" Value="8"></asp:ListItem>
<asp:ListItem Text="Edades" Value="9"></asp:ListItem>
<asp:ListItem Text="Meses (Ingreso)" Value="10"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<%-- <asp:LinkButton ID="LnkDatos" runat="server">Datos</asp:LinkButton>
<asp:LinkButton ID="LnkArbol" runat="server">Arbol</asp:LinkButton>--%>
<asp:Panel ID="PnlDatos" runat="server">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:BoundField DataField="Agrupador" HeaderText="Agrupador" ItemStyle-HorizontalAlign="Center">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:HyperLinkField DataNavigateUrlFields="CveSupervisor,CveCoordinador,CveMunicipio,CveProspectoClasificacion,Auditado" DataNavigateUrlFormatString="/Prospectos/CatProspectosDetalle.aspx?CveSupervisor={0}&CveCoordinador={1}&CveMunicipio={2}&CveProspectoClasificacion={3}&Auditado={4}" DataTextField="NumSupervisores" HeaderText="Simpatizantes">
<ControlStyle CssClass="Texto" />
<ItemStyle HorizontalAlign="Center" />
</asp:HyperLinkField>
<asp:BoundField DataField="Meta" HeaderText="Meta" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:N0}">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField HeaderText="Avance" ItemStyle-HorizontalAlign="Center">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
</Columns>
<HeaderStyle CssClass="Titulos" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
</asp:GridView>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,130 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Prospectos_CatProspectosRedesMetas
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()
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetProspectosAgrupadosMetas(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
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()
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(450)
e.Row.Cells(1).Width = Unit.Pixel(80)
e.Row.Cells(2).Width = Unit.Pixel(80)
e.Row.Cells(3).Width = Unit.Pixel(80)
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") = "" And e.Row.DBCampo("MesAnioIng") = "-1") Then
Dim TotalMetas As Integer = CType(GvDatos.DataSource, DataTable).SUM("Meta", "CveSupervisor=" & e.Row.DBCampo("CveSupervisor")).ToEntero
e.Row.Cells(3).Text = String.Format("{0}%", (e.Row.DBCampo("NumSupervisores").ToDouble / TotalMetas * 100).FormatoNumero)
e.Row.Cells(2).Text = TotalMetas.ToString.FormatoNumero(0)
'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") = "" And e.Row.DBCampo("MesAnioIng") = "-1") Then
e.Row.Cells(3).Text = String.Format("{0}%", (e.Row.DBCampo("NumSupervisores").ToDouble / e.Row.DBCampo("Meta").ToDouble * 100).FormatoNumero)
'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 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

View File

@@ -0,0 +1,146 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProspectosSeguimiento.aspx.vb" Inherits="Prospectos_CatProspectosSeguimiento" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Seguimiento
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="250px">
<asp:LinkButton ID="LbBitacora" runat="server" CausesValidation="false" Text="" CommandArgument="Bitacora" OnClick="LbOrden_Click">
Bitácora
<asp:Literal ID="ImgBitacora" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="120px">
<asp:LinkButton ID="LbEsAgenda" runat="server" CausesValidation="false" Text="" CommandArgument="EsAgenda" OnClick="LbOrden_Click">
EsAgenda
<asp:Literal ID="ImgEsAgenda" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaAgenda" runat="server" CausesValidation="false" Text="" CommandArgument="FechaAgenda" OnClick="LbOrden_Click">
Fecha Agenda
<asp:Literal ID="ImgFechaAgenda" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="165px">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtBitacora" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVBitacora" runat="server" ControlToValidate="TxtBitacora" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Bitacora''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCBitacora" runat="server" HighlightCssClass="vco" TargetControlID="RFVBitacora" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align: center">
<asp:TextBox ID="TxtFechaAgenda" runat="server" MaxLength="10" Width="74px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaAgenda2" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaAgenda" runat="server" TargetControlID="TxtFechaAgenda" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaAgenda" TargetControlID="TxtFechaAgenda" PopupButtonID="ImgFechaAgenda2" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaAgenda" runat="server" ControlToValidate="TxtFechaAgenda" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Agenda''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaAgenda" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaAgenda" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveDepartamento" EmptyDataText="No se encontraron Seguimientos Registrados" ToolTip="Listado de Seguimiento" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlBitacora" runat="server" Text='<%# Eval("Bitacora", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtBitacora" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Bitacora") %>' ValidationGroup="GrpGV" Width="234px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVBitacora" runat="server" ControlToValidate="TxtBitacora" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Bitacora''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCBitacora" runat="server" HighlightCssClass="vco" TargetControlID="RFVBitacora" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEsAgenda" runat="server" Text='<%# Eval("EsAgenda") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEsAgenda" runat="server" Checked='<%# If (Eval("EsAgenda").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaAgenda" runat="server" Text='<%# Eval("FechaAgenda", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtFechaAgenda" runat="server" MaxLength="10" Width="74px" Text='<%# Eval("FechaAgenda", "{0:d}") %>'></asp:TextBox>&nbsp;
<asp:ImageButton runat="server" ID="ImgFechaAgenda" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaAgenda" runat="server" TargetControlID="TxtFechaAgenda" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaAgenda" TargetControlID="TxtFechaAgenda" PopupButtonID="ImgFechaAgenda" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaAgenda" runat="server" ControlToValidate="TxtFechaAgenda" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Agenda''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEditGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaAgenda" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaAgenda" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpGV" />
&nbsp;<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,161 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatProspectosSeguimiento
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjProspectosSeguimiento As New ClsProspectos
If ObjProspectosSeguimiento.GetProspectosSeguimiento(-1) Then
ViewState("DTProspectosSeguimiento") = ObjProspectosSeguimiento.DtResultados
' GlobalDTProspectosSeguimiento = ObjProspectosSeguimiento.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjProspectosSeguimiento.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
'Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
' Dim ObjProspectosSeguimiento As New ClsRH
' If ObjProspectosSeguimiento.AddDepartamento(TxtDepartamento.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
' TxtDepartamento.Text = ""
' Alert("El nuevo Departamento se guardó correctamente.", TipoMensaje.MsgInformacion)
' UpTitulos.Update()
' ViewState("DTProspectosSeguimiento") = ObjProspectosSeguimiento.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
' GlobalDTProspectos = ObjProspectosSeguimiento.DtResultados
' If ViewState("Orden").ToString() <> String.Empty Then
' CargaGrid(ViewState("Orden").ToString())
' Else
' CargaGrid("")
' End If
' End If
' ObjProspectosSeguimiento.Dispose()
'End Sub
#Region "G V D A T O S"
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(250)
e.Row.Cells(1).Width = Unit.Pixel(120)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(100)
e.Row.Cells(7).Width = Unit.Pixel(65)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjProspectosSeguimiento As New ClsRH
If ObjProspectosSeguimiento.RemoveDepartamento(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTProspectosSeguimiento") = ObjProspectosSeguimiento.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
'GlobalDTProspectosSeguimeinto = ObjProspectosSeguimiento.DtResultados
Alert("El Departamento se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProspectosSeguimiento.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjProspectosSeguimiento As New ClsRH
Dim Departamento As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtDepartamento"), TextBox).Text.Trim
Dim EsAgenda As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsAgenda").Checked
Dim CveSeguimiento As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjProspectosSeguimiento.UpdateDepartamento(Departamento, EsAgenda, CveSeguimiento) Then
GvDatos.EditIndex = -1
ViewState("DTProspectosSeguimiento") = ObjProspectosSeguimiento.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
'GlobalDTProspectosSeguimiento = ObjProspectosSeguimiento.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProspectosSeguimiento.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTProspectosSeguimiento"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTProspectosSeguimiento"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,124 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProspectosTipos.aspx.vb" Inherits="Prospectos_CatProspectosTipos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Tipos de Prospectos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="250px">
<asp:LinkButton ID="LbProspectoTipo" runat="server" CausesValidation="false" Text="" CommandArgument="ProspectoTipo" OnClick="LbOrden_Click">
ProspectoTipo
<asp:Literal ID="ImgProspectoTipo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="119">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtProspectoTipo" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="240px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVProspectoTipo" runat="server" ControlToValidate="TxtProspectoTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Prospecto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCProspectoTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVProspectoTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveProspectoTipo" EmptyDataText="No se encontraron Tipos de Prospectos Registrados" ToolTip="Listado de Tipos de Prospectos" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlProspectoTipo" runat="server" Text='<%# Eval("ProspectoTipo", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtProspectoTipo" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("ProspectoTipo") %>' ValidationGroup="GrpGV" Width="240px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVProspectoTipo" runat="server" ControlToValidate="TxtProspectoTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Prospecto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCProspectoTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVProspectoTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script language="javascript" type="text/javascript">
function C() {
return confirm('¿Está seguro que desea eliminar el Tipo de Prospecto?');
}
</script>
</asp:Content>

View File

@@ -0,0 +1,185 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatProspectosTipos
Inherits ClsPaginas
Public Property PuedeEditar As Boolean
Get
Return CBool(ViewState("PuedeEditar"))
End Get
Set(value As Boolean)
ViewState("PuedeEditar") = value
End Set
End Property
Public Property PuedeEliminar As Boolean
Get
Return CBool(ViewState("PuedeEditar"))
End Get
Set(value As Boolean)
ViewState("PuedeEditar") = 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") = ""
CargaDatos()
''Permiso Registro
'If PermisoRegistro Then
' LbAgregar.Enabled = True
'Else
' LbAgregar.Enabled = False
'End If
End If
End Sub
Public Sub CargaDatos()
Dim ObjProspectosTipos As New ClsProspectos
If ObjProspectosTipos.GetProspectoTipos() Then
ViewState("DTProspectoTipos") = ObjProspectosTipos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosTipos(UsuarioActual.CveEmpresa) = ObjProspectosTipos.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjProspectosTipos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjProspectosTipos As New ClsProspectos
If ObjProspectosTipos.AddProspectoTipo(TxtProspectoTipo.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtProspectoTipo.Text = ""
Alert("El nuevo Tipo de Prospecto se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTProspectoTipos") = ObjProspectosTipos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosTipos(UsuarioActual.CveEmpresa) = ObjProspectosTipos.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjProspectosTipos.Dispose()
End Sub
#Region "G V D A T O S"
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(250)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(53)
e.Row.Cells(5).Width = Unit.Pixel(68)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjProspectosTipos As New ClsProspectos
If ObjProspectosTipos.RemoveProspectoTipo(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTProspectoTipos") = ObjProspectosTipos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosTipos(UsuarioActual.CveEmpresa) = ObjProspectosTipos.DtResultados
Alert("El Tipo de Prospecto se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProspectosTipos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjProspectosTipos As New ClsProspectos
Dim ProspectoTipo As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtProspectoTipo"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveProspectoTipo As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjProspectosTipos.UpdateProspectoTipo(ProspectoTipo, Estatus, CveProspectoTipo) Then
GvDatos.EditIndex = -1
ViewState("DTProspectoTipos") = ObjProspectosTipos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosTipos(UsuarioActual.CveEmpresa) = ObjProspectosTipos.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProspectosTipos.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTProspectoTipos"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTProspectoTipos"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,124 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatResponsables.aspx.vb" Inherits="Prospectos_CatSupervisores" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Responsables
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="250px">
<asp:LinkButton ID="LbSupervisor" runat="server" CausesValidation="false" Text="" CommandArgument="Supervisor" OnClick="LbOrden_Click">
Responsable
<asp:Literal ID="ImgSupervisor" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="119">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtSupervisor" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="240px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVSupervisor" runat="server" ControlToValidate="TxtSupervisor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Responsable''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCSupervisor" runat="server" HighlightCssClass="vco" TargetControlID="RFVSupervisor" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveSupervisor" EmptyDataText="No se encontraron Responsables Registrados" ToolTip="Listado de Responsables" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:Literal ID="LtlSupervisor" runat="server" Text='<%# Eval("Supervisor", "{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtSupervisor" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Supervisor") %>' ValidationGroup="GrpGV" Width="240px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVSupervisor" runat="server" ControlToValidate="TxtSupervisor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Responsable''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCSupervisor" runat="server" HighlightCssClass="vco" TargetControlID="RFVSupervisor" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-CssClass="Usuario">
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script language="javascript" type="text/javascript">
function C() {
return confirm('¿Está seguro que desea eliminar el Responsable?');
}
</script>
</asp:Content>

View File

@@ -0,0 +1,163 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatSupervisores
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjSupervisor As New ClsProspectos
If ObjSupervisor.GetSupervisores(-1) Then
ViewState("DTSupervisor") = ObjSupervisor.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosSupervisores(-1) = ObjSupervisor.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjSupervisor.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjSupervisor As New ClsProspectos
If ObjSupervisor.AddSupervisor(TxtSupervisor.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtSupervisor.Text = ""
Alert("El nuevo Supervisor se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTSupervisor") = ObjSupervisor.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosSupervisores(-1) = ObjSupervisor.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjSupervisor.Dispose()
End Sub
#Region "G V D A T O S"
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(250)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(53)
e.Row.Cells(5).Width = Unit.Pixel(68)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjSupervisor As New ClsProspectos
If ObjSupervisor.RemoveSupervisor(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTSupervisor") = ObjSupervisor.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosSupervisores(-1) = ObjSupervisor.DtResultados
Alert("El Supervisor se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjSupervisor.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjSupervisor As New ClsProspectos
Dim Supervisor As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtSupervisor"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveSupervisor As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjSupervisor.UpdateSupervisor(Supervisor, Estatus, CveSupervisor) Then
GvDatos.EditIndex = -1
ViewState("DTSupervisor") = ObjSupervisor.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosSupervisores(-1) = ObjSupervisor.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjSupervisor.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTSupervisor"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTSupervisor"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,124 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatSupervisores.aspx.vb" Inherits="Prospectos_CatSupervisores" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Supervisores
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="table table-striped table-advance table-hover">
<thead>
<tr class="Titulos">
<th width="250px">
<asp:LinkButton ID="LbSupervisor" runat="server" CausesValidation="false" Text="" CommandArgument="Supervisor" OnClick="LbOrden_Click">
Supervisor
<asp:Literal ID="ImgSupervisor" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="" CommandArgument="Estatus" OnClick="LbOrden_Click">
Estatus
<asp:Literal ID="ImgEstatus" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" CommandArgument="FechaIng" OnClick="LbOrden_Click">
Fecha Ing.
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="100px">
<asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="" CommandArgument="Usuario" OnClick="LbOrden_Click">
Usuario
<asp:Literal ID="ImgUsuario" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</th>
<th width="119">Comandos</th>
</tr>
</thead>
<tr>
<td style="text-align: center">
<asp:TextBox ID="TxtSupervisor" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="240px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVSupervisor" runat="server" ControlToValidate="TxtSupervisor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Supervisor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCSupervisor" runat="server" HighlightCssClass="vco" TargetControlID="RFVSupervisor" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align: center">
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveSupervisor" EmptyDataText="No se encontraron Supervisor Registrados" ToolTip="Listado de Supervisor" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSupervisor" runat="server" Text='<%# Eval("Supervisor", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtSupervisor" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Supervisor") %>' ValidationGroup="GrpGV" Width="240px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVSupervisor" runat="server" ControlToValidate="TxtSupervisor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Supervisor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGV"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCSupervisor" runat="server" HighlightCssClass="vco" TargetControlID="RFVSupervisor" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script language="javascript" type="text/javascript">
function C() {
return confirm('¿Está seguro que desea eliminar el Supervisor?');
}
</script>
</asp:Content>

View File

@@ -0,0 +1,161 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_CatSupervisores
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjSupervisor As New ClsProspectos
If ObjSupervisor.GetSupervisores(-1) Then
ViewState("DTSupervisor") = ObjSupervisor.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosSupervisores(-1) = ObjSupervisor.DtResultados
Else
Me.GvDatos.DataSource = Nothing
End If
ObjSupervisor.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjSupervisor As New ClsProspectos
If ObjSupervisor.AddSupervisor(TxtSupervisor.Text.Trim, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtSupervisor.Text = ""
Alert("El nuevo Supervisor se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTSupervisor") = ObjSupervisor.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosSupervisores(-1) = ObjSupervisor.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ObjSupervisor.Dispose()
End Sub
#Region "G V D A T O S"
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(250)
e.Row.Cells(1).Width = Unit.Pixel(100)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(53)
e.Row.Cells(5).Width = Unit.Pixel(68)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
Dim ObjSupervisor As New ClsProspectos
If ObjSupervisor.RemoveSupervisor(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1
ViewState("DTSupervisor") = ObjSupervisor.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosSupervisores(-1) = ObjSupervisor.DtResultados
Alert("El Supervisor se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjSupervisor.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatos.RowCancelingEdit
GvDatos.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating
Dim ObjSupervisor As New ClsProspectos
Dim Supervisor As String = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtSupervisor"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveSupervisor As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjSupervisor.UpdateSupervisor(Supervisor, Estatus, CveSupervisor) Then
GvDatos.EditIndex = -1
ViewState("DTSupervisor") = ObjSupervisor.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosSupervisores(-1) = ObjSupervisor.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjSupervisor.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing
GvDatos.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
#End Region
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTSupervisor"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTSupervisor"), DataTable)
End If
GvDatos.DataBind()
UpDatos.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,34 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="EncuestaResultados.aspx.vb" Inherits="Prospectos_EncuestaResultados" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="table table-striped table-advance table-hover" style="margin-top:-10px; text-align:center;" GridLines="None" >
<Columns>
<asp:BoundField />
<asp:BoundField DataField="NombreCompleto" HeaderText="Encuestado" />
<asp:BoundField DataField="Sexo" HeaderText="Sexo" />
<asp:BoundField DataField="EncuestaEstatus" HeaderText="Estatus" />
<asp:BoundField DataField="P1" HeaderText="1. Podemos" />
<asp:BoundField DataField="P2" HeaderText="2. Cuenta" />
<asp:BoundField DataField="P3" HeaderText="3." />
<asp:BoundField DataField="P4" HeaderText="4." />
<asp:BoundField DataField="P5" HeaderText="5." />
<asp:BoundField DataField="P6" HeaderText="6." />
<asp:BoundField DataField="P7" HeaderText="7." />
<asp:BoundField DataField="P8" HeaderText="8." />
<asp:BoundField DataField="P9" HeaderText="9" />
<asp:BoundField DataField="P10" HeaderText="10." />
</Columns>
</asp:GridView>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,7 @@

Partial Class Prospectos_EncuestaResultados
Inherits ClsPaginas
End Class

View File

@@ -0,0 +1,455 @@
<%@ Page Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatEncuestas.aspx.vb" Inherits="Prospectos_Encuestas_CatEncuestas" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
Catálogo de Encuestas
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<script language="javascript" type="text/javascript">
function C() {
return confirm('¿Está seguro que lo Desea Eliminar?');
}
</script>
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" Width="100%">
<ajax:TabPanel ID="TabEncunestas" runat="server" HeaderText="Encuestas">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<div>
<table border="1" rules="all" style="border-collapse: collapse;">
<tr class="Titulos">
<td width="250px"><asp:LinkButton ID="LbEncuesta" runat="server" CausesValidation="false" Text="Encuesta"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEncuesta" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="250px"><asp:LinkButton ID="LbEncuestaTipo" runat="server" CausesValidation="false" Text="Tipo Encuesta"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEncuestaTipo" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbEstatus" runat="server" CausesValidation="false" Text="Estatus"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEstatus" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="FechaIng"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgFechaIng" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbUsuario" runat="server" CausesValidation="false" Text="Usuario"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgUsuario" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="103">Comandos</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtEncuesta" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardar" Width="244px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVEncuesta" runat="server" ControlToValidate="TxtEncuesta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Encuesta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEncuesta" runat="server" HighlightCssClass="vco" TargetControlID="RFVEncuesta" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:DropDownList ID="DdlEncuestaTipo" runat="server" AppendDataBoundItems="true" DataValueField="CveEncuestaTipo" DataTextField="EncuestaTipo" ValidationGroup="GrpGuardar" Width="200px">
<%--<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>--%>
<asp:ListItem Text="Manual(Papel)" Value="0"></asp:ListItem>
<asp:ListItem Text="CallCenter" Value="1"></asp:ListItem>
<asp:ListItem Text="Web" Value="2"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVEncuestaTipo" runat="server" ControlToValidate="DdlEncuestaTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Encuesta Tipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOEEncuestaTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVEncuestaTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>
<asp:LinkButton ID="LbAgregar" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardar"></asp:LinkButton>
</td>
</tr>
</table>
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosEncuesta" runat="server" AutoGenerateColumns="False" DataKeyNames="CveEncuesta" EmptyDataText="No se encontraron Encuestas Registrados" ToolTip="Listado de Encuestas">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEncuesta" runat="server" Text='<%# Eval("Encuesta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtEncuesta" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Encuesta") %>' ValidationGroup="GrpGuardar" Width="244px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtEncuesta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Encuesta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEncuestaTipo" runat="server" Text='<%# Eval("EncuestaTipo", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlEncuestaTipo" runat="server" DataValueField="CveEncuestaTipo" DataTextField="EncuestaTipo" Width="200px">
<asp:ListItem Text="Manual(Papel)" Value="0"></asp:ListItem>
<asp:ListItem Text="CallCenter" Value="1"></asp:ListItem>
<asp:ListItem Text="Web" Value="2"></asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabEncuestasPreguntas" runat="server" HeaderText="Encuestas Preguntas">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<div>
<table border="1" rules="all" style="border-collapse: collapse;">
<tr class="Titulos">
<td width="190px"><asp:LinkButton ID="LbPreguntaA" runat="server" CausesValidation="false" Text="Pregunta"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgPreguntaA" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="60px"><asp:LinkButton ID="LbOrdenA" runat="server" CausesValidation="false" Text="Orden"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgOrdenA" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"> <asp:LinkButton ID="LbEncuestaA" runat="server" CausesValidation="false" Text="Encuesta"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEncuestaA" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"> <asp:LinkButton ID="LbPreguntaTipoA" runat="server" CausesValidation="false" Text="Tipo Pregunta"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgPreguntaTipoA" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"> <asp:LinkButton ID="LbPiedePreguntaA" runat="server" CausesValidation="false" Text="Pie Pregunta"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgPiedePreguntaA" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"> <asp:LinkButton ID="LbEstatusA" runat="server" CausesValidation="false" Text="Estatus"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEstatusA" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"> <asp:LinkButton ID="LbFechaIngA" runat="server" CausesValidation="false" Text="Fecha Ing"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgFechaIngA" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbUsuarioA" runat="server" CausesValidation="false" Text="Usuario"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgUsuarioA" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="103">Comandos</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtPreguntaA" runat="server" CausesValidation="true" MaxLength="250" ValidationGroup="GrpGuardara" Width="175px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPreguntaA" runat="server" ControlToValidate="TxtPreguntaA" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardara"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCPreguntaA" runat="server" HighlightCssClass="vco" TargetControlID="RFVPreguntaA" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtOrdenA" runat="server" CausesValidation="true" MaxLength="2" ValidationGroup="GrpGuardara" Width="50px"></asp:TextBox>
</td>
<td>
<asp:DropDownList ID="DdlEncuesta" runat="server" AppendDataBoundItems="true" DataValueField="CveEncuesta" DataTextField="Encuesta" ValidationGroup="GrpGuardara" Width="90px">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVEncuestaA" runat="server" ControlToValidate="DdlEncuesta" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Encuesta''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardara"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOEncuestaA" runat="server" HighlightCssClass="vco" TargetControlID="RFVEncuestaA" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:DropDownList ID="DDlPreguntaTipoA" runat="server" AppendDataBoundItems="true" DataValueField="PreguntaTipo" ValidationGroup="GrpGuardara" Width="100px">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Texto" Value="0"></asp:ListItem>
<asp:ListItem Text="Listado" Value="1"></asp:ListItem>
<asp:ListItem Text="Opciones" Value="2"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="TxtPiedePreguntaA" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpGuardara" Width="90px"></asp:TextBox>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>
<asp:LinkButton ID="LbAgregarEncuestaPegunta" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardara"></asp:LinkButton>
</td>
</tr>
</table>
<asp:UpdatePanel ID="UpDatosEncuestasPreguntas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosPregunta" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePregunta" EmptyDataText="No se encontraron Preguntas Registrados" ToolTip="Listado de Preguntas">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPregunta" runat="server" Text='<%# Eval("Pregunta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtPreguntaA" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Pregunta") %>' ValidationGroup="GrpGuardara" Width="175px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPreguntaA" runat="server" ControlToValidate="TxtPreguntaA" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardara"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOEPreguntaA" runat="server" HighlightCssClass="vco" TargetControlID="RFVPreguntaA" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlOrdenA" runat="server" Text='<%# Eval("Orden", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtOrdenA" runat="server" CausesValidation="true" MaxLength="2" Text='<%# Eval("Orden") %>' ValidationGroup="GrpGuardara" Width="52px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEncuesta" runat="server" Text='<%# Eval("Encuesta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlEncuesta" runat="server" DataValueField="CveEncuesta" DataTextField="Encuesta" Width="90px"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPreguntaTipoA" runat="server" Text='<%# Eval("PreguntaTipoTexto", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DDlPreguntaTipoA" runat="server" AppendDataBoundItems="true" DataValueField="PreguntaTipo" ValidationGroup="GrpGuardara" Width="100px">
<asp:ListItem Text="Texto" Value="0"></asp:ListItem>
<asp:ListItem Text="Listado" Value="1"></asp:ListItem>
<asp:ListItem Text="Opciones" Value="2"></asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPiedePreguntaA" runat="server" Text='<%# Eval("PiedePregunta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtPiedePreguntaA" runat="server" CausesValidation="true" MaxLength="2" Text='<%# Eval("PiedePregunta") %>' ValidationGroup="GrpGuardara" Width="90px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabEncuestasPreguntasRespuestas" runat="server" HeaderText="Encuestas Preguntas - Respuestas">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<div>
<table border="1" rules="all" style="border-collapse: collapse;">
<tr class="Titulos">
<td width="100px"><asp:LinkButton ID="LbRespuestaB" runat="server" CausesValidation="false" Text="Respuesta"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgRespuestaB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbOrdenB" runat="server" CausesValidation="false" Text="Orden"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgOrdenB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="120px"> <asp:LinkButton ID="LbPreguntaB" runat="server" CausesValidation="false" Text="Pregunta"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgPreguntaB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="120px"> <asp:LinkButton ID="LbPreguntaSiguienteB" runat="server" CausesValidation="false" Text="Pregunta Sig."></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgPreguntaSiguienteB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"> <asp:LinkButton ID="LbEstatusB" runat="server" CausesValidation="false" Text="Estatus"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEstatusB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"> <asp:LinkButton ID="LbFechaIngB" runat="server" CausesValidation="false" Text="Fecha Ing"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgFechaIngB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbUsuarioB" runat="server" CausesValidation="false" Text="Usuario"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgUsuarioB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="103">Comandos</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtRespuestaB" runat="server" CausesValidation="true" MaxLength="250" ValidationGroup="GrpGuardarB" Width="87px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRespuestaB" runat="server" ControlToValidate="TxtRespuestaB" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarB"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRespuestaB" runat="server" HighlightCssClass="vco" TargetControlID="RFVRespuestaB" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtOrdenB" runat="server" CausesValidation="true" MaxLength="2" ValidationGroup="GrpGuardarB" Width="90px"></asp:TextBox>
</td>
<td>
<asp:DropDownList ID="DdlPreguntaB" runat="server" AppendDataBoundItems="true" DataValueField="CvePregunta" DataTextField="Pregunta" ValidationGroup="GrpGuardarB" Width="90px">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVPreguntaB" runat="server" ControlToValidate="DdlPreguntaB" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardarB"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOPreguntaB" runat="server" HighlightCssClass="vco" TargetControlID="RFVPreguntaB" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:DropDownList ID="DDlPreguntaSiguienteB" runat="server" AppendDataBoundItems="true" DataValueField="CvePregunta" DataTextField="Pregunta" ValidationGroup="GrpGuardarB" Width="90px">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>
<asp:LinkButton ID="LbAgregarEncuestaPeguntasRespuestas" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarB"></asp:LinkButton>
</td>
</tr>
</table>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosPreguntasRespuestas" runat="server" AutoGenerateColumns="False" DataKeyNames="CveRespuesta" EmptyDataText="No se encontraron Preguntas Registrados" ToolTip="Listado de Preguntas">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlRespuestaB" runat="server" Text='<%# Eval("Respuesta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtRespuestaB" runat="server" CausesValidation="true" MaxLength="250" Text='<%# Eval("Respuesta") %>' ValidationGroup="GrpGuardarB" Width="95px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRespuestaB" runat="server" ControlToValidate="TxtRespuestaB" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarB"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOERespuestaB" runat="server" HighlightCssClass="vco" TargetControlID="RFVRespuestaB" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlOrdenB" runat="server" Text='<%# Eval("Orden", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtOrdenB" runat="server" CausesValidation="true" MaxLength="2" Text='<%# Eval("Orden") %>' ValidationGroup="GrpGuardarB" Width="95px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPreguntaB" runat="server" Text='<%# Eval("Pregunta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlPreguntaB" runat="server" DataValueField="CvePregunta" DataTextField="Pregunta" Width="95px"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPreguntaSiguienteB" runat="server" Text='<%# Eval("PreguntaSiguiente", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlPreguntaSiguienteB" runat="server" DataValueField="CvePregunta" DataTextField="Pregunta" Width="95px"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatusB" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatusB" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIngB" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuarioB" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabEncuestasRespuestas" runat="server" HeaderText="Encunestas Respuestas">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<div>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="upProgress" runat="server" DisplayAfter="0">
<ProgressTemplate>
<div id="overlay">
<div id="modalprogress">
<div id="theprogress">
<center>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>La información se está procesando...</td>
</tr>
<tr>
<td>
<img src="/Imagenes/Cargando.gif" style="border-width: 0px;" alt="" />
</td>
</tr>
</table>
</center>
</div>
</div>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</asp:Content>

View File

@@ -0,0 +1,688 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_Encuestas_CatEncuestas
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = ""
ViewState("OEncuesta") = "Encuesta DESC"
ViewState("OEstatus") = "Estatus DESC"
ViewState("OFechaIng") = "FechaIng DESC"
ViewState("OUsuario") = "Usuario DESC"
CargaDatosEncuestas()
'Encuestas Preguntas
ViewState("OOrden") = ""
ViewState("OPreguntaA") = "PreguntaA DESC"
ViewState("OOrdenA") = "OrdenA DESC"
ViewState("OPreguntaTipoA") = "PreguntaTipoA DESC"
ViewState("OEstatusA") = "EstatusA DESC"
ViewState("OFechaIngA") = "FechaIngA DESC"
ViewState("OUsuarioA") = "UsuarioA DESC"
'ENCUESTAS PREGUNTAS RESPUESTAS
ViewState("OOOrden") = ""
ViewState("ORespuestaB") = "RespuestaB DESC"
ViewState("OOrdenB") = "OrdenB DESC"
ViewState("OTipoRespuestaB") = "TipoRespuestaB DESC"
ViewState("OEstatusB") = "EstatusB DESC"
ViewState("OFechaIngB") = "FechaIngB DESC"
ViewState("OUsuarioB") = "UsuarioB DESC"
CargaEncuesta()
CargaDatosPreguntas()
CargaDatosPreguntasRespuestas()
CargaPreguntas()
End If
End Sub
#Region "Tab Encuestas"
Public Sub CargaDatosEncuestas()
Dim ObjProsEncuestas As New ClsProspectos
If ObjProsEncuestas.GetEncuestas(-1, UsuarioActual.CveEmpresa) Then
ViewState("DTEncuestas") = ObjProsEncuestas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa) = ObjProsEncuestas.DtResultados
Else
Me.GvDatosEncuesta.DataSource = Nothing
End If
ObjProsEncuestas.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGridEncuestas(ViewState("Orden").ToString())
Else
CargaGridEncuestas("")
End If
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
Dim ObjProsEncuestas As New ClsProspectos
If ObjProsEncuestas.AddEncuestas(TxtEncuesta.Text.Trim, DdlEncuestaTipo.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
TxtEncuesta.Text = ""
Alert("La nuevo Encuesta se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTEncuestas") = ObjProsEncuestas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa) = ObjProsEncuestas.DtResultados
If ViewState("Orden").ToString() <> String.Empty Then
CargaGridEncuestas(ViewState("Orden").ToString())
Else
CargaGridEncuestas("")
End If
End If
ObjProsEncuestas.Dispose()
End Sub
#Region " O R D E N A M I E N T O"
Protected Sub LbEncuesta_Click(sender As Object, e As System.EventArgs) Handles LbEncuesta.Click, ImgEncuesta.Click
If ViewState("OEncuesta").ToString() = "Encuesta DESC" Then
ViewState("OEncuesta") = "Encuesta ASC"
ImgEncuesta.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OEncuesta") = "Encuesta DESC"
ImgEncuesta.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("Orden") = ViewState("OEncuesta")
CargaGridEncuestas(ViewState("Orden").ToString())
End Sub
Protected Sub LbEstatus_Click(sender As Object, e As System.EventArgs) Handles LbEstatus.Click, ImgEstatus.Click
If ViewState("OEstatus").ToString() = "Estatus DESC" Then
ViewState("OEstatus") = "Estatus ASC"
ImgEstatus.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OEstatus") = "Estatus DESC"
ImgEstatus.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("Orden") = ViewState("OEstatus")
CargaGridEncuestas(ViewState("Orden").ToString())
End Sub
Protected Sub LbFechaIng_Click(sender As Object, e As System.EventArgs) Handles LbFechaIng.Click, ImgFechaIng.Click
If ViewState("OFechaIng").ToString() = "FechaIng DESC" Then
ViewState("OFechaIng") = "FechaIng ASC"
ImgFechaIng.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OFechaIng") = "FechaIng DESC"
ImgFechaIng.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("Orden") = ViewState("OFechaIng")
CargaGridEncuestas(ViewState("Orden").ToString())
End Sub
Protected Sub LbUsuario_Click(sender As Object, e As System.EventArgs) Handles LbUsuario.Click, ImgUsuario.Click
If ViewState("OUsuario").ToString() = "Usuario DESC" Then
ViewState("OUsuario") = "Usuario ASC"
ImgUsuario.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OUsuario") = "Usuario DESC"
ImgUsuario.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("Orden") = ViewState("OUsuario")
CargaGridEncuestas(ViewState("Orden").ToString())
End Sub
#End Region
Protected Sub GvDatosEncuesta_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosEncuesta.RowDataBound
If 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(250)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(50)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub GvDatosEncuesta_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosEncuesta.RowDeleting
Dim ObjProsEncuestas As New ClsProspectos
If ObjProsEncuestas.RemoveEncuestas(GvDatosEncuesta.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatosEncuesta.EditIndex = -1
ViewState("DTEncuestas") = ObjProsEncuestas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa) = ObjProsEncuestas.DtResultados
Alert("La Encuesta se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsEncuestas.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGridEncuestas(ViewState("Orden").ToString())
Else
CargaGridEncuestas("")
End If
End Sub
Protected Sub GvDatosEncuesta_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosEncuesta.RowCancelingEdit
GvDatosEncuesta.EditIndex = -1
If ViewState("Orden").ToString() <> String.Empty Then
CargaGridEncuestas(ViewState("Orden").ToString())
Else
CargaGridEncuestas("")
End If
End Sub
Protected Sub GvDatosEncuesta_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosEncuesta.RowUpdating
Dim ObjProsEncuestas As New ClsProspectos
Dim Encuesta As String = DirectCast(GvDatosEncuesta.Rows(e.RowIndex).FindControl("TxtEncuesta"), TextBox).Text.Trim
Dim EncuestaTipo As Integer = DirectCast(GvDatosEncuesta.Rows(e.RowIndex).FindControl("DdlEncuestaTipo"), DropDownList).SelectedValue.ToEntero
Dim Estatus As Boolean = GvDatosEncuesta.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim CveEncuesta As Integer = GvDatosEncuesta.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjProsEncuestas.UpdateEncuestas(Encuesta, EncuestaTipo, Estatus, CveEncuesta) Then
GvDatosEncuesta.EditIndex = -1
ViewState("DTEncuestas") = ObjProsEncuestas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa) = ObjProsEncuestas.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsEncuestas.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGridEncuestas(ViewState("Orden").ToString())
Else
CargaGridEncuestas("")
End If
End Sub
Protected Sub GvDatosEncuesta_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosEncuesta.RowEditing
GvDatosEncuesta.EditIndex = e.NewEditIndex
If ViewState("Orden").ToString() <> String.Empty Then
CargaGridEncuestas(ViewState("Orden").ToString())
Else
CargaGridEncuestas("")
End If
End Sub
Private Sub CargaGridEncuestas(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTEncuestas"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatosEncuesta.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatosEncuesta.DataSource = CType(ViewState("DTEncuestas"), DataTable)
End If
GvDatosEncuesta.DataBind()
UpDatos.Update()
End Sub
#End Region
#Region "Tab Encuestas Preguntas Respuestas"
Public Sub CargaDatosPreguntasRespuestas()
Dim ObjProsPreguntasRespuestas As New ClsProspectos
If ObjProsPreguntasRespuestas.GetRespuestas() Then
ViewState("DTPreguntasRespuestas") = ObjProsPreguntasRespuestas.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasRespuestas(-1, -1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
'GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
Else
Me.GvDatosPreguntasRespuestas.DataSource = Nothing
End If
ObjProsPreguntasRespuestas.Dispose()
If ViewState("OOOrden").ToString() <> String.Empty Then
CargaGridPreguntasRespuestas(ViewState("OOOrden").ToString())
Else
CargaGridPreguntasRespuestas("")
End If
End Sub
Protected Sub LbAgregarEncuestaPeguntasRespuestas_Click(sender As Object, e As System.EventArgs) Handles LbAgregarEncuestaPeguntasRespuestas.Click
Dim ObjProsPreguntasRespuestas As New ClsProspectos
If ObjProsPreguntasRespuestas.AddRespuesta(TxtRespuestaB.Text.Trim, DdlPreguntaB.SelectedValue.ToEntero, TxtOrdenB.Text.Trim.ToEntero, DDlPreguntaSiguienteB.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
TxtRespuestaB.Text = ""
TxtOrdenB.Text = ""
DdlPreguntaB.SelectedValue = "-1"
DDlPreguntaSiguienteB.SelectedValue = "-1"
Alert("La Nueva Respuesta se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTPreguntasRespuestas") = ObjProsPreguntasRespuestas.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
If ViewState("OOOrden").ToString() <> String.Empty Then
CargaGridPreguntasRespuestas(ViewState("OOOrden").ToString())
Else
CargaGridPreguntasRespuestas("")
End If
End If
ObjProsPreguntasRespuestas.Dispose()
End Sub
#Region " O R D E N A M I E N T O"
Protected Sub LbRespuestaB_Click(sender As Object, e As System.EventArgs) Handles LbRespuestaB.Click, ImgRespuestaB.Click
If ViewState("ORespuestaB").ToString() = "Pregunta DESC" Then
ViewState("ORespuestaB") = "Pregunta ASC"
ImgRespuestaB.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("ORespuestaB") = "Pregunta DESC"
ImgRespuestaB.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOOrden") = ViewState("ORespuestaB")
CargaGridPreguntasRespuestas(ViewState("OOOrden").ToString())
End Sub
Protected Sub LbOrdenB_Click(sender As Object, e As System.EventArgs) Handles LbOrdenB.Click, ImgOrdenB.Click
If ViewState("OOOrdenB").ToString() = "OrdenB DESC" Then
ViewState("OOOrdenB") = "OrdenB ASC"
ImgOrdenB.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OOOrdenB") = "OrdenB DESC"
ImgOrdenB.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOOrden") = ViewState("OOOrdenB")
CargaGridPreguntasRespuestas(ViewState("OOOrden").ToString())
End Sub
Protected Sub LbPreguntaSiguienteB_Click(sender As Object, e As System.EventArgs) Handles LbPreguntaSiguienteB.Click, ImgPreguntaSiguienteB.Click
If ViewState("OPreguntaSiguienteB").ToString() = "PreguntaSiguienteB DESC" Then
ViewState("OPreguntaSiguienteB") = "PreguntaSiguienteB ASC"
ImgPreguntaSiguienteB.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OPreguntaSiguienteB") = "PreguntaSiguienteB DESC"
ImgPreguntaSiguienteB.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOOrden") = ViewState("OPreguntaSiguienteB")
CargaGridPreguntasRespuestas(ViewState("OOOrden").ToString())
End Sub
Protected Sub LbEstatusB_Click(sender As Object, e As System.EventArgs) Handles LbEstatusB.Click, ImgEstatusB.Click
If ViewState("OEstatusB").ToString() = "EstatusB DESC" Then
ViewState("OEstatusB") = "EstatusB ASC"
ImgEstatusB.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OEstatusB") = "EstatusB DESC"
ImgEstatusB.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOOrden") = ViewState("OEstatusB")
CargaGridPreguntasRespuestas(ViewState("OOOrden").ToString())
End Sub
Protected Sub LbFechaIngB_Click(sender As Object, e As System.EventArgs) Handles LbFechaIngB.Click, ImgFechaIngB.Click
If ViewState("OFechaIngB").ToString() = "FechaIng DESC" Then
ViewState("OFechaIngB") = "FechaIng ASC"
ImgFechaIngB.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OFechaIngB") = "FechaIng DESC"
ImgFechaIngB.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOOrden") = ViewState("OFechaIngB")
CargaGridPreguntasRespuestas(ViewState("OOOrden").ToString())
End Sub
Protected Sub LbUsuarioB_Click(sender As Object, e As System.EventArgs) Handles LbUsuarioB.Click, ImgUsuarioB.Click
If ViewState("OUsuarioB").ToString() = "UsuarioB DESC" Then
ViewState("OUsuarioB") = "UsuarioB ASC"
ImgUsuarioB.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OUsuarioB") = "UsuarioB DESC"
ImgUsuarioB.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOOrden") = ViewState("OUsuarioB")
CargaGridPreguntasRespuestas(ViewState("OOOrden").ToString())
End Sub
#End Region
Private Sub CargaPreguntas()
DdlPreguntaB.DataSource = GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa)
DdlPreguntaB.DataBind()
DDlPreguntaSiguienteB.DataSource = GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa)
DDlPreguntaSiguienteB.DataBind()
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosPreguntasRespuestas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(100) 'respuesta
e.Row.Cells(1).Width = Unit.Pixel(100) 'orden
e.Row.Cells(2).Width = Unit.Pixel(120) 'pregunta
e.Row.Cells(3).Width = Unit.Pixel(120) 'pregunta siguiente
e.Row.Cells(4).Width = Unit.Pixel(100) 'estatus
e.Row.Cells(5).Width = Unit.Pixel(100) 'fecha ing
e.Row.Cells(6).Width = Unit.Pixel(100) 'usuario
e.Row.Cells(7).Width = Unit.Pixel(50)
e.Row.Cells(8).Width = Unit.Pixel(50)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlPreguntaB").DataSource = GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlPreguntaB").DataBind()
e.Row.FCDropDownList("DdlPreguntaB").SelectedValue = e.Row.DBCampo("CvePregunta")
e.Row.FCDropDownList("DdlPreguntaSiguienteB").DataSource = GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlPreguntaSiguienteB").DataBind()
e.Row.FCDropDownList("DDlPreguntaSiguienteB").SelectedValue = e.Row.DBCampo("CvePreguntaSiguiente")
End If
End If
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosPreguntasRespuestas.RowDeleting
Dim ObjProsPreguntasRespuestas As New ClsProspectos
If ObjProsPreguntasRespuestas.RemoveRespuesta(GvDatosPreguntasRespuestas.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatosPreguntasRespuestas.EditIndex = -1
ViewState("DTPreguntasRespuestas") = ObjProsPreguntasRespuestas.DtResultados ' .FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
Alert("La Respuesta se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsPreguntasRespuestas.Dispose()
If ViewState("OOOrden").ToString() <> String.Empty Then
CargaGridPreguntasRespuestas(ViewState("OOOrden").ToString())
Else
CargaGridPreguntasRespuestas("")
End If
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosPreguntasRespuestas.RowCancelingEdit
GvDatosPreguntasRespuestas.EditIndex = -1
If ViewState("OOOrden").ToString() <> String.Empty Then
CargaGridPreguntasRespuestas(ViewState("OOOrden").ToString())
Else
CargaGridPreguntasRespuestas("")
End If
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosPreguntasRespuestas.RowUpdating
Dim ObjProsPreguntasRespuestas As New ClsProspectos
Dim Respuesta As String = DirectCast(GvDatosPreguntasRespuestas.Rows(e.RowIndex).FindControl("TxtRespuestaB"), TextBox).Text.Trim
Dim CvePregunta As Integer = DirectCast(GvDatosPreguntasRespuestas.Rows(e.RowIndex).FindControl("DdlPreguntaB"), DropDownList).SelectedValue.ToEntero
Dim CvePreguntaSiguiente As Integer = DirectCast(GvDatosPreguntasRespuestas.Rows(e.RowIndex).FindControl("DDlPreguntaSiguienteB"), DropDownList).SelectedValue.ToEntero
Dim Estatus As Boolean = GvDatosPreguntasRespuestas.Rows(e.RowIndex).FCCheckBox("ChkEstatusB").Checked
Dim Orden As Integer = DirectCast(GvDatosPreguntasRespuestas.Rows(e.RowIndex).FindControl("TxtOrdenB"), TextBox).Text.Trim.ToEntero
Dim CveRespuesta As Integer = GvDatosPreguntasRespuestas.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjProsPreguntasRespuestas.UpdateRespuesta(Respuesta, CvePregunta, Estatus, Orden, CvePreguntaSiguiente, CveRespuesta) Then
GvDatosPreguntasRespuestas.EditIndex = -1
ViewState("DTPreguntasRespuestas") = ObjProsPreguntasRespuestas.DtResultados '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
' GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
GlobalDTProspectosEncuestasRespuestas(CvePregunta, CveRespuesta, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsPreguntasRespuestas.Dispose()
If ViewState("OOOrden").ToString() <> String.Empty Then
CargaGridPreguntasRespuestas(ViewState("OOOrden").ToString())
Else
CargaGridPreguntasRespuestas("")
End If
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosPreguntasRespuestas.RowEditing
GvDatosPreguntasRespuestas.EditIndex = e.NewEditIndex
If ViewState("OOOrden").ToString() <> String.Empty Then
CargaGridPreguntasRespuestas(ViewState("OOOrden").ToString())
Else
CargaGridPreguntasRespuestas("")
End If
End Sub
Private Sub CargaGridPreguntasRespuestas(Orden As String)
If Orden <> String.Empty Then
Dim DVRespuestas As New DataView(CType(ViewState("DTPreguntasRespuestas"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatosPreguntasRespuestas.DataSource = DVRespuestas.ToTable()
DVRespuestas.Dispose()
Else
GvDatosPreguntasRespuestas.DataSource = CType(ViewState("DTPreguntasRespuestas"), DataTable)
End If
GvDatosPreguntasRespuestas.DataBind()
UpDatosEncuestasPreguntas.Update()
End Sub
#End Region
#Region "Tab Encuestas Preguntas"
Public Sub CargaDatosPreguntas()
Dim ObjProsPreguntas As New ClsProspectos
If ObjProsPreguntas.GetPreguntas(-1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ViewState("DTPreguntas") = ObjProsPreguntas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntas.DtResultados
Else
Me.GvDatosPregunta.DataSource = Nothing
End If
ObjProsPreguntas.Dispose()
If ViewState("OOrden").ToString() <> String.Empty Then
CargaGridPreguntas(ViewState("OOrden").ToString())
Else
CargaGridPreguntas("")
End If
End Sub
Protected Sub LbAgregarEncuestaPegunta_Click(sender As Object, e As System.EventArgs) Handles LbAgregarEncuestaPegunta.Click
Dim ObjProsPreguntas As New ClsProspectos
If ObjProsPreguntas.AddPreguntas(TxtPreguntaA.Text.Trim, DdlEncuesta.SelectedValue.ToEntero, DDlPreguntaTipoA.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
TxtPreguntaA.Text = ""
Alert("La nuevo Pregunta se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTPreguntas") = ObjProsPreguntas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntas.DtResultados
If ViewState("OOrden").ToString() <> String.Empty Then
CargaGridPreguntas(ViewState("OOrden").ToString())
Else
CargaGridPreguntas("")
End If
End If
ObjProsPreguntas.Dispose()
End Sub
#Region " O R D E N A M I E N T O"
Protected Sub LbPreguntaA_Click(sender As Object, e As System.EventArgs) Handles LbPreguntaA.Click, ImgPreguntaA.Click
If ViewState("OPreguntaA").ToString() = "PreguntaADESC" Then
ViewState("OPreguntaA") = "PreguntaAASC"
ImgPreguntaA.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OPreguntaA") = "PreguntaADESC"
ImgPreguntaA.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOrden") = ViewState("OPreguntaA")
CargaGridPreguntas(ViewState("OOrden").ToString())
End Sub
Protected Sub LbOrdenA_Click(sender As Object, e As System.EventArgs) Handles LbOrdenA.Click, ImgOrdenA.Click
If ViewState("OOrdenA").ToString() = "OrdenA DESC" Then
ViewState("OOrdenA") = "OrdenA ASC"
ImgOrdenA.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OOrdenA") = "OrdenA DESC"
ImgOrdenA.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOrden") = ViewState("OOrdenA")
CargaGridPreguntas(ViewState("OOrden").ToString())
End Sub
Protected Sub LbPreguntaTipoA_Click(sender As Object, e As System.EventArgs) Handles LbPreguntaTipoA.Click, ImgPreguntaTipoA.Click
If ViewState("OPreguntaTipoA").ToString() = "PreguntaTipoA DESC" Then
ViewState("OPreguntaTipoA") = "PreguntaTipoA ASC"
ImgPreguntaTipoA.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OPreguntaTipoA") = "PreguntaTipoA DESC"
ImgPreguntaTipoA.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOrden") = ViewState("OPreguntaTipoA")
CargaGridPreguntas(ViewState("OOrden").ToString())
End Sub
Protected Sub LbEstatusA_Click(sender As Object, e As System.EventArgs) Handles LbEstatusA.Click, ImgEstatusA.Click
If ViewState("OEstatusA").ToString() = "EstatusA DESC" Then
ViewState("OEstatusA") = "EstatusA ASC"
ImgEstatusA.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OEstatusA") = "EstatusA DESC"
ImgEstatusA.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOrden") = ViewState("OEstatusA")
CargaGridPreguntas(ViewState("OOrden").ToString())
End Sub
Protected Sub LbFechaIngA_Click(sender As Object, e As System.EventArgs) Handles LbFechaIngA.Click, ImgFechaIngA.Click
If ViewState("OFechaIngA").ToString() = "FechaIng DESC" Then
ViewState("OFechaIngA") = "FechaIng ASC"
ImgFechaIngA.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OFechaIngA") = "FechaIng DESC"
ImgFechaIngA.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOrden") = ViewState("OFechaIngA")
CargaGridPreguntas(ViewState("OOrden").ToString())
End Sub
Protected Sub LbUsuarioA_Click(sender As Object, e As System.EventArgs) Handles LbUsuarioA.Click, ImgUsuarioA.Click
If ViewState("OUsuarioA").ToString() = "UsuarioA DESC" Then
ViewState("OUsuarioA") = "UsuarioA ASC"
ImgUsuarioA.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OUsuarioA") = "UsuarioA DESC"
ImgUsuarioA.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOrden") = ViewState("OUsuarioA")
CargaGridPreguntas(ViewState("OOrden").ToString())
End Sub
#End Region
Private Sub CargaEncuesta()
DdlEncuesta.DataSource = GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa) '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
DdlEncuesta.DataBind()
End Sub
Protected Sub GvDatosPregunta_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosPregunta.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(190)
e.Row.Cells(1).Width = Unit.Pixel(60)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(96)
e.Row.Cells(6).Width = Unit.Pixel(97)
e.Row.Cells(7).Width = Unit.Pixel(97)
e.Row.Cells(8).Width = Unit.Pixel(50)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlEncuesta").DataSource = GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa) '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlEncuesta").DataBind()
e.Row.FCDropDownList("DdlEncuesta").SelectedValue = e.Row.DBCampo("CveEncuesta")
e.Row.FCDropDownList("DDlPreguntaTipoA").SelectedValue = e.Row.DBCampo("PreguntaTipo")
End If
End If
End Sub
Protected Sub GvDatosPregunta_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosPregunta.RowDeleting
Dim ObjProsPreguntas As New ClsProspectos
If ObjProsPreguntas.RemovePreguntas(GvDatosPregunta.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatosPregunta.EditIndex = -1
ViewState("DTPreguntas") = ObjProsPreguntas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntas.DtResultados
Alert("La Pregunta se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsPreguntas.Dispose()
If ViewState("OOrden").ToString() <> String.Empty Then
CargaGridPreguntas(ViewState("OOrden").ToString())
Else
CargaGridPreguntas("")
End If
End Sub
Protected Sub GvDatosPregunta_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosPregunta.RowCancelingEdit
GvDatosPregunta.EditIndex = -1
If ViewState("OOrden").ToString() <> String.Empty Then
CargaGridPreguntas(ViewState("OOrden").ToString())
Else
CargaGridPreguntas("")
End If
End Sub
Protected Sub GvDatosPregunta_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosPregunta.RowUpdating
Dim ObjProsPreguntas As New ClsProspectos
Dim Pregunta As String = DirectCast(GvDatosPregunta.Rows(e.RowIndex).FindControl("TxtPreguntaA"), TextBox).Text.Trim
Dim Encuesta As Integer = DirectCast(GvDatosPregunta.Rows(e.RowIndex).FindControl("DdlEncuesta"), DropDownList).SelectedValue.ToEntero
Dim PreguntaTipo As Integer = DirectCast(GvDatosPregunta.Rows(e.RowIndex).FindControl("DdlEncuesta"), DropDownList).SelectedValue.ToEntero
Dim PiePregunta As String = DirectCast(GvDatosPregunta.Rows(e.RowIndex).FindControl("TxtPiePregunta"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatosPregunta.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim Orden As Integer = 1
Dim CvePregunta As Integer = GvDatosPregunta.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjProsPreguntas.UpdatePreguntas(Pregunta, Encuesta, PreguntaTipo, PiePregunta, Estatus, Orden, CvePregunta) Then
GvDatosPregunta.EditIndex = -1
ViewState("DTPreguntas") = ObjProsPreguntas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntas.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsPreguntas.Dispose()
If ViewState("OOrden").ToString() <> String.Empty Then
CargaGridPreguntas(ViewState("OOrden").ToString())
Else
CargaGridPreguntas("")
End If
End Sub
Protected Sub GvDatosPregunta_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosPregunta.RowEditing
GvDatosPregunta.EditIndex = e.NewEditIndex
If ViewState("OOrden").ToString() <> String.Empty Then
CargaGridPreguntas(ViewState("OOrden").ToString())
Else
CargaGridPreguntas("")
End If
End Sub
Private Sub CargaGridPreguntas(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTPreguntas"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatosPregunta.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatosPregunta.DataSource = CType(ViewState("DTPreguntas"), DataTable)
End If
GvDatosPregunta.DataBind()
UpDatosEncuestasPreguntas.Update()
End Sub
#End Region
#Region "Tab Encuestas---"
#End Region
End Class

View File

@@ -0,0 +1,183 @@
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="CatEncuestasPreguntas.aspx.vb" Inherits="Prospectos_Encuestas_CatEncuestasPreguntas" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
Catálogo de Preguntas
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<script language="javascript" type="text/javascript">
function C() {
return confirm('¿Está seguro que desea eliminar el Pregunta?');
}
</script>
<asp:UpdatePanel ID="UpTitulos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" Width="100%">
<ajax:TabPanel ID="TabEncuestasPreguntas" runat="server" HeaderText="Encuestas Preguntas">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<div>
<table border="1" rules="all" style="border-collapse: collapse;">
<tr class="Titulos">
<td width="190px"><asp:LinkButton ID="LbRespuestaB" runat="server" CausesValidation="false" Text="Pregunta"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgRespuestaB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="60px"><asp:LinkButton ID="LbOrdenB" runat="server" CausesValidation="false" Text="Orden"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgOrdenB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"> <asp:LinkButton ID="LbPreguntaB" runat="server" CausesValidation="false" Text="Encuesta"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgPreguntaB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"> <asp:LinkButton ID="LbPreguntaSiguienteB" runat="server" CausesValidation="false" Text="Tipo Pregunta"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgPreguntaSiguienteB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"> <asp:LinkButton ID="LbEstatusB" runat="server" CausesValidation="false" Text="Estatus"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEstatusB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"> <asp:LinkButton ID="LbFechaIngB" runat="server" CausesValidation="false" Text="Fecha Ing"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgFechaIngB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="100px"><asp:LinkButton ID="LbUsuarioB" runat="server" CausesValidation="false" Text="Usuario"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgUsuarioB" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" /></td>
<td width="103">Comandos</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtRespuestaB" runat="server" CausesValidation="true" MaxLength="250" ValidationGroup="GrpGuardarB" Width="175px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRespuestaB" runat="server" ControlToValidate="TxtRespuestaB" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarB"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCRespuestaB" runat="server" HighlightCssClass="vco" TargetControlID="RFVRespuestaB" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtOrdenB" runat="server" CausesValidation="true" MaxLength="2" ValidationGroup="GrpGuardarB" Width="50px"></asp:TextBox>
</td>
<td>
<asp:DropDownList ID="DdlPreguntaB" runat="server" AppendDataBoundItems="true" DataValueField="CvePregunta" DataTextField="Encuesta" ValidationGroup="GrpGuardarB" Width="90px">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVPreguntaB" runat="server" ControlToValidate="DdlPreguntaB" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Encuesta''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardarB"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOPreguntaB" runat="server" HighlightCssClass="vco" TargetControlID="RFVPreguntaB" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:DropDownList ID="DDlPreguntaSiguienteB" runat="server" AppendDataBoundItems="true" DataValueField="PreguntaTipo" ValidationGroup="GrpGuardarB" Width="100px">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="Texto" Value="0"></asp:ListItem>
<asp:ListItem Text="Listado" Value="1"></asp:ListItem>
<asp:ListItem Text="Opciones" Value="2"></asp:ListItem>
</asp:DropDownList>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>
<asp:LinkButton ID="LbAgregarEncuestaPeguntasRespuestas" runat="server" CausesValidation="true" CssClass="Texto" Text="Agregar" ValidationGroup="GrpGuardarB"></asp:LinkButton>
</td>
</tr>
</table>
<asp:UpdatePanel ID="UpDatosEncuestasPreguntas" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosPreguntasRespuestas" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePregunta" EmptyDataText="No se encontraron Preguntas Registrados" ToolTip="Listado de Preguntas">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPregunta" runat="server" Text='<%# Eval("Pregunta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtRespuestaB" runat="server" CausesValidation="true" MaxLength="50" Text='<%# Eval("Respuesta") %>' ValidationGroup="GrpGuardarB" Width="175px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVRespuestaB" runat="server" ControlToValidate="TxtRespuestaB" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pregunta''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarB"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCOERespuestaB" runat="server" HighlightCssClass="vco" TargetControlID="RFVRespuestaB" Width="300px"></ajax:ValidatorCalloutExtender>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlOrdenB" runat="server" Text='<%# Eval("Orden", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TxtOrdenB" runat="server" CausesValidation="true" MaxLength="2" Text='<%# Eval("Orden") %>' ValidationGroup="GrpGuardarB" Width="52px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEncuesta" runat="server" Text='<%# Eval("Encuesta", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DdlPreguntaB" runat="server" DataValueField="CvePregunta" DataTextField="Encuesta" Width="90px"></asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPreguntaSiguienteB" runat="server" Text='<%# Eval("PreguntaTipoTexto", "&nbsp;{0}") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="DropDownList2" runat="server" AppendDataBoundItems="true" DataValueField="PreguntaTipo" ValidationGroup="GrpGuardarB" Width="100px">
<asp:ListItem Text="Texto" Value="0"></asp:ListItem>
<asp:ListItem Text="Listado" Value="1"></asp:ListItem>
<asp:ListItem Text="Opciones" Value="2"></asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstatus" runat="server" Text='<%# Eval("Estatus") %>'></asp:Literal>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="ChkEstatus" runat="server" Checked='<%# If (Eval("Estatus").ToString = "Activo", True, False) %>' />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Editar">
<EditItemTemplate>
<center>
<asp:ImageButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" ImageUrl="/Imagenes/Btn_Update.png" ValidationGroup="GrpGV" />
&nbsp;<asp:ImageButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" ImageUrl="/Imagenes/Btn_Cancel.png" />
</center>
</EditItemTemplate>
<ItemTemplate>
<asp:ImageButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CommandName="Edit" ImageUrl="/Imagenes/Btn_Edit.png" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Eliminar">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="upProgress" runat="server" DisplayAfter="0">
<ProgressTemplate>
<div id="overlay">
<div id="modalprogress">
<div id="theprogress">
<center>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>La información se está procesando...</td>
</tr>
<tr>
<td>
<img src="/Imagenes/Cargando.gif" style="border-width: 0px;" alt="" /></td>
</tr>
</table>
</center>
</div>
</div>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</asp:Content>

View File

@@ -0,0 +1,249 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports System.Linq
Imports Extensiones
Partial Class Prospectos_Encuestas_CatEncuestasPreguntas
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("OOrden") = ""
ViewState("ORespuestaB") = "RespuestaB DESC"
ViewState("OOrdenB") = "OrdenB DESC"
ViewState("OTipoRespuestaB") = "TipoRespuestaB DESC"
ViewState("OEstatusB") = "EstatusB DESC"
ViewState("OFechaIngB") = "FechaIngB DESC"
ViewState("OUsuarioB") = "UsuarioB DESC"
CargaDatosPreguntas()
End If
End Sub
#Region "Tab Encuestas Preguntas"
Public Sub CargaDatosPreguntas()
Dim ObjProsPreguntasRespuestas As New ClsProspectos
If ObjProsPreguntasRespuestas.GetPreguntas(-1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ViewState("DTPreguntas") = ObjProsPreguntasRespuestas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
Else
Me.GvDatosPreguntasRespuestas.DataSource = Nothing
End If
ObjProsPreguntasRespuestas.Dispose()
If ViewState("OOrden").ToString() <> String.Empty Then
CargaGridPreguntasRespuestas(ViewState("OOrden").ToString())
Else
CargaGridPreguntasRespuestas("")
End If
End Sub
Protected Sub LbAgregarEncuestaPeguntasRespuestas_Click(sender As Object, e As System.EventArgs) Handles LbAgregarEncuestaPeguntasRespuestas.Click
Dim ObjProsPreguntasRespuestas As New ClsProspectos
If ObjProsPreguntasRespuestas.AddPreguntas(TxtRespuestaB.Text.Trim, DdlPreguntaB.SelectedValue.ToEntero, DDlPreguntaSiguienteB.SelectedValue.ToEntero, UsuarioActual.CveUsuario) Then
TxtRespuestaB.Text = ""
Alert("El nuevo Pregunta se guardó correctamente.", TipoMensaje.MsgInformacion)
UpTitulos.Update()
ViewState("DTPreguntas") = ObjProsPreguntasRespuestas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
If ViewState("OOrden").ToString() <> String.Empty Then
CargaGridPreguntasRespuestas(ViewState("OOrden").ToString())
Else
CargaGridPreguntasRespuestas("")
End If
End If
ObjProsPreguntasRespuestas.Dispose()
End Sub
#Region " O R D E N A M I E N T O"
Protected Sub LbRespuestaB_Click(sender As Object, e As System.EventArgs) Handles LbRespuestaB.Click, ImgRespuestaB.Click
If ViewState("ORespuestaB").ToString() = "Pregunta DESC" Then
ViewState("ORespuestaB") = "Pregunta ASC"
ImgRespuestaB.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("ORespuestaB") = "Pregunta DESC"
ImgRespuestaB.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOrden") = ViewState("ORespuestaB")
CargaGridPreguntasRespuestas(ViewState("OOrden").ToString())
End Sub
Protected Sub LbOrdenB_Click(sender As Object, e As System.EventArgs) Handles LbOrdenB.Click, ImgOrdenB.Click
If ViewState("OOrdenB").ToString() = "OrdenB DESC" Then
ViewState("OOrdenB") = "OrdenB ASC"
ImgOrdenB.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OOrdenB") = "OrdenB DESC"
ImgOrdenB.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOrden") = ViewState("OOrdenB")
CargaGridPreguntasRespuestas(ViewState("OOrden").ToString())
End Sub
Protected Sub LbPreguntaSiguienteB_Click(sender As Object, e As System.EventArgs) Handles LbPreguntaSiguienteB.Click, ImgPreguntaSiguienteB.Click
If ViewState("OPreguntaSiguienteB").ToString() = "PreguntaSiguienteB DESC" Then
ViewState("OPreguntaSiguienteB") = "PreguntaSiguienteB ASC"
ImgPreguntaSiguienteB.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OPreguntaSiguienteB") = "PreguntaSiguienteB DESC"
ImgPreguntaSiguienteB.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOrden") = ViewState("OPreguntaSiguienteB")
CargaGridPreguntasRespuestas(ViewState("OOrden").ToString())
End Sub
Protected Sub LbEstatusB_Click(sender As Object, e As System.EventArgs) Handles LbEstatusB.Click, ImgEstatusB.Click
If ViewState("OEstatusB").ToString() = "EstatusB DESC" Then
ViewState("OEstatusB") = "EstatusB ASC"
ImgEstatusB.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OEstatusB") = "EstatusB DESC"
ImgEstatusB.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOrden") = ViewState("OEstatusB")
CargaGridPreguntasRespuestas(ViewState("OOrden").ToString())
End Sub
Protected Sub LbFechaIngB_Click(sender As Object, e As System.EventArgs) Handles LbFechaIngB.Click, ImgFechaIngB.Click
If ViewState("OFechaIngB").ToString() = "FechaIng DESC" Then
ViewState("OFechaIngB") = "FechaIng ASC"
ImgFechaIngB.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OFechaIngB") = "FechaIng DESC"
ImgFechaIngB.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOrden") = ViewState("OFechaIngB")
CargaGridPreguntasRespuestas(ViewState("OOrden").ToString())
End Sub
Protected Sub LbUsuarioB_Click(sender As Object, e As System.EventArgs) Handles LbUsuarioB.Click, ImgUsuarioB.Click
If ViewState("OUsuarioB").ToString() = "UsuarioB DESC" Then
ViewState("OUsuarioB") = "UsuarioB ASC"
ImgUsuarioB.ImageUrl = "/Imagenes/FlechasArriba.gif"
Else
ViewState("OUsuarioB") = "UsuarioB DESC"
ImgUsuarioB.ImageUrl = "/Imagenes/FlechasAbajo.gif"
End If
ViewState("OOrden") = ViewState("OUsuarioB")
CargaGridPreguntasRespuestas(ViewState("OOrden").ToString())
End Sub
#End Region
Private Sub CargaPreguntas()
DdlPreguntaB.DataSource = GlobalDTProspectosEncuestasPreguntas(DdlPreguntaB.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
DdlPreguntaB.DataBind()
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosPreguntasRespuestas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(190)
e.Row.Cells(1).Width = Unit.Pixel(60)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(100)
e.Row.Cells(4).Width = Unit.Pixel(100)
e.Row.Cells(5).Width = Unit.Pixel(100)
e.Row.Cells(6).Width = Unit.Pixel(100)
e.Row.Cells(7).Width = Unit.Pixel(50)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlPreguntaB").DataSource = GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa) '.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlPreguntaB").DataBind()
e.Row.FCDropDownList("DdlPreguntaB").SelectedValue = e.Row.DBCampo("CvePregunta")
e.Row.FCDropDownList("DDlPreguntaSiguienteB").SelectedValue = e.Row.DBCampo("CvePregunta")
End If
End If
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosPreguntasRespuestas.RowDeleting
Dim ObjProsPreguntasRespuestas As New ClsProspectos
If ObjProsPreguntasRespuestas.RemovePreguntas(GvDatosPreguntasRespuestas.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatosPreguntasRespuestas.EditIndex = -1
ViewState("DTPreguntas") = ObjProsPreguntasRespuestas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
Alert("El Pregunta se eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsPreguntasRespuestas.Dispose()
If ViewState("OOrden").ToString() <> String.Empty Then
CargaGridPreguntasRespuestas(ViewState("OOrden").ToString())
Else
CargaGridPreguntasRespuestas("")
End If
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvDatosPreguntasRespuestas.RowCancelingEdit
GvDatosPreguntasRespuestas.EditIndex = -1
If ViewState("OOrden").ToString() <> String.Empty Then
CargaGridPreguntasRespuestas(ViewState("OOrden").ToString())
Else
CargaGridPreguntasRespuestas("")
End If
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatosPreguntasRespuestas.RowUpdating
Dim ObjProsPreguntasRespuestas As New ClsProspectos
Dim Pregunta As String = DirectCast(GvDatosPreguntasRespuestas.Rows(e.RowIndex).FindControl("TxtRespuestaB"), TextBox).Text.Trim
Dim Encuesta As Integer = DirectCast(GvDatosPreguntasRespuestas.Rows(e.RowIndex).FindControl("DdlPreguntaB"), DropDownList).SelectedValue.ToEntero
Dim PreguntaTipo As Integer = DirectCast(GvDatosPreguntasRespuestas.Rows(e.RowIndex).FindControl("DdlPreguntaB"), DropDownList).SelectedValue.ToEntero
Dim PiePregunta As String = DirectCast(GvDatosPreguntasRespuestas.Rows(e.RowIndex).FindControl("TxtPiePregunta"), TextBox).Text.Trim
Dim Estatus As Boolean = GvDatosPreguntasRespuestas.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
Dim Orden As Integer = 1
Dim CvePregunta As Integer = GvDatosPreguntasRespuestas.DataKeys(e.RowIndex).Value.ToString.ToEntero
If ObjProsPreguntasRespuestas.UpdatePreguntas(Pregunta, Encuesta, PreguntaTipo, PiePregunta, Estatus, Orden, CvePregunta) Then
GvDatosPreguntasRespuestas.EditIndex = -1
ViewState("DTPreguntas") = ObjProsPreguntasRespuestas.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTProspectosEncuestasPreguntas(-1, UsuarioActual.CveEmpresa) = ObjProsPreguntasRespuestas.DtResultados
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProsPreguntasRespuestas.Dispose()
If ViewState("OOrden").ToString() <> String.Empty Then
CargaGridPreguntasRespuestas(ViewState("OOrden").ToString())
Else
CargaGridPreguntasRespuestas("")
End If
End Sub
Protected Sub GvDatosPreguntasRespuestas_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatosPreguntasRespuestas.RowEditing
GvDatosPreguntasRespuestas.EditIndex = e.NewEditIndex
If ViewState("OOrden").ToString() <> String.Empty Then
CargaGridPreguntasRespuestas(ViewState("OOrden").ToString())
Else
CargaGridPreguntasRespuestas("")
End If
End Sub
Private Sub CargaGridPreguntasRespuestas(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTPreguntas"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatosPreguntasRespuestas.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatosPreguntasRespuestas.DataSource = CType(ViewState("DTPreguntas"), DataTable)
End If
GvDatosPreguntasRespuestas.DataBind()
UpDatosEncuestasPreguntas.Update()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,16 @@
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="CatEncuestasPreguntasRespuestas.aspx.vb" Inherits="Prospectos_Encuestas_CatEncuestasPreguntasRespuestas" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>

View File

@@ -0,0 +1,5 @@

Partial Class Prospectos_Encuestas_CatEncuestasPreguntasRespuestas
Inherits System.Web.UI.Page
End Class

View File

@@ -0,0 +1,199 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="GeneradorEncuestas.aspx.vb" Inherits="Prospectos_GeneradorEncuestas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Padrón
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />&nbsp;&nbsp;
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline" >
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tipo:
<asp:DropDownList ID="DdlTipo" runat="server" Class="table-group-action-input form-control input-inline input-small input-sm" style="width:150px !important;">
<asp:ListItem Selected="True" Text="Deteccion E1" Value="1"></asp:ListItem>
<asp:ListItem Text="Estructura E1" Value="2"></asp:ListItem>
<asp:ListItem Text="Det. E1 Y Est. E1" Value="3"></asp:ListItem>
<asp:ListItem Text="Derivados PRO/PAN" Value="4"></asp:ListItem>
<asp:ListItem Text="Derivados No Sabe" Value="5"></asp:ListItem>
</asp:DropDownList>
</li>
<li> Municipio:
<asp:DropDownList ID="DdlMunicipio" runat="server" AutoPostBack="true" DataTextField="PadronMunicipio" DataValueField="CvePadronMunicipio" Class="table-group-action-input form-control input-inline input-small input-sm" style="width:150px !important;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Dist. Loc.:
<asp:DropDownList ID="DdlDistLoc" runat="server" AutoPostBack="true" DataTextField="Dist_Loc" DataValueField="Dist_Loc" Class="table-group-action-input form-control input-inline input-small input-sm" style="width:150px !important;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand">
</a>
<a onclick="document.getElementById('C_BtnConsultar').click();" class="reload">
</a>
</div>
</div>
<div class="portlet-body" style="display: none;">
<ul class="list-inline" >
<li>Sección:
<asp:DropDownList ID="DdlSeccion" runat="server" DataTextField="seccion" DataValueField="seccion" Class="table-group-action-input form-control input-inline input-small input-sm" style="width:150px !important;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Calle:
<asp:TextBox ID="TxtCalle" runat="server" Width="150px"></asp:TextBox>
</li>
<li> &nbsp; Colonia:
<asp:DropDownList ID="DdlColonia" runat="server" DataTextField="Colonia" DataValueField="Colonia" Class="table-group-action-input form-control input-inline input-small input-sm" style="width:150px !important;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<%--1640--%>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<br />
<asp:Button ID="Btn" runat="server" Text="Genera Encuestas" class="btn btn-primary"/>
<br /><br />
Número de registros:&nbsp;<b><asp:Literal ID="LtlNumRegistros" runat="server" Text="0"></asp:Literal></b>
<br />
<asp:GridView ID="GV" runat="server"></asp:GridView>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="Consec,Tipo,Calle,NumExterior,NumInterior,Colonia,Seccion,CP,PadronMunicipio,APaterno,AMaterno,Nombres,IFE" EmptyDataText="No se encontraron Prospectos Registrados" CssClass="table table-striped table-advance table-hover" style="margin-top:-10px; text-align:center;" GridLines="None" >
<Columns>
<%--<asp:TemplateField>
<HeaderTemplate>S</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="Chk" runat="server" />
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField>
<HeaderTemplate>Tipo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTipo" runat="server" ></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Municipio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMunicipio" runat="server" Text='<%# Eval("PadronMunicipio")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Sección</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSeccion" runat="server" Text='<%# Eval("Seccion")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Calle</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCalle" runat="server" Text='<%# Eval("Calle")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Ext</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlExt" runat="server" Text='<%# Eval("NumExterior")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Int</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlInt" runat="server" Text='<%# Eval("NumInterior")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Colonia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlColonia" runat="server" Text='<%# Eval("Colonia")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Nombre</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("NombreCompleto")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField />--%>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
var SelectedRow = null;
var SelectedRowIndex = null;
var UpperBound = null;
var LowerBound = null;
window.onload = function () {
UpperBound = parseInt('<%= GvDatos.Rows.Count%>') - 1;
LowerBound = 0;
SelectedRowIndex = -1;
}
function SelectRow(CurrentRow, RowIndex) {
if (SelectedRow == CurrentRow || RowIndex > UpperBound || RowIndex < LowerBound)
return;
if (SelectedRow != null) {
SelectedRow.style.backgroundColor = SelectedRow.originalBackgroundColor;
SelectedRow.style.color = SelectedRow.originalForeColor;
}
if (CurrentRow != null) {
CurrentRow.originalBackgroundColor = CurrentRow.style.backgroundColor;
CurrentRow.originalForeColor = CurrentRow.style.color;
CurrentRow.style.backgroundColor = '#65b0bf';
CurrentRow.style.color = 'Black';
}
SelectedRow = CurrentRow;
SelectedRowIndex = RowIndex;
setTimeout("SelectedRow.focus();", 0);
}
function SelectSibling(e) {
var e = e ? e : window.event;
var KeyCode = e.which ? e.which : e.keyCode;
if (KeyCode == 40) {
SelectRow(SelectedRow.nextSibling, SelectedRowIndex + 1);
}
else if (KeyCode == 38) {
SelectRow(SelectedRow.previousSibling, SelectedRowIndex - 1);
}
return false;
}
function EC() {
event.cancelBubble = true;
if (event.stopPropagation)
event.stopPropagation();
}
</script>
</asp:Content>

View File

@@ -0,0 +1,337 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
'Imports msExcel = Microsoft.Office.Interop.Excel
'Imports System.Xml
'Imports System.Collections.Generic
'Imports System.Runtime.InteropServices
'Imports VBIDE
Imports iTextSharp.text.pdf
Partial Class Prospectos_GeneradorEncuestas
Inherits System.Web.UI.Page
ReadOnly Property UsuarioActual() As Usuario
Get
UsuarioActual = DirectCast(Session("UsuarioSIG"), Usuario)
End Get
End Property
Private Property DisLoc As String
Get
Return ViewState("DisLoc").ToString
End Get
Set(value As String)
ViewState("DisLoc") = value
End Set
End Property
Private Property Seccion As String
Get
Return ViewState("Seccion").ToString
End Get
Set(value As String)
ViewState("Seccion") = 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") = String.Empty
DisLoc = "-1" : Seccion = "-1"
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
Dim FiltroDistLoc As String = String.Empty
If DdlDistLoc.SelectedIndex > 0 Then FiltroDistLoc = "Dist_Loc = '" & DdlDistLoc.SelectedValue & "'"
DdlSeccion.DataSource = DT.FiltraParametros(FiltroDistLoc, "", {"seccion"})
DdlSeccion.DataBind()
DdlSeccion.Items.Insert(0, New ListItem("Todas", "-1"))
End If
If DT IsNot Nothing Then DT.Dispose()
'Ocupacion
If ObjProspectos.GetFiltros("Colonias") Then
DdlColonia.DataSource = ObjProspectos.DtResultados
Else
DdlColonia.DataSource = Nothing
End If
DdlColonia.DataBind()
DdlColonia.Items.Insert(0, New ListItem("Todas", "-1"))
ObjProspectos.Dispose()
End Sub
Public Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
Dim Calle As String = "-1"
If TxtCalle.Text.Trim <> String.Empty Then Calle = TxtCalle.Text.Trim
If ObjProspectos.GeneradorEncuestas(DdlTipo.SelectedValue.ToEntero, DdlMunicipio.SelectedValue.ToEntero, DdlDistLoc.SelectedValue.ToEntero, DdlSeccion.SelectedValue.ToEntero, DdlColonia.SelectedValue, Calle) Then
ViewState("DTProspectos") = 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("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)
'Quitar o comentas
'GV.DataSource = CType(ViewState("DTProspectos"), DataTable)
'GV.DataBind()
End Sub
Protected Sub GvDatos_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowCreated
If (e.Row.RowType = DataControlRowType.DataRow AndAlso (e.Row.RowState = DataControlRowState.Normal OrElse e.Row.RowState = DataControlRowState.Alternate)) Then
e.Row.TabIndex = -1
e.Row.Attributes("onclick") = String.Format("javascript:SelectRow(this, {0});", e.Row.RowIndex)
e.Row.Attributes("onkeydown") = "javascript:return SelectSibling(event);"
e.Row.Attributes("onselectstart") = "javascript:return false;"
'e.Row.Cells(10).Attributes.Add("onclick", "EC();")
End If
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
ElseIf e.Row.RowIndex = 1 Then
'e.Row.Cells(0).Width = Unit.Pixel(120) 'Gpo
End If
End If
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos()
UPDatos.Update()
Me.RegistraScript("UpperBound = " & GvDatos.Rows.Count - 1 & ";")
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel(DdlTipo.SelectedItem.Text)
End Sub
Private Shared missing As Object = System.Reflection.Missing.Value
'Private Sub GeneraHoja(ByRef Hoja As msExcel.Worksheet, NumHoja As Integer, BarCode As String, URLBarCode As String, Tipo As String, Folio As String, Calle As String, Numero As String, Interior As String, Colonia As String,
' Seccion As String, CP As String, Municipio As String, Paterno As String, Materno As String, Nombres As String)
' 'Capturo Datos
' NumHoja = (NumHoja * 43) - 43
' Hoja.Range("F" & NumHoja + 2 & ":F" & NumHoja + 2).Value = Tipo : Hoja.Range("J" & NumHoja + 2 & ":J" & NumHoja + 2).Value = Folio
' Hoja.Range("A" & NumHoja + 3 & ":A" & NumHoja + 3).Value = BarCode
' Hoja.Range("A" & NumHoja + 4 & ":A" & NumHoja + 4).Value = Calle : Hoja.Range("E" & NumHoja + 4 & ":E" & NumHoja + 4).Value = Numero : Hoja.Range("G" & NumHoja + 4 & ":G" & NumHoja + 4).Value = Interior : Hoja.Range("I" & NumHoja + 4 & ":I" & NumHoja + 4).Value = Colonia
' Hoja.Range("A" & NumHoja + 7 & ":A" & NumHoja + 7).Value = Seccion : Hoja.Range("E" & NumHoja + 7 & ":E" & NumHoja + 7).Value = CP : Hoja.Range("I" & NumHoja + 7 & ":I" & NumHoja + 7).Value = Municipio
' Hoja.Range("A" & NumHoja + 10 & ":A" & NumHoja + 10).Value = Paterno : Hoja.Range("E" & NumHoja + 10 & ":E" & NumHoja + 10).Value = Materno : Hoja.Range("I" & NumHoja + 10 & ":I" & NumHoja + 10).Value = Nombres
' 'CB
' If URLBarCode <> String.Empty Then
' Dim Top, Left, Width, Height As Single
' Left = 0
' Top = CSng(Hoja.Range("B" & NumHoja + 2 & ":B" & NumHoja + 2).Top)
' Width = CSng(Hoja.Range("B" & NumHoja + 2 & ":B" & NumHoja + 2).Width)
' Height = CSng(Hoja.Range("B" & NumHoja + 2 & ":B" & NumHoja + 2).Height)
' Hoja.Shapes.AddPicture(URLBarCode, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, Left, Top, Width, Height)
' End If
'End Sub
Protected Sub Btn_Click(sender As Object, e As EventArgs) Handles Btn.Click
'Dim Excel As msExcel.Application = New msExcel.Application()
'Dim VB_Module As VBComponent = Nothing
''Excel.Visible = True
''Excel.ScreenUpdating = True
''Excel.DisplayAlerts = True
'Dim Formato As String = "Formato Entrevista 3.xlsm"
'Dim ArchivoBase As New System.IO.FileInfo(AppDomain.CurrentDomain.BaseDirectory & "Recursos\" & Formato)
'ArchivoBase.CopyTo(AppDomain.CurrentDomain.BaseDirectory & "Recursos\Temp\" & UsuarioActual.CveUsuario & ".xlsm", True)
'Dim ArchivoTemp As New System.IO.FileInfo(AppDomain.CurrentDomain.BaseDirectory & "Recursos\Temp\" & UsuarioActual.CveUsuario & ".xlsm")
'Dim Libro As msExcel.Workbook = Excel.Workbooks.Open(ArchivoTemp.FullName, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing)
'Libro.Activate()
'Dim Hoja As msExcel.Worksheet = CType(Libro.Worksheets(1), Microsoft.Office.Interop.Excel.Worksheet)
'Hoja.Visible = Microsoft.Office.Interop.Excel.XlSheetVisibility.xlSheetVisible
'Hoja.Activate()
'Dim AddPage As New StringBuilder
'AddPage.Append(" Sub AddPage(RowF As String) " & vbLf)
'AddPage.Append(" Rows(""1:43"").Select " & vbLf)
'AddPage.Append(" Selection.Copy " & vbLf)
'AddPage.Append(" Rows(RowF & "":"" & RowF).Select " & vbLf)
'AddPage.Append(" Selection.Insert Shift:=xlDown " & vbLf)
'AddPage.Append(" End Sub " & vbLf)
'Dim RemoveFirstPage As New StringBuilder
'RemoveFirstPage.Append(" Sub RemoveFirst() " & vbLf)
'RemoveFirstPage.Append(" Rows(""1:43"").Select " & vbLf)
'RemoveFirstPage.Append(" Selection.Delete Shift:=xlUp " & vbLf)
'RemoveFirstPage.Append(" ActiveSheet.Shapes.Range(Array(""Picture 23"", ""Picture 16"", ""Picture 17"", ""Picture 18"", ""Picture 19"", ""Picture 20"", ""Picture 21"", ""Picture 22"", ""Picture 32"", ""Picture 33"", ""Picture 34"", ""Picture 35"", ""Picture 36"", ""Picture 37"", ""Picture 38"", ""Picture 39"", ""Picture 40"", ""Picture 41"", ""Picture 42"", ""Picture 43"", ""Picture 44"", ""Picture 45"", ""Picture 46"", ""Picture 47"", ""Picture 72"", ""Picture 73"", ""Picture 74"", ""Picture 75"", ""Picture 76"", ""Picture 77"", ""Picture 78"", ""Picture 80"", ""Picture 105"", ""Picture 104"", ""Picture 85"", ""Picture 87"", ""Picture 88"", ""Picture 89"", ""Picture 90"", ""Picture 96"", ""Picture 97"", ""Picture 98"", ""Picture 99"", ""Picture 100"", ""Picture 101"", ""Picture 102"", ""Picture 103"")).Select " & vbLf)
'RemoveFirstPage.Append(" Selection.Delete " & vbLf)
'RemoveFirstPage.Append(" End Sub " & vbLf)
'VB_Module = CType(Libro.VBProject.VBComponents.Add(Microsoft.Vbe.Interop.vbext_ComponentType.vbext_ct_StdModule), VBComponent)
'VB_Module.CodeModule.AddFromString(AddPage.ToString)
'VB_Module.CodeModule.AddFromString(RemoveFirstPage.ToString)
'Dim ObjProspectos As New ClsProspectos
'Dim NumHoja As Integer = 2
'For Each Row As GridViewRow In GvDatos.Rows
' 'If Row.FCCheckBox("Chk").Checked Then
' ''BarCode
' Dim BC39 As New Barcode39
' BC39.Code = Row.DataKey("Consec")
' Dim ObjImg As System.Drawing.Image = BC39.CreateDrawingImage(Drawing.Color.Black, Drawing.Color.White)
' ObjImg.Save(AppDomain.CurrentDomain.BaseDirectory & String.Format("Recursos\Temp\{0}.png", UsuarioActual.CveUsuario), System.Drawing.Imaging.ImageFormat.Png)
' ObjImg.Dispose()
' Dim ImgBC As String = String.Empty
' If System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & String.Format("Recursos\Temp\{0}.png", UsuarioActual.CveUsuario)) Then ImgBC = AppDomain.CurrentDomain.BaseDirectory & String.Format("Recursos\Temp\{0}.png", UsuarioActual.CveUsuario)
' Dim Folio As String = Row.DataKey("Seccion") & "-" & ObjProspectos.EncuestaFolioAdd(Row.DataKey("Tipo").ToEntero, 18, Row.DataKey("Seccion").ToEntero, Row.DataKey("IFE")).ToString
' Libro.Application.Run("AddPage", (NumHoja * 43) - 42, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing)
' GeneraHoja(Hoja, NumHoja, Row.DataKey("Consec"), ImgBC, Row.DataKey("Tipo"), Folio, Row.DataKey("Calle"), Row.DataKey("NumExterior"), Row.DataKey("NumInterior"),
' Row.DataKey("Colonia"), Row.DataKey("Seccion"), Row.DataKey("CP"), Row.DataKey("PadronMunicipio"), Row.DataKey("APaterno"), Row.DataKey("AMaterno"), Row.DataKey("Nombres"))
' NumHoja = NumHoja + 1
' 'End If
'Next
'ObjProspectos.Dispose()
'Libro.Application.Run("RemoveFirst", missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing)
''Exportar PDF
'Dim pdfFileOut As String = AppDomain.CurrentDomain.BaseDirectory & String.Format("Recursos\Temp\Tipo_{0}_Mun_{1}_Secc_{2}_.pdf", DdlTipo.SelectedItem.Text, DdlMunicipio.SelectedItem.Text, DdlSeccion.SelectedItem.Text)
'Dim outputFileName As Object = pdfFileOut
'Dim fileFormat As msExcel.XlFixedFormatType = msExcel.XlFixedFormatType.xlTypePDF
'Libro.ExportAsFixedFormat(fileFormat, outputFileName, missing, missing, missing, missing, missing, missing, missing)
'System.Runtime.InteropServices.Marshal.ReleaseComObject(Hoja)
'Hoja = Nothing
'Dim saveChanges As Object = msExcel.XlSaveAction.xlDoNotSaveChanges
'CType(Libro, msExcel._Workbook).Close(saveChanges, missing, missing)
'System.Runtime.InteropServices.Marshal.ReleaseComObject(Libro)
'Libro = Nothing
'Excel.Quit()
'System.Runtime.InteropServices.Marshal.ReleaseComObject(Excel)
'Excel = Nothing
'GC.Collect()
'GC.WaitForPendingFinalizers()
'ArchivoTemp.Delete()
'If System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory & String.Format("Recursos\Temp\{0}.png", UsuarioActual.CveUsuario)) Then System.IO.File.Delete(AppDomain.CurrentDomain.BaseDirectory & String.Format("Recursos\Temp\{0}.png", UsuarioActual.CveUsuario))
'Dim Descargas As New StringBuilder()
'Descargas.AppendFormat("<li><a class=""Texto"" href=""/Recursos/Temp/Tipo_{0}_Mun_{1}_Secc_{2}_.pdf"">PDF</a></li>", DdlTipo.SelectedItem.Text, DdlMunicipio.SelectedItem.Text, DdlSeccion.SelectedItem.Text)
'Alert("<br />La generación se realizó correctamente.<br /><br /><br />Descargas:<ul>" & Descargas.ToString & "</ul>", TipoMensaje.MsgInformacion)
''RegistraScript("AbrirVentana('/Ventas/PopUpImprimir.aspx?CveVenta=" & If(EsVistaPrevia, UsuarioActual.CveUsuario.ToString, VentaFolio) & "&Ext=PDF', 700, 400, 'N', 'ImpVenta')")
End Sub
Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlMunicipio.SelectedIndexChanged
Dim ObjProspectos As New ClsProspectos
'Distritos
Dim DT As DataTable = Nothing
If ObjProspectos.GetFiltros("Dist") Then
DT = ObjProspectos.DtResultados
Else
DT = Nothing
End If
ObjProspectos.Dispose()
If DT IsNot Nothing AndAlso DT.Rows.Count > 0 Then
'Cargo DistLoc
Dim FiltroMun As String = String.Empty
If DdlMunicipio.SelectedIndex > 0 Then FiltroMun = "Municipio = '" & DdlMunicipio.SelectedValue & "'"
DdlDistLoc.DataSource = DT.FiltraParametros(FiltroMun, "", {"Dist_Loc"})
DdlDistLoc.DataBind()
DdlDistLoc.Items.Insert(0, New ListItem("Todos", "-1"))
End If
If DT IsNot Nothing Then DT.Dispose()
End Sub
Protected Sub DdlDistLoc_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlDistLoc.SelectedIndexChanged
Dim ObjProspectos As New ClsProspectos
'Distritos
Dim DT As DataTable = Nothing
If ObjProspectos.GetFiltros("Dist") Then
DT = ObjProspectos.DtResultados
Else
DT = Nothing
End If
ObjProspectos.Dispose()
If DT IsNot Nothing AndAlso DT.Rows.Count > 0 Then
'Cargo DistLoc
Dim FiltroDistLoc As String = String.Empty
If DdlDistLoc.SelectedIndex > 0 Then FiltroDistLoc = "Dist_Loc = '" & DdlDistLoc.SelectedValue & "'"
DdlSeccion.DataSource = DT.FiltraParametros(FiltroDistLoc, "", {"seccion"})
DdlSeccion.DataBind()
DdlSeccion.Items.Insert(0, New ListItem("Todas", "-1"))
End If
If DT IsNot Nothing Then DT.Dispose()
End Sub
End Class

View File

@@ -0,0 +1,111 @@
<%@ Page Title="Ventas - Búsqueda de Prospectos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpBuscarProspectos.aspx.vb" Inherits="PopUpBuscarProspectos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" Runat="Server">
Búsqueda de Prospectos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" Runat="Server">
<br />
<asp:HiddenField ID="hdnEsThickbox" runat="server" ClientIDMode="Static" />
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table class="Widthall"><%-- border="1" rules="all" style="border-collapse: collapse;"--%>
<tr>
<td class="Titulos" colspan="4">Filtros para búsqueda</td>
</tr>
<tr align="left">
<td class="text-right"><b>Nombre:</b></td>
<td><asp:TextBox ID="TxtNombre" runat="server" MaxLength="90" Width="200px"></asp:TextBox></td>
<td class="text-right"><b>Empresa:</b></td>
<td><asp:TextBox ID="TxtNombreEmpresa" runat="server" MaxLength="90" Width="200px"></asp:TextBox></td>
</tr>
<tr align="left">
<td class="text-right">
<b>Teléfono/Celular:</b>
</td>
<td><asp:TextBox ID="txtCelular" runat="server" MaxLength="90" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td colspan="4" style="text-align: center;">
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" CssClass="btn btn-primary"/>
<asp:Button ID="BtnNuevo" runat="server" Text="Nuevo" CssClass="btn btn-success" Visible="false" OnClientClick="window.opener.document.location.href = '/Prospectos/ProspectosSIP.aspx';window.close();" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table id="TblBusqueda" runat="server" border="0" visible="false">
<tr>
<td align="left">Número de registros encontrados:&nbsp;<b><asp:Literal ID="LtlTotalRegistros" runat="server"></asp:Literal></b></td>
</tr>
<tr>
<td>
<div id="DivBeneficiarios" style="overflow-y:auto; width:760px; height:285px;">
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Contratos encontrados." CssClass="table table-striped table-advance table-hover" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Nombre">
<ItemTemplate>
<div class="truncate" style="width:160px"><asp:HyperLink ID="Hpl" CssClass="Texto" runat="server" NavigateUrl="#" Text='<%# Eval("NombreCompleto")%>' tooltip='<%# Eval("CveProspecto") %>'></asp:HyperLink></div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Empresa">
<ItemTemplate>
<div class="truncate" style="width:125px"><asp:Label runat="server" ID="LblEmpresaNombre" Text='<%# Eval("EmpresaNombre")%>'></asp:Label></div>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField DataField="EmpresaNombre" HeaderText="Empresa"/>--%>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<div class="truncate" style="width:35px"><asp:Label runat="server" ID="LblProspectoTipo" Text='<%# Eval("ProspectoTipo")%>'></asp:Label></div>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField DataField="ProspectoTipo" HeaderText=""/>--%>
<asp:TemplateField HeaderText="Calle">
<ItemTemplate>
<div class="truncate" style="width:130px"><asp:Label runat="server" ID="LblCalle" Text='<%# Eval("Calle")%>'></asp:Label></div>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField DataField="Calle" HeaderText="Calle"/>--%>
<asp:TemplateField HeaderText="#">
<ItemTemplate>
<div class="truncate" style="width:65px"><asp:Label runat="server" ID="LblNumero" Text='<%# Eval("Numero")%>'></asp:Label></div>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField DataField="Numero" HeaderText="#"/>--%>
<%--<asp:BoundField DataField="Edad" HeaderText="Edad"/>
<asp:BoundField DataField="FechaNacimiento" DataFormatString="{0:d}" HeaderText="F. Nacimiento"/>--%>
<asp:TemplateField HeaderText="Municipio">
<ItemTemplate>
<div class="truncate" style="width:130px"><asp:Label runat="server" ID="LblMunicipio" Text='<%# Eval("Municipio")%>'></asp:Label></div>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField DataField="Municipio" HeaderText="Municipio"/>--%>
</Columns>
</asp:GridView>
</div>
</td>
</tr>
</table>
<br />
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script language="javascript" type="text/javascript">
function Ir(ir) {
gotourl(ir);
window.close();
}
</script>
</asp:Content>

View File

@@ -0,0 +1,82 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class PopUpBuscarProspectos
Inherits ClsPaginas
Private ReadOnly Property OpcionBusqueda As String
Get
Return ViewState("Opt").ToString
End Get
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CType(Me.Master, BaseMasterPage).EsPopup = True
CType(Me.Master, BaseMasterPage).PopupWidth = 800
RegistraScript("$get('tdContenido').style.height='520px'")
TxtNombre.Focus()
ViewState("Opt") = IfNull(Request("Opt"), "")
If OpcionBusqueda = "SIP" Then BtnNuevo.Visible = True
If Not Request("EsThickbox") Is Nothing Then
hdnEsThickbox.Value = Request("EsThickbox")
Else
hdnEsThickbox.Value = "N"
End If
End If
End Sub
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
Dim ObjProsp As New ClsProspectos()
Dim Nombre As String = "-1"
Dim NombreEmpresa As String = "-1"
Dim Celular As String = "-1"
If TxtNombre.Text.Trim <> String.Empty Then Nombre = TxtNombre.Text.Trim
If TxtNombreEmpresa.Text.Trim <> String.Empty Then NombreEmpresa = TxtNombreEmpresa.Text.Trim
If txtCelular.Text.Trim <> String.Empty Then Celular = txtCelular.Text.Trim
If ObjProsp.GetProspectosDetalle(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, "-1", -1, Nombre, NombreEmpresa, Celular, UsuarioActual.CveEmpresa) Then
If ObjProsp.DtResultados.Rows.Count > 0 Then
LtlTotalRegistros.Text = ObjProsp.DtResultados.Rows.Count.ToString.FormatoNumero(0)
GV.DataSource = ObjProsp.DtResultados
Else
LtlTotalRegistros.Text = "0"
GV.DataSource = Nothing
Alert("No se encontraron registros con losparámetros solicitados.", Extensiones.TipoMensaje.MsgAdvertencia)
End If
End If
ObjProsp.Dispose()
GV.DataBind()
UPDatos.Update()
TblBusqueda.Visible = True
End Sub
Protected Sub GV_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GV.RowDataBound
If 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(80)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
Select Case OpcionBusqueda
Case "Redes"
e.Row.FCHyperLink("Hpl").Attributes.Add("onclick", String.Format("Ir('/Prospectos/ProspectosRedes.aspx?CveProspecto={0}')", e.Row.DBCampo("CveProspecto")))
Case "Atn"
e.Row.FCHyperLink("Hpl").Attributes.Add("onclick", String.Format("Ir('/Prospectos/ProspectosG15.aspx?CveProspecto={0}')", e.Row.DBCampo("CveProspecto")))
Case "SIP"
e.Row.FCHyperLink("Hpl").Attributes.Add("onclick", String.Format("Ir('/Prospectos/ProspectosSIP.aspx?CveProspecto={0}')", e.Row.DBCampo("CveProspecto")))
Case Else
e.Row.FCHyperLink("Hpl").Attributes.Add("onclick", String.Format("Ir('/Prospectos/Prospectos.aspx?CveProspecto={0}')", e.Row.DBCampo("CveProspecto")))
End Select
End If
End Sub
End Class

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,304 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.IO
Imports System.Data
Imports System.Web.Services
Partial Class Prospectos_ProspectoExpediente
Inherits ClsPaginas
'Confinguración
Private Property DTProspectosValores As DataTable
Get
Return CType(ViewState("DTProspectosValores"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTProspectosValores") = value
End Set
End Property
Private ReadOnly Property CveProspecto As Integer
Get
Return ViewState("CveProspecto").ToString.ToEntero
End Get
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
DdlPaises.DataSource = GlobalDTGralPaises : DdlPaises.DataBind()
DdlEmpresaPaises.DataSource = GlobalDTGralPaises : DdlEmpresaPaises.DataBind()
DdlEscolaridad.DataSource = GlobalDTGralEscolaridades : DdlEscolaridad.DataBind() : DdlEscolaridad.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlClasificacion.DataSource = GlobalDTProspectosClasificaciones(UsuarioActual.CveEmpresa) : DdlClasificacion.DataBind() : DdlClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlCoordinador.DataSource = GlobalDTProspectosCoordinadores(-1, UsuarioActual.CveEmpresa) : DdlCoordinador.DataBind() : DdlCoordinador.Items.Insert(0, New ListItem("Seleccione", "-1"))
'Codigo Comentado por objeto actual, se quitaron campos
'If UsuarioActual.CveCoordinador > 0 Then
' DdlCoordinador.SelectedValue = UsuarioActual.CveCoordinador.ToString
' DdlCoordinador.Enabled = False
'End If
'HdnCveProspectoPadre.Value = UsuarioActual.CveProspecto.ToString
'CEFechaNacimiento.EndDate = Today
'DdlMunicipios.DataSource = GlobalDTGralMunicipios : DdlMunicipios.DataBind()
If Request("CveProspecto") IsNot Nothing AndAlso IsNumeric(Request("CveProspecto")) AndAlso Request("CveProspecto").ToEntero > 0 Then
ViewState("CveProspecto") = Request("CveProspecto")
CargaDatos()
'Configuración de Modalidad Update
BtnGuardar.Text = "Guardar Cambios"
LtlTitulo.Text = "Consulta del Prospecto:"
Else
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
DdlEstados.SelectedValue = "26"
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
DdlEmpresaEstados.SelectedValue = "26"
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
ViewState("CveProspecto") = -1
TxtFechaIngreso.Text = Now.ToShortDateString
End If
End If
End Sub
<WebMethod()> <Script.Services.ScriptMethodAttribute()> _
Public Shared Function wsGetReporta(ByVal prefixText As String, ByVal count As Integer) As String()
'Dim dt As DataTable = CType(Session("DtCuentas"), DataTable)
'Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
'dt = Conta.getCuentasCheque(Prefijo)
'Conta.Dispose()
Dim items As New List(Of String)(count)
Dim Prosp As New ClsProspectos
Dim dt As DataTable = Nothing
If Prosp.GetProspectos(-1, prefixText.Trim, "-1", -1, -1, -1, -1, -1, -1, 41) Then
dt = Prosp.DtResultados
End If
Prosp.Dispose()
For i As Integer = 0 To count - 1
If dt.Rows.Count > i Then
items.Add(AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(dt.Rows(i)("NombreCompleto").ToString, dt.Rows(i)("CveProspecto").ToString))
Else
Exit For
End If
Next
Return items.ToArray()
End Function
Private Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetProspectos(CveProspecto, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
If ObjProspectos.DtResultados.Rows.Count > 0 Then
LtlProspectos.Text = String.Format("{0} {1} {2}", ObjProspectos.ApellidoPaterno, ObjProspectos.ApellidoMaterno, ObjProspectos.Nombres)
TxtCveProspecto.Text = ObjProspectos.CveProspecto.ToString
TxtApellidoPaterno.Text = ObjProspectos.ApellidoPaterno
TxtApellidoMaterno.Text = ObjProspectos.ApellidoMaterno
TxtNombres.Text = ObjProspectos.Nombres
TxtFechaNacimiento.Text = ObjProspectos.FechaNacimiento.ToString
TxtLugarNacimiento.Text = ObjProspectos.LugarNacimiento
TxtRFC.Text = ObjProspectos.RFC
TxtNacionalidad.Text = ObjProspectos.Nacionalidad
TxtCalle.Text = ObjProspectos.Calle
TxtNumero.Text = ObjProspectos.Numero
TxtNumeroInterior.Text = ObjProspectos.NumeroInterior
TxtEntreCalle1.Text = ObjProspectos.EntreCalle1
TxtEntreCalle2.Text = ObjProspectos.EntreCalle2
TxtIFE.Text = ObjProspectos.IFE
DdlClasificacion.SelectedValue = ObjProspectos.CveProspectoClasificacion.ToString
DdlEscolaridad.SelectedValue = ObjProspectos.CveEscolaridad.ToString
DdlSexo.SelectedValue = ObjProspectos.Sexo.ToString
TxtColonia.Text = ObjProspectos.Colonia
TxtCodigoPostal.Text = ObjProspectos.CodigoPostal.ToString
DdlPaises.SelectedValue = ObjProspectos.CvePais.ToString
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
DdlEstados.SelectedValue = ObjProspectos.CveEstado.ToString
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
DdlMunicipios.SelectedValue = ObjProspectos.CveMunicipio.ToString
TxtFacebook.Text = ObjProspectos.Facebook
TxtTwitter.Text = ObjProspectos.Twitter
HdnCveProspectoPadre.Value = ObjProspectos.CveProspectoPadre.ToString
TxtReporta.Text = ObjProspectos.ProspectoPadre
TxtTelefono.Text = ObjProspectos.Telefono
TxtCelular.Text = ObjProspectos.Celular
'TxtFax.Text = ObjProspectos.Fax
TxtCorreo.Text = ObjProspectos.Correo
TxtEmpresaNombre.Text = ObjProspectos.EmpresaNombre
TxtEmpresaGiro.Text = ObjProspectos.EmpresaGiro
TxtEmpresaSector.Text = ObjProspectos.EmpresaSector
TxtEmpresaPagina.Text = ObjProspectos.EmpresaPagina
TxtEmpresaCalle.Text = ObjProspectos.EmpresaCalle
TxtEmpresaNumero.Text = ObjProspectos.EmpresaNumero
TxtEmpresaColonia.Text = ObjProspectos.EmpresaColonia
TxtEmpresaCodigoPostal.Text = ObjProspectos.EmpresaCodigoPostal
DdlEmpresaPaises.SelectedValue = ObjProspectos.CveEmpresaPais.ToString
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
DdlEmpresaEstados.SelectedValue = ObjProspectos.CveEmpresaEstado.ToString
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
DdlEmpresaMunicipios.SelectedValue = ObjProspectos.CveEmpresaMunicipio.ToString
ImgAddObs.Visible = True
ImgAddAgenda.Visible = True
ImgAddObs.Attributes.Add("onclick", "javascript:$get('divObs').style.display=''; PosicionaObjeto(this.id,'divObs');")
ImgAddAgenda.Attributes.Add("onclick", "javascript:$get('divAgenda').style.display=''; PosicionaObjeto(this.id,'divAgenda');")
DdlCoordinador.SelectedValue = ObjProspectos.CveCoordinador.ToString
'cveEmpresaPais.Text = ObjProspectos.EmpresaPais
'TxtEmpresaMunicipio.Text = ObjProspectos.EmpresaMunicipio
'TxtEmpresaEstado.Text = ObjProspectos.EmpresaEstado
TxtEmpresaTelefono.Text = ObjProspectos.EmpresaTelefono
TxtEmpresaFax.Text = ObjProspectos.EmpresaFax
TxtEmpresaCorreo.Text = ObjProspectos.EmpresaCorreo
TxtEmpresaPuesto.Text = ObjProspectos.EmpresaPuesto
TxtEmpresaEspecialidad.Text = ObjProspectos.EmpresaEspecialidad
TxtFechaIngreso.Text = ObjProspectos.FechaIng.ToShortDateString
TxtFechaIngreso.Enabled = False
ImgFechaIngreso.Visible = False
'TxtCveEstatus.Text = ObjProspectos.CveEstatus
'TxtFechaIng.Text = ObjProspectos.FechaIng
'TxtCveUsuario.Text = ObjProspectos.CveUsuario
'TxtCveEmpresa.Text = ObjProspectos.CveEmpresa
'Cargar los Valores de las Caractertisticas
If ObjProspectos.GetProspectosValores(CveProspecto) Then
ViewState("DTProspectosValores") = ObjProspectos.DtResultados
End If
'Permiso Eliminar
If UsuarioActual.TienePermisoProceso(78) Then BtnEliminar.Visible = True Else BtnEliminar.Visible = False
End If
End If
ObjProspectos.Dispose()
End Sub
Private Sub CargaEstados(ddl As DropDownList, CvePais As Integer)
ddl.DataSource = GlobalDTGralEstados(CvePais) : ddl.DataBind()
End Sub
Private Sub CargaMunicipios(ddl As DropDownList, CveEstado As Integer)
ddl.DataSource = GlobalDTGralMunicipios(CveEstado) : ddl.DataBind()
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
If DdlClasificacion.SelectedValue.ToEntero < 0 Then
Alert("Seleccione la clasificación, por favor", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim FechaIngreso As String = TxtFechaIngreso.Text.Trim
If FechaIngreso = "__/__/____" Then FechaIngreso = "-1"
If TxtFechaIngreso.Text.Trim = Now.ToShortDateString Then
FechaIngreso = Now.ToString
End If
Dim ObjProspectos As New ClsProspectos
If CveProspecto = -1 Then
If HdnCveProspectoPadre.Value.ToEntero > 0 Then
Dim RetValue As Integer
RetValue = ObjProspectos.AddProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
TxtNombres.Text.Trim, TxtFechaNacimiento.Text.Trim.ToDate, TxtLugarNacimiento.Text.Trim, TxtRFC.Text.Trim, TxtNacionalidad.Text.Trim, DdlSexo.SelectedValue.ToEntero, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, TxtEntreCalle1.Text.Trim, TxtEntreCalle2.Text.Trim, TxtColonia.Text.Trim, TxtCodigoPostal.Text.Trim.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text, "", "", TxtCorreo.Text.Trim, "", TxtFacebook.Text.Trim, TxtTwitter.Text.Trim, -1, DdlClasificacion.SelectedValue.ToEntero, DdlEscolaridad.SelectedValue.ToEntero, TxtEmpresaNombre.Text.Trim, TxtEmpresaGiro.Text.Trim, TxtEmpresaSector.Text.Trim,
TxtEmpresaPagina.Text.Trim, TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, TxtEmpresaCodigoPostal.Text.Trim, DdlEmpresaMunicipios.SelectedValue.ToEntero,
TxtEmpresaTelefono.Text.Trim, TxtEmpresaFax.Text.Trim, TxtEmpresaCorreo.Text.Trim, TxtEmpresaPuesto.Text.Trim,
TxtEmpresaEspecialidad.Text.Trim, False, "", "", "", "", -1, "", HdnCveProspectoPadre.Value.ToEntero, DdlCoordinador.SelectedValue.ToEntero, -1, TxtIFE.Text.Trim, -1, -1, -1, "", 0, "", -1, -1, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FechaIngreso)
If RetValue > 0 Then
ViewState("CveProspecto") = ObjProspectos.CveProspecto
Alert("El Prospecto se guardó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/CatProspectosRedes.aspx"";")
Else
If RetValue = -2 Then
Alert("No se puede duplicar el campo IFE", TipoMensaje.MsgError)
End If
End If
Else
Alert("Selecione a quién reporta(superior).", TipoMensaje.MsgAdvertencia)
End If
Else
If ObjProspectos.UpdateProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
TxtNombres.Text.Trim, TxtFechaNacimiento.Text.Trim.ToDate, TxtLugarNacimiento.Text.Trim, TxtRFC.Text.Trim, TxtNacionalidad.Text.Trim, DdlSexo.SelectedValue.ToEntero, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, TxtEntreCalle1.Text.Trim, TxtEntreCalle2.Text.Trim, TxtColonia.Text.Trim, TxtCodigoPostal.Text.Trim.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text, "", "", TxtCorreo.Text.Trim, "", TxtFacebook.Text.Trim, TxtTwitter.Text.Trim, -1, DdlClasificacion.SelectedValue.ToEntero, DdlEscolaridad.SelectedValue.ToEntero, TxtEmpresaNombre.Text.Trim, TxtEmpresaGiro.Text.Trim, TxtEmpresaSector.Text.Trim,
TxtEmpresaPagina.Text.Trim, TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, TxtEmpresaCodigoPostal.Text.Trim, DdlEmpresaMunicipios.SelectedValue.ToEntero,
TxtEmpresaTelefono.Text.Trim, TxtEmpresaFax.Text.Trim, TxtEmpresaCorreo.Text.Trim, TxtEmpresaPuesto.Text.Trim,
TxtEmpresaEspecialidad.Text.Trim, False, "", "", "", "", -1, "", HdnCveProspectoPadre.Value.ToEntero, DdlCoordinador.SelectedValue.ToEntero, -1, TxtIFE.Text.Trim, -1, -1, -1, "", 0, "", -1, -1, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProspecto) Then
UpDatos.Update()
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/CatProspectosRedes.aspx"";")
End If
End If
ObjProspectos.Dispose()
Alert(HdnCveProspectoPadre.Value, TipoMensaje.MsgInformacion)
End Sub
Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click
Dim ObjProspectos As New ClsProspectos()
If ObjProspectos.RemoveProspectos(CveProspecto) Then
Alert("El Prospecto se Eliminó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/CatProspectos.aspx""")
End If
ObjProspectos.Dispose()
End Sub
Protected Sub DdlPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPaises.SelectedIndexChanged
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
UPPEstados.Update()
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
UPPMunicipios.Update()
End Sub
Protected Sub DdlEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEstados.SelectedIndexChanged
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
UPPMunicipios.Update()
End Sub
Protected Sub DdlEmpresaPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaPaises.SelectedIndexChanged
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
UPPEmpresaEstados.Update()
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
UPPEmpresaMunicipios.Update()
End Sub
Protected Sub DdlEmpresaEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaEstados.SelectedIndexChanged
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
UPPEmpresaMunicipios.Update()
End Sub
End Class

696
Prospectos/Prospectos.aspx Normal file
View File

@@ -0,0 +1,696 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Prospectos.aspx.vb" Inherits="Prospectos_Prospectos" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
<asp:Literal ID="LtlTitulo" runat="server" Text="Registro de Prospectos"></asp:Literal>&nbsp;<asp:Literal ID="LtlProspectos" runat="server"></asp:Literal>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<style type="text/css">
.CaracteristicaPrincipal {
font-size: 14px;
color: #fff;
background-color: gray;
}
</style>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding-top: 20px;">
<tr>
<td align="left">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabAlta" runat="server" HeaderText="Información General">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<div>
<fieldset>
<legend><b>Datos Generales</b></legend>
<table border="0" cellpadding="1" cellspacing="0">
<tr>
<%--<td>CveProspecto</td>--%><td>
<asp:TextBox ID="TxtCveProspecto" runat="server" MaxLength="12" Width="200px" Enabled="false" Visible="false"></asp:TextBox></td>
</tr>
<tr>
<td>Apellido Paterno:</td>
<td>
<asp:TextBox ID="TxtApellidoPaterno" runat="server" MaxLength="50" Width="150px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVApellidoPaterno" runat="server" ControlToValidate="TxtApellidoPaterno" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Apellido Paterno''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEApellidoPaterno" runat="server" HighlightCssClass="vco" TargetControlID="RFVApellidoPaterno" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>Apellido Materno: </td>
<td>
<asp:TextBox ID="TxtApellidoMaterno" runat="server" MaxLength="50" Width="150px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVApellidoMaterno" runat="server" ControlToValidate="TxtApellidoMaterno" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Apellido Materno ''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEApellidoMaterno" runat="server" HighlightCssClass="vco" TargetControlID="RFVApellidoMaterno" Width="300px">
</ajax:ValidatorCalloutExtender>
</td>
<td>Nombre(s):</td>
<td>
<asp:TextBox ID="TxtNombres" runat="server" MaxLength="12" Width="200px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVNombres" runat="server" ControlToValidate="TxtNombres" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombres''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCENombres" runat="server" HighlightCssClass="vco" TargetControlID="RFVNombres" Width="300px">
</ajax:ValidatorCalloutExtender>
</td>
<td colspan="2"></td>
</tr>
<tr>
<td>Lugar Nacimiento</td>
<td>
<asp:TextBox ID="TxtLugarNacimiento" runat="server" MaxLength="50" Width="150px"></asp:TextBox></td>
<td>Fecha Nacimiento</td>
<td>
<asp:TextBox ID="TxtFechaNacimiento" runat="server" MaxLength="12" Width="100px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgCalendario" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFechaNacimiento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="Calendario" runat="server" TargetControlID="TxtFechaNacimiento" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaNacimiento" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaNacimiento" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaNacimiento1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaNacimiento" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFechaNacimiento2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaNacimiento" Width="350px"></ajax:ValidatorCalloutExtender>
</td>
<td colspan="2"></td>
</tr>
<tr>
<td>RFC</td>
<td>
<asp:TextBox ID="TxtRFC" runat="server" MaxLength="13" Width="150px"></asp:TextBox></td>
<td>Nacionalidad</td>
<td>
<asp:TextBox ID="TxtNacionalidad" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Sexo</td>
<td>
<asp:DropDownList ID="DdlSexo" Width="50px" runat="server">
<asp:ListItem Text="Femenino" Value="0"></asp:ListItem>
<asp:ListItem Text="Masculino" Value="1"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</fieldset>
<br />
<fieldset>
<legend><b>Domicilio Particular</b></legend>
<table border="0">
<tr>
<td>Calle: </td>
<td>
<asp:TextBox ID="TxtCalle" runat="server" MaxLength="100" Width="200px"></asp:TextBox></td>
<td>Número: </td>
<td>
<asp:TextBox ID="TxtNumero" runat="server" MaxLength="10" Width="200px"></asp:TextBox></td>
<td>No. Interior</td>
<td>
<asp:TextBox ID="TxtNumeroInterior" runat="server" MaxLength="10" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Colonia: </td>
<td>
<asp:TextBox ID="TxtColonia" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Código Postal: </td>
<td>
<asp:TextBox ID="TxtCodigoPostal" runat="server" MaxLength="5" Width="200px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="FTBECodigoPostal" runat="server" TargetControlID="TxtCodigoPostal" FilterType="Numbers" />
</td>
<td colspan="2"></td>
</tr>
<tr>
<td>País: </td>
<td>
<asp:UpdatePanel ID="UPPPaises" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlPaises" DataTextField="Pais" DataValueField="CvePais" Width="200px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>Estado: </td>
<td>
<asp:UpdatePanel ID="UPPEstados" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlEstados" DataTextField="Estado" DataValueField="CveEstado" idth="200px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>Municipio:</td>
<td>
<asp:UpdatePanel ID="UPPMunicipios" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlMunicipios" DataTextField="Municipio" DataValueField="CveMunicipio" Width="200px" runat="server"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>Teléfono: </td>
<td>
<asp:TextBox ID="TxtTelefono" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Fax: </td>
<td>
<asp:TextBox ID="TxtFax" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Correo: </td>
<td>
<asp:TextBox ID="TxtCorreo" runat="server" MaxLength="100" Width="200px"></asp:TextBox></td>
</tr>
</table>
</fieldset>
<br />
<fieldset>
<legend><b>Datos de la Empresa o Institución</b></legend>
<table border="0">
<tr>
<td>Nombre</td>
<td colspan="3">
<asp:TextBox ID="TxtEmpresaNombre" runat="server" MaxLength="100" Width="490px"></asp:TextBox></td>
<td>Giro</td>
<td>
<asp:TextBox ID="TxtEmpresaGiro" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Sector</td>
<td>
<asp:TextBox ID="TxtEmpresaSector" runat="server" MaxLength="1" Width="200px"></asp:TextBox></td>
<td>Página</td>
<td>
<asp:TextBox ID="TxtEmpresaPagina" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Calle</td>
<td>
<asp:TextBox ID="TxtEmpresaCalle" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Número</td>
<td>
<asp:TextBox ID="TxtEmpresaNumero" runat="server" MaxLength="10" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Colonia</td>
<td>
<asp:TextBox ID="TxtEmpresaColonia" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>CódigoPostal</td>
<td>
<asp:TextBox ID="TxtEmpresaCodigoPostal" runat="server" MaxLength="5" Width="200px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="FTBEEmpresaCodigoPostal" runat="server" TargetControlID="TxtEmpresaCodigoPostal" FilterType="Numbers" />
</td>
</tr>
<tr>
<td>País</td>
<td>
<asp:UpdatePanel ID="UPPEmpresaPaises" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlEmpresaPaises" DataTextField="Pais" DataValueField="CvePais" Width="200px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>Estado</td>
<td>
<asp:UpdatePanel ID="UPPEmpresaEstados" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlEmpresaEstados" DataTextField="Estado" DataValueField="CveEstado" idth="200px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>Municipio</td>
<td>
<asp:UpdatePanel ID="UPPEmpresaMunicipios" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlEmpresaMunicipios" DataTextField="Municipio" DataValueField="CveMunicipio" Width="200px" runat="server"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>Teléfono</td>
<td>
<asp:TextBox ID="TxtEmpresaTelefono" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Fax</td>
<td>
<asp:TextBox ID="TxtEmpresaFax" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Correo</td>
<td>
<asp:TextBox ID="TxtEmpresaCorreo" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Puesto</td>
<td>
<asp:TextBox ID="TxtEmpresaPuesto" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Especialidad</td>
<td>
<asp:TextBox ID="TxtEmpresaEspecialidad" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td></td>
</tr>
</table>
</fieldset>
<br />
<fieldset>
<legend><b>Envío de Correspondencia</b></legend>
<table border="0">
<tr>
<td>EnvioCorrespondencia</td>
<td>
<asp:CheckBox ID="ChkEnvioCorrespondencia" runat="server" /></td>
</tr>
</table>
</fieldset>
<br />
<fieldset>
<legend><b>Datos Fiscales</b></legend>
<table border="0">
<tr>
<td>Razón Social</td>
<td>
<asp:TextBox ID="TxtFiscalRazonSocial" runat="server" MaxLength="100" Width="490px"></asp:TextBox></td>
<td>RFC</td>
<td>
<asp:TextBox ID="TxtFiscalRFC" runat="server" MaxLength="13" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Domicilio</td>
<td>
<asp:TextBox ID="TxtFiscalDomicilio" runat="server" MaxLength="100" Width="490px"></asp:TextBox></td>
<td>Colonia</td>
<td>
<asp:TextBox ID="TxtFiscalColonia" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Código Postal</td>
<td>
<asp:TextBox ID="TxtFiscalCodigoPostal" runat="server" MaxLength="5" Width="200px"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="ftbeFiscalCodigoPostal" runat="server" TargetControlID="TxtFiscalCodigoPostal" FilterType="Numbers" />
</td>
</tr>
<tr>
<td>Estado</td>
<td>
<asp:UpdatePanel ID="UPPFiscalEstados" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlFiscalEstados" DataTextField="Estado" DataValueField="CveEstado" idth="200px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>Municipio</td>
<td>
<asp:UpdatePanel ID="UPPFiscalMunicipios" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlFiscalMunicipios" DataTextField="Municipio" DataValueField="CveMunicipio" Width="200px" runat="server"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</fieldset>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabCarac" runat="server" HeaderText="Escolaridad">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<asp:GridView ID="GvClasificaciones" runat="server" ShowHeader="false" AutoGenerateColumns="False" DataKeyNames="CveCaracteristicaClasificacion" EmptyDataText="No se encontraron Clasificaciones de Caracteristicas Registradas" ToolTip="Listado de Clasificaciones de Caracteristicas">
<Columns>
<asp:TemplateField>
<ItemStyle BorderStyle="None" />
<ItemTemplate>
<asp:Label Font-Bold="true" Width="100%" ID="LblCaracteristicaClasificacion" runat="server" Text='<%# Eval("CaracteristicaClasificacion")%>'></asp:Label>
<asp:GridView ID="GvTiposCaracteristicas" ShowHeader="false" OnRowDataBound="GvTiposCaracteristicas_RowDataBound" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCaracteristicaTipo" EmptyDataText="No se encontraron Tipos de Caracteristicas Registrados" ToolTip="Listado de Tipos de Caracteristicas">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label Font-Bold="true" Width="100%" ID="LblCaracteristicaTipo" runat="server" Text='<%# Eval("CaracteristicaTipo")%>'></asp:Label>
<asp:GridView ID="GvCaracteristicas" ShowHeader="false" OnRowDataBound="GvCaracteristicas_RowDataBound" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCaracteristica" EmptyDataText="No se encontraron Caracteristicas Registrados" ToolTip="Listado de Caracteristicas">
<Columns>
<asp:TemplateField>
<ItemStyle BorderStyle="None" />
<ItemTemplate>
<asp:Label ID="LtlCaracteristica" runat="server" Text='<%# Eval("Caracteristica")%>' Width="200px"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemStyle BorderStyle="None" />
<ItemTemplate>
<asp:TextBox ID="TxtValor" Visible="false" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpEditGuardarCl" Width="400px"></asp:TextBox>
<asp:ImageButton runat="server" ID="ImgTxtValor" Visible="false" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEETxtValor" Enabled="false" runat="server" TargetControlID="TxtValor" Mask="99/99/9999" MaskType="Date" UserDateFormat="DayMonthYear" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CETxtValor" TargetControlID="TxtValor" PopupButtonID="ImgTxtValor" PopupPosition="BottomRight" Enabled="False"></ajax:CalendarExtender>
<asp:DropDownList ID="DdlCaracteristicaOpcion" Visible="false" runat="server" DataValueField="CveCaracteristicaOpcion" DataTextField="CaracteristicaOpcion"></asp:DropDownList>
<asp:RadioButtonList ID="RbCaracteristicaOpcion" Visible="false" RepeatDirection="Horizontal" runat="server" DataValueField="CveCaracteristicaOpcion" DataTextField="CaracteristicaOpcion" ValidationGroup="GrpGuardar"></asp:RadioButtonList>
<asp:RequiredFieldValidator ID="RFVRbCaracteristicaOpcion" runat="server" ControlToValidate="RbCaracteristicaOpcion" Display="None" ErrorMessage="&lt;b&gt;&lt;span style='text-decoration: underline'&gt;ERROR:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;El campo &lt;b&gt;'' ''&lt;/b&gt; es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCORbOpcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVRbCaracteristicaOpcion" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:HiddenField ID="HdnEsOpcion" runat="server" Value='<%# Eval("EsOpcion")%>' />
<asp:HiddenField ID="HdnCveCaracteristica" runat="server" Value='<%# Eval("CveCaracteristica")%>' />
<asp:HiddenField ID="HdnCveValor" runat="server" Value="-1" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
<tr>
<td>
<div>
<fieldset>
<legend><b>Plan de Beneficio por Defunción</b></legend>
<table>
<tr>
<td align="center">BENEFICIARIOS</td>
<td align="center">%</td>
<td align="center">PARENTESCO</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtNombreReferencia1" runat="server" Width="345px"></asp:TextBox><asp:HiddenField ID="HdnCveReferencia1" runat="server" Value="-1" />
</td>
<td>
<asp:TextBox ID="TxtPorcentaje1" Style="text-align: right" runat="server" Width="50px"></asp:TextBox>
<asp:CompareValidator ID="CVPorcentaje1" runat="server" ControlToValidate="TxtPorcentaje1" Display="None" ErrorMessage="El campo <b>''Porcentaje''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOPorcentaje1" runat="server" HighlightCssClass="vco" TargetControlID="CVPorcentaje1" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtParentesco1" runat="server" Width="150px"></asp:TextBox></td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtNombreReferencia2" runat="server" Width="345px"></asp:TextBox><asp:HiddenField ID="HdnCveReferencia2" runat="server" Value="-1" />
</td>
<td>
<asp:TextBox ID="TxtPorcentaje2" Style="text-align: right" runat="server" Width="50px"></asp:TextBox>
<asp:CompareValidator ID="CVPorcentaje2" runat="server" ControlToValidate="TxtPorcentaje2" Display="None" ErrorMessage="El campo <b>''Porcentaje''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOPorcentaje2" runat="server" HighlightCssClass="vco" TargetControlID="CVPorcentaje2" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtParentesco2" runat="server" Width="150px"></asp:TextBox></td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtNombreReferencia3" runat="server" Width="345px"></asp:TextBox><asp:HiddenField ID="HdnCveReferencia3" runat="server" Value="-1" />
</td>
<td>
<asp:TextBox ID="TxtPorcentaje3" Style="text-align: right" runat="server" Width="50px"></asp:TextBox>
<asp:CompareValidator ID="CVPorcentaje3" runat="server" ControlToValidate="TxtPorcentaje3" Display="None" ErrorMessage="El campo <b>''Porcentaje''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOPorcentaje3" runat="server" HighlightCssClass="vco" TargetControlID="CVPorcentaje3" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtParentesco3" runat="server" Width="150px"></asp:TextBox></td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtNombreReferencia4" runat="server" Width="345px"></asp:TextBox><asp:HiddenField ID="HdnCveReferencia4" runat="server" Value="-1" />
</td>
<td>
<asp:TextBox ID="TxtPorcentaje4" Style="text-align: right" runat="server" Width="50px"></asp:TextBox>
<asp:CompareValidator ID="CVPorcentaje4" runat="server" ControlToValidate="TxtPorcentaje4" Display="None" ErrorMessage="El campo <b>''Porcentaje''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Double" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOPorcentaje4" runat="server" HighlightCssClass="vco" TargetControlID="CVPorcentaje4" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:TextBox ID="TxtParentesco4" runat="server" Width="150px"></asp:TextBox></td>
</tr>
</table>
<table>
<tr>
<td width="300px" align="center">A FALTA DE BENEFICIARIO, SE NOMBRA SUSTITUTO</td>
<td width="250px" align="center">PARA MENOR DE EDAD NOMBRAR UN TUTOR</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtNombreReferenciaSustituto1" runat="server" Width="300px"></asp:TextBox><asp:HiddenField ID="HdnCveReferenciaSustituto1" runat="server" Value="-1" />
</td>
<td>
<asp:TextBox ID="TxtParentescoSustituto1" runat="server" Width="250px"></asp:TextBox></td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtNombreReferenciaSustituto2" runat="server" Width="300px"></asp:TextBox><asp:HiddenField ID="HdnCveReferenciaSustituto2" runat="server" Value="-1" />
</td>
<td>
<asp:TextBox ID="TxtParentescoSustituto2" runat="server" Width="250px"></asp:TextBox></td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtNombreReferenciaSustituto3" runat="server" Width="300px"></asp:TextBox><asp:HiddenField ID="HdnCveReferenciaSustituto3" runat="server" Value="-1" />
</td>
<td>
<asp:TextBox ID="TxtParentescoSustituto3" runat="server" Width="250px"></asp:TextBox></td>
</tr>
</table>
</fieldset>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td align="center">
<br />
<asp:UpdatePanel ID="UpGuardar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" />
<asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" Visible="False" />
<asp:Button ID="BtnCancelar" runat="server" Text="Cancelar" OnClientClick="javascript:window.location.href='/Prospectos/CatProspectos.aspx';return false" />
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
</ContentTemplate>
</asp:UpdatePanel>
<br />
</td>
</tr>
</table>
<br />
<%-- PORLET BITACORA NUEVO --%>
<div class="row">
<div class="col-md-12 ">
<div class="portlet light bordered">
<div class="portlet-title">
<div class="caption font-green">
<span class="caption-subject bold uppercase">Bitacora</span>
</div>
<div class="actions">
<div class="btn-group">
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green' style='font-weight: 700 !important;' ><span class='caption-subject bold'>Agregar</span></i>" Style="cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold" runat="server" Text=" <i class='fa fa-calendar-plus-o font-green' style='font-weight: 700 !important;' >Agendar</i>" Visible="false" Style="cursor: pointer;" ToolTip="Agendar"></asp:HyperLink>
</div>
</div>
</div>
<div class="portlet-body">
<asp:UpdatePanel ID="UPEventoBitacora" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVEventoBitacora" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado comentarios o bitácora">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha Agenda</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaAgenda" runat="server" Text='<%# Eval("FechaInicio") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Usuario</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Descripción</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEventoBitacora" runat="server" Text='<%# Eval("Descripcion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Estatus</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEventoEstatus" runat="server" Text='<%# Eval("EventoEstatus") %>'></asp:Literal>
<asp:LinkButton ID="LnkEventoEstatus" runat="server" ToolTip="Concluir"><img src="../Imagenes/Btn_Update2.png" alt ="Concluir"/></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Archivo</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkArchivo" Visible="false" runat="server" CssClass="Texto" OnClick="DownloadFile">
<asp:Image ImageUrl="/Imagenes/Abajo.png" ID="ImgArchivo" runat="server" />
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<%--<table id="TblEventoBitacora" runat="server" border="1" rules="all" style="border-collapse: collapse;">
<tr>
<td align="left" class="rep_titulo" style="width: 980px">
<b>Bitácora</b>&nbsp;<asp:Image ID="ImgAddObs" runat="server" ImageUrl="~/Imagenes/add_comment.png" AlternateText="Agregar Observación" Style="cursor: pointer;" ToolTip="Agregar a Bitacora" />
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green' style='font-weight: 700 !important;' ><span class='caption-subject bold'>Agregar</span></i>" Style="cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
<asp:HyperLink ID="HlEvento" CssClass="Texto thickbox" runat="server" Text="Agendar..." Visible="false" ImageUrl="/Imagenes/date_add.png" Style="cursor: pointer;" ToolTip="Agendar"></asp:HyperLink>
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel ID="UPEventoBitacora" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVEventoBitacora" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado comentarios o bitácora">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha Agenda</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaInicio") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Usuario</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Descripción</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEventoBitacora" runat="server" Text='<%# Eval("Descripcion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Estatus</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEventoEstatus" runat="server" Text='<%# Eval("EventoEstatus") %>'></asp:Literal>
<asp:LinkButton ID="LnkEventoEstatus" runat="server" ToolTip="Concluir"><img src="../Imagenes/Btn_Update2.png" alt ="Concluir"/></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>--%>
<br />
<%-- MODAL BITACORA --%>
<div id="ModalBitacora" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content" style="width: 700px;">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Bitácora</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel runat="server" ID="UPAddEventoBitacora" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="col-md-8">
<label>Bitácora/Observaciones</label>
<br />
<asp:TextBox CssClass="form-control" ID="TxtEventoDescripcion" class="Widthall" runat="server" TextMode="MultiLine" Columns="60" Rows="8"></asp:TextBox>
<br />
<%--<asp:CheckBox ID="ChkEventoPrioridad" CssClass="md-checksd2" Text="Bitácora de Atención" runat="server" />--%>
</div>
<div class="col-md-4">
<div>
<asp:TextBox ID="Anexo" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
</div>
</div>
<%--<div>
<asp:TextBox ID="Anexo" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div> --%>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnGuardarEventoBitacora" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<%-- FIN MODAL BITACORA --%>
<%--<asp:UpdatePanel runat="server" ID="UPAddEventoBitacora" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivEventoBitacora" style="width: 335px; background-color: White; border: solid 1px black; color: Black; display: none; position: absolute;">
<table border="0" width="335px" cellpadding="0" cellspacing="0">
<tr class="Titulos">
<td style="width: 330px">Bitácora&nbsp;</td>
<td style="padding-right: 4px; padding-top: 4px" valign="top">
<img alt="" src="/Imagenes/close.gif" style="cursor: pointer;" onclick="$('#DivEventoBitacora').hide(1000);" /></td>
</tr>
<tr align="left">
<td>
<table>
<tr>
<td>Bitácora/Observaciones</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtEventoDescripcion" runat="server" TextMode="MultiLine" Columns="60" Rows="4"></asp:TextBox>
</td>
</tr>
</table>
</td>
</tr>
<tr style="height: 25px">
<td align="center" colspan="2">
<asp:Button ID="BtnGuardarEventoBitacora" runat="server" ClientIDMode="Static" OnClientClick="$('#DivEventoBitacora').hide(1000);" Text="Guardar" />
<input id="BtnCancelarObs" type="button" value="Cancelar" onclick="$('#DivEventoBitacora').hide(1000);" />
</td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>--%>
<script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Css" runat="Server">
<link href="/Metronic/assets/global/plugins/dropzone/css/dropzone.css" rel="stylesheet" />
</asp:Content>

View File

@@ -0,0 +1,620 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Runtime.InteropServices
Imports System.IO
Imports System.Data
Partial Class Prospectos_Prospectos
Inherits ClsPaginas
'Confinguración
Private Property DTProspectosValores As DataTable
Get
Return CType(ViewState("DTProspectosValores"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTProspectosValores") = value
End Set
End Property
Private ReadOnly Property CveProspecto As Integer
Get
Return ViewState("CveProspecto").ToString.ToEntero
End Get
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
'ViewState("OCveProspecto") = "CveProspecto DESC"
'ViewState("OCveCliente") = "CveCliente DESC"
'ViewState("OApellidoPaterno") = "ApellidoPaterno DESC"
'ViewState("OApellidoMaterno") = "ApellidoMaterno DESC"
'ViewState("ONombres") = "Nombres DESC"
'ViewState("OFechaNacimiento") = "FechaNacimiento DESC"
'ViewState("OLugarNacimiento") = "LugarNacimiento DESC"
'ViewState("ORFC") = "RFC DESC"
'ViewState("ONacionalidad") = "Nacionalidad DESC"
'ViewState("OCalle") = "Calle DESC"
'ViewState("ONumero") = "Numero DESC"
'ViewState("OColonia") = "Colonia DESC"
'ViewState("OCodigoPostal") = "CodigoPostal DESC"
'ViewState("OPais") = "Pais DESC"
'ViewState("OMunicipio") = "Municipio DESC"
'ViewState("OEstado") = "Estado DESC"
'ViewState("OTelefono") = "Telefono DESC"
'ViewState("OFax") = "Fax DESC"
'ViewState("OCorreo") = "Correo DESC"
'ViewState("OEmpresaNombre") = "EmpresaNombre DESC"
'ViewState("OEmpresaGiro") = "EmpresaGiro DESC"
'ViewState("OEmpresaSector") = "EmpresaSector DESC"
'ViewState("OEmpresaPagina") = "EmpresaPagina DESC"
'ViewState("OEmpresaCalle") = "EmpresaCalle DESC"
'ViewState("OEmpresaNumero") = "EmpresaNumero DESC"
'ViewState("OEmpresaColonia") = "EmpresaColonia DESC"
'ViewState("OEmpresaCodigoPostal") = "EmpresaCodigoPostal DESC"
'ViewState("OEmpresaPais") = "EmpresaPais DESC"
'ViewState("OEmpresaMunicipio") = "EmpresaMunicipio DESC"
'ViewState("OEmpresaEstado") = "EmpresaEstado DESC"
'ViewState("OEmpresaTelefono") = "EmpresaTelefono DESC"
'ViewState("OEmpresaFax") = "EmpresaFax DESC"
'ViewState("OEmpresaCorreo") = "EmpresaCorreo DESC"
'ViewState("OEmpresaPuesto") = "EmpresaPuesto DESC"
'ViewState("OEmpresaEspecialidad") = "EmpresaEspecialidad DESC"
'ViewState("OEnvioCorrespondencia") = "EnvioCorrespondencia DESC"
'ViewState("OFiscalRazonSocial") = "FiscalRazonSocial DESC"
'ViewState("OFiscalDomicilio") = "FiscalDomicilio DESC"
'ViewState("OFiscalColonia") = "FiscalColonia DESC"
'ViewState("OFiscalCodigoPostal") = "FiscalCodigoPostal DESC"
'ViewState("OFiscalMunicipio") = "FiscalMunicipio DESC"
'ViewState("OFiscalEstado") = "FiscalEstado DESC"
'ViewState("OFiscalRFC") = "FiscalRFC DESC"
'ViewState("OCveEstatus") = "CveEstatus DESC"
'ViewState("OFechaIng") = "FechaIng DESC"
'ViewState("OCveUsuario") = "CveUsuario DESC"
'ViewState("OCveEmpresa") = "CveEmpresa DESC"
DdlPaises.DataSource = GlobalDTGralPaises : DdlPaises.DataBind()
DdlPaises.SelectedValue = "1"
DdlEmpresaPaises.SelectedValue = "1"
DdlEmpresaPaises.DataSource = GlobalDTGralPaises : DdlEmpresaPaises.DataBind()
DdlFiscalEstados.DataSource = GlobalDTGralEstados(1) : DdlFiscalEstados.DataBind()
'DdlMunicipios.DataSource = GlobalDTGralMunicipios : DdlMunicipios.DataBind()
If Request("CveProspecto") IsNot Nothing AndAlso IsNumeric(Request("CveProspecto")) AndAlso Request("CveProspecto").ToEntero > 0 Then
ViewState("CveProspecto") = Request("CveProspecto")
CargaDatos()
'Configuración de Modalidad Update
BtnGuardar.Text = "Guardar Cambios"
LtlTitulo.Text = "Consulta del Prospecto:"
'ImgAddObs.Attributes.Add("onclick", "javascript:$('#DivEventoBitacora').show(1000); PosicionaObjeto(this.id,'DivEventoBitacora');")
'Else
' CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
' CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
' CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
' CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
' CargaMunicipios(DdlFiscalMunicipios, DdlFiscalEstados.SelectedValue.ToEntero)
' ViewState("CveProspecto") = -1
Else
CargaEstados(DdlEstados, 1)
DdlEstados.SelectedValue = "26"
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
DdlMunicipios.SelectedValue = "1919"
CargaEstados(DdlEmpresaEstados, 1)
DdlEmpresaEstados.SelectedValue = "26"
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
DdlEmpresaMunicipios.SelectedValue = "1919"
DdlEmpresaEstados.SelectedValue = "26"
CargaMunicipios(DdlMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
DdlMunicipios.SelectedValue = "1919"
CargaEstados(DdlEmpresaEstados, 1)
DdlFiscalEstados.SelectedValue = "26"
CargaMunicipios(DdlFiscalMunicipios, DdlFiscalEstados.SelectedValue.ToEntero)
DdlFiscalMunicipios.SelectedValue = "1919"
ViewState("CveProspecto") = -1
End If
CargaCaracteristicas()
End If
End Sub
Private Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetProspectos(CveProspecto, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
If ObjProspectos.DtResultados.Rows.Count > 0 Then
TxtCveProspecto.Text = ObjProspectos.CveProspecto.ToString
TxtApellidoPaterno.Text = ObjProspectos.ApellidoPaterno
TxtApellidoMaterno.Text = ObjProspectos.ApellidoMaterno
TxtNombres.Text = ObjProspectos.Nombres
TxtFechaNacimiento.Text = ObjProspectos.FechaNacimiento.ToString
TxtLugarNacimiento.Text = ObjProspectos.LugarNacimiento
TxtRFC.Text = ObjProspectos.RFC
TxtNacionalidad.Text = ObjProspectos.Nacionalidad
TxtCalle.Text = ObjProspectos.Calle
TxtNumero.Text = ObjProspectos.Numero
TxtNumeroInterior.Text = ObjProspectos.NumeroInterior
TxtColonia.Text = ObjProspectos.Colonia
TxtCodigoPostal.Text = ObjProspectos.CodigoPostal.ToString
DdlSexo.SelectedValue = ObjProspectos.Sexo.ToString
DdlPaises.SelectedValue = ObjProspectos.CvePais.ToString
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
DdlEstados.SelectedValue = ObjProspectos.CveEstado.ToString
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
DdlMunicipios.SelectedValue = ObjProspectos.CveMunicipio.ToString
TxtTelefono.Text = ObjProspectos.Telefono
TxtFax.Text = ObjProspectos.Fax
TxtCorreo.Text = ObjProspectos.Correo
TxtEmpresaNombre.Text = ObjProspectos.EmpresaNombre
TxtEmpresaGiro.Text = ObjProspectos.EmpresaGiro
TxtEmpresaSector.Text = ObjProspectos.EmpresaSector
TxtEmpresaPagina.Text = ObjProspectos.EmpresaPagina
TxtEmpresaCalle.Text = ObjProspectos.EmpresaCalle
TxtEmpresaNumero.Text = ObjProspectos.EmpresaNumero
TxtEmpresaColonia.Text = ObjProspectos.EmpresaColonia
TxtEmpresaCodigoPostal.Text = ObjProspectos.EmpresaCodigoPostal
DdlEmpresaPaises.SelectedValue = ObjProspectos.CveEmpresaPais.ToString
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
DdlEmpresaEstados.SelectedValue = ObjProspectos.CveEmpresaEstado.ToString
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
DdlEmpresaMunicipios.SelectedValue = ObjProspectos.CveEmpresaMunicipio.ToString
'cveEmpresaPais.Text = ObjProspectos.EmpresaPais
'TxtEmpresaMunicipio.Text = ObjProspectos.EmpresaMunicipio
'TxtEmpresaEstado.Text = ObjProspectos.EmpresaEstado
TxtEmpresaTelefono.Text = ObjProspectos.EmpresaTelefono
TxtEmpresaFax.Text = ObjProspectos.EmpresaFax
TxtEmpresaCorreo.Text = ObjProspectos.EmpresaCorreo
TxtEmpresaPuesto.Text = ObjProspectos.EmpresaPuesto
TxtEmpresaEspecialidad.Text = ObjProspectos.EmpresaEspecialidad
ChkEnvioCorrespondencia.Checked = ObjProspectos.EnvioCorrespondencia
TxtFiscalRazonSocial.Text = ObjProspectos.FiscalRazonSocial
TxtFiscalDomicilio.Text = ObjProspectos.FiscalDomicilio
TxtFiscalColonia.Text = ObjProspectos.FiscalColonia
TxtFiscalCodigoPostal.Text = ObjProspectos.FiscalCodigoPostal
CargaEstados(DdlFiscalEstados, 1)
DdlFiscalEstados.SelectedValue = ObjProspectos.CveFiscalEstado.ToString
CargaMunicipios(DdlFiscalMunicipios, DdlFiscalEstados.SelectedValue.ToEntero)
DdlFiscalMunicipios.SelectedValue = ObjProspectos.CveFiscalMunicipio.ToString
TxtFiscalRFC.Text = ObjProspectos.FiscalRFC
'TxtCveEstatus.Text = ObjProspectos.CveEstatus
'TxtFechaIng.Text = ObjProspectos.FechaIng
'TxtCveUsuario.Text = ObjProspectos.CveUsuario
'TxtCveEmpresa.Text = ObjProspectos.CveEmpresa
'Cargar los Valores de las Caractertisticas
If ObjProspectos.GetProspectosValores(CveProspecto) Then
ViewState("DTProspectosValores") = ObjProspectos.DtResultados
End If
'Cargar Referencias de Beneficiarios
If ObjProspectos.GetProspectosReferencias(CveProspecto) Then
Dim Beneficiarios As DataTable = ObjProspectos.DtResultados.FiltraParametros("CveTipoReferencia = " + ClsProspectos.TipoReferencias.Beneficiario.ToEntero.ToString)
Dim Sustitutos As DataTable = ObjProspectos.DtResultados.FiltraParametros("CveTipoReferencia = " + ClsProspectos.TipoReferencias.Sustituto.ToEntero.ToString)
If Beneficiarios.Rows.Count > 0 Then
HdnCveReferencia1.Value = Beneficiarios.Rows(0)("CveReferencia").ToString
TxtNombreReferencia1.Text = Beneficiarios.Rows(0)("NombreReferencia").ToString
TxtParentesco1.Text = Beneficiarios.Rows(0)("Parentesco").ToString
TxtPorcentaje1.Text = If(Beneficiarios.Rows(0)("Porcentaje").ToString.ToDouble <> 0, Beneficiarios.Rows(0)("Porcentaje").ToString, "")
End If
If Beneficiarios.Rows.Count > 1 Then
HdnCveReferencia2.Value = Beneficiarios.Rows(1)("CveReferencia").ToString
TxtNombreReferencia2.Text = Beneficiarios.Rows(1)("NombreReferencia").ToString
TxtParentesco2.Text = Beneficiarios.Rows(1)("Parentesco").ToString
TxtPorcentaje2.Text = If(Beneficiarios.Rows(1)("Porcentaje").ToString.ToDouble <> 0, Beneficiarios.Rows(1)("Porcentaje").ToString, "")
End If
If Beneficiarios.Rows.Count > 2 Then
HdnCveReferencia3.Value = Beneficiarios.Rows(2)("CveReferencia").ToString
TxtNombreReferencia3.Text = Beneficiarios.Rows(2)("NombreReferencia").ToString
TxtParentesco3.Text = Beneficiarios.Rows(2)("Parentesco").ToString
TxtPorcentaje3.Text = If(Beneficiarios.Rows(2)("Porcentaje").ToString.ToDouble <> 0, Beneficiarios.Rows(2)("Porcentaje").ToString, "")
End If
If Beneficiarios.Rows.Count > 3 Then
HdnCveReferencia4.Value = Beneficiarios.Rows(3)("CveReferencia").ToString
TxtNombreReferencia4.Text = Beneficiarios.Rows(3)("NombreReferencia").ToString
TxtParentesco4.Text = Beneficiarios.Rows(3)("Parentesco").ToString
TxtPorcentaje4.Text = If(Beneficiarios.Rows(3)("Porcentaje").ToString.ToDouble <> 0, Beneficiarios.Rows(3)("Porcentaje").ToString, "")
End If
If Sustitutos.Rows.Count > 0 Then
HdnCveReferenciaSustituto1.Value = Sustitutos.Rows(0)("CveReferencia").ToString
TxtNombreReferenciaSustituto1.Text = Sustitutos.Rows(0)("NombreReferencia").ToString
TxtParentescoSustituto1.Text = Sustitutos.Rows(0)("Parentesco").ToString
End If
If Sustitutos.Rows.Count > 1 Then
HdnCveReferenciaSustituto2.Value = Sustitutos.Rows(1)("CveReferencia").ToString
TxtNombreReferenciaSustituto2.Text = Sustitutos.Rows(1)("NombreReferencia").ToString
TxtParentescoSustituto2.Text = Sustitutos.Rows(1)("Parentesco").ToString
End If
If Sustitutos.Rows.Count > 2 Then
HdnCveReferenciaSustituto3.Value = Sustitutos.Rows(2)("CveReferencia").ToString
TxtNombreReferenciaSustituto3.Text = Sustitutos.Rows(2)("NombreReferencia").ToString
TxtParentescoSustituto3.Text = Sustitutos.Rows(2)("Parentesco").ToString
End If
End If
CargaCaracteristicas()
CargaEventoBitacora()
End If
End If
ObjProspectos.Dispose()
End Sub
#Region "E V E N T O - B I T A C O R A"
Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVEventoBitacora.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(200)
e.Row.Cells(1).Width = Unit.Pixel(200)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(500)
End If
If e.Row.DBCampo("Archivo").ToString <> "" Then
e.Row.FCLinkButton("LinkArchivo").Visible = True
e.Row.FCLinkButton("LinkArchivo").CommandArgument = String.Format("OI\{0}", e.Row.DBCampo("Archivo").ToString)
ScriptManager.GetCurrent(Me).RegisterPostBackControl(e.Row.FCLinkButton("LinkArchivo")) 'Registro un evento Postbacktrigger, que recargue toda la pagina para que funcione
End If
e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub BtnGuardarEventoBitacora_Click(sender As Object, e As EventArgs) Handles BtnGuardarEventoBitacora.Click
Dim ObjEventoBitacora As New ClsOIEventos
Dim FileExtension As String = "-1"
Dim filesgral As List(Of Archivo) = Anexo.getfiles().Archivos
Dim filemove As String = ""
For Each fileItem As Archivo In filesgral
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
filemove = fileItem.filename
Next
If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, String.Format(".{0}", FileExtension), -1, -1, CveProspecto, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If filemove <> "" Then
filemove.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("Empresas\{0}\OI", UsuarioActual.CveEmpresa))
End If
GVEventoBitacora.DataSource = ObjEventoBitacora.DtResultados
TxtEventoDescripcion.Text = ""
Anexo.Text = "[]"
Alert("La bitácora/observación se guardó correctamente", TipoMensaje.MsgInformacion)
RegistraScript("$('#ModalBitacora').modal('hide')", "hidemodal")
End If
ObjEventoBitacora.Dispose()
GVEventoBitacora.DataBind()
UPEventoBitacora.Update()
CargaEventoBitacora()
UPAddEventoBitacora.Update()
End Sub
Private Sub CargaEventoBitacora()
Dim ObjEventoBitacora As New ClsOIEventos()
If ObjEventoBitacora.GetAgendaBitacora(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProspecto:=CveProspecto) Then
GVEventoBitacora.DataSource = ObjEventoBitacora.DtResultados.FiltraParametros("CveTipoEvento = 6 OR CveTipoEvento = 2")
Else
GVEventoBitacora.DataSource = Nothing
End If
GVEventoBitacora.DataBind()
End Sub
Protected Sub DownloadFile(ByVal sender As Object, ByVal e As EventArgs)
Dim filePath As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, CType(sender, LinkButton).CommandArgument)
Dim Archivo As New System.IO.FileInfo(filePath)
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = "application/octet-stream"
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" + Path.GetFileName(filePath))
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(filePath)
HttpContext.Current.Response.Flush()
HttpContext.Current.Response.End()
Archivo = Nothing
End Sub
#End Region
Private Sub CargaEstados(ddl As DropDownList, CvePais As Integer)
ddl.DataSource = GlobalDTGralEstados(CvePais) : ddl.DataBind()
End Sub
Private Sub CargaMunicipios(ddl As DropDownList, CveEstado As Integer)
ddl.DataSource = GlobalDTGralMunicipios(CveEstado) : ddl.DataBind()
End Sub
Protected Sub CargaCaracteristicas()
Dim objClasificaciones As New ClsProspectos
If objClasificaciones.GetCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) Then
GvClasificaciones.DataSource = objClasificaciones.DtResultados
GvClasificaciones.DataBind()
End If
objClasificaciones.Dispose()
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
Dim ObjProspectos As New ClsProspectos
If CveProspecto = -1 Then
Dim RetVal As Integer = ObjProspectos.AddProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
TxtNombres.Text.Trim, TxtFechaNacimiento.Text.Trim.ToDate, TxtLugarNacimiento.Text.Trim, TxtRFC.Text.Trim, TxtNacionalidad.Text.Trim, DdlSexo.SelectedValue.ToEntero, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, "", "", TxtColonia.Text.Trim, TxtCodigoPostal.Text.Trim.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, "", TxtFax.Text.Trim, "", TxtCorreo.Text.Trim, "", "", "", -1, -1, -1, TxtEmpresaNombre.Text.Trim, TxtEmpresaGiro.Text.Trim, TxtEmpresaSector.Text.Trim,
TxtEmpresaPagina.Text.Trim, TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, TxtEmpresaCodigoPostal.Text.Trim, DdlEmpresaMunicipios.SelectedValue.ToEntero,
TxtEmpresaTelefono.Text.Trim, TxtEmpresaFax.Text.Trim, TxtEmpresaCorreo.Text.Trim, TxtEmpresaPuesto.Text.Trim,
TxtEmpresaEspecialidad.Text.Trim, ChkEnvioCorrespondencia.Checked, TxtFiscalRazonSocial.Text.Trim, TxtFiscalDomicilio.Text.Trim, TxtFiscalColonia.Text.Trim,
TxtFiscalCodigoPostal.Text.Trim, DdlFiscalMunicipios.SelectedValue.ToEntero, TxtFiscalRFC.Text.Trim, -1, -1, -1, "", -1, -1, -1, "", 0, "", -1, -1, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If RetVal > 0 Then
ViewState("CveProspecto") = ObjProspectos.CveProspecto
GuardarCaracteristicas()
GuardarReferencias()
Alert("El Prospecto se guardó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/Prospectos.aspx"";")
End If
Else
If ObjProspectos.UpdateProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
TxtNombres.Text.Trim, TxtFechaNacimiento.Text.Trim.ToDate, TxtLugarNacimiento.Text.Trim, TxtRFC.Text.Trim, TxtNacionalidad.Text.Trim, DdlSexo.SelectedValue.ToEntero, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, "", "", TxtColonia.Text.Trim, TxtCodigoPostal.Text.Trim.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, "", TxtFax.Text.Trim, "", TxtCorreo.Text.Trim, "", "", "", -1, -1, -1, TxtEmpresaNombre.Text.Trim, TxtEmpresaGiro.Text.Trim, TxtEmpresaSector.Text.Trim,
TxtEmpresaPagina.Text.Trim, TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, TxtEmpresaCodigoPostal.Text.Trim, DdlEmpresaMunicipios.SelectedValue.ToEntero,
TxtEmpresaTelefono.Text.Trim, TxtEmpresaFax.Text.Trim, TxtEmpresaCorreo.Text.Trim, TxtEmpresaPuesto.Text.Trim,
TxtEmpresaEspecialidad.Text.Trim, ChkEnvioCorrespondencia.Checked, TxtFiscalRazonSocial.Text.Trim, TxtFiscalDomicilio.Text.Trim, TxtFiscalColonia.Text.Trim,
TxtFiscalCodigoPostal.Text.Trim, DdlFiscalMunicipios.SelectedValue.ToEntero, TxtFiscalRFC.Text.Trim, -1, -1, -1, "", -1, -1, -1, "", 0, "", -1, -1, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProspecto) Then
GuardarCaracteristicas()
GuardarReferencias()
UpDatos.Update()
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
End If
ObjProspectos.Dispose()
End Sub
Protected Sub GuardarCaracteristicas()
Dim objProspectosValores As New ClsProspectos
For Each DR As GridViewRow In GvClasificaciones.Rows
For Each DR_CaracteristicaTipo As GridViewRow In DR.FCGridView("GvTiposCaracteristicas").Rows
For Each DR_Caracteristica As GridViewRow In DR_CaracteristicaTipo.FCGridView("GvCaracteristicas").Rows
Dim CveCaracteristicaOpcion As Integer = -1
Dim CveValor As Integer = DR_Caracteristica.FCHiddenField("HdnCveValor").Value.ToEntero
Dim Valor As String = DR_Caracteristica.FCTextBox("TxtValor").Text.Trim
Dim CveCaracteristica As Integer = DR_Caracteristica.FCHiddenField("HdnCveCaracteristica").Value.ToEntero
Select Case DR_Caracteristica.FCHiddenField("HdnEsOpcion").Value
Case "1" 'Listado o DropDownList
CveCaracteristicaOpcion = DR_Caracteristica.FCDropDownList("DdlCaracteristicaOpcion").SelectedValue.ToEntero
Case "2" 'Radio o RadioButtonList
CveCaracteristicaOpcion = DR_Caracteristica.FCRadioButtonList("RbCaracteristicaOpcion").SelectedValue.ToEntero
End Select
If CveValor = -1 Then
objProspectosValores.AddProspectosValores(CveProspecto, CveCaracteristica, CveCaracteristicaOpcion, If(Valor = "", "-1", Valor), UsuarioActual.CveUsuario)
Else
objProspectosValores.UpdateProspectosValores(CveProspecto, CveCaracteristica, CveCaracteristicaOpcion, If(Valor = "", "-1", Valor), UsuarioActual.CveUsuario, CveValor)
End If
Next
Next
Next
objProspectosValores.Dispose()
End Sub
Protected Sub GuardarReferencias()
Dim objProspectosReferencias As New ClsProspectos
If HdnCveReferencia1.Value = "-1" Then
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia1.Text, TxtParentesco1.Text, "", TxtPorcentaje1.Text.ToDouble, UsuarioActual.CveUsuario)
Else
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia1.Text, TxtParentesco1.Text, "", TxtPorcentaje1.Text.ToDouble, HdnCveReferencia1.Value.ToEntero)
End If
If HdnCveReferencia2.Value = "-1" Then
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia2.Text, TxtParentesco2.Text, "", TxtPorcentaje2.Text.ToDouble, UsuarioActual.CveUsuario)
Else
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia2.Text, TxtParentesco2.Text, "", TxtPorcentaje2.Text.ToDouble, HdnCveReferencia2.Value.ToEntero)
End If
If HdnCveReferencia3.Value = "-1" Then
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia3.Text, TxtParentesco3.Text, "", TxtPorcentaje3.Text.ToDouble, UsuarioActual.CveUsuario)
Else
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia3.Text, TxtParentesco3.Text, "", TxtPorcentaje3.Text.ToDouble, HdnCveReferencia3.Value.ToEntero)
End If
If HdnCveReferencia4.Value = "-1" Then
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia4.Text, TxtParentesco4.Text, "", TxtPorcentaje4.Text.ToDouble, UsuarioActual.CveUsuario)
Else
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Beneficiario, TxtNombreReferencia4.Text, TxtParentesco4.Text, "", TxtPorcentaje4.Text.ToDouble, HdnCveReferencia4.Value.ToEntero)
End If
If HdnCveReferenciaSustituto1.Value = "-1" Then
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Sustituto, TxtNombreReferenciaSustituto1.Text, TxtParentescoSustituto1.Text, "", 0, UsuarioActual.CveUsuario)
Else
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Sustituto, TxtNombreReferenciaSustituto1.Text, TxtParentescoSustituto1.Text, "", 0, HdnCveReferenciaSustituto1.Value.ToEntero)
End If
If HdnCveReferenciaSustituto2.Value = "-1" Then
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Sustituto, TxtNombreReferenciaSustituto2.Text, TxtParentescoSustituto2.Text, "", 0, UsuarioActual.CveUsuario)
Else
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Sustituto, TxtNombreReferenciaSustituto2.Text, TxtParentescoSustituto2.Text, "", 0, HdnCveReferenciaSustituto2.Value.ToEntero)
End If
If HdnCveReferenciaSustituto3.Value = "-1" Then
objProspectosReferencias.AddProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Sustituto, TxtNombreReferenciaSustituto3.Text, TxtParentescoSustituto3.Text, "", 0, UsuarioActual.CveUsuario)
Else
objProspectosReferencias.UpdateProspectosReferencias(CveProspecto, ClsProspectos.TipoReferencias.Sustituto, TxtNombreReferenciaSustituto3.Text, TxtParentescoSustituto3.Text, "", 0, HdnCveReferenciaSustituto3.Value.ToEntero)
End If
objProspectosReferencias.Dispose()
End Sub
Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click
Dim ObjProspectos As New ClsProspectos()
If ObjProspectos.RemoveProspectos(CveProspecto) Then
Alert("El Prospecto se Eliminó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/CatProspectos.aspx""")
End If
ObjProspectos.Dispose()
End Sub
Protected Sub GvClasificaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvClasificaciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveCaracteristicaClasificacion").ToEntero > 1 Then
e.Row.FCLabel("LblCaracteristicaClasificacion").CssClass = "CaracteristicaPrincipal"
End If
Dim objTiposCaracteristicas As New ClsProspectos
If objTiposCaracteristicas.GetTiposCaracteristicas(UsuarioActual.CveEmpresa) Then
With e.Row.FCGridView("GvTiposCaracteristicas")
.DataSource = objTiposCaracteristicas.DtResultados.FiltraParametros("CveCaracteristicaClasificacion = " + e.Row.DBCampo("CveCaracteristicaClasificacion"))
.DataBind()
End With
End If
objTiposCaracteristicas.Dispose()
End If
End Sub
Protected Sub GvTiposCaracteristicas_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CaracteristicaClasificacion").Trim = "" Then
e.Row.FCLabel("LblCaracteristicaTipo").CssClass = "CaracteristicaPrincipal"
End If
Dim objCaracteristicas As New ClsProspectos
If objCaracteristicas.GetCaracteristicas(UsuarioActual.CveEmpresa) Then
With e.Row.FCGridView("GvCaracteristicas")
.DataSource = objCaracteristicas.DtResultados.FiltraParametros("Estatus = 'Activo' and CveCaracteristicaTipo = " + e.Row.DBCampo("CveCaracteristicaTipo"))
.DataBind()
End With
End If
objCaracteristicas.Dispose()
End If
End Sub
Protected Sub GvCaracteristicas_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim RowProspectoValor As DataRowCollection
Dim EsOpcion As Integer = e.Row.FCHiddenField("HdnEsOpcion").Value.ToEntero
Dim CveCaracteristica As Integer = e.Row.DBCampo("CveCaracteristica").ToEntero
'Dim RowProspectoValor As DataRowCollection = CType(ViewState("DTPS"), DataTable).FiltraParametros("CveCaracteristica = " + CveCaracteristica.ToString).Rows
If DTProspectosValores.Rows.Count > 0 Then
RowProspectoValor = DTProspectosValores.FiltraParametros("CveCaracteristica = " + CveCaracteristica.ToString).Rows
Else
RowProspectoValor = Nothing
End If
Dim CveValor As Integer = -1
Dim Valor As String = ""
Dim CveCaracteristicaOpcion As Integer = -1
If RowProspectoValor.Count > 0 Then
e.Row.FCHiddenField("HdnCveValor").Value = RowProspectoValor(0)("CveValor").ToString
Valor = RowProspectoValor(0)("Valor").ToString
CveCaracteristicaOpcion = RowProspectoValor(0)("CveOpcion").ToString.ToEntero
End If
Select Case EsOpcion
Case 0, 4 'Texto, Multiline
With e.Row.FCTextBox("TxtValor")
.Text = Valor
.Visible = True
If EsOpcion = 4 Then
.Rows = 3
.TextMode = TextBoxMode.MultiLine
End If
End With
Case 1, 2 'DropDownList, Radios
Dim objOpciones As New ClsProspectos
If objOpciones.GetCaracteristicasOpciones(CveCaracteristica, UsuarioActual.CveEmpresa) Then
If EsOpcion = 1 Then
With e.Row.FCDropDownList("DdlCaracteristicaOpcion")
.Visible = True
.DataSource = objOpciones.DtResultados.FiltraParametros("Estatus = 'Activo'")
.DataBind()
.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
.SelectedValue = CveCaracteristicaOpcion.ToString
End With
ElseIf EsOpcion = 2 Then
With e.Row.FCRadioButtonList("RbCaracteristicaOpcion")
.Visible = True
.DataSource = objOpciones.DtResultados.FiltraParametros("Estatus = 'Activo'")
.DataBind()
If CveCaracteristicaOpcion > 0 Then
.SelectedValue = CveCaracteristicaOpcion.ToString
End If
End With
End If
End If
objOpciones.Dispose()
Case 3 'Fecha
With e.Row.FCTextBox("TxtValor")
If Valor <> "" Then
.Text = Valor
End If
.Visible = True
.Width = New Unit(80)
End With
e.Row.FCImageButton("ImgTxtValor").Visible = True
e.Row.FCMaskedEditExtender("MEETxtValor").Enabled = True
e.Row.FCCalendarExtender("CETxtValor").Enabled = True
End Select
End If
End Sub
Protected Sub DdlPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPaises.SelectedIndexChanged
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
UPPEstados.Update()
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
UPPMunicipios.Update()
End Sub
Protected Sub DdlEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEstados.SelectedIndexChanged
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
UPPMunicipios.Update()
End Sub
Protected Sub DdlEmpresaPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaPaises.SelectedIndexChanged
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
UPPEmpresaEstados.Update()
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
UPPEmpresaMunicipios.Update()
End Sub
Protected Sub DdlEmpresaEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaEstados.SelectedIndexChanged
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
UPPEmpresaMunicipios.Update()
End Sub
Protected Sub DdlFiscalEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFiscalEstados.SelectedIndexChanged
CargaMunicipios(DdlFiscalMunicipios, DdlFiscalEstados.SelectedValue.ToEntero)
UPPFiscalMunicipios.Update()
End Sub
End Class

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,378 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Runtime.InteropServices
Imports System.IO
Imports System.Data
Partial Class Prospectos_ProspectosEstructuras
Inherits ClsPaginas
'Confinguración
Private Property DTProspectosValores As DataTable
Get
Return CType(ViewState("DTProspectosValores"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTProspectosValores") = value
End Set
End Property
Private ReadOnly Property CveProspecto As Integer
Get
Return ViewState("CveProspecto").ToString.ToEntero
End Get
End Property
Private Property EventosTmp As Hashtable
Get
Return CType(ViewState("EventosTmp"), Hashtable)
End Get
Set(value As Hashtable)
ViewState("EventosTmp") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
DdlPaises.DataSource = GlobalDTGralPaises : DdlPaises.DataBind()
DdlEmpresaPaises.DataSource = GlobalDTGralPaises : DdlEmpresaPaises.DataBind()
DdlEscolaridad.DataSource = GlobalDTGralEscolaridades : DdlEscolaridad.DataBind() : DdlEscolaridad.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlClasificacion.DataSource = GlobalDTProspectosClasificaciones(UsuarioActual.CveEmpresa) : DdlClasificacion.DataBind() : DdlClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
EventosTmp = New Hashtable
DdlProspectoEvento.DataSource = GlobalDTProspectosEvento(-1, UsuarioActual.CveEmpresa)
DdlProspectoEvento.DataBind()
CEFechaNacimiento.EndDate = Today
'DdlMunicipios.DataSource = GlobalDTGralMunicipios : DdlMunicipios.DataBind()
If Request("CveProspecto") IsNot Nothing AndAlso IsNumeric(Request("CveProspecto")) AndAlso Request("CveProspecto").ToEntero > 0 Then
ViewState("CveProspecto") = Request("CveProspecto")
CargaDatos()
'Configuración de Modalidad Update
BtnGuardar.Text = "Guardar Cambios"
LtlTitulo.Text = "Consulta del Prospecto:"
Else
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
DdlEstados.SelectedValue = "26"
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
DdlEmpresaEstados.SelectedValue = "26"
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
ViewState("CveProspecto") = -1
PnlBusquedaGral.Visible = True
Me.Form.DefaultButton = BtnBusqueda.UniqueID
TxtBusqueda.Focus()
TxtFechaIngreso.Text = Now.ToShortDateString
End If
End If
End Sub
'<Services.WebMethodAttribute()> <Script.Services.ScriptMethodAttribute()> _
'Public Shared Function wsGetReporta(ByVal prefixText As String, ByVal count As Integer) As String()
' 'Dim dt As DataTable = CType(Session("DtCuentas"), DataTable)
' 'Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
' 'dt = Conta.getCuentasCheque(Prefijo)
' 'Conta.Dispose()
' Dim items As New List(Of String)(count)
' Dim Prosp As New ClsProspectos
' Dim dt As DataTable = Nothing
' If Prosp.GetProspectos(-1, prefixText.Trim, "-1", -1, -1, -1, -1, -1, -1, 41) Then
' dt = Prosp.DtResultados
' End If
' Prosp.Dispose()
' For i As Integer = 0 To count - 1
' If dt.Rows.Count > i Then
' items.Add(AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(dt.Rows(i)("NombreCompleto").ToString, dt.Rows(i)("CveProspecto").ToString))
' Else
' Exit For
' End If
' Next
' Return items.ToArray()
'End Function
Private Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetProspectos(CveProspecto, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
If ObjProspectos.DtResultados.Rows.Count > 0 Then
TxtCveProspecto.Text = ObjProspectos.CveProspecto.ToString
TxtApellidoPaterno.Text = ObjProspectos.ApellidoPaterno
TxtApellidoMaterno.Text = ObjProspectos.ApellidoMaterno
TxtNombres.Text = ObjProspectos.Nombres
TxtFechaNacimiento.Text = ObjProspectos.FechaNacimiento.ToString
TxtLugarNacimiento.Text = ObjProspectos.LugarNacimiento
TxtRFC.Text = ObjProspectos.RFC
TxtNacionalidad.Text = ObjProspectos.Nacionalidad
TxtCalle.Text = ObjProspectos.Calle
TxtNumero.Text = ObjProspectos.Numero
TxtNumeroInterior.Text = ObjProspectos.NumeroInterior
TxtEntreCalle1.Text = ObjProspectos.EntreCalle1
TxtEntreCalle2.Text = ObjProspectos.EntreCalle2
TxtIFE.Text = ObjProspectos.IFE
DdlClasificacion.SelectedValue = ObjProspectos.CveProspectoClasificacion.ToString
DdlEscolaridad.SelectedValue = ObjProspectos.CveEscolaridad.ToString
DdlSexo.SelectedValue = ObjProspectos.Sexo.ToString
TxtColonia.Text = ObjProspectos.Colonia
TxtCodigoPostal.Text = ObjProspectos.CodigoPostal.ToString
DdlPaises.SelectedValue = ObjProspectos.CvePais.ToString
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
DdlEstados.SelectedValue = ObjProspectos.CveEstado.ToString
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
DdlMunicipios.SelectedValue = ObjProspectos.CveMunicipio.ToString
TxtFacebook.Text = ObjProspectos.Facebook
TxtTwitter.Text = ObjProspectos.Twitter
TxtTelefono.Text = ObjProspectos.Telefono
TxtCelular.Text = ObjProspectos.Celular
'TxtFax.Text = ObjProspectos.Fax
TxtCorreo.Text = ObjProspectos.Correo
TxtEmpresaNombre.Text = ObjProspectos.EmpresaNombre
TxtEmpresaGiro.Text = ObjProspectos.EmpresaGiro
TxtEmpresaSector.Text = ObjProspectos.EmpresaSector
TxtEmpresaPagina.Text = ObjProspectos.EmpresaPagina
TxtEmpresaCalle.Text = ObjProspectos.EmpresaCalle
TxtEmpresaNumero.Text = ObjProspectos.EmpresaNumero
TxtEmpresaColonia.Text = ObjProspectos.EmpresaColonia
TxtEmpresaCodigoPostal.Text = ObjProspectos.EmpresaCodigoPostal
DdlEmpresaPaises.SelectedValue = ObjProspectos.CveEmpresaPais.ToString
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
DdlEmpresaEstados.SelectedValue = ObjProspectos.CveEmpresaEstado.ToString
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
DdlEmpresaMunicipios.SelectedValue = ObjProspectos.CveEmpresaMunicipio.ToString
'cveEmpresaPais.Text = ObjProspectos.EmpresaPais
'TxtEmpresaMunicipio.Text = ObjProspectos.EmpresaMunicipio
'TxtEmpresaEstado.Text = ObjProspectos.EmpresaEstado
TxtEmpresaTelefono.Text = ObjProspectos.EmpresaTelefono
TxtEmpresaFax.Text = ObjProspectos.EmpresaFax
TxtEmpresaCorreo.Text = ObjProspectos.EmpresaCorreo
TxtEmpresaPuesto.Text = ObjProspectos.EmpresaPuesto
TxtEmpresaEspecialidad.Text = ObjProspectos.EmpresaEspecialidad
TxtFechaIngreso.Text = ObjProspectos.FechaIng.ToShortDateString
TxtFechaIngreso.Enabled = False
ImgFechaIngreso.Visible = False
LstEventos.Visible = False
HdnProspectoTipo.Value = ObjProspectos.CveProspectoTipo.ToString
'TxtCveEstatus.Text = ObjProspectos.CveEstatus
'TxtFechaIng.Text = ObjProspectos.FechaIng
'TxtCveUsuario.Text = ObjProspectos.CveUsuario
'TxtCveEmpresa.Text = ObjProspectos.CveEmpresa
'Cargar los Valores de las Caractertisticas
If ObjProspectos.GetProspectosValores(CveProspecto) Then
ViewState("DTProspectosValores") = ObjProspectos.DtResultados
End If
PnlBusquedaGral.Visible = False
If ObjProspectos.GetProspectosEventosAsistidos(CveProspecto, UsuarioActual.CveEmpresa) Then
GvE.DataSource = ObjProspectos.DtResultados
GvE.DataBind()
End If
'Permiso Eliminar
If UsuarioActual.TienePermisoProceso(78) Then BtnEliminar.Visible = True Else BtnEliminar.Visible = False
End If
End If
ObjProspectos.Dispose()
End Sub
Private Sub CargaEstados(ddl As DropDownList, CvePais As Integer)
ddl.DataSource = GlobalDTGralEstados(CvePais) : ddl.DataBind()
End Sub
Private Sub CargaMunicipios(ddl As DropDownList, CveEstado As Integer)
ddl.DataSource = GlobalDTGralMunicipios(CveEstado) : ddl.DataBind()
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
If DdlClasificacion.SelectedValue.ToEntero < 0 Then
Alert("Seleccione la clasificación, por favor", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim FechaIngreso As String = TxtFechaIngreso.Text.Trim
If FechaIngreso = "__/__/____" Then FechaIngreso = "-1"
If TxtFechaIngreso.Text.Trim = Now.ToShortDateString Then
FechaIngreso = Now.ToString
End If
Dim ObjProspectos As New ClsProspectos
If CveProspecto = -1 Then
If ObjProspectos.AddProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
TxtNombres.Text.Trim, TxtFechaNacimiento.Text.Trim.ToDate, TxtLugarNacimiento.Text.Trim, TxtRFC.Text.Trim, TxtNacionalidad.Text.Trim, DdlSexo.SelectedValue.ToEntero, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, TxtEntreCalle1.Text.Trim, TxtEntreCalle2.Text.Trim, TxtColonia.Text.Trim, TxtCodigoPostal.Text.Trim.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text, "", "", TxtCorreo.Text.Trim, "", TxtFacebook.Text.Trim, TxtTwitter.Text.Trim, -1, DdlClasificacion.SelectedValue.ToEntero, DdlEscolaridad.SelectedValue.ToEntero, TxtEmpresaNombre.Text.Trim, TxtEmpresaGiro.Text.Trim, TxtEmpresaSector.Text.Trim,
TxtEmpresaPagina.Text.Trim, TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, TxtEmpresaCodigoPostal.Text.Trim, DdlEmpresaMunicipios.SelectedValue.ToEntero,
TxtEmpresaTelefono.Text.Trim, TxtEmpresaFax.Text.Trim, TxtEmpresaCorreo.Text.Trim, TxtEmpresaPuesto.Text.Trim,
TxtEmpresaEspecialidad.Text.Trim, False, "", "", "", "", -1, "", -1, -1, -1, TxtIFE.Text.Trim, -1, -1, -1, "", 0, "", -1, 3, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FechaIngreso) > 0 Then
ViewState("CveProspecto") = ObjProspectos.CveProspecto
If EventosTmp.Count > 0 Then
For Each entry As DictionaryEntry In EventosTmp
ObjProspectos.AddProspectosEventos(entry.Key.ToString.ToEntero, CveProspecto, UsuarioActual.CveUsuario)
Next
End If
Alert("El Prospecto se guardó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/ProspectosEstructuras.aspx"";")
End If
Else
If ObjProspectos.UpdateProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
TxtNombres.Text.Trim, TxtFechaNacimiento.Text.Trim.ToDate, TxtLugarNacimiento.Text.Trim, TxtRFC.Text.Trim, TxtNacionalidad.Text.Trim, DdlSexo.SelectedValue.ToEntero, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, TxtEntreCalle1.Text.Trim, TxtEntreCalle2.Text.Trim, TxtColonia.Text.Trim, TxtCodigoPostal.Text.Trim.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text, "", "", TxtCorreo.Text.Trim, "", TxtFacebook.Text.Trim, TxtTwitter.Text.Trim, -1, DdlClasificacion.SelectedValue.ToEntero, DdlEscolaridad.SelectedValue.ToEntero, TxtEmpresaNombre.Text.Trim, TxtEmpresaGiro.Text.Trim, TxtEmpresaSector.Text.Trim,
TxtEmpresaPagina.Text.Trim, TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, TxtEmpresaCodigoPostal.Text.Trim, DdlEmpresaMunicipios.SelectedValue.ToEntero,
TxtEmpresaTelefono.Text.Trim, TxtEmpresaFax.Text.Trim, TxtEmpresaCorreo.Text.Trim, TxtEmpresaPuesto.Text.Trim,
TxtEmpresaEspecialidad.Text.Trim, False, "", "", "", "", -1, "", -1, -1, -1, TxtIFE.Text.Trim, -2, -1, -1, "", 0, "", -1, HdnProspectoTipo.Value.ToEntero, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProspecto) Then
UpDatos.Update()
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/ProspectosEstructuras.aspx"";")
End If
End If
ObjProspectos.Dispose()
End Sub
Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click
Dim ObjProspectos As New ClsProspectos()
If ObjProspectos.RemoveProspectos(CveProspecto) Then
Alert("El Prospecto se Eliminó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/CatProspectos.aspx""")
End If
ObjProspectos.Dispose()
End Sub
Protected Sub DdlPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPaises.SelectedIndexChanged
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
UPPEstados.Update()
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
UPPMunicipios.Update()
End Sub
Protected Sub DdlEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEstados.SelectedIndexChanged
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
UPPMunicipios.Update()
End Sub
Protected Sub DdlEmpresaPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaPaises.SelectedIndexChanged
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
UPPEmpresaEstados.Update()
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
UPPEmpresaMunicipios.Update()
End Sub
Protected Sub DdlEmpresaEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaEstados.SelectedIndexChanged
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
UPPEmpresaMunicipios.Update()
End Sub
Protected Sub BtnBusqueda_Click(sender As Object, e As EventArgs) Handles BtnBusqueda.Click
'Dim Prosp As New ClsProspectos
'Dim Busqueda As String = TxtBusqueda.Text.Trim.ToUpper
'If DdlOpcion.SelectedValue = "NOMBRE" Then Busqueda = String.Format("%{0}%", Busqueda)
'If Prosp.GetProspectosBusqueda("-1", "-1", "-1", Busqueda, "-1", -1, -1, -1, -1) Then
' GvBusq.DataSource = Prosp.DtResultados
'End If
Dim Prosp As New ClsProspectos
Dim Busqueda As String = TxtBusqueda.Text.Trim.ToUpper
Dim FechaNacimiento As String = "-1"
If Busqueda <> "" Then Busqueda = String.Format("%{0}%", Busqueda) Else Busqueda = "-1"
If TxtFechaNacB.Text <> String.Empty AndAlso IsDate(TxtFechaNacB.Text) Then FechaNacimiento = TxtFechaNacB.Text.Trim
If Prosp.GetProspectosBusqueda("-1", "-1", "-1", Busqueda, FechaNacimiento, -1, -1, -1, -1) Then
GvBusq.DataSource = Prosp.DtResultados
End If
Prosp.Dispose()
GvBusq.DataBind()
End Sub
Protected Sub LnkClave_Click(sender As Object, e As EventArgs)
Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
TxtApellidoPaterno.Text = Gvr.DataKey("APaterno")
TxtApellidoMaterno.Text = Gvr.DataKey("AMaterno")
TxtNombres.Text = Gvr.DataKey("Nombres")
TxtFechaNacimiento.Text = Gvr.DataKey("FechaNacimiento")
TxtCalle.Text = Gvr.DataKey("Calle")
TxtNumero.Text = Gvr.DataKey("NumExterior")
TxtNumeroInterior.Text = Gvr.DataKey("NumInterior")
TxtColonia.Text = Gvr.DataKey("Colonia")
TxtCodigoPostal.Text = Gvr.DataKey("CP")
DdlSexo.SelectedValue = If(Gvr.DataKey("Sexo") = "H", "1", "0")
TxtIFE.Text = Gvr.DataKey("Clave")
DdlMunicipios.SelectedIndex = DdlMunicipios.Items.IndexOf(DdlMunicipios.Items.FindByText(Gvr.DataKey("PadronMunicipio")))
Alert("Información Cargada", TipoMensaje.MsgInformacion)
Me.cpeDesc.Collapsed = True
Me.cpeDesc.ClientState = "true"
UpDatos.Update()
End Sub
Protected Sub LnkApoyoAgregar_Click(sender As Object, e As EventArgs) Handles LnkApoyoAgregar.Click
If CveProspecto > 0 Then
Dim obj As New ClsProspectos
If obj.AddProspectosEventos(DdlProspectoEvento.SelectedValue.ToEntero, CveProspecto, UsuarioActual.CveUsuario) Then
GvE.DataSource = obj.DtResultados
GvE.DataBind()
End If
obj.Dispose()
Else
If Not EventosTmp.ContainsKey(DdlProspectoEvento.SelectedValue) Then
EventosTmp.Add(DdlProspectoEvento.SelectedValue, DdlProspectoEvento.SelectedItem.Text)
End If
LstEventos.DataSource = EventosTmp
LstEventos.DataBind()
End If
End Sub
End Class

View File

@@ -0,0 +1,476 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ProspectosG15.aspx.vb" Inherits="Prospectos_ProspectosG15" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
<asp:Literal ID="LtlTitulo" runat="server" Text="Registro de Prospectos"></asp:Literal>&nbsp;<asp:Literal ID="LtlProspectos" runat="server"></asp:Literal>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding-top: 20px;">
<tr>
<td align="left">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer CssClass="fancy fancy-green" ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabAlta" runat="server" HeaderText="Información General">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<table border="0" cellpadding="1" cellspacing="0">
<tr>
<td>
<asp:TextBox ID="TxtCveProspecto" runat="server" MaxLength="12" Width="200px" Enabled="False" Visible="False"></asp:TextBox></td>
</tr>
<tr>
<td>Apellido Paterno: </td>
<td>
<asp:TextBox ID="TxtApellidoPaterno" runat="server" MaxLength="50" Width="150px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVApellidoPaterno" runat="server" ControlToValidate="TxtApellidoPaterno" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Apellido Paterno''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator><ajax:ValidatorCalloutExtender ID="VCEApellidoPaterno" runat="server" HighlightCssClass="vco" TargetControlID="RFVApellidoPaterno" Width="300px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td>Apellido Materno: </td>
<td>
<asp:TextBox ID="TxtApellidoMaterno" runat="server" MaxLength="50" Width="150px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVApellidoMaterno" runat="server" ControlToValidate="TxtApellidoMaterno" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Apellido Materno ''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator><ajax:ValidatorCalloutExtender ID="VCEApellidoMaterno" runat="server" HighlightCssClass="vco" TargetControlID="RFVApellidoMaterno" Width="300px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td>Nombre(s): </td>
<td>
<asp:TextBox ID="TxtNombres" runat="server" MaxLength="50" Width="200px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVNombres" runat="server" ControlToValidate="TxtNombres" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombres''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator><ajax:ValidatorCalloutExtender ID="VCENombres" runat="server" HighlightCssClass="vco" TargetControlID="RFVNombres" Width="300px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
<td colspan="2"></td>
</tr>
<tr>
<td>Lugar Nacimiento</td>
<td>
<asp:TextBox ID="TxtLugarNacimiento" runat="server" MaxLength="50" Width="150px"></asp:TextBox></td>
</tr>
<tr>
<td>Fecha Nacimiento</td>
<td>
<asp:TextBox ID="TxtFechaNacimiento" runat="server" MaxLength="12" Width="100px"></asp:TextBox>&nbsp;<asp:ImageButton runat="server" ID="ImgCalendario" ImageUrl="~/Imagenes/Imagenes42/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" /><ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFechaNacimiento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="Calendario" runat="server" TargetControlID="TxtFechaNacimiento" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaNacimiento" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator><asp:CompareValidator ID="CVFechaNacimiento" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator><ajax:ValidatorCalloutExtender ID="VCOFechaNacimiento1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaNacimiento" Width="350px" Enabled="True"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFechaNacimiento2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaNacimiento" Width="350px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td>Edo. Civil</td>
<td>
<asp:DropDownList ID="DdlEstadoCivil" DataTextField="EstadoCivil" DataValueField="CveEstadoCivil" Width="155px" runat="server"></asp:DropDownList></td>
</tr>
<tr>
<td>Escolaridad</td>
<td>
<asp:DropDownList ID="DdlEscolaridad" DataTextField="Escolaridad" DataValueField="CveEscolaridad" Width="155px" runat="server"></asp:DropDownList></td>
</tr>
<tr>
<td>Dependientes</td>
<td>
<asp:TextBox ID="TxtDependientes" Width="50px" runat="server"></asp:TextBox></td>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="6">
<hr />
</td>
</tr>
<tr>
<td>Fuente</td>
<td>
<asp:DropDownList ID="DdlEvento" DataTextField="Evento" DataValueField="CveEvento" Width="255px" runat="server"></asp:DropDownList></td>
</tr>
<tr>
<td>IFE</td>
<td>
<asp:TextBox ID="TxtIFE" Width="150px" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td>Seccion</td>
<td>
<asp:TextBox ID="TxtSeccion" Width="50px" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td>Responsable</td>
<td>
<asp:DropDownList ID="DdlResponsable" DataTextField="Supervisor" DataValueField="CveSupervisor" Width="255px" runat="server" AutoPostBack="True"></asp:DropDownList></td>
</tr>
<tr>
<td>Promotor</td>
<td>
<asp:DropDownList ID="DdlPromotor" DataTextField="Coordinador" DataValueField="CveCoordinador" Width="155px" runat="server"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVPromotor" runat="server" ControlToValidate="DdlPromotor" InitialValue="Seleccione un Promotor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Promotor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator><ajax:ValidatorCalloutExtender ID="VCEPromotor" runat="server" HighlightCssClass="vco" TargetControlID="RFVPromotor" Width="300px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td>Clasificación</td>
<td>
<asp:DropDownList ID="DdlProspectoClasificacion" DataTextField="ProspectoClasificacion" DataValueField="CveProspectoClasificacion" Width="155px" runat="server"></asp:DropDownList></td>
</tr>
</table>
<br />
<table border="0">
<tr>
<td>Calle: </td>
<td>
<asp:TextBox ID="TxtCalle" runat="server" MaxLength="100" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Número: </td>
<td>
<asp:TextBox ID="TxtNumero" runat="server" MaxLength="10" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>No. Interior</td>
<td>
<asp:TextBox ID="TxtNumeroInterior" runat="server" MaxLength="10" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Entre Calle: </td>
<td>
<asp:TextBox ID="TxtEntreCalle1" runat="server" MaxLength="100" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Colonia: </td>
<td>
<asp:TextBox ID="TxtColonia" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td colspan="2"></td>
</tr>
<tr>
<td>País: </td>
<td>
<asp:UpdatePanel ID="UPPPaises" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlPaises" DataTextField="Pais" DataValueField="CvePais" Width="200px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>Estado: </td>
<td>
<asp:UpdatePanel ID="UPPEstados" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlEstados" DataTextField="Estado" DataValueField="CveEstado" Width="200px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>Municipio:</td>
<td>
<asp:UpdatePanel ID="UPPMunicipios" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlMunicipios" DataTextField="Municipio" DataValueField="CveMunicipio" Width="200px" runat="server"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>Teléfono: </td>
<td>
<asp:TextBox ID="TxtTelefono" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Celular: </td>
<td>
<asp:TextBox ID="TxtCelular" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Correo: </td>
<td>
<asp:TextBox ID="TxtCorreo" runat="server" MaxLength="100" Width="200px"></asp:TextBox></td>
</tr>
</table>
<br />
</td>
<td style="vertical-align: top;">
<table id="TblVerificado" runat="server">
<tr>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<div>
<fieldset>
<legend><b>Verificación</b></legend>
<table>
<tr>
<td>Estatus de verificación</td>
<td>
<asp:DropDownList ID="DdlVerificado" runat="server">
<asp:ListItem Selected="True" Text="Sin verificar" Value="0"></asp:ListItem>
<asp:ListItem Text="Verificado Negativo" Value="1"></asp:ListItem>
<asp:ListItem Text="Verificado Positivo" Value="2"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>Observación</td>
<td>
<asp:TextBox ID="TxtObservacionVerificacion" runat="server" TextMode="MultiLine" Width="350px" Height="100px"></asp:TextBox>
</td>
</tr>
</table>
</fieldset>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<br />
<asp:UpdatePanel ID="UpGuardar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" />
<asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" Visible="False" />
<asp:Button ID="BtnCancelar" runat="server" Text="Cancelar" OnClientClick="javascript:window.location.href='/Prospectos/CatProspectosG15.aspx';return false" />
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
</ContentTemplate>
</asp:UpdatePanel>
<br />
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabProspectosSolicitudes" runat="server" HeaderText="Solicitudes">
<ContentTemplate>
<div class="cheader42">
<asp:Panel ID="Panel0" runat="server">
<asp:ImageButton ID="ImgPanel0" CssClass="ImgPanel" ImageUrl="~/Imagenes/plusicon.png" runat="server" /><h2>Nueva Solicitud</h2>
</asp:Panel>
</div>
<div class="TextoPanel">
<asp:Panel ID="Panel" runat="server">
<asp:UpdatePanel ID="UpAgregarSolicitud" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0">
<tr>
<td colspan="3">
<div>
<table border="0" cellpadding="1" cellspacing="0">
<tr>
<td>Canalizador por:</td>
<td>
<asp:TextBox ID="TxtCanalizadorPor" runat="server" MaxLength="100" Width="150px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVCanalizadorPor" runat="server" ControlToValidate="TxtCanalizadorPor" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Solicitud''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECanalizadorPor" runat="server" HighlightCssClass="vco" TargetControlID="RFVCanalizadorPor" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td>Entregó Solicitud:</td>
<td>
<asp:TextBox ID="TxtEntregoSolicitud" runat="server" MaxLength="100" Width="150px"></asp:TextBox>(*)
<%--<asp:RequiredFieldValidator ID="RFVEntregoSolicitud" runat="server" ControlToValidate="TxtEntregoSolicitud" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Solicitud''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEEntregoSolicitud" runat="server" HighlightCssClass="vco" TargetControlID="RFVEntregoSolicitud" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</td>
</tr>
<tr>
<td>Fecha de Solicitud:</td>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<asp:TextBox ID="TxtFechaSolicitud" runat="server" MaxLength="10" Width="94px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaSolicitud" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaSolicitud" runat="server" TargetControlID="TxtFechaSolicitud" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaSolicitud" TargetControlID="TxtFechaSolicitud" PopupButtonID="ImgFechaSolicitud" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaSolicitud" runat="server" ControlToValidate="TxtFechaSolicitud" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Solicitud''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaSolicitud" runat="server" ControlToValidate="TxtFechaSolicitud" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''FechaSolicitud''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaSolicitud1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaSolicitud" Width="350px"></ajax:ValidatorCalloutExtender>
&nbsp;
<ajax:ValidatorCalloutExtender ID="VCOFechaSolicitud2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaSolicitud" Width="350px"></ajax:ValidatorCalloutExtender>
&nbsp;
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>Tipo de Solicitud: </td>
<td>
<asp:DropDownList ID="DdlApoyoTipo" DataTextField="ApoyoTipo" DataValueField="CveApoyoTipo" Width="200px" runat="server" AutoPostBack="True"></asp:DropDownList>(*)
<asp:RequiredFieldValidator ID="RFVApoyoTipo" runat="server" ControlToValidate="DdlApoyoTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Apoyo''</b> es necesario, por favor Seleccionelo." ValidationGroup="GrpAgregar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEApoyoTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVApoyoTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td>Descripción: </td>
<td>
<asp:TextBox ID="TxtDescripcion" runat="server" MaxLength="500" Width="300px" Height="50px" TextMode="MultiLine"></asp:TextBox>(*)</td>
</tr>
<tr>
<td>Clasificación: </td>
<td>
<asp:DropDownList ID="DdlClasificacion" runat="server" DataValueField="CveClasificacion" DataTextField="Clasificacion">
<asp:ListItem Text="Normal" Value="1" Selected="True"></asp:ListItem>
<asp:ListItem Text="Caso Especial" Value="2"></asp:ListItem>
<asp:ListItem Text="Urgente" Value="3"></asp:ListItem>
<asp:ListItem Text="Fondos de Donación" Value="4"></asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td>Tipo: </td>
<td>
<asp:DropDownList ID="DdlSolicitudTipo" DataTextField="SolicitudTipo" DataValueField="CveSolicitudTipo" Width="200px" runat="server" AutoPostBack="True"></asp:DropDownList>(*)
<asp:RequiredFieldValidator ID="RFVCanalizadorPorTipo" runat="server" ControlToValidate="DdlSolicitudTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Solicitud''</b> es necesario, por favor Seleccionelo." ValidationGroup="GrpAgregar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECanalizadorPorTipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVCanalizadorPorTipo" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:Button ID="BtnAgregarSolicitud" runat="server" Text="Agregar" ValidationGroup="GrpAgregar" />
<asp:ValidationSummary ID="VS1" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpAgregar" />
</td>
</tr>
</table>
</div>
</td>
<td id="TdRespuesta" runat="server" visible="false">
<fieldset>
<table>
<tr>
<td>Estatus: </td>
<td>
<asp:DropDownList ID="DdlSolicitudEstatus" DataTextField="SolicitudEstatus" DataValueField="CveSolicitudEstatus" Width="300px" runat="server" AutoPostBack="True"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCanalizadorPorEstatus" runat="server" ControlToValidate="DdlSolicitudEstatus" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estatus de Solicitud''</b> es necesario, por favor Seleccionelo." ValidationGroup="GrpAgregar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECanalizadorPorEstatus" runat="server" HighlightCssClass="vco" TargetControlID="RFVCanalizadorPorEstatus" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td>Respuesta: </td>
<td>
<asp:TextBox ID="TxtObservaciones" runat="server" MaxLength="500" Width="300px" Height="50px" TextMode="MultiLine"></asp:TextBox>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:Button ID="BtnAgregarRespuesta" runat="server" Text="Agregar Respuesta" />
</td>
</tr>
</table></fieldset>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
</div>
<ajax:CollapsiblePanelExtender ID="CPESolicitud" ClientIDMode="Static" runat="server" SuppressPostBack="true" ExpandedImage="~/Imagenes/minusicon.png" TargetControlID="Panel" CollapseControlID="Panel0" ExpandControlID="Panel0" CollapsedImage="~/Imagenes/plusicon.png" Collapsed="true" ImageControlID="ImgPanel0"></ajax:CollapsiblePanelExtender>
<table border="0" class="contenido">
<tr>
<td>
<asp:UpdatePanel ID="UpSolicitudes" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<asp:GridView ID="GvSolicitudes" runat="server" AutoGenerateColumns="False" DataKeyNames="CveProspectoSolicitud" EmptyDataText="No se encontraron Solicitudes Registradas" ToolTip="Listado de Solicitudes">
<Columns>
<asp:BoundField DataField="FechaIng" HeaderText="Fecha" DataFormatString="{0:d}" />
<asp:TemplateField ItemStyle-Width="25px" HeaderText="Apoyo">
<HeaderTemplate>Solicitud</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LnkSolicitud" CssClass="Texto" runat="server" Text=' <%# Eval("CanalizadorPor")%>' CommandArgument='<%# Eval("CveProspectoSolicitud")%>' CommandName="Carga"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="SolicitudTipo" HeaderText="Tipo" />
<asp:BoundField DataField="SolicitudEstatus" HeaderText="Estatus" />
<asp:TemplateField ItemStyle-Width="25px" HeaderText="Canalizar">
<ItemTemplate>
<asp:ImageButton runat="server" ID="ImgFlag" ImageUrl="/Imagenes/flag_red.png" ToolTip="Apoyos" CommandArgument='<%# Eval("CveProspectoSolicitud")%>' CommandName="CargaApoyoSolicitud"></asp:ImageButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto"></RowStyle>
<HeaderStyle CssClass="Titulos"></HeaderStyle>
<AlternatingRowStyle CssClass="TextoAlterno"></AlternatingRowStyle>
<SelectedRowStyle CssClass="tabla_seleccionado"></SelectedRowStyle>
</asp:GridView>
</td>
<td style="vertical-align: top;">
<br />
<asp:Panel ID="PnlApoyos" Visible="False" runat="server">
<table border="0" class="contenido">
<tr>
<td>
<table border="1" rules="all" style="border-collapse: collapse;">
<tr class="tabla_seleccionado">
<th colspan="5" scope="col">
<asp:Label ID="LblTituloApoyo" runat="server" Text=""></asp:Label></th>
</tr>
<tr class="Titulos">
<th scope="col" style="width: 45px;">Cantidad</th>
<th scope="col" style="width: 235px;">Canalizar</th>
<%--<th scope="col" style="width: 65px;">Importe</th>--%>
<th scope="col" style="width: 70px;"></th>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtCantidad" runat="server" Width="40px" Text=""></asp:TextBox></td>
<td>
<asp:DropDownList ID="DdlProspectoApoyo" Width="194px" DataTextField="ProspectoApoyo" DataValueField="CveProspectoApoyo" runat="server"></asp:DropDownList></td>
<%--<td><asp:TextBox ID="TxtImporte" Width="60px" runat="server"></asp:TextBox></td>--%>
<td align="center">
<asp:LinkButton ID="LnkApoyoAgregar" CssClass="Texto" runat="server" Text="Agregar" /></td>
</tr>
</table>
<asp:UpdatePanel ID="UppApoyos" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:GridView ID="GvApoyos" runat="server" Width="365px" ShowHeader="False" AutoGenerateColumns="False" DataKeyNames="CveProspectoSolicitudApoyo" EmptyDataText="" ToolTip="Listado de Solicitudes">
<Columns>
<asp:BoundField DataField="Cantidad" HeaderText="Cantidad" DataFormatString="{0:N2}" ItemStyle-Width="45px" />
<asp:BoundField DataField="ProspectoApoyo" HeaderText="Apoyo" ItemStyle-Width="200px" />
<%--<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-Width="65px" />--%>
<asp:TemplateField HeaderText="" ItemStyle-Width="55px">
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return confirm('¿Está seguro que desea eliminar el Apoyo?');" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto"></RowStyle>
<HeaderStyle CssClass="Titulos"></HeaderStyle>
<AlternatingRowStyle CssClass="TextoAlterno"></AlternatingRowStyle>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Content>

View File

@@ -0,0 +1,462 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class Prospectos_ProspectosG15
Inherits ClsPaginas
'Confinguración
Private Property DTProspectosValores As Data.DataTable
Get
Return CType(ViewState("DTProspectosValores"), Data.DataTable)
End Get
Set(value As Data.DataTable)
ViewState("DTProspectosValores") = value
End Set
End Property
Private ReadOnly Property CveProspecto As Integer
Get
Return ViewState("CveProspecto").ToString.ToEntero
End Get
End Property
Private ReadOnly Property CveProspectoSolicitud As Integer
Get
Return ViewState("CveProspectoSolicitud").ToString.ToEntero
End Get
End Property
Private ReadOnly Property CveApoyoTipo As Integer
Get
Return ViewState("CveApoyoTipo").ToString.ToEntero
End Get
End Property
Private ReadOnly Property CveClasificacion As Integer
Get
Return ViewState("CveClasificacion").ToString.ToEntero
End Get
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
DdlPaises.DataSource = GlobalDTGralPaises : DdlPaises.DataBind() : DdlPaises.SelectedValue = "1"
DdlEscolaridad.DataSource = GlobalDTGralEscolaridades : DdlEscolaridad.DataBind()
DdlEstadoCivil.DataSource = GlobalDTEstadoCivil : DdlEstadoCivil.DataBind()
DdlResponsable.DataSource = GlobalDTProspectosSupervisores(UsuarioActual.CveEmpresa) : DdlResponsable.DataBind()
DdlProspectoClasificacion.DataSource = GlobalDTProspectosClasificaciones(UsuarioActual.CveEmpresa) : DdlProspectoClasificacion.DataBind()
ViewState("CveProspectoSolicitud") = -1
Dim ObjEvento As New ClsProspectos
If ObjEvento.GetProspectosEventos(-1, UsuarioActual.CveEmpresa) Then
DdlEvento.DataSource = ObjEvento.DtResultados
End If
ObjEvento.Dispose()
DdlEvento.DataBind()
CargarSolicitudesTipos()
CargarApoyosTipos()
CargarSolicitudesEstatus()
CargarProspectosApoyos()
CargarApoyosTipos()
'DdlMunicipios.DataSource = GlobalDTGralMunicipios : DdlMunicipios.DataBind()
If UsuarioActual.CveRol <> 1023 Then TblVerificado.Visible = False
If Request("CveProspecto") IsNot Nothing AndAlso IsNumeric(Request("CveProspecto")) AndAlso Request("CveProspecto").ToEntero > 0 Then
ViewState("CveProspecto") = Request("CveProspecto")
CargaDatos()
'Configuración de Modalidad Update
BtnGuardar.Text = "Guardar Cambios"
LtlTitulo.Text = "Consulta del Prospecto:"
Else
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
DdlEstados.SelectedValue = "26"
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero) : DdlMunicipios.SelectedValue = "1919"
DdlPromotor.DataSource = GlobalDTProspectosCoordinadores(DdlResponsable.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) : DdlPromotor.DataBind()
DdlPromotor.Items.Insert(0, New ListItem("Seleccione", "-1"))
RFVPromotor.InitialValue = "-1"
ViewState("CveProspecto") = -1
End If
End If
End Sub
Private Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetProspectos(CveProspecto, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
If ObjProspectos.DtResultados.Rows.Count > 0 Then
TxtCveProspecto.Text = ObjProspectos.CveProspecto.ToString
TxtApellidoPaterno.Text = ObjProspectos.ApellidoPaterno
TxtApellidoMaterno.Text = ObjProspectos.ApellidoMaterno
TxtNombres.Text = ObjProspectos.Nombres
TxtFechaNacimiento.Text = ObjProspectos.FechaNacimiento.ToString
TxtLugarNacimiento.Text = ObjProspectos.LugarNacimiento
TxtCalle.Text = ObjProspectos.Calle
TxtNumero.Text = ObjProspectos.Numero
TxtNumeroInterior.Text = ObjProspectos.NumeroInterior
TxtEntreCalle1.Text = ObjProspectos.EntreCalle1
TxtIFE.Text = ObjProspectos.IFE
TxtSeccion.Text = ObjProspectos.Seccion.ToString
DdlEscolaridad.SelectedValue = ObjProspectos.CveEscolaridad.ToString
DdlResponsable.SelectedValue = ObjProspectos.CveSupervisor.ToString
CargaCoordinadores(DdlPromotor, ObjProspectos.CveSupervisor)
'DdlPromotor.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlPromotor.SelectedValue = ObjProspectos.CveCoordinador.ToString
TxtColonia.Text = ObjProspectos.Colonia
DdlPaises.DataSource = GlobalDTGralPaises : DdlPaises.DataBind() : DdlPaises.SelectedValue = "1"
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
DdlEstados.SelectedValue = "26"
DdlEstados.SelectedValue = ObjProspectos.CveEstado.ToString
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
DdlMunicipios.SelectedValue = ObjProspectos.CveMunicipio.ToString
DdlEscolaridad.SelectedValue = ObjProspectos.CveEscolaridad.ToString
DdlEvento.SelectedValue = ObjProspectos.CveEvento.ToString
TxtTelefono.Text = ObjProspectos.Telefono
TxtCelular.Text = ObjProspectos.Celular
'TxtFax.Text = ObjProspectos.Fax
TxtCorreo.Text = ObjProspectos.Correo
TxtDependientes.Text = ObjProspectos.Dependientes.ToString
DdlVerificado.SelectedValue = ObjProspectos.FueAuditado.ToString
TxtObservacionVerificacion.Text = ObjProspectos.ObservacionesVerificacion
'TxtCveEstatus.Text = ObjProspectos.CveEstatus
'TxtFechaIng.Text = ObjProspectos.FechaIng
'TxtCveUsuario.Text = ObjProspectos.CveUsuario
'TxtCveEmpresa.Text = ObjProspectos.CveEmpresa
CargarSolicitudes(CveProspecto)
If UsuarioActual.TienePermisoProceso(90) Then TdRespuesta.Visible = True Else TdRespuesta.Visible = False
'Permiso Eliminar
If UsuarioActual.TienePermisoProceso(78) Then BtnEliminar.Visible = True Else BtnEliminar.Visible = False
End If
End If
ObjProspectos.Dispose()
End Sub
Private Sub CargaEstados(ddl As DropDownList, CvePais As Integer)
ddl.DataSource = GlobalDTGralEstados(CvePais) : ddl.DataBind()
End Sub
Private Sub CargaMunicipios(ddl As DropDownList, CveEstado As Integer)
ddl.DataSource = GlobalDTGralMunicipios(CveEstado) : ddl.DataBind()
End Sub
Private Sub CargaCoordinadores(ddl As DropDownList, CveSupervisor As Integer)
ddl.DataSource = GlobalDTProspectosCoordinadores(CveSupervisor, -1) : ddl.DataBind()
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
Dim ObjProspectos As New ClsProspectos
If CveProspecto = -1 Then
Dim RetVal As Integer = ObjProspectos.AddProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
TxtNombres.Text.Trim, TxtFechaNacimiento.Text.Trim.ToDate, TxtLugarNacimiento.Text.Trim, "", "", 0, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, TxtEntreCalle1.Text.Trim, "", TxtColonia.Text.Trim, -1, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text.Trim, "", "", TxtCorreo.Text.Trim, "", "", "", DdlEstadoCivil.SelectedValue.ToEntero, -1, DdlEscolaridad.SelectedValue.ToEntero, "", "", "",
"", "", "", "", "", -1, "", "", "", "", "", False, "", "", "", "", -1, "", -1, DdlPromotor.SelectedValue.ToEntero, -1, TxtIFE.Text.Trim, TxtSeccion.Text.ToEntero, TxtDependientes.Text.ToEntero, DdlEvento.SelectedValue.ToEntero, TxtObservacionVerificacion.Text, DdlVerificado.SelectedValue.ToEntero, "", -1, -1, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If RetVal > 0 Then
ViewState("CveProspecto") = ObjProspectos.CveProspecto
Alert("El Prospecto se guardó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/CatProspectosG15.aspx"";")
End If
Else
If ObjProspectos.UpdateProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
TxtNombres.Text.Trim, TxtFechaNacimiento.Text.Trim.ToDate, TxtLugarNacimiento.Text.Trim, "", "", 0, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, TxtEntreCalle1.Text.Trim, "", TxtColonia.Text.Trim, -1.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text.Trim, "", "", TxtCorreo.Text.Trim, "", "", "", DdlEstadoCivil.SelectedValue.ToEntero, -1, DdlEscolaridad.SelectedValue.ToEntero, "", "", "",
"", "", "", "", "", -1, "", "", "", "", "", False, "", "", "", "", -1, "", -1, DdlPromotor.SelectedValue.ToEntero, -1, TxtIFE.Text.Trim, TxtSeccion.Text.ToEntero, TxtDependientes.Text.ToEntero, DdlEvento.SelectedValue.ToEntero, TxtObservacionVerificacion.Text.Trim, DdlVerificado.SelectedValue.ToEntero, "", -1, -1, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProspecto) Then
UpDatos.Update()
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/CatProspectosG15.aspx"";")
End If
End If
ObjProspectos.Dispose()
End Sub
Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click
Dim ObjProspectos As New ClsProspectos()
If ObjProspectos.RemoveProspectos(CveProspecto) Then
Alert("El Prospecto se Eliminó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/CatProspectosG15.aspx""")
End If
ObjProspectos.Dispose()
End Sub
Protected Sub DdlPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPaises.SelectedIndexChanged
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
UPPEstados.Update()
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
UPPMunicipios.Update()
End Sub
Protected Sub DdlEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEstados.SelectedIndexChanged
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
UPPMunicipios.Update()
End Sub
Protected Sub DdlResponsable_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlResponsable.SelectedIndexChanged
CargaCoordinadores(DdlPromotor, DdlResponsable.SelectedValue.ToEntero)
End Sub
#Region "S O L I C I T U D E S"
Private Sub CargarSolicitudesTipos()
DdlSolicitudTipo.DataSource = GlobalDTProspectosSolicitudesTipos(UsuarioActual.CveEmpresa)
DdlSolicitudTipo.DataBind()
End Sub
Private Sub CargarApoyosTipos()
DdlApoyoTipo.DataSource = GlobalDTProspectosApoyosTipos(UsuarioActual.CveEmpresa)
DdlApoyoTipo.DataBind()
End Sub
Private Sub CargarSolicitudesEstatus()
DdlSolicitudEstatus.DataSource = GlobalDTProspectosSolicitudesEstatus(UsuarioActual.CveEmpresa)
DdlSolicitudEstatus.DataBind()
End Sub
Private Sub CargarSolicitudes(CveProspecto As Integer)
Dim ObjSolicitudes As New ClsProspectos
If CveProspecto > 0 Then
If ObjSolicitudes.GetProspectosSolicitudes(CveProspecto, -1, -1, -1, UsuarioActual.CveEmpresa) Then
GvSolicitudes.DataSource = ObjSolicitudes.DtResultados
Else
GvSolicitudes.DataSource = Nothing
End If
End If
ObjSolicitudes.Dispose()
GvSolicitudes.DataBind()
End Sub
Private Sub CargarSolicitudesApoyos()
Dim ObjSolicitudesApoyos As New ClsProspectos
If Request("CveProspectoSolicitud") IsNot Nothing AndAlso IsNumeric(Request("CveProspectoSolicitud")) AndAlso Request("CveProspectoSolicitud").ToEntero > 0 Then
If ObjSolicitudesApoyos.GetProspectosSolicitudesApoyos(CveProspectoSolicitud, -1) Then
GvApoyos.DataSource = ObjSolicitudesApoyos.DtResultados
Else
GvApoyos.DataSource = Nothing
End If
End If
ObjSolicitudesApoyos.Dispose()
GvApoyos.DataBind()
End Sub
Protected Sub CargaDatosProspectosSolicitudes()
Dim ObjProspectosSolicitudes As New ClsProspectos
If ObjProspectosSolicitudes.GetProspectosSolicitudes(CveProspecto, CveApoyoTipo, CveClasificacion, CveProspectoSolicitud, UsuarioActual.CveEmpresa) Then
If ObjProspectosSolicitudes.DtResultados.Rows.Count > 0 Then
TxtCanalizadorPor.Text = ObjProspectosSolicitudes.CanalizadorPor.ToString
TxtEntregoSolicitud.Text = ObjProspectosSolicitudes.EntregoSolicitud.ToString
TxtDescripcion.Text = ObjProspectosSolicitudes.Descripcion.ToString
DdlSolicitudTipo.SelectedValue = ObjProspectosSolicitudes.CveSolicitudTipo.ToString
DdlApoyoTipo.SelectedValue = ObjProspectosSolicitudes.CveApoyoTipo.ToString
DdlClasificacion.SelectedValue = ObjProspectosSolicitudes.CveClasificacion.ToString
DdlSolicitudEstatus.SelectedValue = ObjProspectosSolicitudes.CveSolicitudEstatus.ToString
Tab.ActiveTabIndex = 3
End If
End If
ObjProspectosSolicitudes.Dispose()
End Sub
Private Sub CargarProspectosApoyos()
DdlProspectoApoyo.DataSource = GlobalDTProspectosApoyos(UsuarioActual.CveEmpresa)
DdlProspectoApoyo.DataBind()
End Sub
#End Region
Protected Sub BtnAgregarSolicitud_Click(sender As Object, e As EventArgs) Handles BtnAgregarSolicitud.Click
If BtnAgregarSolicitud.Text = "Agregar Nueva" Then
BorrarCampos()
BtnAgregarSolicitud.Text = "Agregar"
Exit Sub
End If
Dim ObjSolicitudes As New ClsProspectos
If CveProspectoSolicitud = -1 And CveProspecto <> -1 Then
If ObjSolicitudes.AddProspectosSolicitudes(CveProspecto, DdlApoyoTipo.SelectedValue.ToEntero, TxtCanalizadorPor.Text.Trim, TxtEntregoSolicitud.Text.Trim, TxtFechaSolicitud.Text.Trim.ToDate, TxtDescripcion.Text.Trim, "", DdlClasificacion.SelectedValue.ToEntero, DdlSolicitudTipo.SelectedValue.ToEntero, 9, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
ViewState("CveProspectoSolicitud") = ObjSolicitudes.CveProspectoSolicitud
UpSolicitudes.Update()
Alert("La Solicitud se guardó correctamente.", TipoMensaje.MsgInformacion)
If ObjSolicitudes.GetProspectosSolicitudes(CveProspecto, -1, -1, -1, UsuarioActual.CveEmpresa) Then
GvSolicitudes.DataSource = ObjSolicitudes.DtResultados
Else
GvSolicitudes.DataSource = Nothing
End If
GvSolicitudes.DataBind()
End If
Else
GvSolicitudes.DataSource = Nothing
Alert("Debe Guardar el prospecto o seleccionarlo de la lista.", TipoMensaje.MsgAdvertencia)
'If ObjSolicitudes.UpdateProspectosSolicitudes(CveProspecto, TxtCanalizadorPor.Text.Trim, TxtEntregoSolicitud.Text.Trim, TxtFechaSolicitud.Text.Trim.ToDate, TxtDescripcion.Text.Trim, TxtObservaciones.Text, DdlSolicitudTipo.SelectedValue.ToEntero, DdlSolicitudEstatus.SelectedValue.ToEntero, CveProspectoSolicitud) Then
' UpSolicitudes.Update()
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
' If ObjSolicitudes.GetProspectosSolicitudes(CveProspecto, -1, -1, -1, UsuarioActual.CveEmpresa) Then
' GvSolicitudes.DataSource = ObjSolicitudes.DtResultados
' Else
' GvSolicitudes.DataSource = Nothing
' End If
' GvSolicitudes.DataBind()
'End If
End If
BorrarCampos()
ObjSolicitudes.Dispose()
End Sub
Protected Sub BtnAgregarRespuesta_Click(sender As Object, e As EventArgs) Handles BtnAgregarRespuesta.Click
Dim ObjSolicitudes As New ClsProspectos
If CveProspectoSolicitud <> -1 And CveProspecto <> -1 Then
If ObjSolicitudes.UpdateProspectosSolicitudesRespuesta(TxtObservaciones.Text, DdlSolicitudEstatus.SelectedValue.ToEntero, CveProspectoSolicitud) Then
UpSolicitudes.Update()
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
If ObjSolicitudes.GetProspectosSolicitudes(CveProspecto, -1, -1, -1, UsuarioActual.CveEmpresa) Then
GvSolicitudes.DataSource = ObjSolicitudes.DtResultados
Else
GvSolicitudes.DataSource = Nothing
End If
GvSolicitudes.DataBind()
End If
End If
BorrarCampos()
ObjSolicitudes.Dispose()
End Sub
'Protected Sub BtnNuevaSolicitud_Click(sender As Object, e As EventArgs) Handles BtnNuevaSolicitud.Click
' If CveProspectoSolicitud > -1 Then
' ViewState("CveProspectoSolicitud") = -1
' Response.Redirect("/Prospectos/Solicitudes/CatProspectosSolicitudes.aspx?CveProspecto=" & CveProspecto & "")
' Tab.TabIndex = 3
' End If
'End Sub
Private Sub BorrarCampos()
TxtCanalizadorPor.Text = ""
DdlApoyoTipo.SelectedValue = "19"
TxtDescripcion.Text = ""
TxtEntregoSolicitud.Text = ""
TxtFechaSolicitud.Text = ""
DdlSolicitudEstatus.SelectedIndex = -1
TxtObservaciones.Text = ""
DdlSolicitudTipo.SelectedIndex = -1
DdlSolicitudEstatus.SelectedValue = "6"
End Sub
Protected Sub GvSolicitudes_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvSolicitudes.RowCommand
Dim ObjProsp As New ClsProspectos
If e.CommandName = "Carga" Then
If ObjProsp.GetProspectosSolicitudes(-1, -1, -1, e.CommandArgument.ToString.ToEntero, UsuarioActual.CveEmpresa) Then
ViewState("CveProspectoSolicitud") = e.CommandArgument.ToString.ToEntero
TxtCanalizadorPor.Text = ObjProsp.CanalizadorPor
TxtEntregoSolicitud.Text = ObjProsp.EntregoSolicitud
TxtFechaSolicitud.Text = ObjProsp.FechaSolicitud.ToString
TxtDescripcion.Text = ObjProsp.Descripcion
TxtObservaciones.Text = ObjProsp.Observaciones
DdlSolicitudTipo.SelectedValue = ObjProsp.CveSolicitudTipo.ToString
DdlClasificacion.SelectedValue = ObjProsp.CveClasificacion.ToString
DdlApoyoTipo.SelectedValue = ObjProsp.CveApoyoTipo.ToString
DdlSolicitudEstatus.SelectedValue = ObjProsp.CveSolicitudEstatus.ToString
BtnAgregarSolicitud.Text = "Agregar Nueva"
'ViewState("CveProspectoSolicitud") = -1
UpAgregarSolicitud.Update()
RegistraScript("$find('CPESolicitud').expandPanel();")
End If
PnlApoyos.Visible = False
Else
End If
If e.CommandName = "CargaApoyoSolicitud" Then
Dim Gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, ImageButton).BindingContainer, GridViewRow)
GvSolicitudes.SelectedIndex = Gvr.RowIndex
ViewState("CveProspectoSolicitud") = e.CommandArgument.ToString.ToEntero
If ObjProsp.GetProspectosSolicitudesApoyos(e.CommandArgument.ToString.ToEntero, -1) Then
TxtCantidad.Text = ""
'TxtImporte.Text = ""
PnlApoyos.Visible = True
UppApoyos.Update()
LblTituloApoyo.Text = Gvr.FCLinkButton("LnkSolicitud").Text
GvApoyos.DataSource = ObjProsp.DtResultados
GvApoyos.DataBind()
End If
ObjProsp.Dispose()
End If
End Sub
Protected Sub LnkApoyoAgregar_Click(sender As Object, e As EventArgs) Handles LnkApoyoAgregar.Click
Dim ObjApoyo As New ClsProspectos
If ObjApoyo.AddProspectosSolicitudesApoyos(CveProspectoSolicitud, DdlProspectoApoyo.SelectedValue.ToEntero, TxtCantidad.Text.ToDouble, 0, 1) Then
GvApoyos.DataSource = ObjApoyo.DtResultados
GvApoyos.DataBind()
Alert("Apoyo Agregado", TipoMensaje.MsgInformacion)
End If
ObjApoyo.Dispose()
End Sub
Protected Sub GvSolicitudes_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvSolicitudes.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(65)
e.Row.Cells(1).Width = Unit.Pixel(300)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(80)
e.Row.Cells(4).Width = Unit.Pixel(50)
End If
If e.Row.DBCampo("Apoyos").ToEntero > 0 Then
'e.Row.FCImageButton("ImgFlag").ImageUrl = "/Imagenes/flag_green.png"
e.Row.FCImageButton("ImgFlag").ToolTip = String.Format("Apoyos:{0}", e.Row.DBCampo("Apoyos"))
End If
End If
End Sub
Protected Sub GvApoyos_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvApoyos.RowDeleting
Dim ObjApoyo As New ClsProspectos
If ObjApoyo.RemoveProspectosSolicitudesApoyos(e.Keys("CveProspectoSolicitudApoyo").ToString.ToEntero) Then
GvApoyos.DataSource = ObjApoyo.DtResultados
GvApoyos.DataBind()
Alert("Apoyo Eliminado", TipoMensaje.MsgInformacion)
End If
ObjApoyo.Dispose()
End Sub
End Class

View File

@@ -0,0 +1,587 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ProspectosRedes.aspx.vb" Inherits="Prospectos_ProspectosRedes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
<script type="text/javascript" >
function OnSucceeded(result, userContext, methodName) {
if (methodName == 'wsGetNombreCuenta') {
$get('TxtCuentaContable').value = result;
}
}
function myItemSelectedHandler(source, eventArgs) {
//debugger;
var CC = $get('HdnCveProspectoPadre');
CC.value = eventArgs.get_value();
// var b = $get('C_Tabs_TabConyuge_BtnTruco');
// b.Click;
//var aTargetElement = 'BtnSelCuenta';
//__doPostBack(aTargetElement, eventArgs.get_value());
// alert(" Key : " + eventArgs.get_text() + " Value : " + eventArgs.get_value());
}
function LimpiaImporte(t, txt) {
if (t.value != '' && $get(txt)) {
$get(txt).value = '';
}
}
</script>
<style type="text/css">
.AutoExtender
{
font-family: Verdana, Helvetica, sans-serif;
font-size: .9em;
font-weight: normal;
border: solid 1px #006699;
line-height: 20px;
padding: 2px;
background-color: White;
margin-left: 2px;
overflow: auto;
list-style-type: none;
}
.AutoExtenderList
{
cursor: pointer;
color: darkgray;
text-align: left;
}
.AutoExtenderHighlight
{
color: White;
background-color: #084784;
cursor: pointer;
}
#divwidth
{
width: 150px !important;
}
#divwidth div
{
width: 150px !important;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
<asp:Literal ID="LtlTitulo" runat="server" Text="Registro de Prospectos"></asp:Literal>&nbsp;<asp:Literal ID="LtlProspectos" runat="server"></asp:Literal>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<asp:Panel ID="PnlBusquedaGral" runat="server" Visible="false">
<asp:UpdatePanel ID="UPPBusq" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:CollapsiblePanelExtender ID="cpeDesc" runat="Server" TargetControlID="PnlBusqueda" ExpandControlID="PnlHBusqueda" CollapseControlID="PnlHBusqueda" Collapsed="False" ExpandedImage="~/imagenes/collapse.jpg" CollapsedImage="~/imagenes/expand.jpg" ImageControlID="description_ToggleImage" />
<asp:Panel ID="PnlHBusqueda" runat="server" Style="cursor: pointer;">
<div class="heading">
<asp:ImageButton ID="Description_ToggleImage" runat="server" ImageUrl="~/imagenes/collapse.jpg" AlternateText="collapse" />Búsquedas
</div>
</asp:Panel>
<asp:Panel ID="PnlBusqueda" runat="server">
<table border="5" cellpadding="0">
<tr>
<td>Nombre</td>
<td>
<asp:TextBox ID="TxtBusqueda" runat="server" Width="450px"> </asp:TextBox>
</td>
<td>Fecha Nacimiento</td>
<td>
<asp:TextBox ID="TxtFechaNacB" runat="server" MaxLength="12" Width="80px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaNacB" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaNacB" runat="server" TargetControlID="TxtFechaNacB" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" ></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CEFechaNacB" runat="server" TargetControlID="TxtFechaNacB" PopupButtonID="ImgFechaNacB" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaNacB" runat="server" ControlToValidate="TxtFechaNacB" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaNacB" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaNacB" Width="350px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align:right;"><asp:Button ID="BtnBusqueda" runat="server" Text="Consultar" ValidationGroup="GrpBusqueda" /></td>
</tr>
<tr>
<td colspan="5">
<div style="height: 200px; overflow-y: scroll; width: 1000px;">
<asp:GridView ID="GvBusq" runat="server" AutoGenerateColumns="False" DataKeyNames="Clave,APaterno,AMaterno,Nombres,FechaNacimiento,Calle,NumExterior,NumInterior, Sexo, Colonia,CP,Ocupacion,PadronMunicipio">
<Columns>
<asp:TemplateField HeaderText="Clave">
<ItemTemplate>
<asp:LinkButton ID="LnkClave" Text='<%# Bind("Clave") %>' CssClass="Texto" runat="server" OnClick="LnkClave_Click"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="100px" />
</asp:TemplateField>
<asp:BoundField DataField="NombreCompleto" HeaderText="Nombre">
<ItemStyle Width="250px" />
</asp:BoundField>
<asp:BoundField DataField="FechaNacimiento" DataFormatString="{0:d}" HeaderText="F.Nac.">
<ItemStyle Width="70px" />
</asp:BoundField>
<asp:BoundField DataField="Calle" HeaderText="Calle">
<ItemStyle Width="250px" />
</asp:BoundField>
<asp:BoundField DataField="NumExterior" HeaderText="#">
<ItemStyle Width="25px" />
</asp:BoundField>
<asp:BoundField DataField="NumInterior" HeaderText="#Int">
<ItemStyle Width="25px" />
</asp:BoundField>
<asp:BoundField DataField="Sexo" HeaderText="Sexo" />
<asp:BoundField DataField="Colonia" HeaderText="Colonia">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="CP" HeaderText="CP">
<ItemStyle Width="50px" />
</asp:BoundField>
<asp:BoundField DataField="PadronMunicipio" HeaderText="Municipio">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="Ocupacion" HeaderText="Ocupacion">
<ItemStyle Width="150px" />
</asp:BoundField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<table width="100%">
<tr>
<td></td>
<td></td>
<td style="text-align: right;">
Simpatizante:<asp:CheckBox ID="ChkSimpatizante" Checked="True" runat="server" />
&nbsp;&nbsp;<asp:Image ID="ImgAddObs" runat="server" ImageUrl="/Imagenes/add_comment.png" Style="cursor:pointer;" Visible="False" />
&nbsp;&nbsp;<asp:Image ID="ImgAddAgenda" runat="server" ImageUrl="/Imagenes/date_add.png" Style="cursor:pointer;" Visible="False" />
</td>
</tr>
</table>
<asp:UpdatePanel runat="server" ID="UPPObs" UpdateMode="Conditional">
<ContentTemplate>
<div id ="divObs" style="width:365px; background-color:White; border:solid 1px black; color:Black; display:none; position: absolute;">
<table border="0" width="365px" cellpadding="0" cellspacing="0">
<tr class="Titulos">
<td style="width:360px">Observaciones:</td>
<td style="padding-right:4px; padding-top:4px" valign="top"><img alt="" src="/imagenes/close.gif" style="cursor:pointer;" onclick="$get('divObs').style.display='none';" /></td>
</tr>
<tr>
<td colspan="2">
&nbsp;<asp:TextBox ID="TxtOBs" runat="server" TextMode="MultiLine" Rows="4" Width="350px" MaxLength="100"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVObs" runat="server" Display="None" ControlToValidate="TxtOBs" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Observaciones''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardaBit"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEOBs" runat="server" HighlightCssClass="vco" TargetControlID="RFVObs" Width="300px"/>
</td>
</tr>
<tr style="height:25px">
<td align="center" colspan="2">
<asp:Button ID="BtnAddObs" runat="server" Text="Agregar" ValidationGroup="GrpGuardaBit" />
<input id="BtnCancelObs" type="button" value="Cancelar" onclick="$get('divObs').style.display = 'none';" />
</td>
</tr>
</table>
</div>
<div id ="divAgenda" style="width:415px; background-color:White; border:solid 1px black; color:Black; display:none; position: absolute;">
<table border="0" width="415px" cellpadding="0" cellspacing="0">
<tr class="Titulos">
<td style="width:410px;text-align: center;">Agenda</td>
<td style="padding-right:4px; padding-top:4px; text-align: right;" valign="top"><img alt="" src="/imagenes/close.gif" style="cursor:pointer;" onclick="$get('divAgenda').style.display='none';" /></td>
</tr>
<tr><td colspan="2" style="height:10px;"></td></tr>
<tr>
<td>&nbsp;Fecha</td>
<td> <asp:TextBox ID="txtFechaI" runat="server" Width="65px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgCalendario" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Agenda''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td>&nbsp;Asunto</td>
<td>
&nbsp;<asp:TextBox ID="TxtAsunto" runat="server" TextMode="MultiLine" Rows="4" Width="350px" MaxLength="100"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVAsunto" runat="server" Display="None" ControlToValidate="TxtAsunto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Asunto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardaBit"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVAsunto" Width="300px"/>
</td>
</tr>
<tr style="height:25px">
<td align="center" colspan="2">
<asp:Button ID="BtnAddAgenda" runat="server" Text="Agregar" ValidationGroup="GrpGuardaAgenda" />
<input id="BtnCancelAgenda" type="button" value="Cancelar" onclick="$get('divAgenda').style.display = 'none';" />
</td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding-top: 20px;">
<tr>
<td align="left">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabAlta" runat="server" HeaderText="Información General">
<ContentTemplate>
<asp:HiddenField ID="HdnProspectoTipo" runat="server" ClientIDMode="Static" />
<table border="0" class="contenido">
<tr>
<td>
<div>
<fieldset>
<legend><b>Datos Generales</b></legend>
<table border="0" cellpadding="1" cellspacing="0">
<tr>
<td>
<asp:TextBox ID="TxtCveProspecto" runat="server" MaxLength="12" Width="200px" Enabled="False" Visible="False"></asp:TextBox></td>
</tr>
<tr>
<td>Apellido Paterno:
</td>
<td>
<asp:TextBox ID="TxtApellidoPaterno" runat="server" MaxLength="50" Width="150px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVApellidoPaterno" runat="server" ControlToValidate="TxtApellidoPaterno" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Apellido Paterno''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEApellidoPaterno" runat="server" HighlightCssClass="vco" TargetControlID="RFVApellidoPaterno" Width="300px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
<td>Apellido Materno:
</td>
<td>
<asp:TextBox ID="TxtApellidoMaterno" runat="server" MaxLength="50" Width="150px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVApellidoMaterno" runat="server" ControlToValidate="TxtApellidoMaterno" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Apellido Materno ''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEApellidoMaterno" runat="server" HighlightCssClass="vco" TargetControlID="RFVApellidoMaterno" Width="300px" Enabled="True">
</ajax:ValidatorCalloutExtender>
</td>
<td>Nombre(s):
</td>
<td>
<asp:TextBox ID="TxtNombres" runat="server" MaxLength="12" Width="200px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVNombres" runat="server" ControlToValidate="TxtNombres" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombres''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCENombres" runat="server" HighlightCssClass="vco" TargetControlID="RFVNombres" Width="300px" Enabled="True">
</ajax:ValidatorCalloutExtender>
</td>
<td colspan="2"></td>
</tr>
<tr>
<td>Lugar Nacimiento</td>
<td>
<asp:TextBox ID="TxtLugarNacimiento" runat="server" MaxLength="50" Width="150px"></asp:TextBox></td>
<td>Fecha Nacimiento</td>
<td>
<asp:TextBox ID="TxtFechaNacimiento" runat="server" MaxLength="12" Width="100px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaNacimiento" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFechaNacimiento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CEFechaNacimiento" runat="server" TargetControlID="TxtFechaNacimiento" PopupButtonID="ImgFechaNacimiento" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaNacimiento" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaNacimiento" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaNacimiento1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaNacimiento" Width="350px" Enabled="True"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFechaNacimiento2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaNacimiento" Width="350px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
<td colspan="2"></td>
</tr>
<tr>
<td>RFC</td>
<td>
<asp:TextBox ID="TxtRFC" runat="server" MaxLength="13" Width="150px"></asp:TextBox></td>
<td>Nacionalidad</td>
<td>
<asp:TextBox ID="TxtNacionalidad" runat="server" MaxLength="50" Width="150px" Text="MEXICANA"></asp:TextBox></td>
<td>Sexo</td>
<td>
<asp:DropDownList ID="DdlSexo" Width="100px" runat="server">
<asp:ListItem Text="Femenino" Value="0"></asp:ListItem>
<asp:ListItem Text="Masculino" Value="1"></asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td>Clasificación</td>
<td>
<asp:DropDownList ID="DdlClasificacion" DataTextField="ProspectoClasificacion" DataValueField="CveProspectoClasificacion" Width="150px" runat="server"></asp:DropDownList></td>
<td>Escolaridad</td>
<td>
<asp:DropDownList ID="DdlEscolaridad" DataTextField="Escolaridad" DataValueField="CveEscolaridad" Width="155px" runat="server"></asp:DropDownList></td>
<td>IFE</td>
<td>
<asp:TextBox ID="TxtIFE" Width="150px" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td>Teléfono: </td>
<td>
<asp:TextBox ID="TxtTelefono" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Celular: </td>
<td>
<asp:TextBox ID="TxtCelular" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Correo: </td>
<td>
<asp:TextBox ID="TxtCorreo" runat="server" MaxLength="100" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Facebook: </td>
<td>
<asp:TextBox ID="TxtFacebook" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Twitter: </td>
<td>
<asp:TextBox ID="TxtTwitter" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Fecha Ingreso</td>
<td>
<asp:TextBox ID="TxtFechaIngreso" runat="server" Width="70px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaIngreso" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaIngreso" runat="server" TargetControlID="TxtFechaIngreso" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaIngreso" TargetControlID="TxtFechaIngreso" PopupButtonID="ImgFechaIngreso" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvFechaIngreso" runat="server" ControlToValidate="TxtFechaIngreso" Display="None" ErrorMessage="El campo <b>''Fecha Ingreso''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="cvFechaIngreso" runat="server" ControlToValidate="TxtFechaIngreso" Display="None" ErrorMessage="El campo <b>''Fecha Ingreso''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCEFechaIngreso" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaIngreso" Width="350px" Enabled="True"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCEcFechaIngreso" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaIngreso" Width="350px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr><td colspan="6"><hr/></td></tr>
<tr>
<td>Reporta a</td>
<td>
<asp:HiddenField ID="HdnCveProspectoPadre" runat="server" ClientIDMode="Static" />
<asp:TextBox ID="TxtReporta" Width="200px" runat="server"></asp:TextBox>
<ajax:AutoCompleteExtender runat="server" BehaviorID="AutoCompleteEx" ID="autoComplete1"
TargetControlID="TxtReporta" ServicePath="" ServiceMethod="wsGetReporta"
CompletionInterval="350" CompletionSetCount="20" CompletionListCssClass="AutoExtender"
CompletionListItemCssClass="AutoExtenderList" CompletionListHighlightedItemCssClass="AutoExtenderHighlight"
DelimiterCharacters=";,:" OnClientItemSelected="myItemSelectedHandler"
FirstRowSelected="True" Enabled="True">
<Animations>
<OnShow>
<Sequence>
<OpacityAction Opacity="0" />
<HideAction Visible="true" />
<ScriptAction Script="
// Cache the size and setup the initial size
var behavior = $find('AutoCompleteEx');
if (!behavior._height) {
var target = behavior.get_completionList();
behavior._height = target.offsetHeight - 2;
target.style.height = '0px';
}" />
<Parallel Duration=".2">
<FadeIn />
<Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx')._height" />
</Parallel>
</Sequence>
</OnShow>
<OnHide>
<Parallel Duration=".4">
<FadeOut />
<Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx')._height" EndValue="0" />
</Parallel>
</OnHide></Animations>
</ajax:AutoCompleteExtender> </td>
<td>Región</td>
<td>
<asp:DropDownList ID="DdlCoordinador" DataTextField="Coordinador" DataValueField="CveCoordinador" Width="155px" runat="server"></asp:DropDownList></td>
</tr>
</table>
</fieldset>
<br />
<fieldset>
<legend><b>Domicilio Particular</b></legend>
<table border="0">
<tr>
<td>Calle: </td>
<td>
<asp:TextBox ID="TxtCalle" runat="server" MaxLength="100" Width="200px"></asp:TextBox></td>
<td>Número: </td>
<td>
<asp:TextBox ID="TxtNumero" runat="server" MaxLength="10" Width="200px"></asp:TextBox></td>
<td>No. Interior</td>
<td>
<asp:TextBox ID="TxtNumeroInterior" runat="server" MaxLength="10" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Entre Calle: </td>
<td>
<asp:TextBox ID="TxtEntreCalle1" runat="server" MaxLength="100" Width="200px"></asp:TextBox></td>
<td>y </td>
<td>
<asp:TextBox ID="TxtEntreCalle2" runat="server" MaxLength="10" Width="200px"></asp:TextBox></td>
<td colspan="2"></td>
</tr>
<tr>
<td>Colonia: </td>
<td>
<asp:TextBox ID="TxtColonia" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Código Postal: </td>
<td>
<asp:TextBox ID="TxtCodigoPostal" runat="server" MaxLength="5" Width="200px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="FTBECodigoPostal" runat="server" TargetControlID="TxtCodigoPostal" FilterType="Numbers" Enabled="True" />
</td>
<td colspan="2"></td>
</tr>
<tr>
<td>País: </td>
<td>
<asp:UpdatePanel ID="UPPPaises" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlPaises" DataTextField="Pais" DataValueField="CvePais" Width="200px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>Estado: </td>
<td>
<asp:UpdatePanel ID="UPPEstados" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlEstados" DataTextField="Estado" DataValueField="CveEstado" Width="200px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>Municipio:</td>
<td>
<asp:UpdatePanel ID="UPPMunicipios" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlMunicipios" DataTextField="Municipio" DataValueField="CveMunicipio" Width="200px" runat="server"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</fieldset>
<br />
<fieldset>
<legend><b>Datos de la Empresa o Institución</b></legend>
<table border="0">
<tr>
<td>Nombre</td>
<td colspan="3">
<asp:TextBox ID="TxtEmpresaNombre" runat="server" MaxLength="100" Width="490px"></asp:TextBox></td>
<td>Giro</td>
<td>
<asp:TextBox ID="TxtEmpresaGiro" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Sector</td>
<td>
<asp:TextBox ID="TxtEmpresaSector" runat="server" MaxLength="1" Width="200px"></asp:TextBox></td>
<td>Página</td>
<td>
<asp:TextBox ID="TxtEmpresaPagina" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Calle</td>
<td>
<asp:TextBox ID="TxtEmpresaCalle" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Número</td>
<td>
<asp:TextBox ID="TxtEmpresaNumero" runat="server" MaxLength="10" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Colonia</td>
<td>
<asp:TextBox ID="TxtEmpresaColonia" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>CódigoPostal</td>
<td>
<asp:TextBox ID="TxtEmpresaCodigoPostal" runat="server" MaxLength="5" Width="200px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="FTBEEmpresaCodigoPostal" runat="server" TargetControlID="TxtEmpresaCodigoPostal" FilterType="Numbers" Enabled="True" />
</td>
</tr>
<tr>
<td>País</td>
<td>
<asp:UpdatePanel ID="UPPEmpresaPaises" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlEmpresaPaises" DataTextField="Pais" DataValueField="CvePais" Width="200px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>Estado</td>
<td>
<asp:UpdatePanel ID="UPPEmpresaEstados" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlEmpresaEstados" DataTextField="Estado" DataValueField="CveEstado" Width="200px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>Municipio</td>
<td>
<asp:UpdatePanel ID="UPPEmpresaMunicipios" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlEmpresaMunicipios" DataTextField="Municipio" DataValueField="CveMunicipio" Width="200px" runat="server"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>Teléfono</td>
<td>
<asp:TextBox ID="TxtEmpresaTelefono" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Fax</td>
<td>
<asp:TextBox ID="TxtEmpresaFax" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Correo</td>
<td>
<asp:TextBox ID="TxtEmpresaCorreo" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td>Puesto</td>
<td>
<asp:TextBox ID="TxtEmpresaPuesto" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td>Especialidad</td>
<td>
<asp:TextBox ID="TxtEmpresaEspecialidad" runat="server" MaxLength="50" Width="200px"></asp:TextBox></td>
<td></td>
</tr>
</table>
</fieldset>
<br />
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td align="center">
<br/>
<asp:UpdatePanel ID="UpGuardar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" />
<asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" Visible="False" />
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
<asp:Button ID="BtnCancelar" runat="server" Text="Cancelar" OnClientClick="javascript:window.location.href='/Prospectos/CatProspectosRedes.aspx';return false;" />
</ContentTemplate>
</asp:UpdatePanel>
<br/>
</td>
</tr>
</table>
<div>
</div>
</asp:Content>

View File

@@ -0,0 +1,341 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
Partial Class Prospectos_ProspectosRedes
Inherits ClsPaginas
'Confinguración
Private Property DTProspectosValores As DataTable
Get
Return CType(ViewState("DTProspectosValores"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTProspectosValores") = value
End Set
End Property
Private ReadOnly Property CveProspecto As Integer
Get
Return ViewState("CveProspecto").ToString.ToEntero
End Get
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
DdlPaises.DataSource = GlobalDTGralPaises : DdlPaises.DataBind()
DdlEmpresaPaises.DataSource = GlobalDTGralPaises : DdlEmpresaPaises.DataBind()
DdlEscolaridad.DataSource = GlobalDTGralEscolaridades : DdlEscolaridad.DataBind() : DdlEscolaridad.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlClasificacion.DataSource = GlobalDTProspectosClasificaciones(UsuarioActual.CveEmpresa) : DdlClasificacion.DataBind() : DdlClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlCoordinador.DataSource = GlobalDTProspectosCoordinadores(-1, UsuarioActual.CveEmpresa) : DdlCoordinador.DataBind() : DdlCoordinador.Items.Insert(0, New ListItem("Seleccione", "-1"))
'codigo Comentado, por el objeto UsuarioActual
'If UsuarioActual.CveCoordinador > 0 Then
' DdlCoordinador.SelectedValue = UsuarioActual.CveCoordinador.ToString
' DdlCoordinador.Enabled = False
'End If
'HdnCveProspectoPadre.Value = UsuarioActual.CveProspecto.ToString
'CEFechaNacimiento.EndDate = Today
'DdlMunicipios.DataSource = GlobalDTGralMunicipios : DdlMunicipios.DataBind()
If Request("CveProspecto") IsNot Nothing AndAlso IsNumeric(Request("CveProspecto")) AndAlso Request("CveProspecto").ToEntero > 0 Then
ViewState("CveProspecto") = Request("CveProspecto")
CargaDatos()
'Configuración de Modalidad Update
BtnGuardar.Text = "Guardar Cambios"
LtlTitulo.Text = "Consulta del Prospecto:"
Else
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
DdlEstados.SelectedValue = "26"
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
DdlEmpresaEstados.SelectedValue = "26"
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
ViewState("CveProspecto") = -1
PnlBusquedaGral.Visible = True
Me.Form.DefaultButton = BtnBusqueda.UniqueID
TxtBusqueda.Focus()
TxtFechaIngreso.Text = Now.ToShortDateString
End If
End If
End Sub
<Web.Services.WebMethod()> <Script.Services.ScriptMethodAttribute()>
Public Shared Function wsGetReporta(ByVal prefixText As String, ByVal count As Integer) As String()
'Dim dt As DataTable = CType(Session("DtCuentas"), DataTable)
'Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
'dt = Conta.getCuentasCheque(Prefijo)
'Conta.Dispose()
Dim items As New List(Of String)(count)
Dim Prosp As New ClsProspectos
Dim dt As DataTable = Nothing
If Prosp.GetProspectos(-1, prefixText.Trim, "-1", -1, -1, -1, -1, -1, -1, 41) Then
dt = Prosp.DtResultados
End If
Prosp.Dispose()
For i As Integer = 0 To count - 1
If dt.Rows.Count > i Then
items.Add(AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(dt.Rows(i)("NombreCompleto").ToString, dt.Rows(i)("CveProspecto").ToString))
Else
Exit For
End If
Next
Return items.ToArray()
End Function
Private Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetProspectos(CveProspecto, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
If ObjProspectos.DtResultados.Rows.Count > 0 Then
TxtCveProspecto.Text = ObjProspectos.CveProspecto.ToString
TxtApellidoPaterno.Text = ObjProspectos.ApellidoPaterno
TxtApellidoMaterno.Text = ObjProspectos.ApellidoMaterno
TxtNombres.Text = ObjProspectos.Nombres
TxtFechaNacimiento.Text = ObjProspectos.FechaNacimiento.ToString
TxtLugarNacimiento.Text = ObjProspectos.LugarNacimiento
TxtRFC.Text = ObjProspectos.RFC
TxtNacionalidad.Text = ObjProspectos.Nacionalidad
TxtCalle.Text = ObjProspectos.Calle
TxtNumero.Text = ObjProspectos.Numero
TxtNumeroInterior.Text = ObjProspectos.NumeroInterior
TxtEntreCalle1.Text = ObjProspectos.EntreCalle1
TxtEntreCalle2.Text = ObjProspectos.EntreCalle2
TxtIFE.Text = ObjProspectos.IFE
DdlClasificacion.SelectedValue = ObjProspectos.CveProspectoClasificacion.ToString
DdlEscolaridad.SelectedValue = ObjProspectos.CveEscolaridad.ToString
DdlSexo.SelectedValue = ObjProspectos.Sexo.ToString
TxtColonia.Text = ObjProspectos.Colonia
TxtCodigoPostal.Text = ObjProspectos.CodigoPostal.ToString
DdlPaises.SelectedValue = ObjProspectos.CvePais.ToString
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
DdlEstados.SelectedValue = ObjProspectos.CveEstado.ToString
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
DdlMunicipios.SelectedValue = ObjProspectos.CveMunicipio.ToString
TxtFacebook.Text = ObjProspectos.Facebook
TxtTwitter.Text = ObjProspectos.Twitter
HdnCveProspectoPadre.Value = ObjProspectos.CveProspectoPadre.ToString
TxtReporta.Text = ObjProspectos.ProspectoPadre
TxtTelefono.Text = ObjProspectos.Telefono
TxtCelular.Text = ObjProspectos.Celular
'TxtFax.Text = ObjProspectos.Fax
TxtCorreo.Text = ObjProspectos.Correo
TxtEmpresaNombre.Text = ObjProspectos.EmpresaNombre
TxtEmpresaGiro.Text = ObjProspectos.EmpresaGiro
TxtEmpresaSector.Text = ObjProspectos.EmpresaSector
TxtEmpresaPagina.Text = ObjProspectos.EmpresaPagina
TxtEmpresaCalle.Text = ObjProspectos.EmpresaCalle
TxtEmpresaNumero.Text = ObjProspectos.EmpresaNumero
TxtEmpresaColonia.Text = ObjProspectos.EmpresaColonia
TxtEmpresaCodigoPostal.Text = ObjProspectos.EmpresaCodigoPostal
DdlEmpresaPaises.SelectedValue = ObjProspectos.CveEmpresaPais.ToString
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
DdlEmpresaEstados.SelectedValue = ObjProspectos.CveEmpresaEstado.ToString
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
DdlEmpresaMunicipios.SelectedValue = ObjProspectos.CveEmpresaMunicipio.ToString
ImgAddObs.Visible = True
ImgAddAgenda.Visible = True
ImgAddObs.Attributes.Add("onclick", "javascript:$get('divObs').style.display=''; PosicionaObjeto(this.id,'divObs');")
ImgAddAgenda.Attributes.Add("onclick", "javascript:$get('divAgenda').style.display=''; PosicionaObjeto(this.id,'divAgenda');")
DdlCoordinador.SelectedValue = ObjProspectos.CveCoordinador.ToString
'cveEmpresaPais.Text = ObjProspectos.EmpresaPais
'TxtEmpresaMunicipio.Text = ObjProspectos.EmpresaMunicipio
'TxtEmpresaEstado.Text = ObjProspectos.EmpresaEstado
TxtEmpresaTelefono.Text = ObjProspectos.EmpresaTelefono
TxtEmpresaFax.Text = ObjProspectos.EmpresaFax
TxtEmpresaCorreo.Text = ObjProspectos.EmpresaCorreo
TxtEmpresaPuesto.Text = ObjProspectos.EmpresaPuesto
TxtEmpresaEspecialidad.Text = ObjProspectos.EmpresaEspecialidad
TxtFechaIngreso.Text = ObjProspectos.FechaIng.ToShortDateString
TxtFechaIngreso.Enabled = False
ImgFechaIngreso.Visible = False
HdnProspectoTipo.Value = ObjProspectos.CveProspectoTipo.ToString
'TxtCveEstatus.Text = ObjProspectos.CveEstatus
'TxtFechaIng.Text = ObjProspectos.FechaIng
'TxtCveUsuario.Text = ObjProspectos.CveUsuario
'TxtCveEmpresa.Text = ObjProspectos.CveEmpresa
'Cargar los Valores de las Caractertisticas
If ObjProspectos.GetProspectosValores(CveProspecto) Then
ViewState("DTProspectosValores") = ObjProspectos.DtResultados
End If
PnlBusquedaGral.Visible = False
'Permiso Eliminar
If UsuarioActual.TienePermisoProceso(78) Then BtnEliminar.Visible = True Else BtnEliminar.Visible = False
End If
End If
ObjProspectos.Dispose()
End Sub
Private Sub CargaEstados(ddl As DropDownList, CvePais As Integer)
ddl.DataSource = GlobalDTGralEstados(CvePais) : ddl.DataBind()
End Sub
Private Sub CargaMunicipios(ddl As DropDownList, CveEstado As Integer)
ddl.DataSource = GlobalDTGralMunicipios(CveEstado) : ddl.DataBind()
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
If DdlClasificacion.SelectedValue.ToEntero < 0 Then
Alert("Seleccione la clasificación, por favor", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim FechaIngreso As String = TxtFechaIngreso.Text.Trim
If FechaIngreso = "__/__/____" Then FechaIngreso = "-1"
If TxtFechaIngreso.Text.Trim = Now.ToShortDateString Then
FechaIngreso = Now.ToString
End If
Dim ObjProspectos As New ClsProspectos
If CveProspecto = -1 Then
If HdnCveProspectoPadre.Value.ToEntero > 0 Then
Dim RetValue As Integer = ObjProspectos.AddProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
TxtNombres.Text.Trim, TxtFechaNacimiento.Text.Trim.ToDate, TxtLugarNacimiento.Text.Trim, TxtRFC.Text.Trim, TxtNacionalidad.Text.Trim, DdlSexo.SelectedValue.ToEntero, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, TxtEntreCalle1.Text.Trim, TxtEntreCalle2.Text.Trim, TxtColonia.Text.Trim, TxtCodigoPostal.Text.Trim.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text, "", "", TxtCorreo.Text.Trim, "", TxtFacebook.Text.Trim, TxtTwitter.Text.Trim, -1, DdlClasificacion.SelectedValue.ToEntero, DdlEscolaridad.SelectedValue.ToEntero, TxtEmpresaNombre.Text.Trim, TxtEmpresaGiro.Text.Trim, TxtEmpresaSector.Text.Trim,
TxtEmpresaPagina.Text.Trim, TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, TxtEmpresaCodigoPostal.Text.Trim, DdlEmpresaMunicipios.SelectedValue.ToEntero,
TxtEmpresaTelefono.Text.Trim, TxtEmpresaFax.Text.Trim, TxtEmpresaCorreo.Text.Trim, TxtEmpresaPuesto.Text.Trim,
TxtEmpresaEspecialidad.Text.Trim, False, "", "", "", "", -1, "", HdnCveProspectoPadre.Value.ToEntero, DdlCoordinador.SelectedValue.ToEntero, -1, TxtIFE.Text.Trim, -1, -1, -1, "", 0, "", -1, 1, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FechaIngreso)
If RetValue > 0 Then
ViewState("CveProspecto") = ObjProspectos.CveProspecto
Alert("El Prospecto se guardó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/ProspectosRedes.aspx"";")
Else
If RetValue = -2 Then
Alert("No se puede duplicar el campo IFE", TipoMensaje.MsgError)
End If
End If
Else
Alert("Selecione a quién reporta(superior).", TipoMensaje.MsgAdvertencia)
End If
Else
If ObjProspectos.UpdateProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
TxtNombres.Text.Trim, TxtFechaNacimiento.Text.Trim.ToDate, TxtLugarNacimiento.Text.Trim, TxtRFC.Text.Trim, TxtNacionalidad.Text.Trim, DdlSexo.SelectedValue.ToEntero, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, TxtEntreCalle1.Text.Trim, TxtEntreCalle2.Text.Trim, TxtColonia.Text.Trim, TxtCodigoPostal.Text.Trim.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text, "", "", TxtCorreo.Text.Trim, "", TxtFacebook.Text.Trim, TxtTwitter.Text.Trim, -1, DdlClasificacion.SelectedValue.ToEntero, DdlEscolaridad.SelectedValue.ToEntero, TxtEmpresaNombre.Text.Trim, TxtEmpresaGiro.Text.Trim, TxtEmpresaSector.Text.Trim,
TxtEmpresaPagina.Text.Trim, TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, TxtEmpresaCodigoPostal.Text.Trim, DdlEmpresaMunicipios.SelectedValue.ToEntero,
TxtEmpresaTelefono.Text.Trim, TxtEmpresaFax.Text.Trim, TxtEmpresaCorreo.Text.Trim, TxtEmpresaPuesto.Text.Trim,
TxtEmpresaEspecialidad.Text.Trim, False, "", "", "", "", -1, "", HdnCveProspectoPadre.Value.ToEntero, DdlCoordinador.SelectedValue.ToEntero, -1, TxtIFE.Text.Trim, -2, -1, -1, "", 0, "", -1, HdnProspectoTipo.Value.ToEntero, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProspecto) Then
UpDatos.Update()
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/ProspectosRedes.aspx"";")
End If
End If
ObjProspectos.Dispose()
End Sub
Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click
Dim ObjProspectos As New ClsProspectos()
If ObjProspectos.RemoveProspectos(CveProspecto) Then
Alert("El Prospecto se Eliminó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/CatProspectos.aspx""")
End If
ObjProspectos.Dispose()
End Sub
Protected Sub DdlPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPaises.SelectedIndexChanged
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
UPPEstados.Update()
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
UPPMunicipios.Update()
End Sub
Protected Sub DdlEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEstados.SelectedIndexChanged
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
UPPMunicipios.Update()
End Sub
Protected Sub DdlEmpresaPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaPaises.SelectedIndexChanged
CargaEstados(DdlEmpresaEstados, DdlEmpresaPaises.SelectedValue.ToEntero)
UPPEmpresaEstados.Update()
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
UPPEmpresaMunicipios.Update()
End Sub
Protected Sub DdlEmpresaEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaEstados.SelectedIndexChanged
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
UPPEmpresaMunicipios.Update()
End Sub
Protected Sub BtnBusqueda_Click(sender As Object, e As EventArgs) Handles BtnBusqueda.Click
Dim Prosp As New ClsProspectos
Dim Busqueda As String = TxtBusqueda.Text.Trim.ToUpper
Dim FechaNacimiento As String = "-1"
If Busqueda <> "" Then Busqueda = String.Format("%{0}%", Busqueda) Else Busqueda = "-1"
If TxtFechaNacB.Text <> String.Empty AndAlso IsDate(TxtFechaNacB.Text) Then FechaNacimiento = TxtFechaNacB.Text.Trim
If Prosp.GetProspectosBusqueda("-1", "-1", "-1", Busqueda, FechaNacimiento, -1, -1, -1, -1) Then
GvBusq.DataSource = Prosp.DtResultados
End If
Prosp.Dispose()
GvBusq.DataBind()
End Sub
Protected Sub LnkClave_Click(sender As Object, e As EventArgs)
Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
TxtApellidoPaterno.Text = Gvr.DataKey("APaterno")
TxtApellidoMaterno.Text = Gvr.DataKey("AMaterno")
TxtNombres.Text = Gvr.DataKey("Nombres")
TxtFechaNacimiento.Text = Gvr.DataKey("FechaNacimiento")
TxtCalle.Text = Gvr.DataKey("Calle")
TxtNumero.Text = Gvr.DataKey("NumExterior")
TxtNumeroInterior.Text = Gvr.DataKey("NumInterior")
TxtColonia.Text = Gvr.DataKey("Colonia")
TxtCodigoPostal.Text = Gvr.DataKey("CP")
DdlSexo.SelectedValue = If(Gvr.DataKey("Sexo") = "H", "1", "0")
TxtIFE.Text = Gvr.DataKey("Clave")
DdlMunicipios.SelectedIndex = DdlMunicipios.Items.IndexOf(DdlMunicipios.Items.FindByText(Gvr.DataKey("PadronMunicipio")))
Alert("Información Cargada", TipoMensaje.MsgInformacion)
Me.cpeDesc.Collapsed = True
Me.cpeDesc.ClientState = "true"
UpDatos.Update()
End Sub
End Class

View File

@@ -0,0 +1,530 @@
<%@ Page Title="Expediente del prospecto" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ProspectosSIP.aspx.vb" Inherits="Prospectos_ProspectosSIP" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
<asp:Literal ID="LtlTitulo" runat="server" Text="Registro de Prospectos"></asp:Literal>&nbsp;<asp:Literal ID="LtlProspectos" runat="server"></asp:Literal>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<style type="text/css">
.CaracteristicaClasificacion {
font-size: 18px;
color: #fff;
background-color: gray;
text-align: center;
}
.CaracteristicaTipo {
font-size: 14px;
color: #808080;
background-color: lightgray;
}
</style>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding-top: 20px;">
<tr>
<td align="left">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabGenerales" runat="server" HeaderText="Información General">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<div>
<div>
<fieldset>
<legend><b>Datos de Contacto</b></legend>
<table border="0" cellpadding="1" cellspacing="0">
<tr>
<td>
<asp:TextBox ID="TxtCveProspecto" runat="server" MaxLength="12" Width="150px" Enabled="False" Visible="False"></asp:TextBox></td>
</tr>
<tr>
<td>Nombre(s): </td>
<td>
<asp:TextBox ID="TxtNombres" runat="server" MaxLength="50" Width="150px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVNombres" runat="server" ControlToValidate="TxtNombres" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombres''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator><ajax:ValidatorCalloutExtender ID="VCENombres" runat="server" HighlightCssClass="vco" TargetControlID="RFVNombres" Width="300px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
<td>A. Paterno: </td>
<td>
<asp:TextBox ID="TxtApellidoPaterno" runat="server" MaxLength="50" Width="150px"></asp:TextBox>(*)</td>
<td>A. Materno: </td>
<td>
<asp:TextBox ID="TxtApellidoMaterno" runat="server" MaxLength="50" Width="150px"></asp:TextBox>(*)</td>
</tr>
<tr>
<td>Teléfono:</td>
<td>
<asp:TextBox ID="TxtTelefono" runat="server" MaxLength="50" Width="150px"></asp:TextBox></td>
<td>Celular: </td>
<td>
<asp:TextBox ID="TxtCelular" runat="server" MaxLength="50" Width="150px"></asp:TextBox></td>
<td>Correo: </td>
<td>
<asp:TextBox ID="TxtCorreo" runat="server" MaxLength="100" Width="150px"></asp:TextBox></td>
</tr>
<tr>
<td>Puesto:</td>
<td>
<asp:TextBox ID="TxtEmpresaPuesto" runat="server" MaxLength="50" Width="150px"></asp:TextBox></td>
<td></td>
<td></td>
</tr>
</table>
</fieldset>
</div>
<br />
<fieldset>
<legend><b>Domicilio Particular</b></legend>
<table border="0">
<tr>
<td>Calle: </td>
<td colspan="3">
<asp:TextBox ID="TxtCalle" runat="server" MaxLength="100" Width="400px"></asp:TextBox></td>
<td>Número: </td>
<td>
<asp:TextBox ID="TxtNumero" runat="server" MaxLength="10"></asp:TextBox></td>
</tr>
<tr>
<td>Entre Calle: </td>
<td>
<asp:TextBox ID="TxtEntreCalle1" runat="server" MaxLength="100" Width="150px"></asp:TextBox></td>
<td>Colonia: </td>
<td>
<asp:TextBox ID="TxtColonia" runat="server" MaxLength="50" Width="150px"></asp:TextBox></td>
<td align="center" colspan="2">
<asp:Image ID="ImgVerMapaParticular" runat="server" Height="22px" ImageUrl="~/Imagenes/PinMapBlue32x32.png" Style="cursor: pointer;" ToolTip="Ver Mapa Particular" />
<asp:HyperLink ID="HlMapaParticular" CssClass="Texto thickbox" runat="server" Text="Mapa Particular" Visible="False" ImageUrl="/Imagenes/date_add.png" Style="cursor: pointer;" ToolTip="Mapa Particular"></asp:HyperLink>
</td>
</tr>
<tr>
<td>Estado: </td>
<td>
<asp:UpdatePanel ID="UPPEstados" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlEstados" DataTextField="Estado" DataValueField="CveEstado" Width="150px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>Municipio:</td>
<td>
<asp:UpdatePanel ID="UPPMunicipios" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlMunicipios" DataTextField="Municipio" DataValueField="CveMunicipio" Width="150px" runat="server"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td colspan="2"></td>
</tr>
</table>
<asp:UpdatePanel runat="server" ID="UPMapa" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivMapaParticular" style="width: 335px; background-color: White; border: solid 1px black; color: Black; display: none; position: absolute;">
<table border="0" width="335px" cellpadding="0" cellspacing="0">
<tr class="Titulos">
<td style="width: 330px">Mapa Particular&nbsp;</td>
<td style="padding-right: 4px; padding-top: 4px" valign="top">
<img alt="" src="/Imagenes/close.gif" style="cursor: pointer;" onclick="$('#DivMapaParticular').hide(1000);" /></td>
</tr>
<tr align="left">
<td>
<table>
<tr>
<td>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px;
}
</style>
<script language="javascript" type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script language="javascript" type="text/javascript">
var map;
function initialize() {
var mapOptions = {
zoom: 16,
center: new google.maps.LatLng(29.0724402, -110.9780811)
};
map = new google.maps.Map(document.getElementById('map-canvasPart'), mapOptions);
var marker = new google.maps.Marker({ position: new google.maps.LatLng(29.0724402, -110.9780811), map: map, title: 'title' });
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<table>
<tr>
<td>
<div style="width: 490px;">
<fieldset>
<legend><b>Domicilio Particular</b></legend>
<div id="map-canvasPart" style="width: 480px; height: 480px;"></div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="DivMapaEmpresa" style="width: 335px; background-color: White; border: solid 1px black; color: Black; display: none; position: absolute;">
<table border="0" width="335px" cellpadding="0" cellspacing="0">
<tr class="Titulos">
<td style="width: 330px">Mapa Empresa&nbsp;</td>
<td style="padding-right: 4px; padding-top: 4px" valign="top">
<img alt="" src="/Imagenes/close.gif" style="cursor: pointer;" onclick="$('#DivMapaEmpresa').hide(1000);" /></td>
</tr>
<tr align="left">
<td>
<table>
<tr>
<td>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px;
}
</style>
<script language="javascript" type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script language="javascript" type="text/javascript">
var map;
function initialize() {
//padron
var mapOptions2 = {
zoom: 16,
center: new google.maps.LatLng(29.1058640, -110.9843025)
};
map2 = new google.maps.Map(document.getElementById('map-canvasEmp'), mapOptions2);
var marker2 = new google.maps.Marker({ position: new google.maps.LatLng(29.98428, -105.8640), map: map2, title: 'title' });
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<table>
<tr>
<td>
<div style="width: 490px;">
<fieldset></fieldset>
<legend><b>Empresa</b></legend>
<div id="map-canvasEmp" style="width: 480px; height: 480px;"></div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</fieldset>
<br />
<fieldset>
<legend><b>Datos de la Empresa</b></legend>
<table border="0">
<tr>
<td>Nombre</td>
<td colspan="3">
<asp:TextBox ID="TxtEmpresaNombre" runat="server" MaxLength="100" Width="490px"></asp:TextBox></td>
<td>
<asp:Image ID="ImgVerMapaEmpresa" runat="server" ImageUrl="~/Imagenes/PinMapYellow32x32.png" Height="22px" Style="cursor: pointer;" ToolTip="Ver Mapa Empresa" />
<asp:HyperLink ID="HlMapaEmpresa" CssClass="Texto thickbox" runat="server" Text="Mapa Empresa" Visible="False" ImageUrl="/Imagenes/date_add.png" Style="cursor: pointer;" ToolTip="Mapa Empresa"></asp:HyperLink></td>
<td></td>
</tr>
<tr>
<td>Calle</td>
<td>
<asp:TextBox ID="TxtEmpresaCalle" runat="server" MaxLength="50" Width="150px"></asp:TextBox></td>
<td>Número</td>
<td>
<asp:TextBox ID="TxtEmpresaNumero" runat="server" MaxLength="10" Width="150px"></asp:TextBox></td>
<td>Colonia</td>
<td>
<asp:TextBox ID="TxtEmpresaColonia" runat="server" MaxLength="50" Width="150px"></asp:TextBox></td>
</tr>
<tr>
<td>Estado</td>
<td>
<asp:UpdatePanel ID="UPPEmpresaEstados" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlEmpresaEstados" DataTextField="Estado" DataValueField="CveEstado" idth="150px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>Municipio</td>
<td>
<asp:UpdatePanel ID="UPPEmpresaMunicipios" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlEmpresaMunicipios" DataTextField="Municipio" DataValueField="CveMunicipio" Width="150px" runat="server"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td colspan="2"></td>
</tr>
<tr>
<td>Teléfono</td>
<td colspan="4">
<asp:TextBox ID="TxtEmpresaTelefono" runat="server" MaxLength="50" Width="150px"></asp:TextBox></td>
</tr>
</table>
</fieldset>
<br />
</div>
</td>
<td style="vertical-align: top;">
<div>
<fieldset>
<legend><b>Datos de Prospección</b></legend>
<table border="0">
<tr>
<td>Clasificación</td>
</tr>
<tr>
<td>
<asp:DropDownList ID="DdlProspectoClasificacion" DataTextField="ProspectoClasificacion" DataValueField="CveProspectoClasificacion" Width="155px" runat="server"></asp:DropDownList></td>
</tr>
<tr>
<td>Vendedor</td>
</tr>
<tr>
<td>
<asp:DropDownList ID="DdlVendedor" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" Width="150px"></asp:DropDownList></td>
</tr>
<tr>
<td>Calificación</td>
</tr>
<tr>
<td>
<asp:DropDownList ID="DdlCalificacion" DataTextField="ProspectoTipo" DataValueField="CveProspectoTipo" runat="server" Width="150px"></asp:DropDownList></td>
</tr>
<tr>
<td>Estatus</td>
</tr>
<tr>
<td>
<asp:DropDownList ID="DdlEstatus" DataTextField="ProspectoEstatus" DataValueField="CveProspectoEstatus" runat="server" Width="150px"></asp:DropDownList></td>
</tr>
</table>
</fieldset>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabDatosTecnicos" runat="server" HeaderText="Datos Técnicos">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<asp:GridView ID="GvCaracteristicaClasificaciones" runat="server" ShowHeader="false" AutoGenerateColumns="False" DataKeyNames="CveCaracteristicaClasificacion" EmptyDataText="No se encontraron Clasificaciones de Caracteristicas Registradas" ToolTip="Listado de Clasificaciones de Caracteristicas">
<Columns>
<asp:TemplateField>
<ItemStyle BorderStyle="None" />
<ItemTemplate>
<asp:Label Font-Bold="true" Width="100%" ID="LblCaracteristicaClasificacion" runat="server" Text='<%# Eval("CaracteristicaClasificacion")%>'></asp:Label>
<asp:GridView ID="GvCaracteristicasTipos" ShowHeader="false" OnRowDataBound="GvCaracteristicasTipos_RowDataBound" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCaracteristicaTipo" EmptyDataText="No se encontraron Tipos de Caracteristicas Registrados" ToolTip="Listado de Tipos de Caracteristicas">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label Font-Bold="true" Width="100%" ID="LblCaracteristicaTipo" runat="server" Text='<%# Eval("CaracteristicaTipo")%>'></asp:Label>
<asp:GridView ID="GvCaracteristicas" ShowHeader="false" OnRowDataBound="GvCaracteristicas_RowDataBound" runat="server" AutoGenerateColumns="False" DataKeyNames="CveCaracteristica" EmptyDataText="No se encontraron Caracteristicas Registrados" ToolTip="Listado de Caracteristicas">
<Columns>
<asp:TemplateField>
<ItemStyle BorderStyle="None" />
<ItemTemplate>
<asp:Label ID="LtlCaracteristica" runat="server" Text='<%# Eval("Caracteristica")%>' Width="200px"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemStyle BorderStyle="None" />
<ItemTemplate>
<asp:TextBox ID="TxtValor" Visible="false" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpEditGuardarCl" Width="400px"></asp:TextBox>
<asp:ImageButton runat="server" ID="ImgTxtValor" Visible="false" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEETxtValor" Enabled="false" runat="server" TargetControlID="TxtValor" Mask="99/99/9999" MaskType="Date" UserDateFormat="DayMonthYear" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CETxtValor" TargetControlID="TxtValor" PopupButtonID="ImgTxtValor" PopupPosition="BottomRight" Enabled="False"></ajax:CalendarExtender>
<asp:DropDownList ID="DdlOpcion" Visible="false" runat="server" DataValueField="CveCaracteristicaOpcion" DataTextField="CaracteristicaOpcion"></asp:DropDownList>
<asp:RadioButtonList ID="RbOpcion" Visible="false" RepeatDirection="Horizontal" runat="server" DataValueField="CveCaracteristicaOpcion" DataTextField="CaracteristicaOpcion" ValidationGroup="GrpGuardar"></asp:RadioButtonList>
<asp:RequiredFieldValidator ID="RFVRbOpcion" runat="server" ControlToValidate="RbOpcion" Display="None" ErrorMessage="&lt;b&gt;&lt;span style='text-decoration: underline'&gt;ERROR:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;El campo &lt;b&gt;'' ''&lt;/b&gt; es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCORbOpcion" runat="server" HighlightCssClass="vco" TargetControlID="RFVRbOpcion" Width="300px"></ajax:ValidatorCalloutExtender>
<asp:HiddenField ID="HdnEsOpcion" runat="server" Value='<%# Eval("EsOpcion")%>' />
<asp:HiddenField ID="HdnCveCaracteristica" runat="server" Value='<%# Eval("CveCaracteristica")%>' />
<asp:HiddenField ID="HdnCveValor" runat="server" Value="-1" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabImagenes" runat="server" HeaderText="Fotografias">
<ContentTemplate>
<asp:Image ID="ImgProspecto1" runat="server" Height="150px" Width="150px" Visible="False" />
<asp:Image ID="ImgProspecto2" runat="server" Height="150px" Width="150px" Visible="False"/>
<asp:Image ID="ImgProspecto3" runat="server" Height="150px" Width="150px" Visible="False"/>
<asp:Image ID="ImgProspecto4" runat="server" Height="150px" Width="150px" Visible="False"/>
<asp:Image ID="ImgProspecto5" runat="server" Height="150px" Width="150px" Visible="False"/>
<br />
<asp:GridView ID="GVEventoAgenda" OnRowDataBound="GVEventoAgenda_RowDataBound" runat="server" ShowHeader="false" AutoGenerateColumns="false" DataKeyNames="CveEvento" EmptyDataText="No hay Imágenes para mostrar" ToolTip="Imágenes de los Eventos">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table>
<tr>
<td colspan="3" class="Titulos">
<asp:Label ID="LblEventoAgenda" runat="server" Text='<%# Eval("Asunto") %>'></asp:Label>
</td>
</tr>
<tr><td width="150px"><asp:Image runat="server" Width="150px" Visible='<%# Eval("Imagen1").ToString <> ""%>' ImageUrl='<%# String.Format("/Empresas/{0}/Eventos/Imagenes/{1}", Eval("CveEmpresa"), Eval("Imagen1"))%>' /></td>
<td width="150px"><asp:Image runat="server" Width="150px" Visible='<%# Eval("Imagen2").ToString <> ""%>' ImageUrl='<%# String.Format("/Empresas/{0}/Eventos/Imagenes/{1}", Eval("CveEmpresa"), Eval("Imagen2"))%>' /></td>
<td width="150px"><asp:Image runat="server" Width="150px" Visible='<%# Eval("Imagen3").ToString <> ""%>' ImageUrl='<%# String.Format("/Empresas/{0}/Eventos/Imagenes/{1}", Eval("CveEmpresa"), Eval("Imagen3"))%>' /></td></tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td align="center">
<br />
<asp:UpdatePanel ID="UpGuardar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" />
<asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" Visible="False" />
<asp:Button ID="BtnCancelar" runat="server" Text="Cancelar" OnClientClick="javascript:window.location.href='/Prospectos/CatProspectosG15.aspx';return false" />
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
</ContentTemplate>
</asp:UpdatePanel>
<br />
</td>
</tr>
</table>
<br />
<table id="TblEventoBitacora" runat="server" border="1" rules="all" style="border-collapse: collapse;">
<tr>
<td align="left" class="rep_titulo" style="width: 980px"><b>Bitácora</b>&nbsp;<asp:Image ID="ImgAddObs" runat="server" ImageUrl="~/Imagenes/add_comment.png" AlternateText="Agregar Observación" Style="cursor: pointer;" ToolTip="Agregar a Bitacora" />
<asp:HyperLink ID="HlEvento" CssClass="Texto thickbox" runat="server" Text="Agendar..." Visible="false" ImageUrl="/Imagenes/date_add.png" Style="cursor: pointer;" ToolTip="Agendar"></asp:HyperLink>
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel ID="UPEventoBitacora" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVEventoBitacora" runat="server" AutoGenerateColumns="False" EmptyDataText="No se han capturado comentarios o bitácora">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("FechaIng") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha Agenda</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaA" runat="server" Text='<%# Eval("FechaInicio") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Usuario</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlUsuario" runat="server" Text='<%# Eval("Usuario") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Descripción</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEventoBitacora" runat="server" Text='<%# Eval("Descripcion") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Estatus</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="LtlEventoEstatus" CssClass="Texto" runat="server" CommandName="Concluir" OnClientClick="return confirm('Está seguro de concluir la agenda?')" CommandArgument='<%# Eval("CveEvento") %>' Text="Concluir" Visible='<%# Eval("CveTipoEvento").ToString ="2" and Eval("CveEventoEstatus").ToString ="1" %>' OnClick="LtlEventoEstatus_Click"></asp:LinkButton>
<asp:LinkButton ID="LbEventoEstatusRevisar" CssClass="Texto" runat="server" CommandName="Revisar" OnClientClick="return confirm('Está seguro de haber revisado la agenda?')" CommandArgument='<%# Eval("CveEvento") %>' Text="Revisar" Visible='<%# Eval("CveTipoEvento").ToString = "2" And Eval("CveEventoEstatus").ToString = "2"%>' OnClick="LbEventoEstatusRevisar_Click"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="Titulos" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
<br />
<asp:UpdatePanel runat="server" ID="UPAddEventoBitacora" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivEventoBitacora" style="width: 335px; background-color: White; border: solid 1px black; color: Black; display: none; position: absolute;">
<table border="0" width="335px" cellpadding="0" cellspacing="0">
<tr class="Titulos">
<td style="width: 330px">Bitácora&nbsp;</td>
<td style="padding-right: 4px; padding-top: 4px" valign="top">
<img alt="" src="/Imagenes/close.gif" style="cursor: pointer;" onclick="$('#DivEventoBitacora').hide(1000);" /></td>
</tr>
<tr align="left">
<td>
<table>
<tr>
<td>Bitácora/Observaciones</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TxtEventoDescripcion" runat="server" TextMode="MultiLine" Columns="60" Rows="4"></asp:TextBox>
</td>
</tr>
</table>
</td>
</tr>
<tr style="height: 25px">
<td align="center" colspan="2">
<asp:Button ID="BtnGuardarEventoBitacora" runat="server" ClientIDMode="Static" OnClientClick="$('#DivEventoBitacora').hide(1000);" Text="Guardar" />
<input id="BtnCancelarObs" type="button" value="Cancelar" onclick="$('#DivEventoBitacora').hide(1000);" />
</td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

View File

@@ -0,0 +1,448 @@
Option Explicit On
Option Strict On
Imports Extensiones
Partial Class Prospectos_ProspectosSIP
Inherits ClsPaginas
'Confinguración
Private Property DTProspectosValores As Data.DataTable
Get
Return CType(ViewState("DTProspectosValores"), Data.DataTable)
End Get
Set(value As Data.DataTable)
ViewState("DTProspectosValores") = value
End Set
End Property
Private ReadOnly Property CveProspecto As Integer
Get
Return ViewState("CveProspecto").ToString.ToEntero
End Get
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
DdlProspectoClasificacion.DataSource = GlobalDTProspectosClasificaciones(UsuarioActual.CveEmpresa) : DdlProspectoClasificacion.DataBind() : DdlProspectoClasificacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlCalificacion.DataSource = GlobalDTProspectosTipos(UsuarioActual.CveEmpresa) : DdlCalificacion.DataBind() : DdlCalificacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) : DdlVendedor.DataBind() : DdlVendedor.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlEstatus.DataSource = GlobalDTProspectosEstatus(UsuarioActual.CveEmpresa) : DdlEstatus.DataBind()
' DdlEscolaridad.DataSource = GlobalDTEscolaridad(UsuarioActual.CveEmpresa) : DdlEscolaridad.DataBind()
If Request("CveProspecto") IsNot Nothing AndAlso IsNumeric(Request("CveProspecto")) AndAlso Request("CveProspecto").ToEntero > 0 Then
ViewState("CveProspecto") = Request("CveProspecto")
CargaDatos()
'Configuración de Modalidad Update
BtnGuardar.Text = "Guardar Cambios"
LtlTitulo.Text = "Consulta del Prospecto:"
ImgAddObs.Attributes.Add("onclick", "javascript:$('#DivEventoBitacora').show(1000); PosicionaObjeto(this.id,'DivEventoBitacora');")
ImgVerMapaParticular.Attributes.Add("onclick", "javascript:$('#DivMapaParticular').show(1000); PosicionaObjeto(this.id,'DivMapaParticular');")
ImgVerMapaEmpresa.Attributes.Add("onclick", "javascript:$('#DivMapaEmpresa').show(1000); PosicionaObjeto(this.id,'DivMapaEmpresa');")
HlEvento.Visible = True
HlEvento.NavigateUrl = "/OI/PopUpAgenda.aspx?CveTipoEvento=2&CveProspecto=" & CveProspecto & "&TB_iframe=true&height=370&width=600;"
CargaProspectoValoress(CveProspecto)
CargaCaracteristicasClasificaciones()
CargaImagenesEvento()
'cambiar el vendedor
If UsuarioActual.TienePermisoProceso(89) Then
DdlVendedor.Enabled = True
Else
DdlVendedor.Enabled = False
End If
Else
CargaEstados(DdlEstados, 1)
DdlEstados.SelectedValue = "26"
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
DdlMunicipios.SelectedValue = "1919"
CargaEstados(DdlEmpresaEstados, 1)
DdlEmpresaEstados.SelectedValue = "26"
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
DdlEmpresaMunicipios.SelectedValue = "1919"
ViewState("CveProspecto") = -1
CargaProspectoValoress(CveProspecto)
ImgAddObs.Visible = False
End If
End If
End Sub
Private Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetProspectos(CveProspecto, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
If ObjProspectos.DtResultados.Rows.Count > 0 Then
TxtCveProspecto.Text = ObjProspectos.CveProspecto.ToString
TxtApellidoPaterno.Text = ObjProspectos.ApellidoPaterno
TxtApellidoMaterno.Text = ObjProspectos.ApellidoMaterno
TxtNombres.Text = ObjProspectos.Nombres
LtlProspectos.Text = "" & ObjProspectos.Nombres & " " & ObjProspectos.ApellidoMaterno & " " & ObjProspectos.ApellidoPaterno
TxtCalle.Text = ObjProspectos.Calle
TxtNumero.Text = ObjProspectos.Numero
TxtEntreCalle1.Text = ObjProspectos.EntreCalle1
TxtColonia.Text = ObjProspectos.Colonia
CargaEstados(DdlEstados, 1)
DdlEstados.SelectedValue = ObjProspectos.CveEstado.ToString
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
DdlMunicipios.SelectedValue = ObjProspectos.CveMunicipio.ToString
DdlVendedor.SelectedValue = ObjProspectos.CveVendedor.ToString
DdlCalificacion.SelectedValue = ObjProspectos.CveProspectoTipo.ToString
DdlProspectoClasificacion.SelectedValue = ObjProspectos.CveProspectoClasificacion.ToString
DdlEstatus.SelectedValue = ObjProspectos.CveProspectoEstatus.ToString
TxtTelefono.Text = ObjProspectos.Telefono
TxtCelular.Text = ObjProspectos.Celular
TxtCorreo.Text = ObjProspectos.Correo
CargaEstados(DdlEmpresaEstados, 1)
DdlEmpresaEstados.SelectedValue = ObjProspectos.CveEmpresaEstado.ToString
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
DdlEmpresaMunicipios.SelectedValue = ObjProspectos.CveEmpresaMunicipio.ToString
DdlEstatus.SelectedValue = ObjProspectos.CveProspectoEstatus.ToString
TxtEmpresaCalle.Text = ObjProspectos.EmpresaCalle
TxtEmpresaNombre.Text = ObjProspectos.EmpresaNombre
TxtEmpresaNumero.Text = ObjProspectos.EmpresaNumero
TxtEmpresaColonia.Text = ObjProspectos.EmpresaColonia
TxtEmpresaPuesto.Text = ObjProspectos.EmpresaPuesto
TxtEmpresaTelefono.Text = ObjProspectos.EmpresaTelefono
If ObjProspectos.Imagen1 <> "" Then ImgProspecto1.Visible = True : ImgProspecto1.ImageUrl = String.Format("/Empresas/{0}/Prospectos/Imagenes/{1}-1.jpg", ObjProspectos.CveEmpresa, CveProspecto)
If ObjProspectos.Imagen2 <> "" Then ImgProspecto2.Visible = True : ImgProspecto2.ImageUrl = String.Format("/Empresas/{0}/Prospectos/Imagenes/{1}-2.jpg", ObjProspectos.CveEmpresa, CveProspecto)
If ObjProspectos.Imagen3 <> "" Then ImgProspecto3.Visible = True : ImgProspecto3.ImageUrl = String.Format("/Empresas/{0}/Prospectos/Imagenes/{1}-3.jpg", ObjProspectos.CveEmpresa, CveProspecto)
If ObjProspectos.Imagen4 <> "" Then ImgProspecto4.Visible = True : ImgProspecto4.ImageUrl = String.Format("/Empresas/{0}/Prospectos/Imagenes/{1}-4.jpg", ObjProspectos.CveEmpresa, CveProspecto)
If ObjProspectos.Imagen5 <> "" Then ImgProspecto5.Visible = True : ImgProspecto5.ImageUrl = String.Format("/Empresas/{0}/Prospectos/Imagenes/{1}-5.jpg", ObjProspectos.CveEmpresa, CveProspecto)
'Permiso Eliminar
If UsuarioActual.TienePermisoProceso(78) Then BtnEliminar.Visible = True Else BtnEliminar.Visible = False
CargaEventoBitacora()
End If
End If
ObjProspectos.Dispose()
End Sub
Private Sub CargaEstados(ddl As DropDownList, CvePais As Integer)
ddl.DataSource = GlobalDTGralEstados(CvePais) : ddl.DataBind()
End Sub
Private Sub CargaMunicipios(ddl As DropDownList, CveEstado As Integer)
ddl.DataSource = GlobalDTGralMunicipios(CveEstado) : ddl.DataBind()
End Sub
Private Sub CargaCoordinadores(ddl As DropDownList, CveSupervisor As Integer)
ddl.DataSource = GlobalDTProspectosCoordinadores(CveSupervisor, -1) : ddl.DataBind()
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
Dim ObjProspectos As New ClsProspectos
If CveProspecto = -1 Then
If ObjProspectos.AddProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
TxtNombres.Text.Trim, Now, "", "", "", 0, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, "", TxtEntreCalle1.Text.Trim, "", TxtColonia.Text.Trim, -1, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text.Trim, "", "", TxtCorreo.Text.Trim, "", "", "", -1, DdlProspectoClasificacion.SelectedValue.ToEntero, -1, TxtEmpresaNombre.Text.Trim, "", "", "",
TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, "", DdlEmpresaMunicipios.SelectedValue.ToEntero, TxtEmpresaTelefono.Text.Trim, "", "", TxtEmpresaPuesto.Text.Trim, "", False, "", "", "", "", -1, "", -1, -1, -1, "", -1, 0, -1, "", 0, "", DdlVendedor.SelectedValue.ToEntero, DdlCalificacion.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) > 0 Then
ViewState("CveProspecto") = ObjProspectos.CveProspecto
Alert("El Prospecto se guardó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Inicio.aspx"";")
End If
Else
If ObjProspectos.UpdateProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
TxtNombres.Text.Trim, Now, "", "", "", 0, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, "", TxtEntreCalle1.Text.Trim, "", TxtColonia.Text.Trim, -1.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
TxtTelefono.Text.Trim, TxtCelular.Text.Trim, "", "", TxtCorreo.Text.Trim, "", "", "", -1, DdlProspectoClasificacion.SelectedValue.ToEntero, -1, TxtEmpresaNombre.Text.Trim, "", "", "",
TxtEmpresaCalle.Text.Trim, TxtEmpresaNumero.Text.Trim, TxtEmpresaColonia.Text.Trim, "", DdlEmpresaMunicipios.SelectedValue.ToEntero, TxtEmpresaTelefono.Text.Trim, "", "", TxtEmpresaPuesto.Text.Trim, "", False, "", "", "", "", -1, "", -1, -1, -1, "", -1, 0, 1, "", 0, "", DdlVendedor.SelectedValue.ToEntero, DdlCalificacion.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProspecto) Then
UpDatos.Update()
GuardarCaracteristicas()
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If
End If
ObjProspectos.Dispose()
End Sub
Protected Sub GuardarCaracteristicas()
Dim objProspectosValores As New ClsProspectos
For Each DR As GridViewRow In GvCaracteristicaClasificaciones.Rows
For Each DR_CaracteristicaTipo As GridViewRow In DR.FCGridView("GvCaracteristicasTipos").Rows
For Each DR_Caracteristica As GridViewRow In DR_CaracteristicaTipo.FCGridView("GvCaracteristicas").Rows
Dim CveCaracteristicaOpcion As Integer = -1
Dim CveValor As Integer = DR_Caracteristica.FCHiddenField("HdnCveValor").Value.ToEntero
Dim Valor As String = DR_Caracteristica.FCTextBox("TxtValor").Text.Trim
Dim CveCaracteristica As Integer = DR_Caracteristica.FCHiddenField("HdnCveCaracteristica").Value.ToEntero
Select Case DR_Caracteristica.FCHiddenField("HdnEsOpcion").Value
Case "1" 'Listado o DropDownList
CveCaracteristicaOpcion = DR_Caracteristica.FCDropDownList("DdlOpcion").SelectedValue.ToEntero
Case "2" 'Radio o RadioButtonList
CveCaracteristicaOpcion = DR_Caracteristica.FCRadioButtonList("RbOpcion").SelectedValue.ToEntero
End Select
If CveValor = -1 Then
objProspectosValores.AddProspectosValores(CveProspecto, CveCaracteristica, CveCaracteristicaOpcion, If(Valor = "", "-1", Valor), UsuarioActual.CveUsuario)
Else
objProspectosValores.UpdateProspectosValores(CveProspecto, CveCaracteristica, CveCaracteristicaOpcion, If(Valor = "", "-1", Valor), UsuarioActual.CveUsuario, CveValor)
End If
Next
Next
Next
objProspectosValores.Dispose()
End Sub
Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click
Dim ObjProspectos As New ClsProspectos()
If ObjProspectos.RemoveProspectos(CveProspecto) Then
Alert("El Prospecto se Eliminó correctamente.", TipoMensaje.MsgInformacion)
End If
ObjProspectos.Dispose()
End Sub
Protected Sub DdlEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEstados.SelectedIndexChanged
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
UPPMunicipios.Update()
End Sub
Protected Sub DdlEmpresaEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEmpresaEstados.SelectedIndexChanged
CargaMunicipios(DdlEmpresaMunicipios, DdlEmpresaEstados.SelectedValue.ToEntero)
UPPEmpresaMunicipios.Update()
End Sub
#Region "E V E N T O - B I T A C O R A"
Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVEventoBitacora.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(200)
e.Row.Cells(1).Width = Unit.Pixel(200)
e.Row.Cells(2).Width = Unit.Pixel(100)
e.Row.Cells(3).Width = Unit.Pixel(500)
End If
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
End If
End Sub
Protected Sub BtnGuardarEventoBitacora_Click(sender As Object, e As EventArgs) Handles BtnGuardarEventoBitacora.Click
Dim ObjEventoBitacora As New ClsOIEventos
If ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim, "", -1, -1, CveProspecto, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
GVEventoBitacora.DataSource = ObjEventoBitacora.DtResultados
TxtEventoDescripcion.Text = ""
Alert("La bitácora/observación se guardó correctamente", TipoMensaje.MsgInformacion)
End If
ObjEventoBitacora.Dispose()
GVEventoBitacora.DataBind()
UPEventoBitacora.Update()
CargaEventoBitacora()
End Sub
Private Sub CargaEventoBitacora()
Dim ObjEventoBitacora As New ClsOIEventos()
If ObjEventoBitacora.GetAgendaBitacora(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProspecto:=CveProspecto) Then
GVEventoBitacora.DataSource = ObjEventoBitacora.DtResultados.FiltraParametros("CveTipoEvento = 6 OR CveTipoEvento = 2")
Else
GVEventoBitacora.DataSource = Nothing
End If
GVEventoBitacora.DataBind()
End Sub
#End Region
#Region "D A T O S - T E C N I C O S "
Protected Sub CargaCaracteristicasClasificaciones()
Dim objClasificaciones As New ClsProspectos
If objClasificaciones.GetCaracteristicasClasificaciones(UsuarioActual.CveEmpresa) Then
GvCaracteristicaClasificaciones.DataSource = objClasificaciones.DtResultados
GvCaracteristicaClasificaciones.DataBind()
End If
objClasificaciones.Dispose()
End Sub
Protected Sub CargaProspectoValoress(CveProspecto As Integer)
Dim Prosp As New ClsProspectos
If Prosp.GetProspectoValores(CveProspecto, UsuarioActual.CveEmpresa) Then
DTProspectosValores = Prosp.DtResultados
End If
Prosp.Dispose()
End Sub
Protected Sub GvCaracteristicaClasificaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCaracteristicaClasificaciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveCaracteristicaClasificacion").ToEntero > 1 Then
e.Row.FCLabel("LblCaracteristicaClasificacion").CssClass = "CaracteristicaClasificacion"
End If
With e.Row.FCGridView("GvCaracteristicasTipos")
.DataSource = DTProspectosValores.FiltraParametros(String.Format("CveCaracteristicaClasificacion = {0}", e.Row.DBCampo("CveCaracteristicaClasificacion")), DistinctColumns:={"CveCaracteristicaTipo", "CaracteristicaTipo"})
.DataBind()
End With
'Dim objCaracteristicasTipos As New ClsProspectos
'If objCaracteristicasTipos.GetTiposCaracteristicas(UsuarioActual.CveEmpresa) Then
' With e.Row.FCGridView("GvCaracteristicasTipos")
' .DataSource = objCaracteristicasTipos.DtResultados.FiltraParametros("CveCaracteristicaClasificacion = " + e.Row.DBCampo("CveCaracteristicaClasificacion"))
' .DataBind()
' End With
'End If
'objCaracteristicasTipos.Dispose()
End If
End Sub
Protected Sub GvCaracteristicasTipos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveCaracteristicaTipo").ToEntero > 1 Then
e.Row.FCLabel("LblCaracteristicaTipo").CssClass = "CaracteristicaTipo"
End If
With e.Row.FCGridView("GvCaracteristicas")
.DataSource = DTProspectosValores.FiltraParametros(String.Format("CveCaracteristicaTipo = {0}", e.Row.DBCampo("CveCaracteristicaTipo")), DistinctColumns:={"CveCaracteristica", "Caracteristica", "EsOpcion", "CveValor", "CveOpcion", "Valor"})
.DataBind()
End With
'Dim objCaracteristicas As New ClsProspectos
'If objCaracteristicas.GetCaracteristicas(UsuarioActual.CveEmpresa) Then
' With e.Row.FCGridView("GvCaracteristicas")
' .DataSource = objCaracteristicas.DtResultados.FiltraParametros("Estatus = 'Activo' and CveCaracteristicaTipo = " + e.Row.DBCampo("CveCaracteristicaTipo"))
' .DataBind()
' End With
'End If
'objCaracteristicas.Dispose()
End If
End Sub
Protected Sub GvCaracteristicas_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim EsOpcion As Integer = e.Row.FCHiddenField("HdnEsOpcion").Value.ToEntero
Dim CveCaracteristica As Integer = e.Row.DBCampo("CveCaracteristica").ToEntero
Dim CveOpcion As Integer = If(e.Row.DBCampo("CveOpcion") <> "", e.Row.DBCampo("CveOpcion").ToEntero, -1)
Dim CveValor As Integer = If(e.Row.DBCampo("CveValor") <> "", e.Row.DBCampo("CveValor").ToEntero, -1)
Dim Valor As String = If(e.Row.DBCampo("Valor") <> "", e.Row.DBCampo("Valor"), "")
e.Row.FCHiddenField("HdnCveValor").Value = CveValor.ToString
Select Case EsOpcion
Case 0, 4 '---------------------------------------------------------------Texto, Multiline
With e.Row.FCTextBox("TxtValor")
.Text = Valor
.Visible = True
If EsOpcion = 4 Then
.Rows = 3
.TextMode = TextBoxMode.MultiLine
End If
End With
Case 1, 2 '---------------------------------------------------------------DropDownList, Radios
Dim objOpciones As New ClsProspectos
If objOpciones.GetCaracteristicasOpciones(CveCaracteristica, UsuarioActual.CveEmpresa) Then
If EsOpcion = 1 Then '---------------------DDL
With e.Row.FCDropDownList("DdlOpcion")
.Visible = True
.DataSource = objOpciones.DtResultados.FiltraParametros("Estatus = 'Activo'")
.DataBind()
.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
.SelectedValue = CveOpcion.ToString
End With
ElseIf EsOpcion = 2 Then '---------------------RB
With e.Row.FCRadioButtonList("RbOpcion")
.Visible = True
.DataSource = objOpciones.DtResultados.FiltraParametros("Estatus = 'Activo'")
.DataBind()
If CveOpcion > 0 Then
.SelectedValue = CveOpcion.ToString
End If
End With
End If
End If
objOpciones.Dispose()
Case 3 '---------------------------------------------------------------F E C H A
With e.Row.FCTextBox("TxtValor")
If Valor <> "" Then
.Text = Valor
End If
.Visible = True
.Width = New Unit(80)
End With
e.Row.FCImageButton("ImgTxtValor").Visible = True
e.Row.FCMaskedEditExtender("MEETxtValor").Enabled = True
e.Row.FCCalendarExtender("CETxtValor").Enabled = True
End Select
End If
End Sub
#End Region
Protected Sub LtlEventoEstatus_Click(sender As Object, e As EventArgs)
Dim Lnk As LinkButton = CType(sender, LinkButton)
Dim OI As New ClsOIEventos
If OI.UpdateEstatusEvento(2, -1, Lnk.CommandArgument.ToString.ToEntero, UsuarioActual.CveUsuario) Then
Alert("Agenda Concluida", TipoMensaje.MsgInformacion)
End If
OI.Dispose()
CargaEventoBitacora()
End Sub
Protected Sub LbEventoEstatusRevisar_Click(sender As Object, e As EventArgs)
Dim Lnk As LinkButton = CType(sender, LinkButton)
Dim OI As New ClsOIEventos
If OI.UpdateEstatusEvento(3, -1, Lnk.CommandArgument.ToString.ToEntero, UsuarioActual.CveUsuario) Then
Alert("Agenda Revisada", TipoMensaje.MsgInformacion)
End If
OI.Dispose()
CargaEventoBitacora()
End Sub
#Region " F O T O G R A F I A S"
Protected Sub CargaImagenesEvento()
Dim ObjEventosAgenda As New ClsOIEventos
If ObjEventosAgenda.GetEventos(-1, -1, -1, "-1", "-1", -1, -1, -1, -1, -1, -1, "-1", -1, -1, CveProspecto, -1, -1, -1, -1, -1, -1, -1, UsuarioActual.CveUsuario, -1, -1, UsuarioActual.CveEmpresa) Then
GVEventoAgenda.DataSource = ObjEventosAgenda.DtResultados.FiltraParametros("Imagen1 <> '' OR Imagen2 <> '' OR Imagen3 <> ''")
GVEventoAgenda.DataBind()
End If
ObjEventosAgenda.Dispose()
End Sub
Protected Sub GvEventoAgenda_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(200)
End If
End If
End Sub
#End Region
End Class

View File

@@ -0,0 +1,198 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ProspectosValidar.aspx.vb" Inherits="Prospectos_ProspectosValidar" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
<asp:Panel ID="PnlBusquedaGral" runat="server" >
<asp:UpdatePanel ID="UPPBusq" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="Panel1" runat="server" GroupingText="Obtener Info.">
<table>
<tr>
<td> <asp:RadioButtonList ID="RBL" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Value="1" Selected="True">No Validados</asp:ListItem>
<asp:ListItem Value="2">No localizado en padrón</asp:ListItem>
</asp:RadioButtonList></td>
<td>Sección: <asp:TextBox ID="TxtSeccionB" runat="server" Width="50px"></asp:TextBox>
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="TxtSeccionB"
Mask="9999" MaskType="Number" OnFocusCssClass="editmask"
OnInvalidCssClass="invalidmask" ClearMaskOnLostFocus="False"
AutoComplete="False" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" />
</td>
<td>
<asp:Button ID="BtnObtener" runat="server" Text="Obtener Registro" /></td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="PnlRedefinir" runat="server">
</asp:Panel>
<asp:Panel ID="PnlBusqueda" runat="server" GroupingText="Redefinir Búsqueda" >
<table border="0" cellpadding="0">
<tr><td>A. Paterno</td><td>A. Materno</td><td>Nombres</td><td>Seccion</td><td>Dia</td><td>Mes</td><td>Año</td><td></td></tr>
<tr>
<td><asp:TextBox ID="TxtPaternoB" runat="server" MaxLength="35"></asp:TextBox></td>
<td><asp:TextBox ID="TxtMaternoB" runat="server" MaxLength="35"></asp:TextBox></td>
<td><asp:TextBox ID="TxtNombresB" runat="server" MaxLength="35"></asp:TextBox></td>
<td>
<asp:TextBox ID="TxtSeccion" runat="server" Width="40px"></asp:TextBox>
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtSeccion"
Mask="9999" MaskType="Number" OnFocusCssClass="editmask"
OnInvalidCssClass="invalidmask" ClearMaskOnLostFocus="False"
AutoComplete="False" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" />
</td>
<td>
<asp:TextBox ID="TxtDia" runat="server" Width="25px" MaxLength="2"></asp:TextBox></td>
<td>
<asp:TextBox ID="TxtMes" runat="server" Width="25px" MaxLength="2"></asp:TextBox></td>
<td>
<asp:TextBox ID="TxtAnio" runat="server" Width="35px" MaxLength="4"></asp:TextBox></td>
<td>
<asp:Button ID="BtnBusqueda" runat="server" Text="Consultar" ValidationGroup="GrpBusqueda" />
</td>
</tr>
<tr>
<td colspan="9"><hr/>
</td></tr>
<tr>
<td colspan="9">
<asp:Label ID="LblBusqueda" runat="server" Text=""></asp:Label>
<div style="height: 200px; overflow-y: scroll; width: 970px;">
<asp:GridView ID="GvBusq" runat="server" AutoGenerateColumns="False" CssClass="tablesorter" ClientIDMode="Static" DataKeyNames="Clave,APaterno,AMaterno,Nombres,FechaNacimiento,Calle,NumExterior,NumInterior, Sexo, Colonia,CP,Ocupacion,Seccion,PadronMunicipio,CveProspecto">
<Columns>
<%--<asp:TemplateField HeaderText="Clave">
<ItemTemplate>
<asp:LinkButton ID="LnkClave" Text='<%# Bind("Clave") %>' CssClass="Texto" runat="server" OnClick="LnkClave_Click"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="100px" />
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Paterno">
<ItemTemplate>
<asp:LinkButton ID="LnkPaterno" Text='<%# Bind("APaterno")%>' CssClass="Texto" runat="server" OnClick="LnkClave_Click"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="80px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Materno">
<ItemTemplate>
<asp:LinkButton ID="LnkMaterno" Text='<%# Bind("AMaterno")%>' CssClass="Texto" runat="server" OnClick="LnkClave_Click"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="80px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombres">
<ItemTemplate>
<asp:LinkButton ID="LnkNombre" Text='<%# Bind("Nombres")%>' CssClass="Texto" runat="server" OnClick="LnkClave_Click"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="150px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="F. Nac.">
<ItemTemplate>
<asp:LinkButton ID="LnkFechaNac" Text='<%# Bind("FechaNacimiento", "{0:d}")%>' CssClass="Texto" runat="server" OnClick="LnkClave_Click"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="70px" />
</asp:TemplateField>
<asp:BoundField DataField="Calle" HeaderText="Calle">
<ItemStyle Width="250px" />
</asp:BoundField>
<asp:BoundField DataField="NumExterior" HeaderText="Ext">
<ItemStyle Width="25px" />
</asp:BoundField>
<asp:BoundField DataField="NumInterior" HeaderText="Int">
<ItemStyle Width="25px" />
</asp:BoundField>
<asp:BoundField DataField="Sexo" HeaderText="Sexo" />
<asp:BoundField DataField="Colonia" HeaderText="Colonia">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="PadronMunicipio" HeaderText="Municipio">
<ItemStyle Width="100px" />
</asp:BoundField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
</td>
</tr>
</table>
<table>
<tr>
<td>
<asp:Panel ID="PnlVerificar" GroupingText="Registro a Verificar" runat="server" Width="480px">
<table border="0" >
<tr>
<td>Nombre(s):</td><td><asp:TextBox ID="TxtNombre" runat="server" Width="150px" ReadOnly="True"></asp:TextBox></td>
<td>Calle:</td><td><asp:TextBox ID="TxtCalle" runat="server" Width="150px" ReadOnly="True"></asp:TextBox></td>
</tr><tr>
<td>A. Paterno:</td><td><asp:TextBox ID="TxtAPaterno" runat="server" Width="150px" ReadOnly="True"></asp:TextBox></td>
<td>Número:</td><td><asp:TextBox ID="TxtNumero" runat="server" Width="100px" ReadOnly="True"></asp:TextBox></td>
</tr><tr>
<td>A. Materno:</td><td><asp:TextBox ID="TxtAMaterno" runat="server" Width="150px" ReadOnly="True"></asp:TextBox></td>
<td>Colonia:</td><td><asp:TextBox ID="TxtColonia" runat="server" Width="150px" ReadOnly="True"></asp:TextBox></td>
</tr><tr>
<td>Fecha Nac.:</td><td><asp:TextBox ID="TxtFechaNacimiento" runat="server" Width="80px" ReadOnly="True"></asp:TextBox></td>
<td>Sección:</td><td><asp:TextBox ID="TxtSeccion1" runat="server" Width="50px" ReadOnly="True"></asp:TextBox></td>
</tr>
</table>
</asp:Panel>
</td>
<td>
<asp:Panel ID="PnlPadron" GroupingText="Registro al Padrón" runat="server" Width="480px">
<asp:HiddenField ID="HdnIFE" runat="server" />
<table border="0" >
<tr>
<td>Nombre(s):</td><td><asp:TextBox ID="TxtPadronNombre" runat="server" Width="150px" ReadOnly="True"></asp:TextBox></td>
<td>Calle:</td><td><asp:TextBox ID="TxtPadronCalle" runat="server" Width="150px" ReadOnly="True"></asp:TextBox></td>
</tr><tr>
<td>A. Paterno:</td><td><asp:TextBox ID="TxtPadronPaterno" runat="server" Width="150px" ReadOnly="True"></asp:TextBox></td>
<td>Número:</td><td><asp:TextBox ID="TxtPadronNumero" runat="server" Width="100px" ReadOnly="True"></asp:TextBox></td>
</tr><tr>
<td>A. Materno:</td><td><asp:TextBox ID="TxtPadronMaterno" runat="server" Width="150px" ReadOnly="True"></asp:TextBox></td>
<td>Colonia:</td><td><asp:TextBox ID="TxtPadronColonia" runat="server" Width="150px" ReadOnly="True"></asp:TextBox></td>
</tr><tr>
<td>Fecha Nac.:</td><td><asp:TextBox ID="TxtPadronFecha" runat="server" Width="80px" ReadOnly="True"></asp:TextBox></td>
<td>Sección:</td><td><asp:TextBox ID="TxtPadronSeccion" runat="server" Width="50px" ReadOnly="True"></asp:TextBox></td>
</tr>
</table>
</asp:Panel>
</td>
<tr><td>&nbsp;</td>
<td>
<asp:Panel ID="PnlSolucion" runat="server" GroupingText="Dar solución al registro seleccionado">
<asp:RadioButtonList ID="RBLSolucion" runat="server" Height="20px">
<asp:ListItem Value="1" ><span style="background-color:lightgreen">Encontrado</span></asp:ListItem>
<asp:ListItem Value="2"><span style="background-color:lightcoral">No localizado en padrón</span></asp:ListItem>
</asp:RadioButtonList>
<asp:Button ID="BtnSolucion" runat="server" Text="Solución" />
</asp:Panel>
</td>
</tr>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
</asp:Content>

View File

@@ -0,0 +1,225 @@

Imports System.Data
Imports Extensiones
Partial Class Prospectos_ProspectosValidar
Inherits ClsPaginas
Public Property CveProspecto As Integer
Get
Return ViewState("CveProspecto").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveProspecto") = value
End Set
End Property
Public Property CveProspectoProspectoProceso As Integer
Get
Return ViewState("CveProspectoProspectoProceso").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveProspectoProspectoProceso") = value
End Set
End Property
Protected Sub BtnObtener_Click(sender As Object, e As EventArgs) Handles BtnObtener.Click
ObtenerSiguiente()
End Sub
Private Sub ObtenerSiguiente()
Dim Prosp As New ClsProspectos
Dim Seccion As Integer = TxtSeccionB.Text.Replace("_", "").ToEntero
If Seccion = 0 Then Seccion = -1
If Prosp.GetSiguienteProspecto(RBL.SelectedValue.ToEntero, Seccion, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If Prosp.DtResultados.Rows.Count > 0 Then
Dim dr As DataRow = Prosp.DtResultados.Rows(0)
Dim FechaNacimiento As String = "-1"
If dr IsNot Nothing Then
TxtPaternoB.Text = dr("ApellidoPaterno").ToString()
TxtMaternoB.Text = dr("ApellidoMaterno").ToString()
TxtNombresB.Text = dr("Nombres").ToString()
TxtSeccion.Text = dr("Seccion").ToString()
If dr("FechaNacimiento").ToString <> "" AndAlso dr("FechaNacimiento").ToString.ToDate.Year > 1900 Then
Dim tFechaNacimiento = dr("FechaNacimiento").ToString.ToDate
FechaNacimiento = tFechaNacimiento.ToShortDateString
TxtDia.Text = tFechaNacimiento.Day.ToString
TxtMes.Text = tFechaNacimiento.Month.ToString
TxtAnio.Text = tFechaNacimiento.Year.ToString
TxtFechaNacimiento.Text = FechaNacimiento
Else
TxtDia.Text = ""
TxtMes.Text = ""
TxtAnio.Text = ""
TxtFechaNacimiento.Text = ""
End If
'cargos datos a verificar
TxtAPaterno.Text = dr("ApellidoPaterno").ToString()
TxtAMaterno.Text = dr("ApellidoMaterno").ToString()
TxtNombre.Text = dr("Nombres").ToString()
TxtCalle.Text = dr("Calle").ToString()
TxtNumero.Text = dr("Numero").ToString()
TxtColonia.Text = dr("Colonia").ToString()
TxtSeccion.Text = dr("Seccion").ToString()
'limpia los datos del padron
TxtPadronPaterno.Text = ""
TxtPadronMaterno.Text = ""
TxtPadronNombre.Text = ""
TxtPadronCalle.Text = ""
TxtPadronNumero.Text = ""
TxtPadronColonia.Text = ""
TxtPadronSeccion.Text = ""
HdnIFE.Value = ""
CveProspecto = dr("CveProspecto").ToString.ToEntero()
CveProspectoProspectoProceso = dr("CveProspectoProspectoProceso").ToString.ToEntero()
End If
Busqueda()
Else
Alert("No se seleccionó ninguna persona.", TipoMensaje.MsgAdvertencia)
CveProspecto = -1
CveProspectoProspectoProceso = -1
End If
End If
Prosp.Dispose()
End Sub
Private Sub Busqueda()
Dim Prosp As New ClsProspectos
Dim Contador As Integer = 0
If Prosp.GetProspectosBusqueda(TxtPaternoB.Text.ToUpper.Trim & "%", TxtMaternoB.Text.ToUpper.Trim & "%", TxtNombresB.Text.ToUpper.Trim & "%", "-1", "-1",
If(TxtSeccion.Text.Replace("_", "") = "", "-1", TxtSeccion.Text.Replace("_", "")).ToEntero,
If(TxtDia.Text = "", "-1", TxtDia.Text).ToEntero,
If(TxtMes.Text = "", "-1", TxtMes.Text).ToEntero,
If(TxtAnio.Text = "", "-1", TxtAnio.Text).ToEntero) Then
GvBusq.DataSource = Prosp.DtResultados
Contador = Prosp.DtResultados.Rows.Count
Prosp.Dispose()
GvBusq.DataBind()
LblBusqueda.Text = String.Format("<table width='100%'><tr><td>Registros localizados con el criterio de búsqueda: <b>{0}</b></td><tr></table>", Contador)
LimpiaDatos()
End If
End Sub
Protected Sub BtnBusqueda_Click(sender As Object, e As EventArgs) Handles BtnBusqueda.Click
Busqueda()
End Sub
Private Sub LimpiaDatos()
TxtPadronPaterno.Text = ""
TxtPadronMaterno.Text = ""
TxtPadronNombre.Text = ""
TxtPadronCalle.Text = ""
TxtPadronNumero.Text = ""
TxtPadronColonia.Text = ""
TxtPadronSeccion.Text = ""
TxtPadronFecha.Text = ""
HdnIFE.Value = ""
TxtNombre.BackColor = Drawing.Color.White : TxtPadronNombre.BackColor = Drawing.Color.White
TxtAPaterno.BackColor = Drawing.Color.White : TxtPadronPaterno.BackColor = Drawing.Color.White
TxtAMaterno.BackColor = Drawing.Color.White : TxtPadronMaterno.BackColor = Drawing.Color.White
TxtFechaNacimiento.BackColor = Drawing.Color.White : TxtPadronFecha.BackColor = Drawing.Color.White
TxtCalle.BackColor = Drawing.Color.White : TxtPadronCalle.BackColor = Drawing.Color.White
TxtNumero.BackColor = Drawing.Color.White : TxtPadronNumero.BackColor = Drawing.Color.White
TxtColonia.BackColor = Drawing.Color.White : TxtPadronColonia.BackColor = Drawing.Color.White
End Sub
Protected Sub LnkClave_Click(sender As Object, e As EventArgs)
Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
TxtPadronPaterno.Text = Gvr.DataKey("APaterno")
TxtPadronMaterno.Text = Gvr.DataKey("AMaterno")
TxtPadronNombre.Text = Gvr.DataKey("Nombres")
TxtPadronFecha.Text = Gvr.DataKey("FechaNacimiento").ToDate.ToShortDateString
TxtPadronCalle.Text = Gvr.DataKey("Calle")
TxtPadronNumero.Text = Gvr.DataKey("NumExterior")
TxtPadronColonia.Text = Gvr.DataKey("Colonia")
HdnIFE.Value = Gvr.DataKey("Clave")
TxtPadronSeccion.Text = Gvr.DataKey("Seccion")
If TxtNombre.Text.Trim = TxtPadronNombre.Text.Trim Then TxtNombre.BackColor = Drawing.Color.PaleGreen : TxtPadronNombre.BackColor = Drawing.Color.PaleGreen
If TxtAPaterno.Text.Trim = TxtPadronPaterno.Text.Trim Then TxtAPaterno.BackColor = Drawing.Color.PaleGreen : TxtPadronPaterno.BackColor = Drawing.Color.PaleGreen
If TxtAMaterno.Text.Trim = TxtPadronMaterno.Text.Trim Then TxtAMaterno.BackColor = Drawing.Color.PaleGreen : TxtPadronMaterno.BackColor = Drawing.Color.PaleGreen
If TxtFechaNacimiento.Text.Trim = TxtPadronFecha.Text.Trim Then TxtFechaNacimiento.BackColor = Drawing.Color.PaleGreen : TxtPadronFecha.BackColor = Drawing.Color.PaleGreen
If TxtCalle.Text.Trim = TxtPadronCalle.Text.Trim Then TxtCalle.BackColor = Drawing.Color.PaleGreen : TxtPadronCalle.BackColor = Drawing.Color.PaleGreen
If TxtNumero.Text.Trim = TxtPadronNumero.Text.Trim Then TxtNumero.BackColor = Drawing.Color.PaleGreen : TxtPadronNumero.BackColor = Drawing.Color.PaleGreen
If TxtColonia.Text.Trim = TxtPadronColonia.Text.Trim Then TxtColonia.BackColor = Drawing.Color.PaleGreen : TxtPadronColonia.BackColor = Drawing.Color.PaleGreen
BtnSolucion.Enabled = True
'Dim tCveProspecto As Integer = Gvr.DataKey("CveProspecto").ToEntero
'UpDatos.Update()
End Sub
Protected Sub BtnSolucion_Click(sender As Object, e As EventArgs) Handles BtnSolucion.Click
If RBLSolucion.SelectedValue.ToEntero > 0 Then
If CveProspectoProspectoProceso > 0 Then
Dim IFE As String = HdnIFE.Value
If RBLSolucion.SelectedValue.ToEntero = 1 AndAlso IFE = "" Then
Alert("No se encontró", TipoMensaje.MsgInformacion)
RBLSolucion.SelectedValue = "2"
Exit Sub
End If
If RBLSolucion.SelectedValue.ToEntero = 2 Then IFE = ""
Dim Prosp As New ClsProspectos
If Prosp.UpdateProspectoProceso(CveProspectoProspectoProceso, RBLSolucion.SelectedValue.ToEntero, Now, IFE) Then
Alert("Registro Guardado", TipoMensaje.MsgInformacion)
LimpiaDatos()
GvBusq.DataBind()
TxtNombre.Text = ""
TxtAPaterno.Text = ""
TxtAMaterno.Text = ""
TxtFechaNacimiento.Text = ""
TxtCalle.Text = ""
TxtNumero.Text = ""
TxtColonia.Text = ""
TxtPaternoB.Text = ""
TxtMaternoB.Text = ""
TxtNombresB.Text = ""
TxtSeccion.Text = ""
TxtDia.Text = ""
TxtMes.Text = ""
TxtAnio.Text = ""
End If
Prosp.Dispose()
ObtenerSiguiente()
End If
Else
Alert("Seleccione una solución", TipoMensaje.MsgAdvertencia)
End If
End Sub
End Class

View File

@@ -0,0 +1,75 @@
<%@ Page Title="Prospectos - Catálogo de Prospectos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RedesArbol.aspx.vb" Inherits="Prospectos_RedesArbol" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Prospectos
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<img alt="Nuevo Prospecto" onclick="document.location.href='/Prospectos/ProspectosRedes.aspx'" src="/Imagenes/BotonAgregar.gif" style="cursor: pointer;" />&nbsp;
<%--<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" />--%>
<asp:Image ID="ImgPersonalizar" ToolTip="Personalizar Listado" runat="server" ImageUrl="/Imagenes/Table-icon.png" Style="cursor: pointer; height: 23px;" />&nbsp;
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="display:none;">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline">
<li>Clasificación:
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" DataTextField="ProspectoClasificacion" DataValueField="CveProspectoClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 120px !important;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Zona:
<asp:DropDownList ID="DdlZona" runat="server" AppendDataBoundItems="true" DataTextField="Supervisor" DataValueField="CveSupervisor" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 120px !important;" AutoPostBack="True">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Región:
<asp:DropDownList ID="DdlRegion" runat="server" AppendDataBoundItems="true" DataTextField="Coordinador" DataValueField="CveCoordinador" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 120px !important;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<a href="javascript:;" class="expand"></a>
<a onclick="document.getElementById('C_BtnConsultar').click();" class="reload"></a>
</div>
</div>
<div class="portlet-body" style="display: none;">
<ul class="list-inline">
<li>Municipio:
<asp:DropDownList ID="DdlMunicipioFiltro" runat="server" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 120px !important;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</li>
<li>Auditado:
<asp:DropDownList ID="DdlAuditado" runat="server" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 50px !important;">
<asp:ListItem Selected="True" Text="-" Value="-1"></asp:ListItem>
<asp:ListItem Text="Si" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:DropDownList>
</li>
</ul>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:TreeView ID="TV" runat="server" SelectedNodeStyle-Font-Bold="true" SelectedNodeStyle-Font-Size="Larger">
</asp:TreeView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,147 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Prospectos_RedesArbol
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()
CargaDatos(True)
ImgPersonalizar.Attributes.Add("onclick", "$('#DivPersonalizar').show(1000); PosicionaObjeto(this.id,'DivPersonalizar');")
End If
End Sub
Public Sub CargaDatos(Optional RecargaArbol As Boolean = False)
Dim ObjProspectos As New ClsProspectos
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
If RecargaArbol Then
TV.Nodes.Clear()
If ObjProspectos.GetProspectosArbol(0, UsuarioActual.CveEmpresa) Then
DtDatos = ObjProspectos.DtResultados
Dim dt As DataTable = getNodosHijos(InicioPadre)
For Each dr As DataRow In dt.Rows
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)
Next
End If
End If
ObjProspectos.Dispose()
UPDatos.Update()
End Sub
#Region "Arbol"
Private Sub AddNodes(ByRef node As TreeNode)
Dim dt As New DataTable
dt = getNodosHijos(node.Value.ToEntero)
For Each dr As DataRow In dt.Rows
Dim nNode As New TreeNode
nNode.Text = String.Format("<span style='color:{2};'>{0} {1}</span>", dr("NombreCompleto"), If(dr("Hijos").ToString.ToEntero > 0, String.Format("({0})", dr("Hijos")), ""), Colores(dr("Level").ToString.ToEntero))
nNode.Value = dr("CveProspecto").ToString
If dr("level").ToString.ToEntero > 1 Then nNode.Expanded = False
AddNodes(nNode)
node.ChildNodes.Add(nNode)
Next
End Sub
Private Function Colores(Numero As Integer) As String
Dim Retorno As String = ""
Select Case Numero
Case 1 : Retorno = "red"
Case 2 : Retorno = "#228B22"
Case 3 : Retorno = "#4B0082"
Case 4 : Retorno = "#808000"
Case 5 : Retorno = "#8B4513"
End Select
Return Retorno
End Function
Private Function getNodosHijos(CveProspecto As Integer) As DataTable
Return DtDatos.FiltraParametros(String.Format("CveProspectoPadre = {0}", CveProspecto))
End Function
#End Region
'Protected Sub LnkDatos_Click(sender As Object, e As EventArgs) Handles LnkDatos.Click
' PnlDatos.Visible = True
' PnlArbol.Visible = False
'End Sub
'Protected Sub LnkArbol_Click(sender As Object, e As EventArgs) Handles LnkArbol.Click
' PnlDatos.Visible = False
' PnlArbol.Visible = True
'End Sub
Protected Sub TV_SelectedNodeChanged(sender As Object, e As EventArgs) Handles TV.SelectedNodeChanged
' Alert(TV.SelectedValue)
CveProspectoSeleccionado = TV.SelectedValue.ToEntero
RegistraScript("window.open('/Prospectos/CatProspectosDetalle.aspx?CveProspectoPadre=" & CveProspectoSeleccionado & "','_blank')")
CargaDatos()
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

View File

@@ -0,0 +1,131 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RedesCallCenter.aspx.vb" Inherits="Prospectos_RedesCallCenter" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
Encuesta
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
Número de encuestas realizadas&nbsp;{&nbsp;<asp:Literal ID="LtlNumEncuestas" runat="server" Text="0"></asp:Literal>&nbsp;}
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table width="100%" style="font-family: 'Open Sans', sans-serif;">
<tr style="height: 30px;">
<td colspan="2" style="background-color: #eee; font-size: 14px; color: #333;">Datos del Encuestado</td>
</tr>
<tr>
<td>&nbsp;</td>
<td style="color: #000; font-size: 18px;">
<asp:Label ID="LblNombre" runat="server" Text="Sin Encuestar"></asp:Label></td>
</tr>
<tr>
<td>&nbsp;</td>
<td style="color: #000; font-size: 14px;">Casa:&nbsp;&nbsp;&nbsp;<asp:Label ID="LblTelefono" runat="server" Text="666-666-6666"></asp:Label>&nbsp;&nbsp;<asp:Label ID="LblTelefonoOtro" runat="server" Text="662-213-6895"></asp:Label></td>
</tr>
<tr>
<td>&nbsp;</td>
<td style="color: #000; font-size: 14px;">Celular:&nbsp;&nbsp;<asp:Label ID="LblCelular" runat="server" Text="666-666-6666"></asp:Label></td>
</tr>
<tr>
<td colspan="2">
<hr />
</td>
</tr>
<tr>
<td colspan="2" style="font-size: 13px;">BUENOS DIAS/TARDES, MI NOMBRE ES
<asp:Label ID="LblUsuarioActual" runat="server" Text=""></asp:Label>
Y LE ESTOY HABLANDO DE UNA EMPRESA DE INVESTIGACIÓN DE OPINIÓN PÚBLICA, PARA REALIZARLE UNA PEQUEÑA ENTREVISTA SOBRE PROGRAMAS SOCIALES LLEVADOS A CABO CERCA DE SU COMUNIDAD, LE ASEGURO QUE ESTE CUESTIONARIO NO LE QUITARÁ MÁS DE 2 MINUTOS: </td>
</tr>
<tr>
<td colspan="2">
<hr />
</td>
</tr>
</table>
<br />
<p>
<%--<asp:GridView ID="GvClasificaciones" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="CveEncuesta,CvePregunta" EmptyDataText="No se encontraron Clasificaciones de Caracteristicas Registradas" ShowHeader="false" ToolTip="Listado de Clasificaciones de Caracteristicas">
<Columns>
<asp:TemplateField>
<ItemStyle BorderStyle="None" />
<ItemTemplate>
<asp:Label ID="LblClasificacion" runat="server" Font-Bold="true" Text='<%# Eval("Pregunta")%>' Width="100%"></asp:Label>--%>
<%-- <asp:GridView ID="GvPreguntas" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="CveEncuesta,CvePregunta" EmptyDataText="No se encontraron Tipos de Caracteristicas Registrados" OnRowDataBound="GvPreguntas_RowDataBound" ShowHeader="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="LblTipoCaracteristica" runat="server" Font-Bold="true" Text='<%# Eval("Pregunta")%>' Width="100%"></asp:Label>
<asp:HiddenField ID="HdnPreguntaTipo" runat="server" Value='<%# Eval("PreguntaTipo")%>' />--%>
<asp:GridView ID="GvPreguntas" runat="server" GridLines="None" AutoGenerateColumns="False" DataKeyNames="CveEncuesta,CvePregunta,PreguntaTipo" EmptyDataText="No se encontraron Respuestas Registrados" OnRowDataBound="GvPreguntas_RowDataBound" ShowHeader="false">
<Columns>
<asp:TemplateField>
<ItemStyle BorderStyle="None" />
<ItemTemplate>
<table border="0" cellpadding="0">
<tr>
<td>
<asp:Label ID="LtlCaracteristica" runat="server" Font-Size="14pt" ForeColor="#2a6496" Font-family="sans serif" Text='<%# Eval("Pregunta")%>'></asp:Label>
</td>
</tr>
<tr>
<tr>
<td>
<asp:TextBox ID="TxtValor" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpEditGuardarCl" Visible="false" Width="400px"></asp:TextBox>
<asp:ImageButton ID="ImgTxtValor" runat="server" AlternateText="Click para ver el Calendario" Height="16px" ImageAlign="AbsMiddle" ImageUrl="/Imagenes/calendar.png" Visible="false" Width="16px" />
<ajax:MaskedEditExtender ID="MEETxtValor" runat="server" AcceptNegative="Left" DisplayMoney="Left" Enabled="false" Mask="99/99/9999" MaskType="Date" TargetControlID="TxtValor" UserDateFormat="DayMonthYear">
</ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CETxtValor" runat="server" Enabled="False" PopupButtonID="ImgTxtValor" PopupPosition="BottomRight" TargetControlID="TxtValor">
</ajax:CalendarExtender>
<asp:DropDownList ID="DdlRespuesta" runat="server" DataTextField="Respuesta" DataValueField="CveRespuesta" Visible="false">
</asp:DropDownList>
<asp:RadioButtonList ID="RbRespuesta" Font-family="sans serif" runat="server" DataTextField="Respuesta" font-size="9pt" DataValueField="CveRespuesta" RepeatDirection="Horizontal" ValidationGroup="GrpGuardar" Visible="false">
</asp:RadioButtonList>
<asp:RequiredFieldValidator ID="RFVRbRespuesta" runat="server" ControlToValidate="RbRespuesta" Display="None" ErrorMessage="&lt;b&gt;&lt;span style='text-decoration: underline'&gt;ERROR:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;El campo &lt;b&gt;'' ''&lt;/b&gt; es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCORbRespuesta" runat="server" HighlightCssClass="vco" TargetControlID="RFVRbRespuesta" Width="300px">
</ajax:ValidatorCalloutExtender>
<asp:TextBox ID="TxtValor1" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpEditGuardarCl" Visible="false" Width="200px"></asp:TextBox>
<asp:TextBox ID="TxtValor2" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpEditGuardarCl" Visible="false" Width="200px"></asp:TextBox>
<asp:TextBox ID="TxtValor3" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpEditGuardarCl" Visible="false" Width="200px"></asp:TextBox>
<asp:Label ID="LblPiedePregunta" runat="server" Visible='<%# Eval("PiedePregunta").toString <> "" %>' Text='<%# Eval("PiedePregunta") %>' Font-Underline="True" Font-Italic="True" Font-Size="6.5"></asp:Label>
<br />
</td>
</tr>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<%-- </ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>--%>
<%-- </ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>--%>
</p>
<p>Observaciones:<asp:TextBox ID="TxtObservaciones" runat="server" TextMode="MultiLine" Rows="3" MaxLength="500" Width="250px"></asp:TextBox></p>
<p style="text-align: center">
<asp:Button ID="BtnEncuesta" runat="server" Text="Guardar Encuesta" Visible="False" />
&nbsp;&nbsp;&nbsp;<asp:Button ID="BtnSaltarEncuesta" runat="server" Text="Saltar Encuesta" Visible="False" />
&nbsp;&nbsp;&nbsp;<asp:Button ID="BtnSaltarNoContactado" runat="server" Text="No Contactado" Visible="False" />
</p>
<br />
<asp:GridView ID="Gvv" runat="server"></asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

View File

@@ -0,0 +1,293 @@
Imports System.Data
Imports System.Linq.Expressions
Imports Extensiones
Partial Class Prospectos_RedesCallCenter
Inherits ClsPaginas
Private Property DTProspectosPreguntas As DataTable
Get
Return CType(ViewState("DTProspectosPreguntas"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTProspectosPreguntas") = value
End Set
End Property
Private Property DTProspectosRespuestas As DataTable
Get
Return CType(ViewState("DTProspectosRespuestas"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTProspectosRespuestas") = value
End Set
End Property
Private Property CveProspecto As Integer
Get
Return ViewState("CveProspecto").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveProspecto") = value
End Set
End Property
Private Property CveEncuesta As Integer
Get
Return ViewState("CveEncuesta").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveEncuesta") = value
End Set
End Property
Private Property CveEncuestaRespuesta As Integer
Get
Return ViewState("CveEncuestaRespuesta").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveEncuestaRespuesta") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
LblUsuarioActual.Text = UsuarioActual.Nombre
CveEncuesta = 17 ' Encuestas ya levantadas: 9
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
Dim ObjProsEncuestas As New ClsProspectos
'cargo los datos del prospecto
TxtObservaciones.Text = ""
CveEncuestaRespuesta = ObjProsEncuestas.GetSiguienteaEncuestar(CveEncuesta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveEncuestaRespuesta > 0 Then
'si encontró un prospecto disponible
CveProspecto = ObjProsEncuestas.CveProspecto
Dim ObjProsp As New ClsProspectos
If ObjProsp.GetProspectos(CveProspecto, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
LblNombre.Text = String.Format("{0} {1} {2}", ObjProsp.ApellidoPaterno, ObjProsp.ApellidoMaterno, ObjProsp.Nombres)
LblCelular.Text = ObjProsp.Celular
LblTelefono.Text = ObjProsp.Telefono
LblTelefonoOtro.Text = String.Format("Otro: {0}", ObjProsp.TelefonoOtro)
If ObjProsEncuestas.GetPreguntas(CveEncuesta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Try
LtlNumEncuestas.Text = "Hoy:&nbsp;" & ObjProsEncuestas.DtResultados.Rows(0)("NumEncuestasHoy").ToString.FormatoNumero(0) & "&nbsp;-&nbsp;Total:&nbsp;" & ObjProsEncuestas.DtResultados.Rows(0)("NumEncuestas").ToString.FormatoNumero(0)
Catch ex As Exception
LtlNumEncuestas.Text = "Hoy:&nbsp;0&nbsp;-&nbsp;Total:&nbsp;0"
End Try
GvPreguntas.DataSource = ObjProsEncuestas.DtResultados
DTProspectosPreguntas = ObjProsEncuestas.DtResultados
If ObjProsEncuestas.GetRespuestas(-1, CveEncuesta) Then
DTProspectosRespuestas = ObjProsEncuestas.DtResultados
End If
BtnEncuesta.Visible = True
BtnSaltarEncuesta.Visible = True
BtnSaltarNoContactado.Visible = True
Dim ObjEncuesta As New ClsProspectos
'JJMQ
'Pongo el SP que trae el encabezado de la encuesta, por si trae si le pusieron algo en Observaciones, que las ponga aquí, para si dice llamar a determinada hora que primero lean la Obs.
If ObjEncuesta.GetEncuestasProspecto(-1, CveProspecto, UsuarioActual.CveEmpresa) Then
If ObjEncuesta.DtResultados IsNot Nothing AndAlso ObjEncuesta.DtResultados.Rows.Count > 0 Then
TxtObservaciones.Text = ObjEncuesta.DtResultados.Rows(0)("Observaciones").ToString
End If
End If
End If
End If
ObjProsp.Dispose()
Else
Alert("No se encontraron encuestas disponibles", TipoMensaje.MsgInformacion)
End If
'If ObjProsEncuestas.GetRespuestasProspecto(CveEncuesta, CveProspecto, UsuarioActual.CveEmpresa) Then
' Gvv.DataSource = ObjProsEncuestas.DtResultados
' Gvv.DataBind()
'End If
ObjProsEncuestas.Dispose()
GvPreguntas.DataBind()
End Sub
Protected Sub GuardarRespuestas()
Dim Correcto As Boolean = True
Dim ObjEncuesta As New ClsProspectos
ObjEncuesta.IniciaTransacSQL()
If CveEncuestaRespuesta > 0 Then
For Each gvr As GridViewRow In GvPreguntas.Rows
Dim CveOpcion As Integer = -2
Dim Valor As String = gvr.FCTextBox("TxtValor").Text.Trim
Select Case gvr.DataKey("PreguntaTipo")
Case "1" 'Listado o DropDownList
CveOpcion = gvr.FCDropDownList("DdlRespuesta").SelectedValue.ToEntero
Case "2" 'Radio o RadioButtonList
CveOpcion = gvr.FCRadioButtonList("RbRespuesta").SelectedValue.ToEntero
Case "5" 'multiple textbox
Valor = String.Format("{0}<br>{1}<br>{2}", gvr.FCTextBox("TxtValor1").Text.Trim, gvr.FCTextBox("TxtValor2").Text.Trim, gvr.FCTextBox("TxtValor3").Text.Trim)
Valor = Valor.Replace("<br><br>", "") ' sino respondieron algun cuadro quito el fin de linea
End Select
If gvr.DataKey("CvePregunta").ToEntero > 0 Then
If Not ObjEncuesta.AddEncuestaRespuestaDetalle(CveEncuestaRespuesta, gvr.DataKey("CvePregunta").ToEntero, If(CveOpcion = 0, -2, CveOpcion), If(Valor = "", "-1", Valor), UsuarioActual.CveUsuario) Then
Correcto = False
Exit For
End If
'Else
' objProspectosValores.UpdateProspectosValores(CveProspecto, CveCaracteristica, CveOpcion, If(Valor = "", "-1", Valor), UsuarioActual.CveUsuario, CveValor)
End If
Next
Else
Correcto = False
End If
If Correcto Then
If ObjEncuesta.ActualizaEstatus(CveEncuestaRespuesta, 10, UsuarioActual.CveUsuario, TxtObservaciones.Text) Then
Correcto = True
ObjEncuesta.Commit()
Else
Correcto = False
End If
Alert("Encuenta Guardada", TipoMensaje.MsgInformacion)
Else
ObjEncuesta.RollBack()
End If
ObjEncuesta.Dispose()
If Correcto Then
CargaDatos()
End If
End Sub
Protected Sub GvPreguntas_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim EsOpcion As Integer = e.Row.DBCampo("PreguntaTipo").ToEntero
Dim CvePregunta As Integer = e.Row.DBCampo("CvePregunta").ToEntero
Select Case EsOpcion
Case 0, 4 'Texto, Multiline
With e.Row.FCTextBox("TxtValor")
.Visible = True
If EsOpcion = 4 Then
.Rows = 3
.TextMode = TextBoxMode.MultiLine
End If
End With
Case 1, 2 'DropDownList, Radios
Dim dt As DataTable = DTProspectosRespuestas.FiltraParametros(String.Format("CvePregunta = {0} AND Estatus = 'Activo'", CvePregunta))
If EsOpcion = 1 Then
With e.Row.FCDropDownList("DdlRespuesta")
.Visible = True
.DataSource = dt
.DataBind()
.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End With
ElseIf EsOpcion = 2 Then
With e.Row.FCRadioButtonList("RbRespuesta")
.Visible = True
.DataSource = dt
.DataBind()
End With
End If
Case 3 'Fecha
With e.Row.FCTextBox("TxtValor")
.Visible = True
.Width = New Unit(80)
End With
e.Row.FCImageButton("ImgTxtValor").Visible = True
e.Row.FCMaskedEditExtender("MEETxtValor").Enabled = True
e.Row.FCCalendarExtender("CETxtValor").Enabled = True
Case 5 ' multiples textbox
e.Row.FCTextBox("TxtValor1").Visible = True : e.Row.FCTextBox("TxtValor2").Visible = True : e.Row.FCTextBox("TxtValor3").Visible = True
End Select
End If
End Sub
Protected Sub BtnEncuesta_Click(sender As Object, e As EventArgs) Handles BtnEncuesta.Click
GuardarRespuestas()
End Sub
Protected Sub BtnSaltarEncuesta_Click(sender As Object, e As EventArgs) Handles BtnSaltarEncuesta.Click
Dim ObjEncuesta As New ClsProspectos
If ObjEncuesta.ActualizaEstatus(CveEncuestaRespuesta, 2, UsuarioActual.CveUsuario, TxtObservaciones.Text) Then
Alert("Encuesta Saltada", TipoMensaje.MsgInformacion)
ObjEncuesta.GetSiguienteaEncuestar(CveEncuesta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CargaDatos()
End If
ObjEncuesta.Dispose()
End Sub
Protected Sub BtnSaltarNoContactado_Click(sender As Object, e As EventArgs) Handles BtnSaltarNoContactado.Click
Dim ObjEncuesta As New ClsProspectos
If ObjEncuesta.ActualizaEstatus(CveEncuestaRespuesta, 3, UsuarioActual.CveUsuario, TxtObservaciones.Text) Then
Alert("Encuesta Saltada", TipoMensaje.MsgInformacion)
ObjEncuesta.GetSiguienteaEncuestar(CveEncuesta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CargaDatos()
End If
ObjEncuesta.Dispose()
End Sub
End Class

View File

@@ -0,0 +1,512 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RedesEncuestas.aspx.vb" Inherits="Prospectos_RedesEncuestas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
<script type="text/javascript" >
function OnSucceeded(result, userContext, methodName) {
if (methodName == 'wsGetNombreCuenta') {
$get('TxtCuentaContable').value = result;
}
}
function myItemSelectedHandler(source, eventArgs) {
//debugger;
var CC = $get('HdnCveProspectoPadre');
CC.value = eventArgs.get_value();
// var b = $get('C_Tabs_TabConyuge_BtnTruco');
// b.Click;
//var aTargetElement = 'BtnSelCuenta';
//__doPostBack(aTargetElement, eventArgs.get_value());
// alert(" Key : " + eventArgs.get_text() + " Value : " + eventArgs.get_value());
}
function LimpiaImporte(t, txt) {
if (t.value != '' && $get(txt)) {
$get(txt).value = '';
}
}
function SetText(ObjFrom, ObjTo) {
ObjTo.value = ObjFrom.value;
}
</script>
<style type="text/css">
.AutoExtender
{
font-family: Verdana, Helvetica, sans-serif;
font-size: .9em;
font-weight: normal;
border: solid 1px #006699;
line-height: 20px;
padding: 2px;
background-color: White;
margin-left: 2px;
overflow: auto;
list-style-type: none;
}
.AutoExtenderList
{
cursor: pointer;
color: darkgray;
text-align: left;
}
.AutoExtenderHighlight
{
color: White;
background-color: #084784;
cursor: pointer;
}
#divwidth
{
width: 150px !important;
}
#divwidth div
{
width: 150px !important;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
<asp:Literal ID="LtlTitulo" runat="server" Text="Registro de Prospectos"></asp:Literal>&nbsp;<asp:Literal ID="LtlProspectos" runat="server"></asp:Literal>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
Número de encuestas realizadas&nbsp;{&nbsp;<asp:Literal ID="LtlNumEncuestas" runat="server" Text="0"></asp:Literal>&nbsp;}
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<asp:Panel ID="PnlBusquedaGral" runat="server" Visible="false">
<asp:UpdatePanel ID="UPPBusq" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:CollapsiblePanelExtender ID="cpeDesc" runat="Server" TargetControlID="PnlBusqueda" ExpandControlID="PnlHBusqueda" CollapseControlID="PnlHBusqueda" Collapsed="True" ExpandedImage="~/imagenes/collapse.jpg" CollapsedImage="~/imagenes/expand.jpg" ImageControlID="description_ToggleImage" />
<asp:Panel ID="PnlHBusqueda" runat="server" Style="cursor: pointer;">
<div class="heading">
<asp:ImageButton ID="Description_ToggleImage" runat="server" ImageUrl="~/imagenes/collapse.jpg" AlternateText="collapse" />Búsquedas
</div>
</asp:Panel>
<asp:Panel ID="PnlBusqueda" runat="server" >
<table border="0" cellpadding="0">
<tr>
<td>A. Paterno</td>
<td><asp:TextBox ID="TxtPaternoB" runat="server" MaxLength="35"></asp:TextBox></td>
<td>A. Materno</td>
<td><asp:TextBox ID="TxtMaternoB" runat="server" MaxLength="35"></asp:TextBox></td>
<td>Nombres</td>
<td><asp:TextBox ID="TxtNombresB" runat="server" MaxLength="35"></asp:TextBox></td>
<td>Fecha Nacimiento</td>
<td>
<asp:TextBox ID="TxtFechaNacB" runat="server" MaxLength="12" Width="100px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaNacB" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaNacB" runat="server" TargetControlID="TxtFechaNacB" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" ></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CEFechaNacB" runat="server" TargetControlID="TxtFechaNacB" PopupButtonID="ImgFechaNacB" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CVFechaNacB" runat="server" ControlToValidate="TxtFechaNacB" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaNacB" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaNacB" Width="350px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
<td>
<asp:Button ID="BtnBusqueda" runat="server" Text="Consultar" ValidationGroup="GrpBusqueda" />
</td>
</tr>
<%--<tr>
<td>Criterio</td>
<td>
<asp:DropDownList ID="DdlOpcion" runat="server">
<asp:ListItem Selected="True" Text="Nombre" Value="NOMBRE"></asp:ListItem>
<asp:ListItem Text="F. Nacimiento" Value="NACIMIENTO"></asp:ListItem>
</asp:DropDownList></td>
<td>
<asp:TextBox ID="TxtBusqueda" runat="server" Width="550px"> </asp:TextBox>
<asp:RequiredFieldValidator ID="RFVBusqueda" runat="server" ControlToValidate="TxtBusqueda" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Texto a buscar''</b> es necesario, por favor ingréselo." ValidationGroup="GrpBusqueda"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEBusqueda" runat="server" HighlightCssClass="vco" TargetControlID="RFVBusqueda" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td style="text-align:right;"><asp:Button ID="BtnBusqueda" runat="server" Text="Consultar" ValidationGroup="GrpBusqueda" /></td>
</tr>--%>
<tr>
<td colspan="9">
<div style="height: 200px; overflow-y: scroll; width: 1000px;">
<asp:GridView ID="GvBusq" runat="server" AutoGenerateColumns="False" CssClass="tablesorter" ClientIDMode="Static" DataKeyNames="Clave,APaterno,AMaterno,Nombres,FechaNacimiento,Calle,NumExterior,NumInterior, Sexo, Colonia,CP,Ocupacion,Seccion,PadronMunicipio,CveProspecto">
<Columns>
<%--<asp:TemplateField HeaderText="Clave">
<ItemTemplate>
<asp:LinkButton ID="LnkClave" Text='<%# Bind("Clave") %>' CssClass="Texto" runat="server" OnClick="LnkClave_Click"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="100px" />
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Paterno">
<ItemTemplate>
<asp:LinkButton ID="LnkPaterno" Text='<%# Bind("APaterno")%>' CssClass="Texto" runat="server" OnClick="LnkClave_Click"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="80px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Materno">
<ItemTemplate>
<asp:LinkButton ID="LnkMaterno" Text='<%# Bind("AMaterno")%>' CssClass="Texto" runat="server" OnClick="LnkClave_Click"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="80px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombres">
<ItemTemplate>
<asp:LinkButton ID="LnkNombre" Text='<%# Bind("Nombres")%>' CssClass="Texto" runat="server" OnClick="LnkClave_Click"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="100px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="F. Nac.">
<ItemTemplate>
<asp:LinkButton ID="LnkFechaNac" Text='<%# Bind("FechaNacimiento", "{0:d}")%>' CssClass="Texto" runat="server" OnClick="LnkClave_Click"></asp:LinkButton>
</ItemTemplate>
<ItemStyle Width="70px" />
</asp:TemplateField>
<asp:BoundField DataField="Calle" HeaderText="Calle">
<ItemStyle Width="250px" />
</asp:BoundField>
<asp:BoundField DataField="NumExterior" HeaderText="Ext">
<ItemStyle Width="25px" />
</asp:BoundField>
<asp:BoundField DataField="NumInterior" HeaderText="Int">
<ItemStyle Width="25px" />
</asp:BoundField>
<asp:BoundField DataField="Sexo" HeaderText="Sexo" />
<asp:BoundField DataField="Colonia" HeaderText="Colonia">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="PadronMunicipio" HeaderText="Municipio">
<ItemStyle Width="100px" />
</asp:BoundField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="padding-top: 20px;">
<tr>
<td align="left">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabAlta" runat="server" HeaderText="Información General">
<ContentTemplate>
<table border="0" class="contenido">
<tr>
<td>
<div>
<fieldset>
<legend><b>Datos Generales</b></legend>
<table border="0" cellpadding="1" cellspacing="0" style="width: 100%">
<tr>
<td>En Detección:</td>
<td>
<asp:DropDownList ID="DdlEnDeteccion" Width="50px" runat="server" AutoPostBack="True">
<asp:ListItem Value="0">No</asp:ListItem>
<asp:ListItem Value="1">Si</asp:ListItem>
</asp:DropDownList>
</td>
<td colspan="6">
<asp:Panel ID="PnlReporta" runat="server">
Referencia de: <asp:HiddenField ID="HdnCveProspectoPadre" runat="server" ClientIDMode="Static" />
<asp:TextBox ID="TxtReporta" Width="200px" runat="server"></asp:TextBox>
<ajax:AutoCompleteExtender runat="server" BehaviorID="AutoCompleteEx" ID="autoComplete1"
TargetControlID="TxtReporta" ServicePath="" ServiceMethod="wsGetReporta"
CompletionInterval="350" CompletionSetCount="20" CompletionListCssClass="AutoExtender"
CompletionListItemCssClass="AutoExtenderList" CompletionListHighlightedItemCssClass="AutoExtenderHighlight"
DelimiterCharacters=";,:" OnClientItemSelected="myItemSelectedHandler"
FirstRowSelected="True" Enabled="True">
<Animations>
<OnShow>
<Sequence>
<OpacityAction Opacity="0" />
<HideAction Visible="true" />
<ScriptAction Script="
// Cache the size and setup the initial size
var behavior = $find('AutoCompleteEx');
if (!behavior._height) {
var target = behavior.get_completionList();
behavior._height = target.offsetHeight - 2;
target.style.height = '0px';
}" />
<Parallel Duration=".2">
<FadeIn />
<Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx')._height" />
</Parallel>
</Sequence>
</OnShow>
<OnHide>
<Parallel Duration=".4">
<FadeOut />
<Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx')._height" EndValue="0" />
</Parallel>
</OnHide></Animations>
</ajax:AutoCompleteExtender>
</asp:Panel>
</td>
</tr>
<tr>
<td><asp:TextBox ID="TxtCveProspecto" runat="server" MaxLength="12" Width="200px" Enabled="False" Visible="False"></asp:TextBox></td>
</tr>
<tr>
<td>Apellido Paterno: </td>
<td>
<asp:TextBox ID="TxtApellidoPaterno" runat="server" MaxLength="50" Width="150px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVApellidoPaterno" runat="server" ControlToValidate="TxtApellidoPaterno" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Apellido Paterno''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEApellidoPaterno" runat="server" HighlightCssClass="vco" TargetControlID="RFVApellidoPaterno" Width="300px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
<td>Apellido Materno: </td>
<td>
<asp:TextBox ID="TxtApellidoMaterno" runat="server" MaxLength="50" Width="150px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVApellidoMaterno" runat="server" ControlToValidate="TxtApellidoMaterno" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Apellido Materno ''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEApellidoMaterno" runat="server" HighlightCssClass="vco" TargetControlID="RFVApellidoMaterno" Width="300px" Enabled="True">
</ajax:ValidatorCalloutExtender>
</td>
<td>Nombre(s): </td>
<td>
<asp:TextBox ID="TxtNombres" runat="server" MaxLength="50" Width="150px"></asp:TextBox>(*)
<asp:RequiredFieldValidator ID="RFVNombres" runat="server" ControlToValidate="TxtNombres" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombres''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCENombres" runat="server" HighlightCssClass="vco" TargetControlID="RFVNombres" Width="300px" Enabled="True">
</ajax:ValidatorCalloutExtender>
</td>
<td colspan="2"></td>
</tr>
<tr>
<td>Sexo</td>
<td>
<asp:DropDownList ID="DdlSexo" Width="100px" runat="server">
<asp:ListItem Text="Femenino" Value="0"></asp:ListItem>
<asp:ListItem Text="Masculino" Value="1"></asp:ListItem>
</asp:DropDownList>
</td>
<td>Sección</td>
<td>
<asp:TextBox ID="TxtSeccion" runat="server" Width="50px" MaxLength="4"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVSeccion" runat="server" ControlToValidate="TxtSeccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sección''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCESeccion" runat="server" HighlightCssClass="vco" TargetControlID="RFVSeccion" Width="350px" Enabled="True"></ajax:ValidatorCalloutExtender>
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="TxtSeccion"
Mask="9999" MaskType="Number" OnFocusCssClass="editmask"
OnInvalidCssClass="invalidmask" ClearMaskOnLostFocus="False"
AutoComplete="False" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" />
</td>
<td>F. Nacimiento</td>
<td>
<asp:TextBox ID="TxtFechaNacimiento" runat="server" MaxLength="12" Width="80px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaNacimiento" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFechaNacimiento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CEFechaNacimiento" runat="server" TargetControlID="TxtFechaNacimiento" PopupButtonID="ImgFechaNacimiento" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaNacimiento" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaNacimiento" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaNacimiento1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaNacimiento" Width="350px" Enabled="True"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFechaNacimiento2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaNacimiento" Width="350px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr style="display: none;">
<td>IFE</td>
<td colspan="5">
<asp:TextBox ID="TxtIFE" Width="150px" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>Teléfono: </td>
<td>
<asp:TextBox ID="TxtTelefono" runat="server" MaxLength="10" Width="100px"></asp:TextBox>
<ajax:MaskedEditExtender ID="MEETelefono" runat="server" TargetControlID="TxtTelefono"
Mask="(999) 999-9999" OnFocusCssClass="editmask"
OnInvalidCssClass="invalidmask" ClearMaskOnLostFocus="False"
AutoComplete="False" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" />
<ajax:MaskedEditValidator ID="MEVTelefono" runat="server" ControlToValidate="TxtTelefono" ValidationGroup="GrpGuardar2"
ControlExtender="MEETelefono" Display="Dynamic" ValidationExpression="((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}"
InvalidValueMessage="*" ErrorMessage="MEVTelefono" />
</td>
<td>Celular: </td>
<td>
<asp:TextBox ID="TxtCelular" runat="server" MaxLength="10" Width="100px"></asp:TextBox>
<ajax:MaskedEditExtender ID="MEECelular" runat="server" TargetControlID="TxtCelular"
Mask="(999) 999-9999" OnFocusCssClass="editmask"
OnInvalidCssClass="invalidmask" ClearMaskOnLostFocus="False"
AutoComplete="False" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" />
<ajax:MaskedEditValidator ID="MEVCelular" runat="server" ControlToValidate="TxtCelular" ValidationGroup="GrpGuardar2"
ControlExtender="MEECelular" Display="Dynamic" ValidationExpression="((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}"
InvalidValueMessage="*" ErrorMessage="MEVCelular" />
</td>
<td>Correo: </td>
<td>
<asp:TextBox ID="TxtCorreo" runat="server" MaxLength="100" Width="200px"></asp:TextBox>
<asp:RegularExpressionValidator ID="REVCorreo" runat="server" ControlToValidate="TxtCorreo" Display="None" ErrorMessage="El campo <b>''Correo''</b> no tiene el formato correcto, por favor corrija." ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="GrpGuardar"></asp:RegularExpressionValidator>
</td>
</tr>
</table>
</fieldset>
<br />
<fieldset>
<legend><b>Domicilio Particular</b></legend>
<table border="0">
<tr>
<td>Calle: </td>
<td>
<asp:TextBox ID="TxtCalle" runat="server" MaxLength="100" Width="200px"></asp:TextBox>
</td>
<td>Número: </td>
<td>
<asp:TextBox ID="TxtNumero" runat="server" MaxLength="10" Width="200px"></asp:TextBox>
</td>
<td>No. Interior</td>
<td>
<asp:TextBox ID="TxtNumeroInterior" runat="server" MaxLength="10" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td>Entre Calle: </td>
<td>
<asp:TextBox ID="TxtEntreCalle1" runat="server" MaxLength="100" Width="200px"></asp:TextBox>
</td>
<td>y </td>
<td>
<asp:TextBox ID="TxtEntreCalle2" runat="server" MaxLength="100" Width="200px"></asp:TextBox>
</td>
<td colspan="2"></td>
</tr>
<tr>
<td>Colonia: </td>
<td>
<asp:TextBox ID="TxtColonia" runat="server" MaxLength="50" Width="200px"></asp:TextBox>
</td>
<td>Código Postal: </td>
<td>
<asp:TextBox ID="TxtCodigoPostal" runat="server" MaxLength="5" Width="200px"></asp:TextBox><ajax:FilteredTextBoxExtender ID="FTBECodigoPostal" runat="server" TargetControlID="TxtCodigoPostal" FilterType="Numbers" Enabled="True" />
</td>
<td colspan="2"></td>
</tr>
<tr style="display: none;">
<td>País: </td>
<td>
<asp:UpdatePanel ID="UPPPaises" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlPaises" DataTextField="Pais" DataValueField="CvePais" Width="200px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>Estado: </td>
<td>
<asp:UpdatePanel ID="UPPEstados" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlEstados" DataTextField="Estado" DataValueField="CveEstado" Width="200px" runat="server" AutoPostBack="True"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>Municipio:</td>
<td>
<asp:UpdatePanel ID="UPPMunicipios" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="DdlMunicipios" DataTextField="Municipio" DataValueField="CveMunicipio" Width="200px" runat="server"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</fieldset>
<br />
<fieldset>
<legend><b>Encuesta</b></legend>
<table border="0">
<tr>
<td>Promotor: </td>
<td>
<asp:DropDownList ID="DdlPromotor" DataTextField="Vendedor" DataValueField="CveVendedor" Width="250px" runat="server"></asp:DropDownList>
</td>
<td>Fecha: </td>
<td>
<asp:TextBox ID="TxtEncuestaFecha" runat="server" MaxLength="12" Width="70px"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgEncuestaFecha" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtEncuestaFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left" Century="2000" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TxtEncuestaFecha" PopupButtonID="ImgEncuestaFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVEncuestaFecha" runat="server" ControlToValidate="TxtEncuestaFecha" Display="None" ErrorMessage="El campo <b>''Fecha de Encuesta''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVEncuestaFecha" runat="server" ControlToValidate="TxtEncuestaFecha" Display="None" ErrorMessage="El campo <b>''Fecha de Encuesta''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="CVEEncuestaFecha" runat="server" HighlightCssClass="vco" TargetControlID="RFVEncuestaFecha" Width="350px" Enabled="True"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="CVEEncuestaFecha2" runat="server" HighlightCssClass="vco" TargetControlID="CVEncuestaFecha" Width="350px" Enabled="True"></ajax:ValidatorCalloutExtender>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="6">
<hr/>
<asp:GridView ID="GvPreguntas" runat="server" GridLines="None" AutoGenerateColumns="False" DataKeyNames="CveEncuesta,CvePregunta,PreguntaTipo" EmptyDataText="No se encontraron Respuestas Registrados" OnRowDataBound="GvPreguntas_RowDataBound" ShowHeader="False">
<Columns>
<asp:TemplateField>
<ItemStyle BorderStyle="None" />
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">
<asp:Label ID="LtlCaracteristica" runat="server" Font-Size="15px" ForeColor="#2a6496" Font-family="sans serif" Text='<%# Eval("Pregunta")%>'></asp:Label>
</td>
</tr>
<tr>
<td style="width: 20px;">&nbsp;&nbsp;&nbsp;</td>
<td>
<asp:TextBox ID="TxtValor" runat="server" CausesValidation="true" MaxLength="50" ValidationGroup="GrpEditGuardarCl" Visible="false" Width="400px"></asp:TextBox>
<asp:ImageButton ID="ImgTxtValor" runat="server" AlternateText="Click para ver el Calendario" Height="16px" ImageAlign="AbsMiddle" ImageUrl="/Imagenes/calendar.png" Visible="false" Width="16px" />
<ajax:MaskedEditExtender ID="MEETxtValor" runat="server" AcceptNegative="Left" DisplayMoney="Left" Enabled="false" Mask="99/99/9999" MaskType="Date" TargetControlID="TxtValor" UserDateFormat="DayMonthYear"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="CETxtValor" runat="server" Enabled="False" PopupButtonID="ImgTxtValor" PopupPosition="BottomRight" TargetControlID="TxtValor"></ajax:CalendarExtender>
<asp:DropDownList ID="DdlRespuesta" runat="server" DataTextField="Respuesta" DataValueField="CveRespuesta" Visible="false"></asp:DropDownList>
<asp:RadioButtonList ID="RbRespuesta" Font-family="sans serif" runat="server" DataTextField="Respuesta" DataValueField="CveRespuesta" RepeatDirection="Vertical" ValidationGroup="GrpGuardar" Visible="false"></asp:RadioButtonList>
<asp:RequiredFieldValidator ID="RFVRbRespuesta" runat="server" ControlToValidate="RbRespuesta" Display="None" ErrorMessage="" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCORbRespuesta" runat="server" HighlightCssClass="vco" TargetControlID="RFVRbRespuesta" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
</table>
</fieldset>
</div>
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td align="center">
<br/>
<asp:UpdatePanel ID="UpGuardar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnGuardar" runat="server" Text="Guardar" ValidationGroup="GrpGuardar" />
<asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" Visible="False" />
<asp:Button ID="BtnCancelar" runat="server" Text="Cancelar" OnClientClick="javascript:window.location.href='/Prospectos/RedesEncuestas.aspx';return false;" />
</ContentTemplate>
</asp:UpdatePanel>
<br/>
</td>
</tr>
</table>
</asp:Content>

View File

@@ -0,0 +1,577 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Runtime.InteropServices
Imports System.IO
Imports System.Data
Imports System.Web.Services
Partial Class Prospectos_RedesEncuestas
Inherits ClsPaginas
'Confinguración
Private Property DTProspectosValores As DataTable
Get
Return CType(ViewState("DTProspectosValores"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTProspectosValores") = value
End Set
End Property
Private ReadOnly Property CveProspecto As Integer
Get
Return ViewState("CveProspecto").ToString.ToEntero
End Get
End Property
Private Property DTProspectosPreguntas As DataTable
Get
Return CType(ViewState("DTProspectosPreguntas"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTProspectosPreguntas") = value
End Set
End Property
Private Property DTProspectosRespuestas As DataTable
Get
Return CType(ViewState("DTProspectosRespuestas"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTProspectosRespuestas") = value
End Set
End Property
Private Property CveEncuesta As Integer
Get
Return ViewState("CveEncuesta").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveEncuesta") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
DdlPaises.DataSource = GlobalDTGralPaises : DdlPaises.DataBind()
DdlPromotor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) : DdlPromotor.DataBind() ' GlobalDTProspectosCoordinadores(-1, UsuarioActual.CveEmpresa)
'CEFechaNacimiento.EndDate = Today
CveEncuesta = 2
TxtApellidoPaterno.Focus()
'DdlMunicipios.DataSource = GlobalDTGralMunicipios : DdlMunicipios.DataBind()
If Request("CveProspecto") IsNot Nothing AndAlso IsNumeric(Request("CveProspecto")) AndAlso Request("CveProspecto").ToEntero > 0 Then
ViewState("CveProspecto") = Request("CveProspecto")
CargaDatos()
'Configuración de Modalidad Update
BtnGuardar.Text = "Guardar Cambios"
LtlTitulo.Text = "Consulta del Prospecto:"
Else
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
DdlEstados.SelectedValue = "26"
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
ViewState("CveProspecto") = -1
PnlBusquedaGral.Visible = True
Me.Form.DefaultButton = BtnBusqueda.UniqueID
TxtPaternoB.Attributes.Add("onKeyUp", "SetText(" & TxtPaternoB.ClientID & ", " & TxtApellidoPaterno.ClientID & ")")
TxtMaternoB.Attributes.Add("onKeyUp", "SetText(" & TxtMaternoB.ClientID & ", " & TxtApellidoMaterno.ClientID & ")")
TxtNombresB.Attributes.Add("onKeyUp", "SetText(" & TxtNombresB.ClientID & ", " & TxtNombres.ClientID & ")")
'TxtFechaNacB.Attributes.Add("onKeyUp", "SetText(" & TxtFechaNacB.ClientID & ", " & TxtFechaNacimiento.ClientID & ")")
TxtPaternoB.Focus()
End If
CargaEncuesta()
End If
End Sub
Private Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetProspectos(CveProspecto, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
If ObjProspectos.DtResultados.Rows.Count > 0 Then
TxtCveProspecto.Text = ObjProspectos.CveProspecto.ToString
TxtApellidoPaterno.Text = ObjProspectos.ApellidoPaterno
TxtApellidoMaterno.Text = ObjProspectos.ApellidoMaterno
TxtNombres.Text = ObjProspectos.Nombres
TxtFechaNacimiento.Text = ObjProspectos.FechaNacimiento.ToString
TxtCalle.Text = ObjProspectos.Calle
TxtNumero.Text = ObjProspectos.Numero
TxtNumeroInterior.Text = ObjProspectos.NumeroInterior
TxtEntreCalle1.Text = ObjProspectos.EntreCalle1
TxtEntreCalle2.Text = ObjProspectos.EntreCalle2
TxtIFE.Text = ObjProspectos.IFE
DdlSexo.SelectedValue = ObjProspectos.Sexo.ToString
TxtColonia.Text = ObjProspectos.Colonia
TxtCodigoPostal.Text = ObjProspectos.CodigoPostal.ToString
DdlPaises.SelectedValue = ObjProspectos.CvePais.ToString
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
DdlEstados.SelectedValue = ObjProspectos.CveEstado.ToString
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
DdlMunicipios.SelectedValue = ObjProspectos.CveMunicipio.ToString
TxtSeccion.Text = ObjProspectos.Seccion.ToString()
TxtTelefono.Text = ObjProspectos.Telefono
TxtCelular.Text = ObjProspectos.Celular
'TxtFax.Text = ObjProspectos.Fax
TxtCorreo.Text = ObjProspectos.Correo
'cveEmpresaPais.Text = ObjProspectos.EmpresaPais
'TxtEmpresaMunicipio.Text = ObjProspectos.EmpresaMunicipio
'TxtEmpresaEstado.Text = ObjProspectos.EmpresaEstado
'TxtCveEstatus.Text = ObjProspectos.CveEstatus
'TxtFechaIng.Text = ObjProspectos.FechaIng
'TxtCveUsuario.Text = ObjProspectos.CveUsuario
'TxtCveEmpresa.Text = ObjProspectos.CveEmpresa
'Cargar los Valores de las Caractertisticas
If ObjProspectos.GetProspectosValores(CveProspecto) Then
ViewState("DTProspectosValores") = ObjProspectos.DtResultados
End If
PnlBusquedaGral.Visible = False
'Permiso Eliminar
If UsuarioActual.TienePermisoProceso(78) Then BtnEliminar.Visible = True Else BtnEliminar.Visible = False
End If
End If
ObjProspectos.Dispose()
End Sub
Private Sub CargaEstados(ddl As DropDownList, CvePais As Integer)
ddl.DataSource = GlobalDTGralEstados(CvePais) : ddl.DataBind()
End Sub
Private Sub CargaMunicipios(ddl As DropDownList, CveEstado As Integer)
ddl.DataSource = GlobalDTGralMunicipios(CveEstado) : ddl.DataBind()
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
If CveProspecto = -1 Then
If TxtEncuestaFecha.Text = "" Then
Alert("Seleccione la fecha de la encuesta", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim Seccion As Integer = TxtSeccion.Text.Replace("_", "").ToEntero
If Seccion <= 0 Then
Alert("Ingrese un sección correcta", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim CveMunicipio As Integer = 0
If HdnCveProspectoPadre.Value.ToEntero <= 0 Then HdnCveProspectoPadre.Value = "-1"
Dim Correcto As Boolean = True
Dim ObjProspectos As New ClsProspectos
Dim ObjEncuesta As New ClsProspectos(ObjProspectos.IniciaTransacSQL())
Dim Telefono, Celular As String
Telefono = TxtTelefono.Text.Trim.Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", "")
Celular = TxtCelular.Text.Trim.Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", "")
If Seccion > 0 Then
'obtengo la clave del municipio en base a su secion
CveMunicipio = ObjProspectos.GetMunicipioSeccion(Seccion)
End If
Dim RetValue As Integer = ObjProspectos.AddProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
TxtNombres.Text.Trim, TxtFechaNacimiento.Text.ToDate, "", "", "MEXICANA", DdlSexo.SelectedValue.ToEntero, TxtCalle.Text.Trim,
TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, TxtEntreCalle1.Text.Trim, TxtEntreCalle2.Text.Trim, TxtColonia.Text.Trim, TxtCodigoPostal.Text.Trim.ToEntero, CveMunicipio,
Telefono, Celular, "", "", TxtCorreo.Text.Trim, "", "", "", -1, 0, 0, "", "", "",
"", "", "", "", "", 0, "", "", "", "", "", False, "", "", "", "", -1, "", HdnCveProspectoPadre.Value.ToEntero, -1, -1, TxtIFE.Text.Trim, Seccion, -1, -1, "", 0, "", -1, 2, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If RetValue > 0 OrElse RetValue = -2 Then
Dim tCveProspecto As Integer = ObjProspectos.CveProspecto
Dim Actualizar As Boolean = False
'registro la encuesta
Dim Clave As Integer = 0
'verifico si ya existe una encuesta registrada
If ObjEncuesta.GetEncuestasProspecto(CveEncuesta, tCveProspecto, UsuarioActual.CveEmpresa) Then
If ObjEncuesta.DtResultados.Rows.Count > 0 Then
Clave = ObjEncuesta.DtResultados(0)("CveEncuestaRespuesta").ToString.ToEntero
Actualizar = True
End If
End If
If Clave = 0 Then
Clave = ObjEncuesta.AddEncuestaRespuesta(CveEncuesta, tCveProspecto, TxtEncuestaFecha.Text.ToDate, DdlPromotor.SelectedValue.ToEntero, UsuarioActual.CveUsuario)
End If
If Clave > 0 Then
For Each gvr As GridViewRow In GvPreguntas.Rows
Dim CveOpcion As Integer = -1
Dim Valor As String = gvr.FCTextBox("TxtValor").Text.Trim
Select Case gvr.DataKey("PreguntaTipo")
Case "1" 'Listado o DropDownList
CveOpcion = gvr.FCDropDownList("DdlRespuesta").SelectedValue.ToEntero
Case "2" 'Radio o RadioButtonList
CveOpcion = gvr.FCRadioButtonList("RbRespuesta").SelectedValue.ToEntero
End Select
If gvr.DataKey("CvePregunta").ToEntero > 0 Then
If Actualizar Then
If Not ObjEncuesta.UpdateEncuestaRespuestaDetalle(Clave, gvr.DataKey("CvePregunta").ToEntero, CveOpcion, If(Valor = "", "-1", Valor), UsuarioActual.CveUsuario) Then
Correcto = False
Exit For
End If
Else
If Not ObjEncuesta.AddEncuestaRespuestaDetalle(Clave, gvr.DataKey("CvePregunta").ToEntero, CveOpcion, If(Valor = "", "-1", Valor), UsuarioActual.CveUsuario) Then
Correcto = False
Exit For
End If
End If
End If
Next
Else
Correcto = False
Alert("El Prospecto ya tiene esta encuesta registrada", TipoMensaje.MsgAdvertencia)
End If
Else
Correcto = False
End If
If Correcto Then
ObjProspectos.Commit()
Alert("El Prospecto se guardó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/RedesEncuestas.aspx"";")
TxtPaternoB.Text = "" : TxtMaternoB.Text = "" : TxtNombresB.Text = "" : TxtFechaNacB.Text = "" : GvBusq.DataSource = Nothing : GvBusq.DataBind() : TxtFechaNacimiento.Text = ""
DdlEnDeteccion.SelectedIndex = 0 : TxtApellidoPaterno.Text = "" : TxtApellidoMaterno.Text = "" : TxtNombres.Text = "" : DdlSexo.SelectedIndex = 0
DdlSexo.SelectedIndex = 0 : TxtTelefono.Text = "" : TxtCelular.Text = "" : TxtCorreo.Text = ""
TxtCalle.Text = "" : TxtNumero.Text = "" : TxtNumeroInterior.Text = "" : TxtEntreCalle1.Text = "" : TxtEntreCalle2.Text = "" : TxtColonia.Text = "" : TxtCodigoPostal.Text = ""
DdlPromotor.SelectedIndex = 0 : TxtEncuestaFecha.Text = ""
Else
ObjProspectos.RollBack()
End If
ObjEncuesta.Dispose()
ObjProspectos.Dispose()
'Else
' Dim ObjProspectos As New ClsProspectos
' If ObjProspectos.UpdateProspectos(-1, TxtApellidoPaterno.Text.Trim, TxtApellidoMaterno.Text.Trim,
' TxtNombres.Text.Trim, TxtFechaNacimiento.Text.Trim.ToDate, TxtLugarNacimiento.Text.Trim, "", "MEXICANA", DdlSexo.SelectedValue.ToEntero, TxtCalle.Text.Trim,
' TxtNumero.Text.Trim, TxtNumeroInterior.Text.Trim, TxtEntreCalle1.Text.Trim, TxtEntreCalle2.Text.Trim, TxtColonia.Text.Trim, TxtCodigoPostal.Text.Trim.ToEntero, DdlMunicipios.SelectedValue.ToEntero,
' TxtTelefono.Text.Trim, TxtCelular.Text, "", "", TxtCorreo.Text.Trim, "", "", "", -1, 0, 0, "", "", "",
' "", "", "", "", "", 0, "", "", "", "", "", False, "", "", "", "", -1, "", -1, -1, -1, TxtIFE.Text.Trim, -1, -1, -1, False, "", -1, -1, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProspecto) Then
' UpDatos.Update()
' Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
' End If
' ObjProspectos.Dispose()
End If
End Sub
Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click
Dim ObjProspectos As New ClsProspectos()
If ObjProspectos.RemoveProspectos(CveProspecto) Then
Alert("El Prospecto se Eliminó correctamente.", TipoMensaje.MsgInformacion, "document.location.href=""/Prospectos/CatProspectos.aspx""")
End If
ObjProspectos.Dispose()
End Sub
Protected Sub DdlPaises_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPaises.SelectedIndexChanged
CargaEstados(DdlEstados, DdlPaises.SelectedValue.ToEntero)
UPPEstados.Update()
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
UPPMunicipios.Update()
End Sub
Protected Sub DdlEstados_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEstados.SelectedIndexChanged
CargaMunicipios(DdlMunicipios, DdlEstados.SelectedValue.ToEntero)
UPPMunicipios.Update()
End Sub
Protected Sub BtnBusqueda_Click(sender As Object, e As EventArgs) Handles BtnBusqueda.Click
Dim Prosp As New ClsProspectos
Dim BusqPaterno As String = TxtPaternoB.Text.Trim.ToUpper.Replace(" ", "%")
Dim BusqMaterno As String = If(TxtMaternoB.Text.Trim <> "", TxtMaternoB.Text.Trim.ToUpper.Replace(" ", "%") & "%", "-1")
Dim BusqNombres As String = If(TxtNombresB.Text.Trim <> "", "%" & TxtNombresB.Text.Trim.ToUpper.Replace(" ", "%") & "%", "-1")
'Busqueda = String.Format("%{0}%", Busqueda.Trim)
Dim FechaNacimiento As String = "-1"
If TxtFechaNacB.Text <> String.Empty AndAlso IsDate(TxtFechaNacB.Text) Then FechaNacimiento = TxtFechaNacB.Text.Trim
If Prosp.GetProspectosBusqueda(BusqPaterno.ToUpper(), BusqMaterno.ToUpper(), BusqNombres.ToUpper(), "-1", FechaNacimiento, -1, -1, -1, -1) Then
GvBusq.DataSource = Prosp.DtResultados
End If
Prosp.Dispose()
GvBusq.DataBind()
If GvBusq.HeaderRow IsNot Nothing Then GvBusq.HeaderRow.TableSection = TableRowSection.TableHeader : GeneraOrden(GvBusq.ID)
End Sub
Protected Sub LnkClave_Click(sender As Object, e As EventArgs)
Dim Gvr As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
TxtApellidoPaterno.Text = Gvr.DataKey("APaterno")
TxtApellidoMaterno.Text = Gvr.DataKey("AMaterno")
TxtNombres.Text = Gvr.DataKey("Nombres")
'TxtFechaNacimiento.Text = Gvr.DataKey("FechaNacimiento")
TxtCalle.Text = Gvr.DataKey("Calle")
TxtNumero.Text = Gvr.DataKey("NumExterior")
TxtNumeroInterior.Text = Gvr.DataKey("NumInterior")
TxtColonia.Text = Gvr.DataKey("Colonia")
TxtCodigoPostal.Text = Gvr.DataKey("CP")
DdlSexo.SelectedValue = If(Gvr.DataKey("Sexo") = "H", "1", "0")
TxtIFE.Text = Gvr.DataKey("Clave")
TxtSeccion.Text = Gvr.DataKey("Seccion")
TxtFechaNacimiento.Text = Gvr.DataKey("FechaNacimiento").ToDate.ToShortDateString
DdlMunicipios.SelectedIndex = DdlMunicipios.Items.IndexOf(DdlMunicipios.Items.FindByText(Gvr.DataKey("PadronMunicipio")))
Alert("Informacion Cargada", TipoMensaje.MsgInformacion)
Me.cpeDesc.Collapsed = True
Me.cpeDesc.ClientState = "true"
Dim tCveProspecto As Integer = Gvr.DataKey("CveProspecto").ToEntero
'CargaEncuesta()
'Bloqueo controles si lo encontré
TxtApellidoPaterno.Enabled = False : TxtApellidoMaterno.Enabled = False : TxtNombres.Enabled = False : TxtFechaNacimiento.Enabled = False
'TxtFechaNacimiento.Enabled = False
RFVApellidoPaterno.Enabled = False : RFVApellidoMaterno.Enabled = False
DdlSexo.Enabled = False
'detectar si hay una encuesta ya realizada del prospecto
If tCveProspecto > 0 Then
Dim Prosp As New ClsProspectos
If Prosp.GetProspectos(tCveProspecto, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
TxtCalle.Text = Prosp.Calle
TxtNumero.Text = Prosp.Numero
TxtNumeroInterior.Text = Prosp.NumeroInterior
TxtColonia.Text = Prosp.Colonia
TxtCodigoPostal.Text = Prosp.CodigoPostal.ToString()
DdlSexo.SelectedValue = If(Gvr.DataKey("Sexo") = "H", "1", "0")
TxtIFE.Text = Prosp.IFE
TxtCelular.Text = Prosp.Celular
TxtTelefono.Text = Prosp.Telefono
TxtCorreo.Text = Prosp.Correo
TxtEntreCalle1.Text = Prosp.EntreCalle1
TxtEntreCalle2.Text = Prosp.EntreCalle2
End If
Prosp.Dispose()
Dim ObjEncuesta As New ClsProspectos
If ObjEncuesta.GetEncuestasProspecto(-1, tCveProspecto, UsuarioActual.CveEmpresa) Then
If ObjEncuesta.DtResultados.Rows.Count > 0 Then
DdlEnDeteccion.SelectedValue = "1"
PnlReporta.Visible = False
Else
'se habilita la refencia de
DdlEnDeteccion.SelectedValue = "0"
PnlReporta.Visible = True
End If
End If
ObjEncuesta.Dispose()
Else
DdlEnDeteccion.SelectedValue = "0"
PnlReporta.Visible = True
End If
UpDatos.Update()
End Sub
<WebMethod()> <Script.Services.ScriptMethodAttribute()> _
Public Shared Function wsGetReporta(ByVal prefixText As String, ByVal count As Integer) As String()
'Dim dt As DataTable = CType(Session("DtCuentas"), DataTable)
'Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
'dt = Conta.getCuentasCheque(Prefijo)
'Conta.Dispose()
Dim items As New List(Of String)(count)
Dim Prosp As New ClsProspectos
Dim dt As DataTable = Nothing
If Prosp.GetProspectos(-1, prefixText.Trim, "-1", -1, -1, -1, -1, -1, -1, 41) Then
dt = Prosp.DtResultados
End If
Prosp.Dispose()
For i As Integer = 0 To count - 1
If dt.Rows.Count > i Then
items.Add(AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(dt.Rows(i)("NombreCompleto").ToString, dt.Rows(i)("CveProspecto").ToString))
Else
Exit For
End If
Next
Return items.ToArray()
End Function
Private Sub CargaEncuesta()
Dim ObjProsEncuestas As New ClsProspectos
If ObjProsEncuestas.GetPreguntas(CveEncuesta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
If ObjProsEncuestas.DtResultados.Rows.Count > 0 Then
LtlNumEncuestas.Text = "Hoy:&nbsp;" & ObjProsEncuestas.DtResultados.Rows(0)("NumEncuestasHoy").ToString.FormatoNumero(0) & "&nbsp;-&nbsp;Total:&nbsp;" & ObjProsEncuestas.DtResultados.Rows(0)("NumEncuestas").ToString.FormatoNumero(0)
Else
LtlNumEncuestas.Text = "Hoy:&nbsp;0&nbsp;-&nbsp;Total:&nbsp;0"
End If
GvPreguntas.DataSource = ObjProsEncuestas.DtResultados
DTProspectosPreguntas = ObjProsEncuestas.DtResultados
If ObjProsEncuestas.GetRespuestas(-1, CveEncuesta) Then
DTProspectosRespuestas = ObjProsEncuestas.DtResultados
End If
End If
ObjProsEncuestas.Dispose()
GvPreguntas.DataBind()
End Sub
Protected Sub GvPreguntas_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
Dim EsOpcion As Integer = e.Row.DBCampo("PreguntaTipo").ToEntero
Dim CvePregunta As Integer = e.Row.DBCampo("CvePregunta").ToEntero
Select Case EsOpcion
Case 0, 4 'Texto, Multiline
With e.Row.FCTextBox("TxtValor")
.Visible = True
If EsOpcion = 4 Then
.Rows = 3
.TextMode = TextBoxMode.MultiLine
End If
End With
Case 1, 2 'DropDownList, Radios
Dim dt As DataTable = DTProspectosRespuestas.FiltraParametros(String.Format("CvePregunta = {0} AND Estatus = 'Activo'", CvePregunta))
If EsOpcion = 1 Then
With e.Row.FCDropDownList("DdlRespuesta")
.Visible = True
.DataSource = dt
.DataBind()
.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End With
ElseIf EsOpcion = 2 Then
With e.Row.FCRadioButtonList("RbRespuesta")
.Visible = True
.DataSource = dt
.DataBind()
End With
e.Row.FCRequiredFieldValidator("RFVRbRespuesta").ErrorMessage = String.Format("ERROR: Falta contestar la pregunta: <b>{0}</b>", e.Row.DBCampo("Pregunta"))
End If
Case 3 'Fecha
With e.Row.FCTextBox("TxtValor")
.Visible = True
.Width = New Unit(80)
End With
e.Row.FCImageButton("ImgTxtValor").Visible = True
e.Row.FCMaskedEditExtender("MEETxtValor").Enabled = True
e.Row.FCCalendarExtender("CETxtValor").Enabled = True
End Select
End If
End Sub
Private Sub GeneraOrden(ByVal Tabla As String)
Dim StrSQL As New StringBuilder
StrSQL.Append(" $(document).ready(function () { ")
StrSQL.Append(" var oTable = $('#" & Tabla & "').dataTable({ ")
StrSQL.Append(" ""bPaginate"": false, ")
StrSQL.Append(" ""bLengthChange"": false, ")
StrSQL.Append(" ""bFilter"": false, ")
StrSQL.Append(" ""bSort"": true, ")
StrSQL.Append(" ""bInfo"": false, ")
StrSQL.Append(" ""bAutoWidth"": false, ")
StrSQL.Append(" ""aoColumns"": [ ")
StrSQL.Append(" null, ")
StrSQL.Append(" null, ")
StrSQL.Append(" null, ")
StrSQL.Append(" null, ")
StrSQL.Append(" null, ")
StrSQL.Append(" null, ")
StrSQL.Append(" null, ")
StrSQL.Append(" null, ")
StrSQL.Append(" null ")
'StrSQL.Append(" { ""sType"": ""numeric-comma"" }, ")
'StrSQL.Append(" { ""sType"": ""uk_date"" }, ")
'StrSQL.Append(" { ""sType"": ""uk_date"" }, ")
'StrSQL.Append(" null, ")
'StrSQL.Append(" null, ")
'StrSQL.Append(" null, ")
'StrSQL.Append(" { ""sType"": ""numeric-comma"" }, ")
'StrSQL.Append(" null, ")
'StrSQL.Append(" null, ")
'StrSQL.Append(" null ")
StrSQL.Append(" ] ")
StrSQL.Append(" }); ")
StrSQL.Append(" }); ")
RegistraScript(StrSQL.ToString)
End Sub
Protected Sub GvBusq_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvBusq.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveProspecto").ToEntero > 0 Then e.Row.CssClass = "tabla_seleccionado"
End If
End Sub
Protected Sub DdlEnDeteccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEnDeteccion.SelectedIndexChanged
If DdlEnDeteccion.SelectedValue = "1" Then
PnlReporta.Visible = False
HdnCveProspectoPadre.Value = "-1"
Else
PnlReporta.Visible = True
HdnCveProspectoPadre.Value = "-1"
End If
End Sub
End Class

View File

@@ -0,0 +1,195 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RedesIndicadores.aspx.vb" Inherits="Prospectos_RedesIndicadores" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
<table width="100%" cellpadding="0">
<tr>
<td>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline">
<ContentTemplate>
<asp:Chart ID="ChtVarios" runat="server" Height="250px" Width="330px" onclick="ChtVarios_Click" Palette="BrightPastel" BackColor="#F3DFC1" ImageType="Png" EnableViewState="true" BorderlineDashStyle="Solid" BackGradientStyle="TopBottom" BorderWidth="2" BorderColor="181, 64, 1">
<Legends>
<asp:Legend Alignment="Center" Docking="Bottom" Name="Legend1" Enabled="True" Font="Trebuchet MS, 6.75pt, style=Bold">
<CustomItems>
<asp:LegendItem Name="Legend Item" >
<Cells>
<asp:LegendCell CellType="Image" Image="/Imagenes/radio_button_checked.gif"
Name="Cell1">
<Margins Left="15" Right="15" />
</asp:LegendCell>
<asp:LegendCell Name="Cell2" Text="Clasificación">
<Margins Left="15" Right="15" />
</asp:LegendCell>
</Cells>
</asp:LegendItem>
<asp:LegendItem Name="Legend Item" >
<Cells>
<asp:LegendCell CellType="Image" Image="/Imagenes/radio_button_unchecked.gif"
Name="Cell1" ImageTransparentColor="Black">
<Margins Left="15" Right="15" />
</asp:LegendCell>
<asp:LegendCell Name="Cell2" Text="Edades">
<Margins Left="15" Right="15" />
</asp:LegendCell>
</Cells>
</asp:LegendItem>
<asp:LegendItem Name="Legend Item" >
<Cells>
<asp:LegendCell CellType="Image" Image="/Imagenes/radio_button_unchecked.gif"
Name="Cell1" ImageTransparentColor="Black">
<Margins Left="15" Right="15" />
</asp:LegendCell>
<asp:LegendCell Name="Cell2" Text="Zonas">
<Margins Left="15" Right="15" />
</asp:LegendCell>
</Cells>
</asp:LegendItem>
<asp:LegendItem Name="Legend Item" >
<Cells>
<asp:LegendCell CellType="Image" Image="/Imagenes/radio_button_unchecked.gif"
Name="Cell1" ImageTransparentColor="Black">
<Margins Left="15" Right="15" />
</asp:LegendCell>
<asp:LegendCell Name="Cell2" Text="Regiones">
<Margins Left="15" Right="15" />
</asp:LegendCell>
</Cells>
</asp:LegendItem>
<asp:LegendItem Name="Legend Item" >
<Cells>
<asp:LegendCell CellType="Image" Image="/Imagenes/radio_button_unchecked.gif"
Name="Cell1" ImageTransparentColor="Black">
<Margins Left="15" Right="15" />
</asp:LegendCell>
<asp:LegendCell Name="Cell2" Text="Municipios">
<Margins Left="15" Right="15" />
</asp:LegendCell>
</Cells>
</asp:LegendItem>
</CustomItems>
</asp:Legend>
<asp:Legend BackColor="Transparent" Font="Trebuchet MS, 7.00pt, style=Bold" IsTextAutoFit="False" Enabled="True" Name="Leyenda2"></asp:Legend>
</Legends>
<series>
<asp:Series BorderWidth="2" Name="Central" Label="#PERCENT{P2}" LegendText="#VALX" ShadowColor="Black" YValueType="Double" ChartType="Pie">
</asp:Series>
</series>
<BorderSkin SkinStyle="Emboss" />
<chartareas>
<asp:ChartArea Name="Default" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid" BackSecondaryColor="White" BackColor="OldLace" ShadowColor="Transparent" BackGradientStyle="TopBottom">
<AxisY IsStartedFromZero="false"></AxisY>
</asp:ChartArea>
</chartareas>
</asp:Chart>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td style="vertical-align: top;">
<br />
<asp:GridView ID="GvSup" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="Supervisor" HeaderText="Zona" />
<asp:BoundField DataField="Semana" DataFormatString="{0:N0}" HeaderText="Semana Actual" />
<asp:BoundField DataField="Mes" DataFormatString="{0:N0}" HeaderText="Mes Actual" />
<asp:BoundField DataField="Total" DataFormatString="{0:N0}" HeaderText="Total" />
</Columns>
<HeaderStyle CssClass="Titulos" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<RowStyle CssClass="Texto" />
</asp:GridView>
<asp:GridView ID="GvTop" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="Agrupador" />
<asp:BoundField DataField="Hijos" />
</Columns>
<HeaderStyle CssClass="Titulos" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
</asp:GridView>
</td>
<td>
<table style="width:100%" cellspacing="0">
<tr>
<td rowspan="3"><div id="gauge" style="display:inline-block; width: 200px; height:160px;"></div></td>
<td><div id="gauge1" style="display:inline-block; width: 100px; height:80px;"></div></td>
</tr>
<tr>
<td><div id="gauge2" style="display:inline-block; width: 100px; height:80px;"></div></td>
</tr>
<tr>
<td><div id="gauge3" style="display:inline-block; width: 100px; height:80px;"></div></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3" style="text-align:center;">
<asp:CHART id="ChtAvances" runat="server" ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)" Width="900px" Height="350px" Palette="BrightPastel" BackColor="#F3DFC1" ImageType="Png" BorderlineDashStyle="Solid" BackGradientStyle="TopBottom" BorderWidth="2" BorderColor="181, 64, 1">
<titles>
<asp:Title ShadowColor="32, 0, 0, 0" Font="Trebuchet MS, 14.25pt, style=Bold" ShadowOffset="3" Text="Registros Mensuales de Redes" Name="Title1" ForeColor="26, 59, 105"></asp:Title>
</titles>
<legends>
<asp:Legend Enabled="True" IsTextAutoFit="False" Name="Default" Docking="Bottom" BackColor="Transparent" Font="Trebuchet MS, 8.25pt, style=Bold"></asp:Legend>
</legends>
<borderskin SkinStyle="Emboss"></borderskin>
<series>
<asp:Series MarkerSize="4" BorderWidth="3" Name="Series1" ChartType="Line" LegendText="Mensual" MarkerStyle="Circle" ShadowColor="Black" BorderColor="180, 26, 59, 105" Color="220, 65, 140, 240" ShadowOffset="2" YValueType="Double"></asp:Series>
<asp:Series MarkerSize="5" BorderWidth="1" Name="Series2" ChartType="Line" LegendText="Acumulada" MarkerStyle="Diamond" ShadowColor="Black" BorderColor="180, 26, 59, 105" Color="220, 224, 64, 10" ShadowOffset="2" YValueType="Double"></asp:Series>
</series>
<chartareas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid" BackSecondaryColor="White" BackColor="OldLace" ShadowColor="Transparent" BackGradientStyle="TopBottom">
<area3dstyle Rotation="25" Perspective="9" LightStyle="Realistic" Inclination="40" IsRightAngleAxes="False" WallWidth="3" IsClustered="False" />
<axisy LineColor="64, 64, 64, 64">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</axisy>
<axisx LineColor="64, 64, 64, 64">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</axisx>
</asp:ChartArea>
</chartareas>
</asp:CHART>
</td>
</tr>
<tr>
<td colspan="3" style="text-align:center;">
<asp:CHART id="ChtBarras" runat="server" Palette="BrightPastel" BackColor="#F3DFC1" Width="900px" Height="350px" BorderlineDashStyle="Solid" BackGradientStyle="TopBottom" BorderWidth="2" BorderColor="181, 64, 1">
<titles>
<asp:Title ShadowColor="32, 0, 0, 0" Font="Trebuchet MS, 14.25pt, style=Bold" ShadowOffset="3" Text="Metas" Name="Title1" ForeColor="26, 59, 105"></asp:Title>
<asp:Title ShadowColor="32, 0, 0, 0" Font="Trebuchet MS, 7.25pt, style=Bold" ShadowOffset="3" Text="Metas" Name="Title2" ForeColor="26, 59, 105"></asp:Title>
</titles>
<legends>
<asp:Legend TitleFont="Microsoft Sans Serif, 8pt, style=Bold" Docking="Bottom" BackColor="Transparent" Font="Trebuchet MS, 8.25pt, style=Bold" IsTextAutoFit="False" Enabled="True" Name="Default"></asp:Legend>
</legends>
<borderskin SkinStyle="Emboss"></borderskin>
<series>
<asp:Series Name="Series1" LegendText="Meta" BorderColor="180, 26, 59, 105">
</asp:Series>
<asp:Series Name="Series2" LegendText="Actual" BorderColor="180, 26, 59, 105">
</asp:Series>
</series>
<chartareas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BackSecondaryColor="White" BackColor="OldLace" ShadowColor="Transparent" BackGradientStyle="TopBottom">
<area3dstyle Rotation="10" Perspective="10" Inclination="15" IsRightAngleAxes="False" WallWidth="0" IsClustered="False" />
<axisy LineColor="64, 64, 64, 64" LabelAutoFitMaxFontSize="8">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</axisy>
<axisx LineColor="64, 64, 64, 64" LabelAutoFitMaxFontSize="8">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" IsEndLabelVisible="False" />
<MajorGrid LineColor="64, 64, 64, 64" />
</axisx>
</asp:ChartArea>
</chartareas>
</asp:CHART>
</td>
</tr>
</table>
<br/>
</asp:Content>

View File

@@ -0,0 +1,336 @@

Imports System.Data
Imports System.Drawing
Imports Extensiones
Imports System.Web.UI.DataVisualization.Charting
Partial Class Prospectos_RedesIndicadores
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDatos()
End If
End Sub
Private Sub CargaDatos()
Dim Ind As New ClsProspectos
'INDICADOR BARRAS
If Ind.GetProspectosRedesIndicadores(-1, -1, -1, -1, -1, -1, -1, -1, 2, UsuarioActual.CveEmpresa) Then
Dim yValues As New ArrayList
Dim xValues As New ArrayList
Dim MetaValues As New ArrayList
For Each dr As DataRow In Ind.DtResultados.Rows
yValues.Add(dr("Total"))
xValues.Add(dr("Coordinador"))
MetaValues.Add(dr("Meta"))
Next
ChtBarras.ChartAreas("ChartArea1").Area3DStyle.Enable3D = True
ChtBarras.Titles(1).Text = String.Format("{0} de {1} ({2}%)", Ind.DtResultados.SUM("Total"), Ind.DtResultados.SUM("Meta"), (Ind.DtResultados.SUM("Total") / Ind.DtResultados.SUM("Meta") * 100).FormatoNumero)
ChtBarras.Series("Series1")("DrawingStyle") = "Cylinder"
ChtBarras.Series("Series2")("DrawingStyle") = "Cylinder"
ChtBarras.Series("Series1").Points.DataBindXY(xValues, MetaValues)
ChtBarras.Series("Series2").Points.DataBindXY(xValues, yValues)
End If
GraficaVarios()
Ind.Dispose()
CargaAvances()
End Sub
Private Sub GraficaVarios()
Me.ChtVarios.ViewStateContent = SerializationContents.All
Me.ChtVarios.EnableViewState = True
Me.ChtVarios.Legends(0).CustomItems(0).Cells(0).PostBackValue = "LegendClick/0"
Me.ChtVarios.Legends(0).CustomItems(1).Cells(0).PostBackValue = "LegendClick/1"
Me.ChtVarios.Legends(0).CustomItems(2).Cells(0).PostBackValue = "LegendClick/2"
Me.ChtVarios.Legends(0).CustomItems(3).Cells(0).PostBackValue = "LegendClick/3"
Me.ChtVarios.Legends(0).CustomItems(4).Cells(0).PostBackValue = "LegendClick/4"
' Initialize chart settings
Dim series As System.Web.UI.DataVisualization.Charting.Series = ChtVarios.Series(0)
' Fill data
CargaPie(series, 1)
series.Legend = "Leyenda2"
' Set axis marks to be on bottom
Me.ChtVarios.ChartAreas(0).AxisX.IsMarksNextToAxis = False
' Show end labels for Y axis
Me.ChtVarios.ChartAreas(0).AxisY.LabelStyle.IsEndLabelVisible = True
' Set initial properties for border and shadows
series.BorderWidth = 1
series.ShadowOffset = 1
series.ShadowColor = Color.FromArgb(240, 64, 64, 64)
End Sub
Protected Sub ChtVarios_Click(sender As Object, e As ImageMapEventArgs)
' If user clicks on the map area attribute that corresponds to a legend item
If e.PostBackValue.StartsWith("LegendClick") Then
Dim args As String = e.PostBackValue.Split("/"c)(1)
' Identify which legend item was clicked
Dim index As Integer = Integer.Parse(args)
' Legend item result
Dim legendItem As LegendItem = Me.ChtVarios.Legends(0).CustomItems(index)
' Resets all radio button images to be unchecked
For Each item As LegendItem In Me.ChtVarios.Legends(0).CustomItems
item.Cells(0).ImageTransparentColor = Color.Black
item.Cells(0).Image = "/Imagenes/radio_button_unchecked.gif"
Next
Dim Opcion As Integer = 1
Select Case index
Case 0 : Opcion = 1
Case 1 : Opcion = 9 'Edades
Case 2 : Opcion = 4 'Supervisor
Case 3 : Opcion = 5 'Coordinador
Case 4 : Opcion = 3 'Municipio
End Select
CargaPie(ChtVarios.Series(0), Opcion)
Select Case legendItem.Cells(1).Text
End Select
'Me.ChtVarios.Series(0).ChartType = DirectCast([Enum].Parse(GetType(SeriesChartType), legendItem.Cells(1).Text, True), SeriesChartType)
Me.ChtVarios.Series(0).BorderWidth = If(Me.ChtVarios.Series(0).ChartType = SeriesChartType.Line, 3, 1)
legendItem.Cells(0).Image = "/Imagenes/radio_button_checked.gif"
legendItem.Cells(0).ImageTransparentColor = Color.Green
End If
End Sub
Private Sub CargaPie(series As System.Web.UI.DataVisualization.Charting.Series, Opcion As Integer)
Dim Ind As New ClsProspectos
If Ind.GetProspectosAgrupados2(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, Opcion, UsuarioActual.CveEmpresa) Then
Dim yValues As New ArrayList
Dim xValues As New ArrayList
series("PieDrawingStyle") = "Concave"
'cuando es por edades, ordena por la claverango
Dim dt As DataTable = Ind.DtResultados.FiltraParametros("CveAgrupador > 0", If(Opcion = 9, "CveRangoEdad", "Total Desc"))
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
Dim Total As Double = dt.SUM("Total")
'Dim pp As DataPoint
'Dim i As Integer = 0
'For Each dr As DataRow In dt.Rows
' pp = New DataPoint(dr("Total").ToString.ToDouble, dr("Total").ToString)
' 'series.Points.AddXY("-", POL) : .Series(0).Points(ii).AxisLabel = "POL" : .Series(0).Points(ii).Label = POL.ToString
' series.Points.Add(pp)
' series.Points(i).Label = "a"
' i += 1
' 'yValues.Add(dr("Total"))
' ''xValues.Add(dr("ProspectoClasificacionpie
' 'xValues.Add(String.Format("{0} ({1}%)", dr("Agrupador"), (dr("Total").ToString.ToDouble / Total * 100).FormatoNumero))
'Next
For Each dr As DataRow In dt.Rows
yValues.Add(dr("Total"))
'xValues.Add(dr("ProspectoClasificacion"))
xValues.Add(String.Format("{0} ({2} - {1}%)", dr("Agrupador"), (dr("Total").ToString.ToDouble / Total * 100).FormatoNumero, dr("Total")))
Next
series.Points.DataBindXY(xValues, yValues)
End If
End If
'If Ind.GetProspectosTopTen(UsuarioActual.CveEmpresa) Then
' GvTop.DataSource = Ind.DtResultados
' GvTop.DataBind()
'End If
Ind.Dispose()
End Sub
Private Sub CargaAvances()
Dim FechaInicio As Date = DateTime.Parse("2014/03/01")
Dim FechaFin As Date = DateTime.Parse("2015/03/31")
Dim Marcador As Integer = 1
Dim Marcador1 As Integer = 1
Dim Marcador2 As Integer = 1
Dim Marcador3 As Integer = 1
Dim TotalDias As Integer = (FechaFin - FechaInicio).Days
Dim DiasTranscurridos As Integer = (DateTime.Now - FechaInicio).Days
Dim Str As New StringBuilder
Dim Total As Integer = 20000
Dim Total1 As Integer
Dim Total2 As Integer
Dim Total3 As Integer
Dim Acum1 As Integer
Dim Acum2 As Integer
Dim Acum3 As Integer
Dim Ind As New ClsProspectos
Dim Acum As Double = 0 ' Ind.DtResultados.SUM("Total").ToDouble
If Ind.GetProspectosAgrupados2(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, UsuarioActual.CveEmpresa) Then
Dim yValues As New ArrayList
Dim xValues As New ArrayList
Dim yyValues As New ArrayList
' ChtAvances.ChartAreas("ChartArea1").AxisX.IsMarginVisible = False
Dim Fechas = From s In Ind.DtResultados.AsEnumerable Where s!MesAnioIng <> "-1" Select Fecha = ("01/" & s!MesAnioIng).ToString.ToDate, Tot = s!Total.ToString.ToDouble Order By Fecha
'xValues.Add(" - ")
'yValues.Add(0)
'yyValues.Add(0)
For Each dr In Fechas.ToList
'ChtAvances.Series("Series1").Points.AddY(dr.Tot)
yValues.Add(dr.Tot)
xValues.Add(dr.Fecha.ToString("MMM yyyy"))
yyValues.Add(dr.Tot + Acum)
Acum += dr.Tot
Next
ChtAvances.Series(0).Points.DataBindXY(xValues, yValues)
ChtAvances.Series(1).Points.DataBindXY(xValues, yyValues)
End If
Dim DtZonas As DataTable
If Ind.GetProspectosSupervisor(UsuarioActual.CveEmpresa) Then
GvSup.DataSource = Ind.DtResultados
GvSup.DataBind()
DtZonas = Ind.DtResultados
Acum1 = DtZonas.SUM("Total", "CveSupervisor=3").ToEntero
Acum2 = DtZonas.SUM("Total", "CveSupervisor=4").ToEntero
Acum3 = DtZonas.SUM("Total", "CveSupervisor=5").ToEntero
Acum = Acum1 + Acum2 + Acum3
End If
Ind.Dispose()
'carga la grafica de avances
Dim dtt As DataTable = GlobalDTProspectosCoordinadores(-1, UsuarioActual.CveEmpresa)
Total1 = dtt.SUM("Meta", "CveSupervisor=3").ToEntero
Total2 = dtt.SUM("Meta", "CveSupervisor=4").ToEntero
Total3 = dtt.SUM("Meta", "CveSupervisor=5").ToEntero
Total = Total1 + Total2 + Total3
Marcador = ((Acum / DiasTranscurridos) / (Total / TotalDias) * 100).ToEntero
Marcador1 = ((Acum1 / DiasTranscurridos) / (Total1 / TotalDias) * 100).ToEntero
Marcador2 = ((Acum2 / DiasTranscurridos) / (Total2 / TotalDias) * 100).ToEntero
Marcador3 = ((Acum3 / DiasTranscurridos) / (Total3 / TotalDias) * 100).ToEntero
Str.Append(" var g = new JustGage({ ")
Str.Append(" id: ""gauge"", ")
Str.AppendFormat(" value: {0}, ", Marcador)
Str.Append(" min: 0, ")
Str.Append(" max: 200, ")
Str.Append(" title: ""Avance Gral"", ")
Str.Append(" label: ""%"", levelColors: new Array('#FF0000','#FFFF00','#00FF00') ")
Str.Append(" }); ")
Str.Append(" var g = new JustGage({ ")
Str.Append(" id: ""gauge1"", ")
Str.AppendFormat(" value: {0}, ", Marcador1)
Str.Append(" min: 0, ")
Str.Append(" max: 200, ")
Str.Append(" title: ""Norte"", ")
Str.Append(" label: ""%"", levelColors: new Array('#FF0000','#FFFF00','#00FF00') ")
Str.Append(" }); ")
Str.Append(" var g = new JustGage({ ")
Str.Append(" id: ""gauge2"", ")
Str.AppendFormat(" value: {0}, ", Marcador2)
Str.Append(" min: 0, ")
Str.Append(" max: 200, ")
Str.Append(" title: ""Centro"", ")
Str.Append(" label: ""%"", levelColors: new Array('#FF0000','#FFFF00','#00FF00') ")
Str.Append(" }); ")
Str.Append(" var g = new JustGage({ ")
Str.Append(" id: ""gauge3"", ")
Str.AppendFormat(" value: {0}, ", Marcador3)
Str.Append(" min: 0, ")
Str.Append(" max: 200, ")
Str.Append(" title: ""Sur"", ")
Str.Append(" label: ""%"", levelColors: new Array('#FF0000','#FFFF00','#00FF00') ")
Str.Append(" }); ")
RegistraScript(Str.ToString)
End Sub
Protected Sub Gv_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvTop.RowDataBound
If 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(80)
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
If e.Row.DBCampo("CveSupervisor").ToEntero > 0 AndAlso e.Row.DBCampo("CveCoordinador").ToEntero = 0 Then
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("NombreCompleto") = "" Then
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
e.Row.CssClass = "SubTotales"
e.Row.Height = 20
End If
End If
End If
End Sub
Protected Sub GvSup_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvSup.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(100)
e.Row.Cells(1).Width = Unit.Pixel(70)
e.Row.Cells(2).Width = Unit.Pixel(70)
e.Row.Cells(3).Width = Unit.Pixel(70)
e.Row.CssClass = "Totales"
e.Row.HorizontalAlign = HorizontalAlign.Center
End If
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
If e.Row.Cells(1).Text = "0" Then e.Row.Cells(1).Text = ""
If e.Row.Cells(2).Text = "0" Then e.Row.Cells(2).Text = ""
If e.Row.Cells(3).Text = "0" Then e.Row.Cells(3).Text = ""
End If
End Sub
End Class

View File

@@ -0,0 +1,196 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepAgendasBitacoras.aspx.vb" Inherits="Prospectos_RepAgendasBitacoras" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte Agendas y Bitácoras
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline">
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vendedor:
<asp:DropDownList ID="ddlVendedor" runat="server" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;" DataTextField="Vendedor" DataValueField="CveVendedor"></asp:DropDownList>
</li>
<li>Fecha Inicio:
<asp:TextBox ID="TxtFechaI" runat="server" CausesValidation="true" MaxLength="10" ValidationGroup="GrpConsultar" Width="70px" ClientIDMode="Static"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaI" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaI" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
</li>
<li>Fecha Fin:
<asp:TextBox ID="TxtFechaF" runat="server" CausesValidation="true" MaxLength="10" ValidationGroup="GrpConsultar" Width="70px" ClientIDMode="Static"></asp:TextBox>
&nbsp;<asp:ImageButton runat="server" ID="ImgFechaF" ImageUrl="/Imagenes/calendar.png" ImageAlign="AbsMiddle" Width="16px" Height="16px" AlternateText="Click para ver el Calendario" />
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
</li>
<li>Tipo de Agenda:
<asp:DropDownList ID="ddlAgenda" runat="server" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;" DataTextField="AgendaTipo" DataValueField="CveAgendaTipo"></asp:DropDownList>
</li>
</ul>
</div>
<div class="tools">
<asp:Button ID="btnconsultar" runat="server" Text="Consultar" class="btn btn-primary" ValidationGroup="GrpGuardar" />
<a href="javascript:;" class="expand"></a>
<a onclick="document.getElementById('C_BtnConsultar').click();" class="reload"></a>
</div>
</div>
<div class="portlet-body" style="display: none;">
<ul class="list-inline">
<li>&nbsp;Tipo de Evento:
<asp:DropDownList ID="ddlTipoEvento" runat="server" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;" DataTextField="ddlTipoEvento" DataValueField="CveAgendaTipo"></asp:DropDownList>
</li>
<li>Estatus:
<asp:DropDownList ID="ddlAgendaEstatus" runat="server" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;" DataTextField="EventoEstatus" DataValueField="CveEventoEstatus"></asp:DropDownList>
</li>
</ul>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPPInventario" runat="server" RenderMode="Inline" UpdateMode="Conditional" ViewStateMode="Inherit">
<ContentTemplate>
<asp:GridView ID="GvProspectos" Width="970px" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False"
ShowHeaderWhenEmpty="True" CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Fecha Ingreso">
<HeaderTemplate>
<asp:LinkButton ID="LbFechaIng" runat="server" CausesValidation="false" Text="" OnClick="LbOrden_Click" CommandArgument="FechaIng">
Fecha Ingreso
<asp:Literal ID="ImgFechaIng" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lbFI" runat="server"
Text='<%# Eval("FechaIng", "{0:d}")%>'>
</asp:Label>
</ItemTemplate>
<HeaderStyle CssClass="Titulos" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Fecha Agenda">
<HeaderTemplate>
<asp:LinkButton ID="LbFechaInicio" runat="server" CausesValidation="false" Text="" OnClick="LbOrden_Click" CommandArgument="FechaInicio">
Fecha Agenda
<asp:Literal ID="ImgFechaInicio" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lbFechaInicio" runat="server"
Text='<%# Eval("FechaInicio","{0:dd/MM/yyyy hh:mm tt}")%>'>
</asp:Label>
</ItemTemplate>
<HeaderStyle CssClass="Titulos" />
<ItemStyle Width="135px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Agenda Tipo">
<HeaderTemplate>
<asp:LinkButton ID="LbAgendaTipo" runat="server" CausesValidation="false" Text="" OnClick="LbOrden_Click" CommandArgument="FechaInicio">
Agenda Tipo
<asp:Literal ID="ImgFechaInicio" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lbAgendaTipo" runat="server"
Text='<%# Eval("AgendaTipo")%>'>
</asp:Label>
</ItemTemplate>
<ItemStyle Width="65px" HorizontalAlign="Left" />
<HeaderStyle CssClass="Titulos" />
</asp:TemplateField>
<asp:TemplateField ControlStyle-Width="320px" HeaderText="Descripción">
<HeaderTemplate>
<asp:LinkButton ID="Lbdescripcion" runat="server" CausesValidation="false" Text="" OnClick="LbOrden_Click" CommandArgument="descripcion">
Descripción
<asp:Literal ID="Imgdescripcion" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lbdescripcion" runat="server"
Text='<%# Eval("descripcion")%>'>
</asp:Label>
</ItemTemplate>
<ItemStyle Width="380px" HorizontalAlign="Left" />
<HeaderStyle CssClass="Titulos" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre Completo" Visible="False">
<ItemTemplate>
<asp:HyperLink runat="server" Target="_blank"
NavigateUrl='<%# String.Format("~/Prospectos/ProspectosSIP.aspx?CveProspecto={0}", HttpUtility.UrlEncode(Eval("CveProspecto").ToString()))%>'
Text='<%# Eval("NombreCompleto")%>'
CssClass="Texto" />
</ItemTemplate>
<HeaderStyle CssClass="Titulos" />
<ItemStyle HorizontalAlign="Left" />
<HeaderTemplate>
<asp:LinkButton
ID="LbNombreCompleto" runat="server"
CausesValidation="false" Text=""
OnClick="LbOrden_Click" CommandArgument="NombreCompleto">
Nombre Completo
<asp:Literal ID="ImgNombreCompleto" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</HeaderTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Empresa">
<ItemTemplate>
<asp:HyperLink runat="server" Target="_blank"
NavigateUrl='<%# String.Format("~/Prospectos/ProspectosSIP.aspx?CveProspecto={0}", HttpUtility.UrlEncode(Eval("CveProspecto").ToString()))%>'
Text='<%# Eval("EmpresaNombre")%>'
CssClass="Texto" />
</ItemTemplate>
<HeaderStyle CssClass="Titulos" />
<ItemStyle HorizontalAlign="Left" />
<HeaderTemplate>
<asp:LinkButton
ID="LbEmpresaNombre" runat="server"
CausesValidation="false" Text=""
OnClick="LbOrden_Click" CommandArgument="EmpresaNombre">
Empresa
<asp:Literal ID="ImgEmpresaNombre" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</HeaderTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Usuario">
<HeaderTemplate>
<asp:LinkButton ID="LbNombre" runat="server" CausesValidation="false" Text="" OnClick="LbOrden_Click" CommandArgument="Nombre">
Usuario
<asp:Literal ID="ImgNombre" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>
</asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lbNombre" runat="server"
Text='<%# Eval("Nombre")%>'>
</asp:Label>
</ItemTemplate>
<ItemStyle Width="90px" HorizontalAlign="Left" />
<HeaderStyle CssClass="Titulos" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
</asp:GridView>
<br />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnConsultar" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,96 @@
Imports System.Data
Imports Extensiones
Partial Class Prospectos_RepAgendasBitacoras
Inherits ClsPaginas
Private Property DtDatos As DataTable
Get
Return CType(ViewState("DtDatos"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtDatos") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
InicializarListas()
End If
End Sub
Private Sub InicializarListas()
ddlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
ddlVendedor.DataBind()
If UsuarioActual.CveRol = 1015 Then
ddlVendedor.Enabled = False
ddlVendedor.SelectedValue = UsuarioActual.CveVendedor.ToString
End If
Dim eventos As New ClsOIEventos
If eventos.GetAgendaTipo() Then
ddlAgenda.DataSource = eventos.DtResultados()
ddlAgenda.DataBind()
End If
eventos.Dispose()
ddlAgenda.Items.Insert(0, New ListItem("Todos", "-1"))
ddlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
TxtFechaI.Text = Now.AddDays(-1).ToShortDateString
TxtFechaF.Text = Now.ToShortDateString
ddlTipoEvento.Items.Insert(0, New ListItem("Todos", "-1"))
ddlTipoEvento.Items.Insert(1, New ListItem("Agenda", "2"))
ddlTipoEvento.Items.Insert(2, New ListItem("Bitácora", "6"))
ddlAgendaEstatus.DataSource = GlobalDTOIEstatusEventos
ddlAgendaEstatus.DataBind()
ddlAgendaEstatus.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Protected Sub btnconsultar_Click(sender As Object, e As EventArgs) Handles btnconsultar.Click
Dim rep As New ClsProspectos
If rep.RepAgendasBitacoras(UsuarioActual.CveEmpresa, TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, ddlVendedor.SelectedValue.ToEntero, ddlAgenda.SelectedValue.ToEntero, ddlTipoEvento.SelectedValue.ToEntero, ddlAgendaEstatus.SelectedValue.ToEntero) Then
gvProspectos.DataSource = rep.DtResultados
DtDatos = rep.DtResultados
End If
rep.Dispose()
gvProspectos.DataBind()
End Sub
#Region "O R D E N A M I E N T O"
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Orden As String = ""
Dim Campo As String = ""
Dim Literal As Literal = Nothing
Const OrdenInicial As String = ""
Dim Arg(2) As String
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
Campo = Arg(0)
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
ViewState("Orden") = Orden
CargaGrid(Orden)
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(DtDatos, "", Orden, DataViewRowState.CurrentRows)
gvProspectos.DataSource = DV.ToTable()
DV.Dispose()
Else
gvProspectos.DataSource = DtDatos
End If
GvProspectos.DataBind()
End Sub
#End Region
End Class

View File

@@ -0,0 +1,206 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEncuestas.aspx.vb" Inherits="Prospectos_RepRedesEstructuras" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" Runat="Server">
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />&nbsp;&nbsp;
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" Runat="Server">
Reporte de Encuestas
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
<script type="text/javascript">
var SelectedRow = null;
var SelectedRowIndex = null;
var UpperBound = null;
var LowerBound = null;
window.onload = function () {
UpperBound = parseInt('<%= GvDatos.Rows.Count%>') - 1;
LowerBound = 0;
SelectedRowIndex = -1;
}
function SelectRow(CurrentRow, RowIndex) {
if (SelectedRow == CurrentRow || RowIndex > UpperBound || RowIndex < LowerBound)
return;
if (SelectedRow != null) {
SelectedRow.style.backgroundColor = SelectedRow.originalBackgroundColor;
SelectedRow.style.color = SelectedRow.originalForeColor;
}
if (CurrentRow != null) {
CurrentRow.originalBackgroundColor = CurrentRow.style.backgroundColor;
CurrentRow.originalForeColor = CurrentRow.style.color;
CurrentRow.style.backgroundColor = '#65b0bf';
CurrentRow.style.color = 'Black';
}
SelectedRow = CurrentRow;
SelectedRowIndex = RowIndex;
setTimeout("SelectedRow.focus();", 0);
}
function SelectSibling(e) {
var e = e ? e : window.event;
var KeyCode = e.which ? e.which : e.keyCode;
if (KeyCode == 40) {
SelectRow(SelectedRow.nextSibling, SelectedRowIndex + 1);
}
else if (KeyCode == 38) {
SelectRow(SelectedRow.previousSibling, SelectedRowIndex - 1);
}
return false;
}
function EC() {
event.cancelBubble = true;
if (event.stopPropagation)
event.stopPropagation();
}
</script>
<%--<script language="javascript" type="text/javascript">
var gridViewCtlId = '<%=GvDatos.ClientID%>';
var gridViewCtl = null;
var curSelRow = null;
function getGridViewControl() {
if (null == gridViewCtl) {
gridViewCtl = document.getElementById(gridViewCtlId);
}
}
function onGridViewRowSelected(rowIdx) {
var selRow = getSelectedRow(rowIdx);
if (curSelRow != null) {
curSelRow.style.backgroundColor = '#ffffff';
}
if (null != selRow) {
curSelRow = selRow;
curSelRow.style.backgroundColor = '#ff0022';
}
}
function getSelectedRow(rowIdx) {
getGridViewControl();
if (null != gridViewCtl) {
return gridViewCtl.rows[rowIdx];
}
return null;
}
</script> --%>
<%--<script language="javascript" type="text/javascript">
var originalstyle = "";
</script>--%>
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr align="left" class="SubTotales">
<td style="width: 100px;">Municipio</td>
<td style="width: 100px;">
<asp:DropDownList ID="DdlMunicipio" runat="server" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="HUATABAMPO"></asp:ListItem>
<asp:ListItem Text="NAVOJOA"></asp:ListItem>
<asp:ListItem Text="HERMOSILLO"></asp:ListItem>
<asp:ListItem Text="EMPALME"></asp:ListItem>
<asp:ListItem Text="NOGALES"></asp:ListItem>
<asp:ListItem Text="CAJEME"></asp:ListItem>
<asp:ListItem Text="SAN LUIS RIO COLORADO"></asp:ListItem>
<asp:ListItem Text="GUAYMAS"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="width: 100px;">Sección</td>
<td style="width: 100px;">
<asp:DropDownList ID="DdlSeccion" runat="server" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="width: 100px;">Sexo</td>
<td style="width: 100px;">
<asp:DropDownList ID="DdlSexo" runat="server" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Hombre" Value="1"></asp:ListItem>
<asp:ListItem Text="Mujer" Value="2"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="width: 50px;">IFE</td>
<td style="width: 60px;">
<asp:DropDownList ID="DdlIFE" runat="server" Width="60px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Con IFE" Value="1"></asp:ListItem>
<asp:ListItem Text="Sin IFE" Value="2"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="width: 100px;">Agrupador</td>
<td style="width: 100px;">
<asp:DropDownList ID="DdlAgrupador" runat="server" AppendDataBoundItems="true" Width="100px">
<asp:ListItem Text="Municipio" Value="1"></asp:ListItem>
<asp:ListItem Text="Sección Electoral" Value="2"></asp:ListItem>
<asp:ListItem Text="Sexo" Value="3"></asp:ListItem>
<asp:ListItem Text="Rango de Edad" Value="4"></asp:ListItem>
</asp:DropDownList>
</td>
<td align="left" style="border-left-style: solid; border-left-color: Blue; border-left-width: 1px;"><asp:Button ID="BtnConsultar" runat="server" Text="Consultar" /></td>
</tr>
<tr class="SubTotales"><td>Encuesta:</td><td colspan="10">
<asp:DropDownList ID="DdlEncuesta" runat="server" DataTextField="Encuesta" DataValueField="CveEncuesta" Width="500px" AutoPostBack="True"></asp:DropDownList>
</td></tr>
<tr class="SubTotales"><td>Pregunta:</td>
<td colspan="10"><asp:DropDownList ID="DdlPreguntas" runat="server" DataTextField="Pregunta" DataValueField="CvePregunta" Width="500px" AutoPostBack="True"></asp:DropDownList>
</td>
</tr>
<tr class="SubTotales"><td>Respuesta:</td>
<td colspan="9"><asp:DropDownList ID="DdlRespuestas" DataTextField="Respuesta" DataValueField="CveRespuesta" runat="server" Width="500px"></asp:DropDownList>
</td>
<td>
<asp:HyperLink ID="LigaTabla" runat="server" CssClass="Texto" NavigateUrl="/Prospectos/RepEncuestasDetalleTabla.aspx">Listado Masivo</asp:HyperLink></td>
</tr>
<tr><td colspan="11"><hr/></td></tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<br/>
<%--1640--%>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" ShowHeader="True">
<Columns>
<asp:TemplateField ItemStyle-Width="200px" HeaderText="Agrupador">
<ItemTemplate>
<asp:Literal ID="LtlGpo" runat="server" Text='<%# Eval("Agrupador")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="120px" HeaderText="">
<ItemTemplate>
<asp:Literal ID="LtlRes" runat="server" Text='<%# Eval("Respuesta")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="50px" HeaderText="Total">
<ItemTemplate>
<asp:Hyperlink ID="LtlCantidad" CssClass="Texto" runat="server" Text='<%# Eval("Total", "{0:N0}")%>'></asp:Hyperlink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="50px" HeaderText="%">
<ItemTemplate>
<asp:Literal ID="LtlPor" runat="server" Text='<%# Eval("Porcentaje", "{0:N2}%")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField />--%>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

View File

@@ -0,0 +1,152 @@

Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Prospectos_RepRedesEstructuras
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = String.Empty
DdlEncuesta.DataSource = GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa)
DdlEncuesta.DataBind()
DdlPreguntas.DataSource = GlobalDTProspectosEncuestasPreguntas(DdlEncuesta.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
DdlPreguntas.DataBind()
DdlRespuestas.DataSource = GlobalDTProspectosEncuestasRespuestas(DdlPreguntas.SelectedValue.ToEntero, DdlEncuesta.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
DdlRespuestas.DataBind()
DdlRespuestas.Items.Insert(0, New ListItem("Todas", "-1"))
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetRepEncuestas(DdlMunicipio.SelectedValue.ToEntero, DdlSeccion.SelectedValue.ToEntero, DdlSexo.SelectedValue.ToEntero, DdlIFE.SelectedValue.ToEntero, DdlEncuesta.SelectedValue.ToEntero, DdlPreguntas.SelectedValue.ToEntero, DdlRespuestas.SelectedValue.ToEntero, DdlAgrupador.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
ViewState("DTProspectos") = ObjProspectos.DtResultados
'LtlAgrupador.Text = DdlAgrupador.SelectedItem.Text
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("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_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowCreated
If (e.Row.RowType = DataControlRowType.DataRow AndAlso (e.Row.RowState = DataControlRowState.Normal OrElse e.Row.RowState = DataControlRowState.Alternate)) Then
e.Row.TabIndex = -1
e.Row.Attributes("onclick") = String.Format("javascript:SelectRow(this, {0});", e.Row.RowIndex)
e.Row.Attributes("onkeydown") = "javascript:return SelectSibling(event);"
e.Row.Attributes("onselectstart") = "javascript:return false;"
' e.Row.Cells(10).Attributes.Add("onclick", "EC();")
End If
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 = "SubTotales2"
e.Row.FCLiteral("LtlGpo").Text = "Total General"
e.Row.FCLiteral("LtlPor").Text = ""
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
'ElseIf e.Row.RowIndex = 1 Then
' e.Row.Cells(0).Width = Unit.Pixel(120)
' e.Row.Cells(1).Width = Unit.Pixel(60)
' e.Row.Cells(2).Width = Unit.Pixel(60)
' e.Row.Cells(3).Width = Unit.Pixel(60)
' e.Row.Cells(4).Width = Unit.Pixel(70)
' e.Row.Cells(5).Width = Unit.Pixel(60)
' e.Row.Cells(6).Width = Unit.Pixel(60)
' e.Row.Cells(7).Width = Unit.Pixel(70)
' e.Row.Cells(8).Width = Unit.Pixel(100)
' e.Row.Cells(9).Width = Unit.Pixel(80)
' e.Row.Cells(10).Width = Unit.Pixel(105)
' e.Row.Cells(11).Width = Unit.Pixel(100)
' e.Row.Cells(12).Width = Unit.Pixel(100)
' e.Row.Cells(13).Width = Unit.Pixel(110)
' e.Row.Cells(14).Width = Unit.Pixel(100)
' e.Row.Cells(15).Width = Unit.Pixel(80)
' e.Row.Cells(16).Width = Unit.Pixel(70)
' e.Row.Cells(17).Width = Unit.Pixel(70)
' e.Row.Cells(18).Width = Unit.Pixel(60)
' e.Row.Cells(19).Width = Unit.Pixel(60)
' e.Row.Cells(20).Width = Unit.Pixel(120)
' e.Row.Cells(21).Width = Unit.Pixel(60)
' e.Row.Cells(22).Width = Unit.Pixel(60)
End If
If e.Row.DBCampo("Respuesta") = "" AndAlso e.Row.DBCampo("Agrupador") <> "" Then
e.Row.CssClass = "SubTotales"
e.Row.FCLiteral("LtlRes").Text = "Total"
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center
Dim Por As Double = e.Row.DBCampo("Total").ToDouble / DirectCast(GvDatos.DataSource, DataTable).SUM("Total", "Agrupador IS NULL ") * 100
e.Row.FCLiteral("LtlPor").Text = Por.FormatoNumero & "%"
End If
e.Row.FCHyperLink("LtlCantidad").NavigateUrl = String.Format("/Prospectos/RepEncuestasDetalle.aspx?CveMunicipio={0}&Seccion={1}&Sexo={2}&IFE={3}&CveEncuesta={4}&CvePregunta={5}&CveRespuesta={6}",
e.Row.DBCampo("CveMunicipio"), e.Row.DBCampo("Seccion"), e.Row.DBCampo("Sexo"), e.Row.DBCampo("IFE"), e.Row.DBCampo("CveEncuesta"), e.Row.DBCampo("CvePregunta"), e.Row.DBCampo("CveRespuesta"))
End If
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos()
UPDatos.Update()
Me.RegistraScript("UpperBound = " & GvDatos.Rows.Count - 1 & ";")
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("Estructuras")
End Sub
Protected Sub DdlEncuesta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEncuesta.SelectedIndexChanged
DdlPreguntas.DataSource = GlobalDTProspectosEncuestasPreguntas(DdlEncuesta.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
DdlPreguntas.DataBind()
DdlRespuestas.DataSource = GlobalDTProspectosEncuestasRespuestas(DdlPreguntas.SelectedValue.ToEntero, DdlEncuesta.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
DdlRespuestas.DataBind()
DdlRespuestas.Items.Insert(0, New ListItem("Todas", "-1"))
End Sub
Protected Sub DdlPreguntas_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPreguntas.SelectedIndexChanged
DdlRespuestas.DataSource = GlobalDTProspectosEncuestasRespuestas(DdlPreguntas.SelectedValue.ToEntero, DdlEncuesta.SelectedValue.ToEntero, UsuarioActual.CveEmpresa)
DdlRespuestas.DataBind()
DdlRespuestas.Items.Insert(0, New ListItem("Todas", "-1"))
End Sub
End Class

View File

@@ -0,0 +1,93 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEncuestasAvances.aspx.vb" Inherits="Prospectos_RepEncuestasAvances" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Avance
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />&nbsp;&nbsp;
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline" >
<li>Encuesta:
<asp:DropDownList ID="DdlEncuesta" runat="server" DataTextField="Encuesta" DataValueField="CveEncuesta" Class="table-group-action-input form-control input-inline input-small input-sm" style="width:500px !important;" ></asp:DropDownList>
</li>
<li>
</li>
</ul>
</div>
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
<asp:Button ID="BtnReasignar" runat="server" Text="Reasignación" class="btn btn-primary" OnClientClick="javascript:return confirm('¿Está seguro que desea RE ASIGNAR las llamadas?');" />
<a href="javascript:;" class="expand">
</a>
<a onclick="document.getElementById('C_BtnConsultar').click();" class="reload">
</a>
</div>
</div>
</div>
<br/>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros" CssClass="table table-striped table-advance table-hover" style="margin-top:-10px; text-align:center;" GridLines="None" >
<Columns>
<asp:TemplateField ItemStyle-Width="250px">
<HeaderTemplate>Agente</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAgente" runat="server" Text='<%# Eval("Agente")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Total</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTotal" runat="server" Text='<%# Eval("Total")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Pendientes</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPendientes" runat="server" Text='<%# Eval("Pendientes")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Asignadas</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlAsignadas" runat="server" Text='<%# Eval("Asignadas")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Saltadas</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSaltadas" runat="server" Text='<%# Eval("Saltadas")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Excluidas</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlExcluidas" runat="server" Text='<%# Eval("Excluidas")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Terminadas</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTerminadas" runat="server" Text='<%# Eval("Terminadas")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,97 @@
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 = "&nbsp;&nbsp;Evento:&nbsp;" & 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 = "&nbsp;&nbsp;&nbsp;&nbsp;Municipio:&nbsp;" & 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 = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & 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

View File

@@ -0,0 +1,168 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEncuestasDetalle.aspx.vb" Inherits="Prospectos_RepEncuestasDetalle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" Runat="Server">
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />&nbsp;&nbsp;
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" Runat="Server">
Reporte de Padrón
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
<script type="text/javascript">
var SelectedRow = null;
var SelectedRowIndex = null;
var UpperBound = null;
var LowerBound = null;
window.onload = function () {
UpperBound = parseInt('<%= GvDatos.Rows.Count%>') - 1;
LowerBound = 0;
SelectedRowIndex = -1;
}
function SelectRow(CurrentRow, RowIndex) {
if (SelectedRow == CurrentRow || RowIndex > UpperBound || RowIndex < LowerBound)
return;
if (SelectedRow != null) {
SelectedRow.style.backgroundColor = SelectedRow.originalBackgroundColor;
SelectedRow.style.color = SelectedRow.originalForeColor;
}
if (CurrentRow != null) {
CurrentRow.originalBackgroundColor = CurrentRow.style.backgroundColor;
CurrentRow.originalForeColor = CurrentRow.style.color;
CurrentRow.style.backgroundColor = '#65b0bf';
CurrentRow.style.color = 'Black';
}
SelectedRow = CurrentRow;
SelectedRowIndex = RowIndex;
setTimeout("SelectedRow.focus();", 0);
}
function SelectSibling(e) {
var e = e ? e : window.event;
var KeyCode = e.which ? e.which : e.keyCode;
if (KeyCode == 40) {
SelectRow(SelectedRow.nextSibling, SelectedRowIndex + 1);
}
else if (KeyCode == 38) {
SelectRow(SelectedRow.previousSibling, SelectedRowIndex - 1);
}
return false;
}
function EC() {
event.cancelBubble = true;
if (event.stopPropagation)
event.stopPropagation();
}
</script>
<%--<script language="javascript" type="text/javascript">
var gridViewCtlId = '<%=GvDatos.ClientID%>';
var gridViewCtl = null;
var curSelRow = null;
function getGridViewControl() {
if (null == gridViewCtl) {
gridViewCtl = document.getElementById(gridViewCtlId);
}
}
function onGridViewRowSelected(rowIdx) {
var selRow = getSelectedRow(rowIdx);
if (curSelRow != null) {
curSelRow.style.backgroundColor = '#ffffff';
}
if (null != selRow) {
curSelRow = selRow;
curSelRow.style.backgroundColor = '#ff0022';
}
}
function getSelectedRow(rowIdx) {
getGridViewControl();
if (null != gridViewCtl) {
return gridViewCtl.rows[rowIdx];
}
return null;
}
</script> --%>
<%--<script language="javascript" type="text/javascript">
var originalstyle = "";
</script>--%>
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr align="left" class="SubTotales">
<td style="width: 100px;">Municipio</td>
<td style="width: 100px;">
<asp:Label ID="LblMunicipio" runat="server" Text="Todos"></asp:Label>
</td>
<td style="width: 100px;">Sección</td>
<td style="width: 100px;">
<asp:Label ID="LblSeccion" runat="server" Text="Todos"></asp:Label>
</td>
<td style="width: 100px;">Sexo</td>
<td style="width: 100px;">
<asp:Label ID="LblSexo" runat="server" Text="Todos"></asp:Label>
</td>
<td style="width: 50px;">IFE</td>
<td style="width: 60px;">
<asp:Label ID="LblIFE" runat="server" Text="Todos"></asp:Label>
</td>
<td align="left" style="border-left-style: solid; border-left-color: Blue; border-left-width: 1px;"></td>
</tr>
<tr class="SubTotales"><td>Encuesta:</td><td colspan="10">
<asp:Label ID="LblEncuesta" runat="server" Text="Todos"></asp:Label>
</td></tr>
<tr class="SubTotales"><td>Pregunta:</td>
<td colspan="10"> <asp:Label ID="LblPregunta" runat="server" Text="Todos"></asp:Label>
</td>
</tr>
<tr class="SubTotales"><td>Respuesta:</td>
<td colspan="10"> <asp:Label ID="LblRespuesta" runat="server" Text="Todos"></asp:Label>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<br/>
<asp:Label ID="LblTotal" runat="server" Text=""></asp:Label>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" ShowHeader="True">
<Columns>
<asp:BoundField HeaderText="Nombre" DataField="NombreCompleto"/>
<asp:BoundField HeaderText="F.Nacimiento" DataField="FechaNacimiento" DataFormatString="{0:d}"/>
<asp:BoundField HeaderText="Direccion" DataField="Calle"/>
<asp:BoundField HeaderText="#" DataField="Numero"/>
<asp:BoundField HeaderText="# Int" DataField="NumeroInterior"/>
<asp:BoundField HeaderText="Entre Calle" DataField="EntreCalle1"/>
<asp:BoundField HeaderText="y Entre" DataField="EntreCalle2"/>
<asp:BoundField HeaderText="Colonia" DataField="Colonia"/>
<asp:BoundField HeaderText="Municipio" DataField="Municipio"/>
<asp:BoundField HeaderText="IFE" DataField="IFE"/>
<asp:BoundField HeaderText="Teléfono" DataField="Telefono"/>
<asp:BoundField HeaderText="Celular" DataField="Celular"/>
<asp:BoundField HeaderText="Correo" DataField="Correo"/>
<asp:BoundField HeaderText="Eventos Asistidos" DataField="Eventos"/>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

View File

@@ -0,0 +1,140 @@

Option Explicit On
Option Strict On
Imports System.Data
Imports System.Activities.Expressions
Imports Extensiones
Partial Class Prospectos_RepEncuestasDetalle
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = String.Empty
Dim CveMunicipio, Seccion, Sexo, IFE, CveEncuesta, CvePregunta, CveRespuesta As Integer
CveMunicipio = IfNull(Request("CveMunicipio"), "0").ToString.ToEntero
Seccion = IfNull(Request("Seccion"), "0").ToString.ToEntero
Sexo = IfNull(Request("Sexo"), "0").ToString.ToEntero
IFE = IfNull(Request("IFE"), "0").ToString.ToEntero
CveEncuesta = IfNull(Request("CveEncuesta"), "0").ToString.ToEntero
CvePregunta = IfNull(Request("CvePregunta"), "0").ToString.ToEntero
CveRespuesta = IfNull(Request("CveRespuesta"), "0").ToString.ToEntero
If CveMunicipio > 0 Then
Dim dr As DataRow = GlobalDTGralMunicipios(-1).FiltroPrimero("CveMunicipio =" & CveMunicipio)
If dr IsNot Nothing Then LblMunicipio.Text = dr("Municipio").ToString()
End If
LblSeccion.Text = Seccion.ToString
If Sexo > 0 Then LblSexo.Text = If(Sexo = 1, "Hombre", "Mujer")
If CveEncuesta > 0 Then
Dim dr As DataRow = GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa).FiltroPrimero("CveEncuesta =" & CveEncuesta)
If dr IsNot Nothing Then LblEncuesta.Text = dr("Encuesta").ToString()
End If
If CvePregunta > 0 Then
Dim dr As DataRow = GlobalDTProspectosEncuestasPreguntas(CveEncuesta, UsuarioActual.CveEmpresa).FiltroPrimero("CvePregunta =" & CvePregunta)
If dr IsNot Nothing Then LblPregunta.Text = dr("Pregunta").ToString()
End If
If CveRespuesta > 0 Then
Dim dr As DataRow = GlobalDTProspectosEncuestasRespuestas(CvePregunta, CveEncuesta, UsuarioActual.CveEmpresa).FiltroPrimero("CveRespuesta =" & CveRespuesta)
If dr IsNot Nothing Then LblRespuesta.Text = dr("Respuesta").ToString()
End If
CargaDatos(CveMunicipio, Seccion, Sexo, IFE, CveEncuesta, CvePregunta, CveRespuesta)
End If
End Sub
Public Sub CargaDatos(CveMunicipio As Integer, Seccion As Integer, Sexo As Integer, IFE As Integer, CveEncuesta As Integer, CvePregunta As Integer, CveRespuesta As Integer)
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetRepEncuestasDetalle(CveMunicipio, Seccion, Sexo, IFE, CveEncuesta, CvePregunta, CveRespuesta, UsuarioActual.CveEmpresa) Then
ViewState("DTProspectos") = ObjProspectos.DtResultados
'LtlAgrupador.Text = DdlAgrupador.SelectedItem.Text
Else
Me.GvDatos.DataSource = Nothing
End If
ObjProspectos.Dispose()
LblTotal.Text = String.Format("Registros: {0}", ObjProspectos.DtResultados.Rows.Count)
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_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowCreated
If (e.Row.RowType = DataControlRowType.DataRow AndAlso (e.Row.RowState = DataControlRowState.Normal OrElse e.Row.RowState = DataControlRowState.Alternate)) Then
e.Row.TabIndex = -1
e.Row.Attributes("onclick") = String.Format("javascript:SelectRow(this, {0});", e.Row.RowIndex)
e.Row.Attributes("onkeydown") = "javascript:return SelectSibling(event);"
e.Row.Attributes("onselectstart") = "javascript:return false;"
' e.Row.Cells(10).Attributes.Add("onclick", "EC();")
End If
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
'ElseIf e.Row.RowIndex = 1 Then
' e.Row.Cells(0).Width = Unit.Pixel(120)
' e.Row.Cells(1).Width = Unit.Pixel(60)
' e.Row.Cells(2).Width = Unit.Pixel(60)
' e.Row.Cells(3).Width = Unit.Pixel(60)
' e.Row.Cells(4).Width = Unit.Pixel(70)
' e.Row.Cells(5).Width = Unit.Pixel(60)
' e.Row.Cells(6).Width = Unit.Pixel(60)
' e.Row.Cells(7).Width = Unit.Pixel(70)
' e.Row.Cells(8).Width = Unit.Pixel(100)
' e.Row.Cells(9).Width = Unit.Pixel(80)
' e.Row.Cells(10).Width = Unit.Pixel(105)
' e.Row.Cells(11).Width = Unit.Pixel(100)
' e.Row.Cells(12).Width = Unit.Pixel(100)
' e.Row.Cells(13).Width = Unit.Pixel(110)
' e.Row.Cells(14).Width = Unit.Pixel(100)
' e.Row.Cells(15).Width = Unit.Pixel(80)
' e.Row.Cells(16).Width = Unit.Pixel(70)
' e.Row.Cells(17).Width = Unit.Pixel(70)
' e.Row.Cells(18).Width = Unit.Pixel(60)
' e.Row.Cells(19).Width = Unit.Pixel(60)
' e.Row.Cells(20).Width = Unit.Pixel(120)
' e.Row.Cells(21).Width = Unit.Pixel(60)
' e.Row.Cells(22).Width = Unit.Pixel(60)
End If
End If
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("Estructuras")
End Sub
End Class

View File

@@ -0,0 +1,196 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEncuestasDetalleTabla.aspx.vb" Inherits="Prospectos_RepEncuestasDetalleTabla" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Padrón
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />&nbsp;&nbsp;
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:Panel ID="PnlFiltro" runat="server">
<div class="portlet solid grey-cascade portlet-filter" style="">
<div class="portlet-title portlet-filterT" style="">
<div class="titlefiltros caption ">
<ul class="list-inline" >
<li>Encuesta:
<asp:DropDownList ID="DdlEncuesta" runat="server" DataTextField="Encuesta" DataValueField="CveEncuesta" Class="table-group-action-input form-control input-inline input-small input-sm" style="width:500px !important;" ></asp:DropDownList>
</li>
</ul>
</div>
<div class="tools">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" /> <asp:Button ID="Btn1y2" runat="server" Visible="False" Text="Encuesta 1 y 2" class="btn btn-primary" />
<a href="javascript:;" class="expand">
</a>
<a onclick="document.getElementById('C_BtnConsultar').click();" class="reload">
</a>
</div>
</div>
</div>
</asp:Panel>
<asp:Label ID="LblTotal" runat="server" Text=""></asp:Label>
<br/>
<div style="display: none;" >
<asp:GridView ID="GVD" Visible="true" Width="5px" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" ShowHeader="True" CssClass="table table-striped table-advance table-hover" style="margin-top:-10px; text-align:center;" GridLines="None">
<Columns>
<asp:BoundField HeaderText="A. Paterno" DataField="APellidoPaterno"/>
<asp:BoundField HeaderText="A. Materno" DataField="APellidoMaterno"/>
<asp:BoundField HeaderText="Nombres" DataField="Nombres"/>
<asp:BoundField HeaderText="F.Nacimiento" DataField="FechaNacimiento" DataFormatString="{0:d}"/>
<asp:BoundField HeaderText="Direccion" DataField="Calle"/>
<asp:BoundField HeaderText="#" DataField="Numero"/>
<asp:BoundField HeaderText="# Int" DataField="NumeroInterior"/>
<asp:BoundField HeaderText="Entre Calle" DataField="EntreCalle1"/>
<asp:BoundField HeaderText="y Entre" DataField="EntreCalle2"/>
<asp:BoundField HeaderText="Colonia" DataField="Colonia"/>
<asp:BoundField HeaderText="Sección" DataField="Seccion"/>
<asp:BoundField HeaderText="Municipio" DataField="Municipio"/>
<asp:BoundField HeaderText="IFE" DataField="IFE"/>
<asp:BoundField HeaderText="Teléfono" DataField="Telefono"/>
<asp:BoundField HeaderText="Celular" DataField="Celular"/>
<asp:BoundField HeaderText="Correo" DataField="Correo"/>
<asp:BoundField HeaderText="Estatus" DataField="EncuestaEstatus"/>
<asp:BoundField HeaderText="F. Encuesta" DataField="FechaEncuesta" DataFormatString="{0:d}"/>
<asp:BoundField HeaderText="F. Ingreso" DataField="FechaEncuestaIngreso" DataFormatString="{0:d}"/>
<asp:BoundField HeaderText="U. Ingreso" DataField="UsuarioIngreso"/>
<asp:BoundField HeaderText="U. Encuestador" DataField="Encuestador"/>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
<div style="display: none;" >
<asp:GridView ID="GV1y2" Visible="true" Width="5px" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" ShowHeader="True" CssClass="table table-striped table-advance table-hover" style="margin-top:-10px; text-align:center;" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Nombre Completo" DataField="NombreCompleto"/>
<asp:BoundField HeaderText="F.Nacimiento" DataField="FechaNacimiento" DataFormatString="{0:d}"/>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</div>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" ShowHeader="True" CssClass="table table-striped table-advance table-hover" style="margin-top:-10px; text-align:center;" GridLines="None">
<Columns>
<asp:BoundField HeaderText="A. Paterno" DataField="APellidoPaterno"/>
<asp:BoundField HeaderText="A. Materno" DataField="APellidoMaterno"/>
<asp:BoundField HeaderText="Nombres" DataField="Nombres"/>
<asp:BoundField HeaderText="F.Nacimiento" DataField="FechaNacimiento" DataFormatString="{0:d}"/>
<asp:BoundField HeaderText="Direccion" DataField="Calle"/>
<asp:BoundField HeaderText="#" DataField="Numero"/>
<asp:BoundField HeaderText="# Int" DataField="NumeroInterior"/>
<asp:BoundField HeaderText="Entre Calle" DataField="EntreCalle1"/>
<asp:BoundField HeaderText="y Entre" DataField="EntreCalle2"/>
<asp:BoundField HeaderText="Colonia" DataField="Colonia"/>
<asp:BoundField HeaderText="Sección" DataField="Seccion"/>
<asp:BoundField HeaderText="Municipio" DataField="Municipio"/>
<asp:BoundField HeaderText="IFE" DataField="IFE"/>
<asp:BoundField HeaderText="Teléfono" DataField="Telefono"/>
<asp:BoundField HeaderText="Celular" DataField="Celular"/>
<asp:BoundField HeaderText="Correo" DataField="Correo"/>
<asp:BoundField HeaderText="Estatus" DataField="EncuestaEstatus"/>
<asp:BoundField HeaderText="F. Encuesta" DataField="FechaEncuesta" DataFormatString="{0:d}"/>
<asp:BoundField HeaderText="F. Ingreso" DataField="FechaEncuestaIngreso" DataFormatString="{0:d}"/>
<asp:BoundField HeaderText="U. Ingreso" DataField="UsuarioIngreso"/>
<asp:BoundField HeaderText="U. Encuestador" DataField="Encuestador"/>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
<%-- var SelectedRow = null;
var SelectedRowIndex = null;
var UpperBound = null;
var LowerBound = null;
window.onload = function () {
UpperBound = parseInt('<%= GvDatos.Rows.Count%>') - 1;
LowerBound = 0;
SelectedRowIndex = -1;
}
function SelectRow(CurrentRow, RowIndex) {
if (SelectedRow == CurrentRow || RowIndex > UpperBound || RowIndex < LowerBound)
return;
if (SelectedRow != null) {
SelectedRow.style.backgroundColor = SelectedRow.originalBackgroundColor;
SelectedRow.style.color = SelectedRow.originalForeColor;
}
if (CurrentRow != null) {
CurrentRow.originalBackgroundColor = CurrentRow.style.backgroundColor;
CurrentRow.originalForeColor = CurrentRow.style.color;
CurrentRow.style.backgroundColor = '#65b0bf';
CurrentRow.style.color = 'Black';
}
SelectedRow = CurrentRow;
SelectedRowIndex = RowIndex;
setTimeout("SelectedRow.focus();", 0);
}
function SelectSibling(e) {
var e = e ? e : window.event;
var KeyCode = e.which ? e.which : e.keyCode;
if (KeyCode == 40) {
SelectRow(SelectedRow.nextSibling, SelectedRowIndex + 1);
}
else if (KeyCode == 38) {
SelectRow(SelectedRow.previousSibling, SelectedRowIndex - 1);
}
return false;
}
function EC() {
event.cancelBubble = true;
if (event.stopPropagation)
event.stopPropagation();
}--%>
</script>
<%--<script language="javascript" type="text/javascript">
var gridViewCtlId = '<%=GvDatos.ClientID%>';
var gridViewCtl = null;
var curSelRow = null;
function getGridViewControl() {
if (null == gridViewCtl) {
gridViewCtl = document.getElementById(gridViewCtlId);
}
}
function onGridViewRowSelected(rowIdx) {
var selRow = getSelectedRow(rowIdx);
if (curSelRow != null) {
curSelRow.style.backgroundColor = '#ffffff';
}
if (null != selRow) {
curSelRow = selRow;
curSelRow.style.backgroundColor = '#ff0022';
}
}
function getSelectedRow(rowIdx) {
getGridViewControl();
if (null != gridViewCtl) {
return gridViewCtl.rows[rowIdx];
}
return null;
}
</script> --%>
<%--<script language="javascript" type="text/javascript">
var originalstyle = "";
</script>--%>
</asp:Content>

View File

@@ -0,0 +1,286 @@

Option Explicit On
Option Strict On
Imports System.Data
Imports System.Activities.Expressions
Imports System.Web.UI.WebControls.Expressions
Imports Extensiones
Partial Class Prospectos_RepEncuestasDetalleTabla
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = String.Empty
If IfNull(Request("Estructura"), "0").ToString = "1" Then
CargaEstructura()
PnlFiltro.Visible = False
Else
DdlEncuesta.DataSource = GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa)
DdlEncuesta.DataBind()
End If
'CveEncuesta = DdlEncuesta.SelectedValue.ToEntero
'CvePregunta = IfNull(Request("CvePregunta"), "0").ToString.ToEntero
'CveRespuesta = IfNull(Request("CveRespuesta"), "0").ToString.ToEntero
End If
End Sub
Private Sub CargaEstructura()
Dim ObjProspectos As New ClsProspectos
Dim dt As DataTable = nothing
If ObjProspectos.GetRepEstructurasDetalleJGM() Then
dt = ObjProspectos.DtResultados
ViewState("DTProspectos") = dt
LblTotal.Text = String.Format("Registros: {0:N0}", dt.Rows.Count)
'If ds.Tables.Count > 0 Then
' Dim dt1 As DataTable = ds.Tables(0).FiltraParametros("CveProspectoTipo = 2")
' ds = ObjProspectos.GetRepEncuestasDetalleTabla(5, -1, -1, UsuarioActual.CveEmpresa)
' dt1.Merge(ds.Tables(0))
' ViewState("DTProspectos") = dt1.FiltraParametros("CveProspectoTipo = 2")
' LblTotal.Text = String.Format("Registros: {0}", dt1.Rows.Count)
'End If
'LtlAgrupador.Text = DdlAgrupador.SelectedItem.Text
Else
Me.GvDatos.DataSource = Nothing
LblTotal.Text = ""
End If
ObjProspectos.Dispose()
dt.Dispose()
If ViewState("Orden").ToString() <> String.Empty Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End Sub
Public Sub CargaDatos(CveEncuesta As Integer, CvePregunta As Integer, CveRespuesta As Integer)
Dim ObjProspectos As New ClsProspectos
Dim ds As DataSet = ObjProspectos.GetRepEncuestasDetalleTabla(CveEncuesta, CvePregunta, CveRespuesta, UsuarioActual.CveEmpresa)
If ds IsNot Nothing Then
If ds.Tables.Count > 0 Then
ViewState("DTProspectos") = ds.Tables(0)
Dim dt1 As DataTable = ds.Tables(1)
LblTotal.Text = String.Format("Registros: {0}", ds.Tables(0).Rows.Count)
If GvDatos.Columns.Count > 21 Then
Dim i As Integer = GvDatos.Columns.Count - 21
For jj = 0 To i - 1
GvDatos.Columns.RemoveAt(21)
Next
End If
For Each dr As DataRow In dt1.Rows
Dim bfield As New BoundField()
bfield.HeaderText = dr("Pregunta").ToString : bfield.DataField = String.Format("Preg_{0}", dr("CvePregunta"))
GvDatos.Columns.Add(bfield)
Next
End If
'LtlAgrupador.Text = DdlAgrupador.SelectedItem.Text
Else
Me.GvDatos.DataSource = Nothing
LblTotal.Text = ""
End If
ObjProspectos.Dispose()
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()
End Sub
'Protected Sub GvDatos_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowCreated
' If (e.Row.RowType = DataControlRowType.DataRow AndAlso (e.Row.RowState = DataControlRowState.Normal OrElse e.Row.RowState = DataControlRowState.Alternate)) Then
' e.Row.TabIndex = -1
' e.Row.Attributes("onclick") = String.Format("javascript:SelectRow(this, {0});", e.Row.RowIndex)
' e.Row.Attributes("onkeydown") = "javascript:return SelectSibling(event);"
' e.Row.Attributes("onselectstart") = "javascript:return false;"
' ' e.Row.Cells(10).Attributes.Add("onclick", "EC();")
' End If
'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
'ElseIf e.Row.RowIndex = 1 Then
' e.Row.Cells(0).Width = Unit.Pixel(120)
' e.Row.Cells(1).Width = Unit.Pixel(60)
' e.Row.Cells(2).Width = Unit.Pixel(60)
' e.Row.Cells(3).Width = Unit.Pixel(60)
' e.Row.Cells(4).Width = Unit.Pixel(70)
' e.Row.Cells(5).Width = Unit.Pixel(60)
' e.Row.Cells(6).Width = Unit.Pixel(60)
' e.Row.Cells(7).Width = Unit.Pixel(70)
' e.Row.Cells(8).Width = Unit.Pixel(100)
' e.Row.Cells(9).Width = Unit.Pixel(80)
' e.Row.Cells(10).Width = Unit.Pixel(105)
' e.Row.Cells(11).Width = Unit.Pixel(100)
' e.Row.Cells(12).Width = Unit.Pixel(100)
' e.Row.Cells(13).Width = Unit.Pixel(110)
' e.Row.Cells(14).Width = Unit.Pixel(100)
' e.Row.Cells(15).Width = Unit.Pixel(80)
' e.Row.Cells(16).Width = Unit.Pixel(70)
' e.Row.Cells(17).Width = Unit.Pixel(70)
' e.Row.Cells(18).Width = Unit.Pixel(60)
' e.Row.Cells(19).Width = Unit.Pixel(60)
' e.Row.Cells(20).Width = Unit.Pixel(120)
' e.Row.Cells(21).Width = Unit.Pixel(60)
' e.Row.Cells(22).Width = Unit.Pixel(60)
End If
End If
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
Dim ObjProspectos As New ClsProspectos
Dim ds As DataSet = ObjProspectos.GetRepEncuestasDetalleTabla(DdlEncuesta.SelectedValue.ToEntero, -1, -1, UsuarioActual.CveEmpresa)
If ds IsNot Nothing Then
If ds.Tables.Count > 0 Then
'ViewState("DTProspectos") = ds.Tables(0)
Dim dt1 As DataTable = ds.Tables(1)
'If GvDatos.Columns.Count > 21 Then
' Dim i As Integer = GvDatos.Columns.Count - 21
' For jj = 0 To i - 1
' GvDatos.Columns.RemoveAt(21)
' Next
'End If
For Each dr As DataRow In dt1.Rows
Dim bfield As New BoundField()
bfield.HeaderText = dr("Pregunta").ToString : bfield.DataField = String.Format("Preg_{0}", dr("CvePregunta"))
GVD.Columns.Add(bfield)
Next
Dim cvefield As New BoundField()
cvefield.HeaderText = "Clave" : cvefield.DataField = "CveProspecto"
GVD.Columns.Add(cvefield)
GVD.DataSource = ds.Tables(0)
GVD.DataBind()
End If
'LtlAgrupador.Text = DdlAgrupador.SelectedItem.Text
Else
Me.GvDatos.DataSource = Nothing
LblTotal.Text = ""
End If
ObjProspectos.Dispose()
GVD.ExportToExcel("Estructuras")
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos(DdlEncuesta.SelectedValue.ToEntero, -1, -1)
End Sub
Protected Sub Btn1y2_Click(sender As Object, e As EventArgs) Handles Btn1y2.Click
Dim ObjProspectos As New ClsProspectos
Dim ds As DataSet = ObjProspectos.GetRepEncuestasDetalleTabla2(DdlEncuesta.SelectedValue.ToEntero, -1, -1, UsuarioActual.CveEmpresa)
If ds IsNot Nothing Then
If ds.Tables.Count > 0 Then
'ViewState("DTProspectos") = ds.Tables(0)
Dim dt1 As DataTable = ds.Tables(1)
'If GvDatos.Columns.Count > 21 Then
' Dim i As Integer = GvDatos.Columns.Count - 21
' For jj = 0 To i - 1
' GvDatos.Columns.RemoveAt(21)
' Next
'End If
For Each dr As DataRow In dt1.Rows
Dim bfield As New BoundField()
bfield.HeaderText = dr("Pregunta").ToString : bfield.DataField = String.Format("Preg_{0}", dr("CvePregunta"))
GV1y2.Columns.Add(bfield)
Next
GV1y2.DataSource = ds.Tables(0)
GV1y2.DataBind()
End If
'LtlAgrupador.Text = DdlAgrupador.SelectedItem.Text
Else
Me.GV1y2.DataSource = Nothing
LblTotal.Text = ""
End If
ObjProspectos.Dispose()
GV1y2.ExportToExcel("Encuestas")
End Sub
End Class

121
Prospectos/RepEventos.aspx Normal file
View File

@@ -0,0 +1,121 @@
<%@ Page Title="Reporte de Eventos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEventos.aspx.vb" Inherits="Prospectos_RepEventos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Padrón
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros" CssClass="table table-striped table-advance table-hover" style="margin-top:-10px; text-align:center;" GridLines="None" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEvento" runat="server" Text='<%# Eval("Evento")%>'></asp:Literal>
</ItemTemplate>
<HeaderTemplate>Evento</HeaderTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlNumAsistentes" runat="server" Text='<%# Eval("Cantidad", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
<HeaderTemplate>Cantidad de Asistentes</HeaderTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFechaEvento" runat="server" Text='<%# Eval("FechaEvento", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
<HeaderTemplate>Fecha del Evento</HeaderTemplate>
</asp:TemplateField>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />&nbsp;&nbsp;
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
var SelectedRow = null;
var SelectedRowIndex = null;
var UpperBound = null;
var LowerBound = null;
window.onload = function () {
UpperBound = parseInt('<%= GvDatos.Rows.Count%>') - 1;
LowerBound = 0;
SelectedRowIndex = -1;
}
function SelectRow(CurrentRow, RowIndex) {
if (SelectedRow == CurrentRow || RowIndex > UpperBound || RowIndex < LowerBound)
return;
if (SelectedRow != null) {
SelectedRow.style.backgroundColor = SelectedRow.originalBackgroundColor;
SelectedRow.style.color = SelectedRow.originalForeColor;
}
if (CurrentRow != null) {
CurrentRow.originalBackgroundColor = CurrentRow.style.backgroundColor;
CurrentRow.originalForeColor = CurrentRow.style.color;
CurrentRow.style.backgroundColor = '#65b0bf';
CurrentRow.style.color = 'Black';
}
SelectedRow = CurrentRow;
SelectedRowIndex = RowIndex;
setTimeout("SelectedRow.focus();", 0);
}
function SelectSibling(e) {
var e = e ? e : window.event;
var KeyCode = e.which ? e.which : e.keyCode;
if (KeyCode == 40) {
SelectRow(SelectedRow.nextSibling, SelectedRowIndex + 1);
}
else if (KeyCode == 38) {
SelectRow(SelectedRow.previousSibling, SelectedRowIndex - 1);
}
return false;
}
function EC() {
event.cancelBubble = true;
if (event.stopPropagation)
event.stopPropagation();
}
</script>
<%-- <asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<td style="width: 80px;">&nbsp;Agrupador</td>
<td style="width: 100px;">
<asp:DropDownList ID="DdlAgrupador" runat="server" AppendDataBoundItems="true" Width="100px">
<asp:ListItem Text="Municipio" Value="1"></asp:ListItem>
<asp:ListItem Text="Clasificacion" Value="2"></asp:ListItem>
<asp:ListItem Text="Vendedor" Value="3"></asp:ListItem>
<asp:ListItem Text="Tipo de Prospecto" Value="4"></asp:ListItem>
<asp:ListItem Text="Fecha" Value="5"></asp:ListItem>
</asp:DropDownList>
</td>
<td align="left" style="border-left-style: solid; border-left-color: Blue; border-left-width: 1px;"><asp:Button ID="BtnConsultar" runat="server" Text="Consultar" /></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>--%>
<%--1640--%>
</asp:Content>

View File

@@ -0,0 +1,95 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Prospectos_RepEventos
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = String.Empty
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetRepEventos Then
ViewState("DTEventos") = 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("DTEventos"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTEventos"), DataTable)
End If
GvDatos.DataBind()
End Sub
Protected Sub GvDatos_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowCreated
If (e.Row.RowType = DataControlRowType.DataRow AndAlso (e.Row.RowState = DataControlRowState.Normal OrElse e.Row.RowState = DataControlRowState.Alternate)) Then
e.Row.TabIndex = -1
e.Row.Attributes("onclick") = String.Format("javascript:SelectRow(this, {0});", e.Row.RowIndex)
e.Row.Attributes("onkeydown") = "javascript:return SelectSibling(event);"
e.Row.Attributes("onselectstart") = "javascript:return false;"
'e.Row.Cells(10).Attributes.Add("onclick", "EC();")
End If
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 = "&nbsp;&nbsp;Evento:&nbsp;" & 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 = "&nbsp;&nbsp;&nbsp;&nbsp;Municipio:&nbsp;" & 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 = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & 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 BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
' CargaDatos()
' UPDatos.Update()
' Me.RegistraScript("UpperBound = " & GvDatos.Rows.Count - 1 & ";")
'End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("RepEventos")
End Sub
End Class

View File

@@ -0,0 +1,182 @@
<%@ Page Title="Reporte de Eventos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEventosDetalle.aspx.vb" Inherits="Prospectos_RepEventosDetalle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Padrón
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />&nbsp;&nbsp;
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
Número de registros:&nbsp;<b><asp:Literal ID="LtlNumRegistros" runat="server" Text="0"></asp:Literal></b>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros" CssClass="table table-striped table-advance table-hover" style="margin-top:-10px; text-align:center;" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>Tipo de Evento</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEvento" runat="server" Text='<%# Eval("EventoTipo")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Municipio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMunicipio" runat="server" Text='<%# Eval("Municipio")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Evento</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEvento" runat="server" Text='<%# Eval("Evento")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha Evento</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFechaEvento" runat="server" Text='<%# Eval("FechaEvento", "{0:d}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Nombre</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombre" runat="server" Text='<%# Eval("NombreCompleto")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Número</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNumero" runat="server" Text='<%# Eval("Numero")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Número Int.</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNumeroInt" runat="server" Text='<%# Eval("NumeroInterior")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Colonia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlColonia" runat="server" Text='<%# Eval("Colonia")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Teléfono</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTelefono" runat="server" Text='<%# Eval("Telefono")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Celular</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCelular" runat="server" Text='<%# Eval("Celular")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Teléfono Otro</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTelefonoOtro" runat="server" Text='<%# Eval("TelefonoOtro")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Correo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCorreo" runat="server" Text='<%# Eval("Correo")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>IFE</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlIFE" runat="server" Text='<%# Eval("IFE")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
var SelectedRow = null;
var SelectedRowIndex = null;
var UpperBound = null;
var LowerBound = null;
window.onload = function () {
UpperBound = parseInt('<%= GvDatos.Rows.Count%>') - 1;
LowerBound = 0;
SelectedRowIndex = -1;
}
function SelectRow(CurrentRow, RowIndex) {
if (SelectedRow == CurrentRow || RowIndex > UpperBound || RowIndex < LowerBound)
return;
if (SelectedRow != null) {
SelectedRow.style.backgroundColor = SelectedRow.originalBackgroundColor;
SelectedRow.style.color = SelectedRow.originalForeColor;
}
if (CurrentRow != null) {
CurrentRow.originalBackgroundColor = CurrentRow.style.backgroundColor;
CurrentRow.originalForeColor = CurrentRow.style.color;
CurrentRow.style.backgroundColor = '#65b0bf';
CurrentRow.style.color = 'Black';
}
SelectedRow = CurrentRow;
SelectedRowIndex = RowIndex;
setTimeout("SelectedRow.focus();", 0);
}
function SelectSibling(e) {
var e = e ? e : window.event;
var KeyCode = e.which ? e.which : e.keyCode;
if (KeyCode == 40) {
SelectRow(SelectedRow.nextSibling, SelectedRowIndex + 1);
}
else if (KeyCode == 38) {
SelectRow(SelectedRow.previousSibling, SelectedRowIndex - 1);
}
return false;
}
function EC() {
event.cancelBubble = true;
if (event.stopPropagation)
event.stopPropagation();
}
</script>
<%-- <asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<td style="width: 80px;">&nbsp;Agrupador</td>
<td style="width: 100px;">
<asp:DropDownList ID="DdlAgrupador" runat="server" AppendDataBoundItems="true" Width="100px">
<asp:ListItem Text="Municipio" Value="1"></asp:ListItem>
<asp:ListItem Text="Clasificacion" Value="2"></asp:ListItem>
<asp:ListItem Text="Vendedor" Value="3"></asp:ListItem>
<asp:ListItem Text="Tipo de Prospecto" Value="4"></asp:ListItem>
<asp:ListItem Text="Fecha" Value="5"></asp:ListItem>
</asp:DropDownList>
</td>
<td align="left" style="border-left-style: solid; border-left-color: Blue; border-left-width: 1px;"><asp:Button ID="BtnConsultar" runat="server" Text="Consultar" /></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>--%>
<%--1640--%>
</asp:Content>

View File

@@ -0,0 +1,111 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Prospectos_RepEventosDetalle
Inherits ClsPaginas
Private Property CveEvento As Integer
Get
Return ViewState("CveEvento").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveEvento") = value
End Set
End Property
Private Property CveEventoTipo As Integer
Get
Return ViewState("CveEventoTipo").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveEventoTipo") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CveEvento = IfNull(Request("CveEvento"), "0").ToString.ToEntero()
CveEventoTipo = IfNull(Request("CveEventoTipo"), "-1").ToString.ToEntero()
ViewState("Orden") = String.Empty
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetRepEventosDetalle(CveEvento, CveEventoTipo) Then
ViewState("DTEventosDetalle") = 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
LtlNumRegistros.Text = GvDatos.Rows.Count.ToString.FormatoNumero(0)
UPDatos.Update()
End Sub
Private Sub CargaGrid(Orden As String)
If Orden <> String.Empty Then
Dim DV As New DataView(CType(ViewState("DTEventosDetalle"), DataTable), "", Orden, DataViewRowState.CurrentRows)
GvDatos.DataSource = DV.ToTable()
DV.Dispose()
Else
GvDatos.DataSource = CType(ViewState("DTEventosDetalle"), DataTable)
End If
GvDatos.DataBind()
End Sub
Protected Sub GvDatos_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowCreated
If (e.Row.RowType = DataControlRowType.DataRow AndAlso (e.Row.RowState = DataControlRowState.Normal OrElse e.Row.RowState = DataControlRowState.Alternate)) Then
e.Row.TabIndex = -1
e.Row.Attributes("onclick") = String.Format("javascript:SelectRow(this, {0});", e.Row.RowIndex)
e.Row.Attributes("onkeydown") = "javascript:return SelectSibling(event);"
e.Row.Attributes("onselectstart") = "javascript:return false;"
'e.Row.Cells(10).Attributes.Add("onclick", "EC();")
End If
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 = "&nbsp;&nbsp;Evento:&nbsp;" & 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 = "&nbsp;&nbsp;&nbsp;&nbsp;Municipio:&nbsp;" & 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 = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & 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("RepEventosDetalle")
End Sub
End Class

183
Prospectos/RepMetas2.aspx Normal file
View File

@@ -0,0 +1,183 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepMetas2.aspx.vb" Inherits="Prospectos_RepMetas2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
<asp:Label ID="LblNombre" runat="server" Text=""></asp:Label>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
<br />
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
<ajax:TabPanel ID="TabAlta" runat="server" HeaderText="Información General">
<ContentTemplate>
<asp:GridView ID="Gv" runat="server" AutoGenerateColumns="False">
<RowStyle CssClass="Texto" />
<AlternatingRowStyle CssClass="TextoAlterno" />
<HeaderStyle CssClass="Titulos"></HeaderStyle>
<Columns>
<asp:TemplateField HeaderText="%">
<ItemTemplate>
<asp:HyperLink ID="Hpl" runat="server" CssClass="Texto" NavigateUrl='<%# Eval("CveProspecto","RepMetas2.aspx?CveProspecto={0}") %>' Text='<%# Eval("NombreCompleto")%>'></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="300px"></ItemStyle>
</asp:TemplateField>
<asp:BoundField DataField="Hijos" HeaderText="#" DataFormatString="{0:##,###}" />
<asp:BoundField DataField="MetaGlobal" HeaderText="Meta" DataFormatString="{0:##,###}" />
<asp:TemplateField HeaderText="%">
<ItemTemplate>
<asp:Literal ID="LitPor" runat="server" ></asp:Literal>
</ItemTemplate>
<ItemStyle Width="50px"></ItemStyle>
</asp:TemplateField>
<asp:BoundField DataField="UltimoIngreso" DataFormatString="{0:d}" HeaderText="último Ingreso" />
</Columns>
</asp:GridView>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabEncuestas" runat="server" HeaderText="Encuestas">
<ContentTemplate>
<asp:UpdatePanel ID="UPPEnc" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0">
<tr>
<td>Encuestas</td>
<td>
<asp:DropDownList ID="DdlEncuesta" runat="server" DataTextField="Encuesta" DataValueField="CveEncuesta" Width="500px" AutoPostBack="True"></asp:DropDownList>
</td>
<td></td>
</tr>
</table>
<table width="100%"><tr><td>
<asp:CHART id="ChtGral" runat="server" Visible="false" Palette="BrightPastel" BackColor="WhiteSmoke" Height="296px" Width="650px" BorderlineDashStyle="Solid" BackSecondaryColor="White" BackGradientStyle="TopBottom" BorderWidth="2" BorderColor="26, 59, 105" ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)">
<titles>
<asp:Title ShadowColor="32, 0, 0, 0" Font="Trebuchet MS, 14.25pt, style=Bold" ShadowOffset="3" Text="Encuesta General" Name="Title1" ForeColor="26, 59, 105"></asp:Title>
</titles>
<legends>
<asp:Legend BackColor="Transparent" Alignment="Near" Docking="Right" Font="Trebuchet MS, 8.25pt, style=Bold" IsTextAutoFit="False" Name="Default" LegendStyle="Column"></asp:Legend>
</legends>
<borderskin SkinStyle="Emboss"></borderskin>
<series>
<asp:Series Name="Default" ChartType="Pie" BorderColor="180, 26, 59, 105" Color="220, 65, 140, 240" Label="#PERCENT{P2}" LegendText="#VALX - #VALY"></asp:Series>
</series>
<chartareas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BackSecondaryColor="Transparent" BackColor="Transparent" ShadowColor="Transparent" BorderWidth="0">
<area3dstyle Rotation="0" />
<axisy LineColor="64, 64, 64, 64">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</axisy>
<axisx LineColor="64, 64, 64, 64">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</axisx>
</asp:ChartArea>
</chartareas>
</asp:CHART>
</td><td><asp:GridView ID="GvEstatus" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField ItemStyle-Width="200px" HeaderText="Resultados">
<ItemTemplate>
<asp:Literal ID="LtlGpo" runat="server" Text='<%# Eval("EncuestaEstatus")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="50px" HeaderText="Total">
<ItemTemplate>
<asp:Hyperlink ID="LtlCantidad" CssClass="Texto" runat="server" Text='<%# Eval("Total", "{0:N0}")%>'></asp:Hyperlink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</td></tr></table>
<hr/>
<asp:GridView ID="GvE" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" ShowHeader="True">
<Columns>
<asp:TemplateField ItemStyle-Width="990px" HeaderText="">
<ItemTemplate>
<br/>
<table width="100%"><tr><td colspan="2" style="text-align: left;"> <asp:Label ID="LtlGpo" runat="server" Font-Size="15px" Text='<%# Eval("Agrupador")%>'></asp:Label></td></tr>
<tr><td><asp:GridView ID="GvE" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" ShowHeader="True" OnRowDataBound="GvEE_RowDataBound">
<Columns>
<asp:TemplateField ItemStyle-Width="200px" HeaderText="Respuestas">
<ItemTemplate>
<asp:Literal ID="LtlGpo" runat="server" Text='<%# Eval("Agrupador")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="50px" HeaderText="Total">
<ItemTemplate>
<asp:HyperLink ID="LtlCantidad" CssClass="Texto" runat="server" Text='<%# Eval("Total", "{0:N0}")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="50px" HeaderText="%">
<ItemTemplate>
<asp:Literal ID="LtlPor" runat="server" Text='<%# Eval("Porcentaje", "{0:N2}%")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="lightgray" />
</asp:GridView></td><td>
<asp:CHART id="ChtPie" runat="server" Palette="BrightPastel" BackColor="WhiteSmoke" Height="296px" Width="412px" BorderlineDashStyle="Solid" BackSecondaryColor="White" BackGradientStyle="TopBottom" BorderWidth="2" BorderColor="26, 59, 105" ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)">
<titles>
<asp:Title ShadowColor="32, 0, 0, 0" Font="Trebuchet MS, 14.25pt, style=Bold" ShadowOffset="3" Text="Gráfica" Name="Title1" ForeColor="26, 59, 105"></asp:Title>
</titles>
<legends>
<asp:Legend BackColor="Transparent" Alignment="Center" Docking="Bottom" Font="Trebuchet MS, 8.25pt, style=Bold" IsTextAutoFit="False" Name="Default" LegendStyle="Row"></asp:Legend>
</legends>
<borderskin SkinStyle="Emboss"></borderskin>
<series>
<asp:Series Name="Default" ChartType="Pie" BorderColor="180, 26, 59, 105" Color="220, 65, 140, 240"></asp:Series>
</series>
<chartareas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BackSecondaryColor="Transparent" BackColor="Transparent" ShadowColor="Transparent" BorderWidth="0">
<area3dstyle Rotation="0" />
<axisy LineColor="64, 64, 64, 64">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</axisy>
<axisx LineColor="64, 64, 64, 64">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</axisx>
</asp:ChartArea>
</chartareas>
</asp:CHART>
</td></tr>
</table>
<br/>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField />--%>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
<ajax:TabPanel ID="TabA" runat="server" HeaderText="Voy" Visible="False">
<ContentTemplate>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</asp:Content>

View File

@@ -0,0 +1,214 @@
Imports System.Web.UI.DataVisualization.Charting
Imports DocumentFormat.OpenXml.Office2010.Excel
Imports Extensiones
Imports System.Data
Partial Class Prospectos_RepMetas2
Inherits ClsPaginas
Public Property CveProspecto As Integer
Get
Return CType(ViewState("CveProspecto"), Integer)
End Get
Set(value As Integer)
ViewState("CveProspecto") = value
End Set
End Property
Public Property DtEncuesta As DataTable
Get
Return CType(ViewState("DtEncuesta"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtEncuesta") = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CveProspecto = IfNull(Request("CveProspecto"), "820088").ToString.ToEntero
CargaDatos()
DdlEncuesta.DataSource = GlobalDTProspectosEncuestas(UsuarioActual.CveEmpresa).FiltraParametros("CveEncuesta IN (32,48)")
DdlEncuesta.DataBind()
CargaEncuestas()
End If
End Sub
Private Sub CargaDatos()
Dim Prosp As New ClsProspectos
If Prosp.GetProspectos(CveProspecto, "-1", "-1", -1, -1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
LblNombre.Text = String.Format("{0} {1} {2}", Prosp.ApellidoPaterno, Prosp.ApellidoMaterno, Prosp.Nombres)
'If Prosp.GetProspectosHijos(CveProspecto, UsuarioActual.CveEmpresa, 1) > 0 Then
' Gv.DataSource = Prosp.DtResultados
'End If
End If
Prosp.Dispose()
Gv.DataBind()
End Sub
Public Sub CargaEncuestas()
Dim ObjProspectos As New ClsProspectos
Dim CvePersona As Integer = CveProspecto
If ObjProspectos.GetRepEncuestasEstatus(DdlEncuesta.SelectedValue.ToEntero, If(CvePersona > 0, CvePersona, 2476), UsuarioActual.CveEmpresa) Then
If ObjProspectos.DtResultados.Rows.Count > 0 Then
Dim dtt As DataTable = ObjProspectos.DtResultados
GvEstatus.DataSource = dtt
GvEstatus.DataBind()
' ChtPie.Series("Default").Points.DataBindXY(dtt.AsEnumerable, "Agrupador", dtt.AsEnumerable, "Total")
Dim yValues As Double() = {65.62, 75.54, 60.45, 55.73, 70.42}
Dim xValues As String() = {"France", "Canada", "UK", "USA", "Italy"}
Dim xValores As New ArrayList
Dim yValores As New ArrayList
For Each dr As DataRow In dtt.FiltraParametros("Estatus >= 0").Rows
yValores.Add(dr("Total").ToString.ToDouble)
xValores.Add(dr("EncuestaEstatus").ToString)
Next
ChtGral.Series("Default").Points.DataBindXY(xValores, yValores)
ChtGral.Series(0)("PieDrawingStyle") = "Concave"
ChtGral.ChartAreas("ChartArea1").Area3DStyle.Enable3D = True
ChtGral.Visible = True
End If
End If
If ObjProspectos.GetRepEncuestasRedesMetas(DdlEncuesta.SelectedValue.ToEntero, CvePersona, UsuarioActual.CveEmpresa) Then
DtEncuesta = ObjProspectos.DtResultados
'LtlAgrupador.Text = DdlAgrupador.SelectedItem.Text
'If DdlAgrupador.SelectedValue = "5" Then
' ChtPie.Visible = True
' If ObjProspectos.DtResultados.Rows.Count > 0 Then
' Dim dtt As DataTable = ObjProspectos.DtResultados.FiltraParametros("Porcentaje < 100")
' 'en el caso de sin clasificacion, elimino el primer registro poruqe viene duplicado de la consulta, porque se tiene que ignorar un groupingset
' ObjProspectos.DtResultados.Rows.RemoveAt(1)
' ViewState("DTProspectos") = ObjProspectos.DtResultados
' ' ChtPie.Series("Default").Points.DataBindXY(dtt.AsEnumerable, "Agrupador", dtt.AsEnumerable, "Total")
' Dim yValues As Double() = {65.62, 75.54, 60.45, 55.73, 70.42}
' Dim xValues As String() = {"France", "Canada", "UK", "USA", "Italy"}
' Dim xValores As New ArrayList
' Dim yValores As New ArrayList
' For Each dr As DataRow In dtt.Rows
' yValores.Add(dr("Total").ToString.ToDouble)
' xValores.Add(dr("Respuesta").ToString)
' Next
' ChtPie.Series("Default").Points.DataBindXY(xValores, yValores)
' ChtPie.Series(0)("PieDrawingStyle") = "Concave"
' ChtPie.ChartAreas("ChartArea1").Area3DStyle.Enable3D = True
' End If
'Else
'End If
Me.GvE.DataSource = DtEncuesta.FiltraParametros("CvePregunta > 0 AND CveRespuesta = -1 and NumRespuestas > 0 AND PreguntaEstatus = 'True'")
ViewState("DTProspectos") = ObjProspectos.DtResultados
Else
Me.GvE.DataSource = Nothing
End If
ObjProspectos.Dispose()
GvE.DataBind()
End Sub
Protected Sub DdlEncuesta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlEncuesta.SelectedIndexChanged
CargaEncuestas()
End Sub
Protected Sub GvE_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvE.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCGridView("GvE").DataSource = DtEncuesta.FiltraParametros(String.Format("CvePregunta = {0} AND (CveRespuesta > 0 OR CveRespuesta = -2)", e.Row.DBCampo("CvePregunta")))
e.Row.FCGridView("GvE").DataBind()
Dim dtt As DataTable = DtEncuesta.FiltraParametros(String.Format("Porcentaje < 100 And CvePregunta = {0} AND (CveRespuesta > 0 OR CveRespuesta = -2)", e.Row.DBCampo("CvePregunta")))
'en el caso de sin clasificacion, elimino el primer registro poruqe viene duplicado de la consulta, porque se tiene que ignorar un groupingset
' ChtPie.Series("Default").Points.DataBindXY(dtt.AsEnumerable, "Agrupador", dtt.AsEnumerable, "Total")
Dim yValues As Double() = {65.62, 75.54, 60.45, 55.73, 70.42}
Dim xValues As String() = {"France", "Canada", "UK", "USA", "Italy"}
Dim xValores As New ArrayList
Dim yValores As New ArrayList
For Each dr As DataRow In dtt.Rows
yValores.Add(dr("Total").ToString.ToDouble)
xValores.Add(dr("Respuesta").ToString)
Next
CType(e.Row.FindControl("ChtPie"), DataVisualization.Charting.Chart).Series("Default").Points.DataBindXY(xValores, yValores)
CType(e.Row.FindControl("ChtPie"), DataVisualization.Charting.Chart).Series(0)("PieDrawingStyle") = "Concave"
CType(e.Row.FindControl("ChtPie"), DataVisualization.Charting.Chart).ChartAreas("ChartArea1").Area3DStyle.Enable3D = True
End If
End Sub
Protected Sub Gv_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles Gv.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCLiteral("LitPor").Text = (e.Row.DBCampo("Hijos").ToDouble / e.Row.DBCampo("MetaGlobal").ToDouble * 100).FormatoNumero(0)
If e.Row.DBCampo("UltimoIngreso") <> "" AndAlso e.Row.DBCampo("UltimoIngreso") < Now.AddDays(-10) Then
e.Row.Cells(4).ForeColor = System.Drawing.Color.Red
e.Row.Cells(4).ToolTip = "Ultimo ingreso mayor a 10 dias"
End If
If e.Row.DBCampo("FechaIng") <> "" AndAlso e.Row.DBCampo("FechaIng").ToDate < Now.AddDays(-14) AndAlso e.Row.DBCampo("Hijos").ToEntero = 0 Then
e.Row.Cells(0).BackColor = System.Drawing.Color.Red
e.Row.Cells(0).ToolTip = String.Format("No se han ingresado hijos. Fecha de ingreso: {0}", e.Row.DBCampo("FechaIng").ToDate.ToShortDateString)
End If
If e.Row.DBCampo("Hijos").ToEntero = 0 Then
e.Row.FCHyperLink("Hpl").NavigateUrl = ""
End If
End If
End Sub
Protected Sub GvEE_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
' e.Row.FCLiteral("LitPor").Text = (e.Row.DBCampo("Hijos").ToDouble / e.Row.DBCampo("Meta").ToDouble * 100).FormatoNumero(0)
e.Row.FCHyperLink("LtlCantidad").NavigateUrl = String.Format("/Prospectos/RepEncuestasDetalle.aspx?CveMunicipio={0}&Seccion={1}&Sexo={2}&IFE={3}&CveEncuesta={4}&CvePregunta={5}&CveRespuesta={6}&CveProspectoPadre={7}",
e.Row.DBCampo("CveMunicipio"), e.Row.DBCampo("Seccion"), e.Row.DBCampo("Sexo"), e.Row.DBCampo("IFE"), e.Row.DBCampo("CveEncuesta"), e.Row.DBCampo("CvePregunta"), e.Row.DBCampo("CveRespuesta"), e.Row.DBCampo("CveProspectoPadre"))
End If
End Sub
Protected Sub GvEstatus_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEstatus.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCHyperLink("LtlCantidad").NavigateUrl = String.Format("/Prospectos/RepEncuestasRedesDetalle.aspx?CveMunicipio={0}&Seccion={1}&Sexo={2}&IFE={3}&CveEncuesta={4}&CvePregunta={5}&CveRespuesta={6}&CveEvento={7}&CveProspectoPadre={8}&Estatus={9}",
-1, -1, -1, -1, e.Row.DBCampo("CveEncuesta"), -1, -1, -1, CveProspecto, e.Row.DBCampo("Estatus"))
If e.Row.DBCampo("Estatus") = "-1" Then
e.Row.CssClass = "SubTotales2"
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center
End If
End If
End Sub
End Class

333
Prospectos/RepPadron.aspx Normal file
View File

@@ -0,0 +1,333 @@
<%@ Page Title="Reporte de Padrón" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPadron.aspx.vb" Inherits="Prospectos_RepPadron" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" Runat="Server">
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />&nbsp;&nbsp;
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" Runat="Server">
Reporte de Padrón
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
<script type="text/javascript">
var SelectedRow = null;
var SelectedRowIndex = null;
var UpperBound = null;
var LowerBound = null;
window.onload = function () {
UpperBound = parseInt('<%= GvDatos.Rows.Count%>') - 1;
LowerBound = 0;
SelectedRowIndex = -1;
}
function SelectRow(CurrentRow, RowIndex) {
if (SelectedRow == CurrentRow || RowIndex > UpperBound || RowIndex < LowerBound)
return;
if (SelectedRow != null) {
SelectedRow.style.backgroundColor = SelectedRow.originalBackgroundColor;
SelectedRow.style.color = SelectedRow.originalForeColor;
}
if (CurrentRow != null) {
CurrentRow.originalBackgroundColor = CurrentRow.style.backgroundColor;
CurrentRow.originalForeColor = CurrentRow.style.color;
CurrentRow.style.backgroundColor = '#65b0bf';
CurrentRow.style.color = 'Black';
}
SelectedRow = CurrentRow;
SelectedRowIndex = RowIndex;
setTimeout("SelectedRow.focus();", 0);
}
function SelectSibling(e) {
var e = e ? e : window.event;
var KeyCode = e.which ? e.which : e.keyCode;
if (KeyCode == 40) {
SelectRow(SelectedRow.nextSibling, SelectedRowIndex + 1);
}
else if (KeyCode == 38) {
SelectRow(SelectedRow.previousSibling, SelectedRowIndex - 1);
}
return false;
}
function EC() {
event.cancelBubble = true;
if (event.stopPropagation)
event.stopPropagation();
}
</script>
<%--<script language="javascript" type="text/javascript">
var gridViewCtlId = '<%=GvDatos.ClientID%>';
var gridViewCtl = null;
var curSelRow = null;
function getGridViewControl() {
if (null == gridViewCtl) {
gridViewCtl = document.getElementById(gridViewCtlId);
}
}
function onGridViewRowSelected(rowIdx) {
var selRow = getSelectedRow(rowIdx);
if (curSelRow != null) {
curSelRow.style.backgroundColor = '#ffffff';
}
if (null != selRow) {
curSelRow = selRow;
curSelRow.style.backgroundColor = '#ff0022';
}
}
function getSelectedRow(rowIdx) {
getGridViewControl();
if (null != gridViewCtl) {
return gridViewCtl.rows[rowIdx];
}
return null;
}
</script> --%>
<%--<script language="javascript" type="text/javascript">
var originalstyle = "";
</script>--%>
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr align="left" class="SubTotales">
<td style="width: 70px;">&nbsp;Dist. Loc.</td>
<td style="width: 100px;">
<asp:DropDownList ID="DdlDistLoc" runat="server" DataTextField="Dist_Loc" DataValueField="Dist_Loc" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="width: 70px;">&nbsp;Municipio</td>
<td style="width: 100px;">
<asp:DropDownList ID="DdlMunicipio" runat="server" DataTextField="PadronMunicipio" DataValueField="CvePadronMunicipio" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="width: 70px;">&nbsp;Sección</td>
<td style="width: 100px;">
<asp:DropDownList ID="DdlSeccion" runat="server" DataTextField="seccion" DataValueField="seccion" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="width: 70px;">&nbsp;Dist. Fed</td>
<td style="width: 100px;">
<asp:DropDownList ID="DdlDistFed" runat="server" DataTextField="Dist_Fed" DataValueField="Dist_Fed" Width="100px">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="width: 80px;">&nbsp;Ocupación</td>
<td style="width: 100px;">
<asp:DropDownList ID="DdlOcupacion" runat="server" DataTextField="Ocupacion" DataValueField="Ocupacion" Width="100px">
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td style="width: 80px;">&nbsp;Agrupador</td>
<td style="width: 100px;">
<asp:DropDownList ID="DdlAgrupador" runat="server" AppendDataBoundItems="true" Width="100px">
<asp:ListItem Text="Municipio" Value="1"></asp:ListItem>
<asp:ListItem Text="Distrito Federal" Value="2"></asp:ListItem>
<asp:ListItem Text="Distrito Local" Value="3"></asp:ListItem>
<asp:ListItem Text="Sección Electoral" Value="4"></asp:ListItem>
<asp:ListItem Text="Colonia" Value="5"></asp:ListItem>
<asp:ListItem Text="Ocupación" Value="6"></asp:ListItem>
<asp:ListItem Selected="True" Text="Sexo" Value="7"></asp:ListItem>
<asp:ListItem Text="Rango de Edad" Value="8"></asp:ListItem>
<asp:ListItem Text="Año Nacimiento" Value="9"></asp:ListItem>
<asp:ListItem Text="Código Postal" Value="10"></asp:ListItem>
</asp:DropDownList>
</td>
<td align="left" style="border-left-style: solid; border-left-color: Blue; border-left-width: 1px;"><asp:Button ID="BtnConsultar" runat="server" Text="Consultar" /></td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<%--1640--%>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table id="TbEncabezado" border="1" rules="all" runat="server" style="border-collapse: collapse;" width="1970px">
<tr class="Titulos">
<td>Agrupador</td>
<td rowspan="2" style="width: 60px;">Cantidad</td>
<td class="BorderR" rowspan="2" style="width: 60px;">Votaron</td>
<td class="BorderR" colspan="5"><a class="TextoBlanco" href="/Prospectos/RepSimpatizantes.aspx">Equipo J.G.M.</a></td>
<td class="BorderR" colspan="7">Programas del Gobierno</td>
<td class="BorderR" colspan="4">Nóminas del Gobierno</td>
<td class="BorderR" colspan="3">Otros</td>
<td class="BorderR" colspan="2">Contacto</td>
<%--<td rowspan="2">&nbsp;</td>--%>
</tr>
<tr class="Titulos">
<td style="width: 120px;"><asp:Literal ID="LtlAgrupador" runat="server"></asp:Literal></td>
<td style="width: 60px;">Redes</td>
<td style="width: 70px;">Estructura</td>
<td style="width: 60px;">Eventos</td>
<td style="width: 60px;">Apoyos</td>
<td class="BorderR" style="width: 60px;">Total</td>
<td style="width: 70px;">CRECER</td>
<td style="width: 100px;">CRECER<br />Madre Fam.</td>
<td style="width: 80px;">Ahorrando</td>
<td style="width: 100px;">Mejor vivienda</td>
<td style="width: 105px;">Vivienda Urbana</td>
<td style="width: 100px;">Seguro Popular</td>
<td class="BorderR" style="width: 110px;">FOVISSSTESON</td>
<td style="width: 100px;">Honorarios GES</td>
<td style="width: 80px;">ISSSTESON</td>
<td style="width: 70px;">Nómina GES</td>
<td class="BorderR" style="width: 70px;">Nómina SEC</td>
<td style="width: 60px;">Licencia</td>
<td style="width: 60px;">Placas</td>
<td class="BorderR" style="width: 120px;">Org. Descentralizados</td>
<td style="width: 60px;">TELMEX</td>
<td class="BorderR" style="width: 60px;">Mail</td>
</tr>
</table>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" ShowHeader="false" Width="1970px">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlGpo" runat="server" Text='<%# Eval("Agrupador")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlVoto" runat="server" Text='<%# Eval("Voto", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle CssClass="BorderR" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlRedes" runat="server" Text='<%# Eval("Redes", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEstructuras" runat="server" Text='<%# Eval("Estructuras", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlEventos" runat="server" Text='<%# Eval("Eventos", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlApoyos" runat="server" Text='<%# Eval("Apoyos", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlTotalJGM" runat="server" Text='<%# Eval("TotalJGM", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle CssClass="BorderR" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCrecer" runat="server" Text='<%# Eval("CRECER", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlCrecerMadreFam" runat="server" Text='<%# Eval("CRECER_MadreFam", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlAhorrando" runat="server" Text='<%# Eval("Ahorrando", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMejorVivienda" runat="server" Text='<%# Eval("MejorVivienda", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlViviendaUrbana" runat="server" Text='<%# Eval("ViviendaUrbana", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlSeguroPopular" runat="server" Text='<%# Eval("SeguroPopular", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlFovisssteson" runat="server" Text='<%# Eval("FOVISSSTESON", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle CssClass="BorderR" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlHonorarios" runat="server" Text='<%# Eval("HonorariosEstado", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlISSSTESON" runat="server" Text='<%# Eval("ISSSTESON", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlNominaEstado" runat="server" Text='<%# Eval("NominaEstado", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlNominaSec" runat="server" Text='<%# Eval("NominaSec", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle CssClass="BorderR" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlLicencia" runat="server" Text='<%# Eval("Licencia", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlPlacas" runat="server" Text='<%# Eval("Placas", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlOrganismosDecentralizados" runat="server" Text='<%# Eval("OrganismosDecentralizados", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle CssClass="BorderR" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlTelmex" runat="server" Text='<%# Eval("Telmex", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="LtlMail" runat="server" Text='<%# Eval("Mail", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
<ItemStyle CssClass="BorderR" />
</asp:TemplateField>
<%--<asp:BoundField />--%>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

View File

@@ -0,0 +1,335 @@

Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Prospectos_RepPadron
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = String.Empty
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
Public Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetRepPadron(DdlMunicipio.SelectedValue.ToEntero, DdlDistFed.SelectedValue.ToEntero, DdlDistLoc.SelectedValue.ToEntero, DdlSeccion.SelectedValue.ToEntero, DdlOcupacion.SelectedValue, DdlAgrupador.SelectedValue.ToEntero) Then
If DdlAgrupador.SelectedValue = "2" OrElse DdlAgrupador.SelectedValue = "3" OrElse DdlAgrupador.SelectedValue = "4" Then
Dim DT As DataTable = ObjProspectos.DtResultados
DT.Columns.Add("int_agrupador", GetType(Integer))
For Each Row As DataRow In DT.Rows
Row("int_agrupador") = GetNumber(Row("agrupador").ToString)
Next
DT = DT.FiltraParametros("", "int_agrupador")
ViewState("DTProspectos") = DT
If DT IsNot Nothing Then DT.Dispose()
Else
ViewState("DTProspectos") = ObjProspectos.DtResultados
End If
LtlAgrupador.Text = DdlAgrupador.SelectedItem.Text
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 Function GetNumber(Str As String) As Integer
Dim Result As System.Text.RegularExpressions.Match = System.Text.RegularExpressions.Regex.Match(Str, "\d+")
Return Result.Value.ToEntero
End Function
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_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowCreated
If (e.Row.RowType = DataControlRowType.DataRow AndAlso (e.Row.RowState = DataControlRowState.Normal OrElse e.Row.RowState = DataControlRowState.Alternate)) Then
e.Row.TabIndex = -1
e.Row.Attributes("onclick") = String.Format("javascript:SelectRow(this, {0});", e.Row.RowIndex)
e.Row.Attributes("onkeydown") = "javascript:return SelectSibling(event);"
e.Row.Attributes("onselectstart") = "javascript:return false;"
e.Row.Cells(10).Attributes.Add("onclick", "EC();")
End If
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
Dim FC1 As New SortedList
FC1.Add(0, "Sexo,1,1")
FC1.Add(1, "Redes,1,1,Titulos")
FC1.Add(2, "Estructura,1,1,Titulos")
FC1.Add(3, "Eventos,1,1,Titulos")
FC1.Add(4, "Apoyos,1,1,Titulos")
FC1.Add(5, "Total,1,1,BorderR")
FC1.Add(6, "CRECER,1,1,Titulos")
FC1.Add(7, "CRECER Madre Fam.,1,1,Titulos")
FC1.Add(8, "Ahorrando,1,1,Titulos")
FC1.Add(9, "Mejor vivienda,1,1,Titulos")
FC1.Add(10, "Vivienda Urbana,1,1,Titulos")
FC1.Add(11, "Seguro Popular,1,1,Titulos")
FC1.Add(12, "FOVISSSTESON,1,1,BorderR")
FC1.Add(13, "Honorarios GES,1,1,Titulos")
FC1.Add(14, "ISSSTESON,1,1,Titulos")
FC1.Add(15, "Nómina GES,1,1,Titulos")
FC1.Add(16, "Nómina SEC,1,1,BorderR")
FC1.Add(17, "Licencia,1,1,Titulos")
FC1.Add(18, "Placas,1,1,Titulos")
FC1.Add(19, "Org. Descentralizados,1,1,BorderR")
FC1.Add(20, "TELMEX,1,1,Titulos")
FC1.Add(21, "Mail,1,1,BorderR")
FC1.Add(22, "P1 Plus,1,1,Titulos")
FC1.Add(23, "P1,1,1,BorderR")
FC1.Add(24, "A,1,1,Titulos")
FC1.Add(25, "AA,1,1,Titulos")
FC1.Add(26, "AAA,1,1,Titulos")
FC1.Add(27, "OP/252,1,1,Titulos")
FC1.Add(28, "PRD,1,1,Titulos")
FC1.Add(29, "R,1,1,Titulos")
FC1.Add(30, "RESECC,1,1,Titulos")
FC1.Add(31, "SR,1,1,Titulos")
GetMultiRowHeader(e, FC1, "Titulos")
Dim FC As New SortedList
FC.Add(0, " Agrupador,1,1,Titulos")
FC.Add(1, "Cantidad,1,2,Titulos")
FC.Add(2, "Votaron,1,2,BorderR")
FC.Add(3, "Equipo J.G.M.,5,1,BorderR")
FC.Add(4, "Programas del Gobierno,7,1,BorderR")
FC.Add(5, "Nóminas del Gobierno,4,1,BorderR")
FC.Add(6, "Otros,3,1,BorderR")
FC.Add(7, "Contacto,2,1,BorderR")
FC.Add(8, "Gob,2,1,BorderR")
FC.Add(9, "252,8,1,BorderR")
GetMultiRowHeader(e, FC, "Titulos")
End If
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.RowIndex = 0 Then
e.Row.CssClass = "SubTotales"
e.Row.FCLiteral("LtlGpo").Text = "Total"
'Ligas
e.Row.FCLiteral("LtlRedes").Text = "<a class=""Texto"" href=""/Prospectos/RepProspectosRedes.aspx"">" & e.Row.FCLiteral("LtlRedes").Text & "</a>"
e.Row.FCLiteral("LtlEstructuras").Text = "<a class=""Texto"" href=""/Prospectos/RepRedesEstructuras.aspx"">" & e.Row.FCLiteral("LtlEstructuras").Text & "</a>"
e.Row.FCLiteral("LtlEventos").Text = "<a class=""Texto"" href=""/Prospectos/RepEventos.aspx"">" & e.Row.FCLiteral("LtlEventos").Text & "</a>"
ElseIf e.Row.RowIndex = 1 Then
e.Row.Cells(0).Width = Unit.Pixel(120) 'Gpo
e.Row.Cells(1).Width = Unit.Pixel(60) 'Cantidad
e.Row.Cells(2).Width = Unit.Pixel(60) 'Votaron
'JGM
e.Row.Cells(3).Width = Unit.Pixel(60) 'Redes
e.Row.Cells(4).Width = Unit.Pixel(70) 'Estructuras
e.Row.Cells(5).Width = Unit.Pixel(60) 'Eventos
e.Row.Cells(6).Width = Unit.Pixel(60) 'Apoyos
e.Row.Cells(7).Width = Unit.Pixel(60) 'Total
'Programas del Gobierno
e.Row.Cells(8).Width = Unit.Pixel(70) 'CRECER
e.Row.Cells(9).Width = Unit.Pixel(100) 'CRECER Madre Fam
e.Row.Cells(10).Width = Unit.Pixel(80) 'Ahorrando
e.Row.Cells(11).Width = Unit.Pixel(105) 'Mejor Vivienda
e.Row.Cells(12).Width = Unit.Pixel(100) 'Vivienda Urbana
e.Row.Cells(13).Width = Unit.Pixel(100) 'Seguro Popular
e.Row.Cells(14).Width = Unit.Pixel(110) 'FOVI
'Nóminas del Gobierno
e.Row.Cells(15).Width = Unit.Pixel(100) 'Honorarios GES
e.Row.Cells(16).Width = Unit.Pixel(80) 'ISSSTESON
e.Row.Cells(17).Width = Unit.Pixel(70) 'Nómina GES
e.Row.Cells(18).Width = Unit.Pixel(70) 'Nómina SEC
'Otros
e.Row.Cells(19).Width = Unit.Pixel(60) ' Licencias
e.Row.Cells(20).Width = Unit.Pixel(60) 'Placas
e.Row.Cells(21).Width = Unit.Pixel(120) 'Org. Des
'Contactos
e.Row.Cells(22).Width = Unit.Pixel(60) 'Telmex
e.Row.Cells(23).Width = Unit.Pixel(60) 'Mail
''Clasificaciones
'e.Row.Cells(24).Width = Unit.Pixel(60) 'P1 Plus
'e.Row.Cells(25).Width = Unit.Pixel(60) 'P1
'e.Row.Cells(26).Width = Unit.Pixel(60) 'A
'e.Row.Cells(27).Width = Unit.Pixel(60) 'AA
'e.Row.Cells(28).Width = Unit.Pixel(60) 'AAA
'e.Row.Cells(29).Width = Unit.Pixel(60) '252
'e.Row.Cells(30).Width = Unit.Pixel(60) 'PRD
'e.Row.Cells(31).Width = Unit.Pixel(60) 'R
'e.Row.Cells(32).Width = Unit.Pixel(60) 'RESECC
'e.Row.Cells(33).Width = Unit.Pixel(60) 'SR
End If
If e.Row.FCLiteral("LtlGpo").Text = "0" Then
e.Row.BackColor = Drawing.Color.LightGray
e.Row.FCLiteral("LtlGpo").Text = "SIN PADRÓN"
End If
If e.Row.RowIndex > 0 Then
e.Row.FCLiteral("LtlRedes").Text = "" : e.Row.FCLiteral("LtlEventos").Text = "" : e.Row.FCLiteral("LtlEstructuras").Text = ""
e.Row.FCLiteral("LtlTotalJGM").Text = ""
End If
'Dim Liga As String = "<a class=""Texto"" href=""/Prospectos/RepPadronDetalle.aspx"">"
'e.Row.FCLiteral("LtlGpo").Text = Liga & e.Row.FCLiteral("LtlGpo").Text & "</a>"
'e.Row.FCLiteral("LtlCantidad").Text = Liga & e.Row.FCLiteral("LtlCantidad").Text & "</a>"
'e.Row.FCLiteral("LtlVoto").Text = Liga & e.Row.FCLiteral("LtlVoto").Text & "</a>"
'e.Row.FCLiteral("LtlRedes").Text = Liga & e.Row.FCLiteral("LtlRedes").Text & "</a>"
'e.Row.FCLiteral("LtlEstructuras").Text = Liga & e.Row.FCLiteral("LtlEstructuras").Text & "</a>"
'e.Row.FCLiteral("LtlEventos").Text = Liga & e.Row.FCLiteral("LtlEventos").Text & "</a>"
'e.Row.FCLiteral("LtlApoyos").Text = Liga & e.Row.FCLiteral("LtlApoyos").Text & "</a>"
'e.Row.FCLiteral("LtlCrecer").Text = Liga & e.Row.FCLiteral("LtlCrecer").Text & "</a>"
'e.Row.FCLiteral("LtlCrecerMadreFam").Text = Liga & e.Row.FCLiteral("LtlCrecerMadreFam").Text & "</a>"
'e.Row.FCLiteral("LtlAhorrando").Text = Liga & e.Row.FCLiteral("LtlAhorrando").Text & "</a>"
'e.Row.FCLiteral("LtlMejorVivienda").Text = Liga & e.Row.FCLiteral("LtlMejorVivienda").Text & "</a>"
'e.Row.FCLiteral("LtlViviendaUrbana").Text = Liga & e.Row.FCLiteral("LtlViviendaUrbana").Text & "</a>"
'e.Row.FCLiteral("").Text = Liga & e.Row.FCLiteral("").Text & "</a>"
'e.Row.FCLiteral("").Text = Liga & e.Row.FCLiteral("").Text & "</a>"
'e.Row.FCLiteral("").Text = Liga & e.Row.FCLiteral("").Text & "</a>"
'e.Row.FCLiteral("").Text = Liga & e.Row.FCLiteral("").Text & "</a>"
'e.Row.FCLiteral("").Text = Liga & e.Row.FCLiteral("").Text & "</a>"
'e.Row.FCLiteral("").Text = Liga & e.Row.FCLiteral("").Text & "</a>"
'e.Row.FCLiteral("").Text = Liga & e.Row.FCLiteral("").Text & "</a>"
'e.Row.FCLiteral("").Text = Liga & e.Row.FCLiteral("").Text & "</a>"
'e.Row.FCLiteral("").Text = Liga & e.Row.FCLiteral("").Text & "</a>"
'e.Row.FCLiteral("").Text = Liga & e.Row.FCLiteral("").Text & "</a>"
'e.Row.FCLiteral("").Text = Liga & e.Row.FCLiteral("").Text & "</a>"
'Alineo columnas
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
For i As Integer = 1 To 22
e.Row.Cells(i).HorizontalAlign = HorizontalAlign.Right
Next
'e.Row.Attributes.Add("onmouseover", "this.originalstyle=this.style.backgroundColor;this.style.backgroundColor='#EEFFAA'")
'e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalstyle;")
End If
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos()
UPDatos.Update()
Me.RegistraScript("UpperBound = " & GvDatos.Rows.Count - 1 & ";")
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("Padron", TbEncabezado)
End Sub
'Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlMunicipio.SelectedIndexChanged
' Dim DT As DataTable = CType(ViewState("Distritos"), DataTable)
' DT = DT.FiltraParametros("Municipio = " & DdlMunicipio.SelectedValue, "", {"Dist_Fed"})
' DdlDistFed.DataSource = DT
' DdlDistFed.DataBind()
' DdlDistFed.Items.Insert(0, New ListItem("Todos", "-1"))
' If DT IsNot Nothing Then DT.Dispose()
'End Sub
'Protected Sub DdlDistFed_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlDistFed.SelectedIndexChanged
' Dim DT As DataTable = CType(ViewState("Distritos"), DataTable)
' DT = DT.FiltraParametros("Dist_Fed = " & DdlDistFed.SelectedValue, "", {"Dist_Loc"})
' DdlDistLoc.DataSource = DT
' DdlDistLoc.DataBind()
' DdlDistLoc.Items.Insert(0, New ListItem("Todos", "-1"))
' If DT IsNot Nothing Then DT.Dispose()
'End Sub
'Protected Sub DdlDistLoc_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlDistLoc.SelectedIndexChanged
' Dim DT As DataTable = CType(ViewState("Distritos"), DataTable)
' DT = DT.FiltraParametros("Dist_Loc = " & DdlDistLoc.SelectedValue, "", {"seccion"})
' DdlSeccion.DataSource = DT
' DdlSeccion.DataBind()
' DdlSeccion.Items.Insert(0, New ListItem("Todos", "-1"))
' If DT IsNot Nothing Then DT.Dispose()
'End Sub
End Class

View File

@@ -0,0 +1,181 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPadronDetalle.aspx.vb" Inherits="Prospectos_RepPadronDetalle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Reporte de Padrón, Detallado
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />&nbsp;&nbsp;
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" CssClass="table table-striped table-advance table-hover" style="margin-top:-10px; text-align:center;" GridLines="None" >
<Columns>
<asp:TemplateField>
<HeaderTemplate>Clave Electoral</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlClave" runat="server" Text='<%# Eval("Clave")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Nombre</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNombreCompleto" runat="server" Text='<%# Eval("NombreCompleto")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Edad</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEdad" runat="server" Text='<%# Eval("Edad")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Sexo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSexo" runat="server" Text='<%# Eval("Sexo")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Calle</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCalle" runat="server" Text='<%# Eval("Calle")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Num. Ext.</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNumExterior" runat="server" Text='<%# Eval("NumExterior")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Num. Int.</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNumInterior" runat="server" Text='<%# Eval("NumInterior")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Colonia</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlColonia" runat="server" Text='<%# Eval("Colonia")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>C.P.</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCP" runat="server" Text='<%# Eval("CP")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Ocupación</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlOcupacion" runat="server" Text='<%# Eval("Ocupacion")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Municipio</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMunicipio" runat="server" Text='<%# Eval("PadronMunicipio")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Dist. Federal</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlDistritoFederal" runat="server" Text='<%# Eval("Dist_Fed")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Dist. Local</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlDistritoLocal" runat="server" Text='<%# Eval("Dist_Loc")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Sección</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSeccion" runat="server" Text='<%# Eval("Seccion")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Votos</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlVoto" runat="server" Text='<%# Eval("Voto")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Mail</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmail" runat="server" Text='<%# Eval("Email")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Teléfonos</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTelefonos" runat="server" Text='<%# Eval("TELEFONO_S")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
var SelectedRow = null;
var SelectedRowIndex = null;
var UpperBound = null;
var LowerBound = null;
window.onload = function () {
UpperBound = parseInt('<%= GvDatos.Rows.Count%>') - 1;
LowerBound = 0;
SelectedRowIndex = -1;
}
function SelectRow(CurrentRow, RowIndex) {
if (SelectedRow == CurrentRow || RowIndex > UpperBound || RowIndex < LowerBound)
return;
if (SelectedRow != null) {
SelectedRow.style.backgroundColor = SelectedRow.originalBackgroundColor;
SelectedRow.style.color = SelectedRow.originalForeColor;
}
if (CurrentRow != null) {
CurrentRow.originalBackgroundColor = CurrentRow.style.backgroundColor;
CurrentRow.originalForeColor = CurrentRow.style.color;
CurrentRow.style.backgroundColor = '#65b0bf';
CurrentRow.style.color = 'Black';
}
SelectedRow = CurrentRow;
SelectedRowIndex = RowIndex;
setTimeout("SelectedRow.focus();", 0);
}
function SelectSibling(e) {
var e = e ? e : window.event;
var KeyCode = e.which ? e.which : e.keyCode;
if (KeyCode == 40) {
SelectRow(SelectedRow.nextSibling, SelectedRowIndex + 1);
}
else if (KeyCode == 38) {
SelectRow(SelectedRow.previousSibling, SelectedRowIndex - 1);
}
return false;
}
function EC() {
event.cancelBubble = true;
if (event.stopPropagation)
event.stopPropagation();
}
</script>
</asp:Content>

View File

@@ -0,0 +1,57 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Prospectos_RepPadronDetalle
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = String.Empty
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetRepPadronDetalle() Then
ViewState("DTProspectos") = 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
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 ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("PadronDetalle")
End Sub
Protected Sub GvDatos_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowCreated
If (e.Row.RowType = DataControlRowType.DataRow AndAlso (e.Row.RowState = DataControlRowState.Normal OrElse e.Row.RowState = DataControlRowState.Alternate)) Then
e.Row.TabIndex = -1
e.Row.Attributes("onclick") = String.Format("javascript:SelectRow(this, {0});", e.Row.RowIndex)
e.Row.Attributes("onkeydown") = "javascript:return SelectSibling(event);"
e.Row.Attributes("onselectstart") = "javascript:return false;"
e.Row.Cells(10).Attributes.Add("onclick", "EC();")
End If
End Sub
End Class

View File

@@ -0,0 +1,207 @@
<%@ Page Title="Reporte de Prospectos" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepProspectos.aspx.vb" Inherits="Prospectos_RepProspectos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" Runat="Server">
<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="17px" Height="17px" />&nbsp;&nbsp;
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" Runat="Server">
Reporte de Prospectos
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
<%-- <script type="text/javascript">
var SelectedRow = null;
var SelectedRowIndex = null;
var UpperBound = null;
var LowerBound = null;
window.onload = function () {
UpperBound = parseInt('<%= GvDatos.Rows.Count%>') - 1;
LowerBound = 0;
SelectedRowIndex = -1;
}
function SelectRow(CurrentRow, RowIndex) {
if (SelectedRow == CurrentRow || RowIndex > UpperBound || RowIndex < LowerBound)
return;
if (SelectedRow != null) {
SelectedRow.style.backgroundColor = SelectedRow.originalBackgroundColor;
SelectedRow.style.color = SelectedRow.originalForeColor;
}
if (CurrentRow != null) {
CurrentRow.originalBackgroundColor = CurrentRow.style.backgroundColor;
CurrentRow.originalForeColor = CurrentRow.style.color;
CurrentRow.style.backgroundColor = '#65b0bf';
CurrentRow.style.color = 'Black';
}
SelectedRow = CurrentRow;
SelectedRowIndex = RowIndex;
setTimeout("SelectedRow.focus();", 0);
}
function SelectSibling(e) {
var e = e ? e : window.event;
var KeyCode = e.which ? e.which : e.keyCode;
if (KeyCode == 40) {
SelectRow(SelectedRow.nextSibling, SelectedRowIndex + 1);
}
else if (KeyCode == 38) {
SelectRow(SelectedRow.previousSibling, SelectedRowIndex - 1);
}
return false;
}
function EC() {
event.cancelBubble = true;
if (event.stopPropagation)
event.stopPropagation();
}
</script> --%>
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr class="SubTotales">
<td style="width: 101px; text-align: right;">Vendedor:
</td>
<td style="width: 188px;">
<asp:DropDownList ID="ddlVendedor" runat="server" Width="131px" DataTextField="Vendedor" DataValueField="CveVendedor"></asp:DropDownList>
</td>
<td style="width: 80px;">&nbsp;Agrupador</td>
<td style="width: 100px;">
<asp:DropDownList ID="DdlAgrupador" runat="server" AppendDataBoundItems="true" Width="100px">
<asp:ListItem Text="Municipio" Value="1"></asp:ListItem>
<asp:ListItem Text="Clasificacion" Value="2"></asp:ListItem>
<asp:ListItem Text="Vendedor" Value="3"></asp:ListItem>
<asp:ListItem Text="Tipo de Prospecto" Value="4"></asp:ListItem>
<asp:ListItem Text="Fecha" Value="5"></asp:ListItem>
</asp:DropDownList>
</td>
<td align="left" style="border-left-style: solid; border-left-color: Blue; border-left-width: 1px;"><asp:Button ID="BtnConsultar" runat="server" Text="Consultar" /></td>
</tr>
</table>
<br/>
</ContentTemplate>
</asp:UpdatePanel>
<%--1640--%>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Prospectos Registrados" >
<Columns>
<asp:TemplateField Visible="False">
<ItemTemplate>
<asp:Literal ID="LtlGpo" runat="server" Text='<%# Eval("Cantidad")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False">
<ItemTemplate>
<asp:Literal ID="LtlCantidad" runat="server" Text='<%# Eval("Cantidad", "{0:N0}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Empresa">
<HeaderTemplate><asp:LinkButton ID="LbEmpresaNombre" runat="server" CausesValidation="false" Text="Empresa" OnClick="LbOrden_Click" CommandArgument="EmpresaNombre"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEmpresaNombre" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" CommandArgument="EmpresaNombre"/></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEmpresa" runat="server" Text='<%# Eval("EmpresaNombre")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Nombre" ItemStyle-Width="250px">
<HeaderTemplate><asp:LinkButton ID="LbAgrupador_OrdenAgrupador_NombreCompleto" runat="server" CausesValidation="false" Text="Nombre" OnClick="LbOrden_Click" CommandArgument="Agrupador,OrdenAgrupador,NombreCompleto"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgAgrupador_OrdenAgrupador_NombreCompleto" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" CommandArgument="Agrupador,OrdenAgrupador,NombreCompleto"/></HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplNombre" CssClass="Texto" runat="server" Text='<%# Eval("NombreCompleto")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Calle">
<HeaderTemplate><asp:LinkButton ID="LbCalle" runat="server" CausesValidation="false" Text="Calle" OnClick="LbOrden_Click" CommandArgument="Calle"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCalle" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" CommandArgument="Calle"/></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCalle" runat="server" Text='<%# Eval("Calle")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField headerText ="#">
<HeaderTemplate><asp:LinkButton ID="LbNumero" runat="server" CausesValidation="false" Text="#" OnClick="LbOrden_Click" CommandArgument="Numero"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgNumero" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" CommandArgument="Numero"/></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlNumero" runat="server" Text='<%# Eval("Numero")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" Visible="False">
<HeaderTemplate><asp:LinkButton ID="LbEntreCalle1" runat="server" CausesValidation="false" Text="Entre Calle" OnClick="LbOrden_Click" CommandArgument="EntreCalle1"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEntreCalle1" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" CommandArgument="EntreCalle1"/></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEntreCalle1" runat="server" Text='<%# Eval("EntreCalle1")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" Visible="False">
<HeaderTemplate><asp:LinkButton ID="LbEntreCalle2" runat="server" CausesValidation="false" Text="y Calle" OnClick="LbOrden_Click" CommandArgument="EntreCalle2"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgEntreCalle2" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" CommandArgument="EntreCalle2"/></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlEntreCalle2" runat="server" Text='<%# Eval("EntreCalle2")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<HeaderTemplate><asp:LinkButton ID="LbColonia" runat="server" CausesValidation="false" Text="Colonia" OnClick="LbOrden_Click" CommandArgument="Colonia"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgColonia" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" CommandArgument="Colonia"/></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlColonia" runat="server" Text='<%# Eval("Colonia")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" Visible="False">
<HeaderTemplate><asp:LinkButton ID="LbCodigoPostal" runat="server" CausesValidation="false" Text="Código Postal" OnClick="LbOrden_Click" CommandArgument="CodigoPostal"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCodigoPostal" CommandArgument="CodigoPostal" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" /></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCodigoPostal" runat="server" Text='<%# Eval("CodigoPostal","{0:#####}")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Municipio">
<HeaderTemplate><asp:LinkButton ID="LbMunicipio" runat="server" CausesValidation="false" Text="Municipio" OnClick="LbOrden_Click" CommandArgument="Municipio"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgMunicipio" CommandArgument="Municipio" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" /></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMunicipio" runat="server" Text='<%# Eval("Municipio")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<HeaderTemplate><asp:LinkButton ID="LbTelefono" runat="server" CausesValidation="false" Text="Teléfono" OnClick="LbOrden_Click" CommandArgument="Telefono"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgTelefono" CommandArgument="Telefono" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" /></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlTelefono" runat="server" Text='<%# Eval("Telefono")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Celular">
<HeaderTemplate><asp:LinkButton ID="LbCelular" runat="server" CausesValidation="false" Text="Celular" OnClick="LbOrden_Click" CommandArgument="Celular"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCelular" CommandArgument="Celular" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" /></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCelular" runat="server" Text='<%# Eval("Celular")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<HeaderTemplate><asp:LinkButton ID="LbCorreo" runat="server" CausesValidation="false" Text="Correo" OnClick="LbOrden_Click" CommandArgument="Correo"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgCorreo" CommandArgument="Correo" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" /></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlCorreo" runat="server" Text='<%# Eval("Correo")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<HeaderTemplate><asp:LinkButton ID="LbProspectoClasificacion" runat="server" CausesValidation="false" Text="Clasificación" OnClick="LbOrden_Click" CommandArgument="ProspectoClasificacion"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgProspectoClasificacion" CommandArgument="ProspectoClasificacion" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" /></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlProspectoClasificacion" runat="server" Text='<%# Eval("ProspectoClasificacion")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Vendedor">
<HeaderTemplate><asp:LinkButton ID="LbVendedor" runat="server" CausesValidation="false" Text="Vendedor" OnClick="LbOrden_Click" CommandArgument="Vendedor"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgVendedor" CommandArgument="Vendedor" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" /></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlVendedor" runat="server" Text='<%# Eval("Vendedor")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Calificación">
<HeaderTemplate><asp:LinkButton ID="LbProspectoTipo" runat="server" CausesValidation="false" Text="Calificación" OnClick="LbOrden_Click" CommandArgument="ProspectoTipo"></asp:LinkButton>&nbsp;<asp:ImageButton ID="ImgProspectoTipo" CommandArgument="ProspectoTipo" runat="server" CausesValidation="false" ImageUrl="/Imagenes/FlechasAbajo.gif" OnClick="LbOrden_Click" /></HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlProspectoTipo" runat="server" Text='<%# Eval("ProspectoTipo")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<AlternatingRowStyle CssClass="TextoAlterno" />
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

View File

@@ -0,0 +1,127 @@

Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class Prospectos_RepProspectos
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("Orden") = String.Empty
ddlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
ddlVendedor.DataBind()
ddlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
'rol de prospectador
If UsuarioActual.CveRol = 1015 Then
ddlVendedor.Enabled = False
End If
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjProspectos As New ClsProspectos
If ObjProspectos.GetRepProspectos(ddlVendedor.SelectedValue.ToEntero, DdlAgrupador.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
ViewState("DTProspectos") = 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("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_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GvDatos.RowCreated
' If (e.Row.RowType = DataControlRowType.DataRow AndAlso (e.Row.RowState = DataControlRowState.Normal OrElse e.Row.RowState = DataControlRowState.Alternate)) Then
' e.Row.TabIndex = -1
' e.Row.Attributes("onclick") = String.Format("javascript:SelectRow(this, {0});", e.Row.RowIndex)
' e.Row.Attributes("onkeydown") = "javascript:return SelectSibling(event);"
' e.Row.Attributes("onselectstart") = "javascript:return false;"
' e.Row.Cells(10).Attributes.Add("onclick", "EC();")
' End If
'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.DBCampo("NombreCompleto") = "" Then
e.Row.FCHyperLink("HplNombre").Text = String.Format("{0} - ({1})", e.Row.DBCampo("Agrupador"), e.Row.DBCampo("Cantidad"))
e.Row.CssClass = "SubTotales3"
'e.Row.Cells(2).ColumnSpan = 3
'e.Row.Cells.RemoveAt(3) : e.Row.Cells.RemoveAt(3)
Else
e.Row.Cells(2).Width = 250
e.Row.FCHyperLink("HplNombre").NavigateUrl = String.Format("/Prospectos/ProspectosSIP.aspx?CveProspecto={0}", e.Row.DBCampo("CveProspecto"))
End If
End If
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
CargaDatos()
UPDatos.Update()
Me.RegistraScript("UpperBound = " & GvDatos.Rows.Count - 1 & ";")
End Sub
Protected Sub ImgExcel_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("Prospectos")
End Sub
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim Tipo As Integer = 1
Dim Orden As String = ""
Dim Campo As String = ""
Dim ImgButon As ImageButton = Nothing
Const OrdenInicial As String = "Agrupador,OrdenAgrupador,"
Select Case sender.GetType().Name
Case "LinkButton"
Tipo = 1
Campo = CType(sender, LinkButton).CommandArgument
ImgButon = CType(CType(sender, LinkButton).BindingContainer.FindControl("Img" & Campo.Replace(",", "_")), ImageButton)
Case "ImageButton"
Tipo = 2
Campo = CType(sender, ImageButton).CommandArgument
ImgButon = CType(sender, ImageButton)
End Select
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
RegistraScript(String.Format("$get('{0}').src='{1}'", ImgButon.ClientID, "/Imagenes/FlechasArriba.gif"))
Else
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
RegistraScript(String.Format("$get({0}).src='{1}'", ImgButon.ClientID, "/Imagenes/FlechasAbajo.gif"))
End If
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
CargaGrid(Orden)
End Sub
End Class

Some files were not shown because too many files have changed in this diff Show More