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

248
ZDG/ActualizaPadron.aspx Normal file
View File

@@ -0,0 +1,248 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="ActualizaPadron.aspx.vb" Inherits="ZDG_ActualizaPadron" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Actualizar Padron
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<div class="row">
<div class="col-md-6">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Cargar Archivo</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<table width="100%">
<tr>
<td align="center">
<b>Seleccione el archivo EXCEL a cargar</b>
</td>
<td align="left">
<div class="btn-file btn green">
<i class="fa fa-plus"></i>
<span>Seleccionar Archivo</span>
<asp:FileUpload ID="FUExcel" runat="server" onchange="$('#FUTxtt').text(this.value);" />
</div>
<%--<asp:HyperLink ID="HyperLink1" CssClass="btn-file btn green" Width="150px" data-toggle="modal" data-target="#ModalUploadExcel" runat="server" Text="Seleccionar Archivo" Style="cursor: pointer;" ToolTip="Cargar Excel"></asp:HyperLink>--%><br />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<span id="FUTxtt"></span>
<hr />
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:Button runat="server" ID="BtnCargaExcel" Text="Cargar Excel" class="btn btn-primary" />
</td>
</tr>
</table>
</div>
</div>
</div>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="col-md-4" id="DivArchivoCargado" runat="server" visible="false">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Último Archivo Cargado</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<center>
<table id="TableExcel" runat="server" class="table table-striped Widthall">
<tr>
<td width="110px"><i>Nombre del archivo:</i></td>
<td><i>
<asp:Literal runat="server" ID="LtNombreArchivo" Text=""></asp:Literal></i></td>
</tr>
<tr>
<td><i>Registros Actualizados:</i></td>
<td><i>
<asp:Literal runat="server" ID="LtRegistrosActualizados" Text=""></asp:Literal></i></td>
</tr>
<tr>
<td><i>Fecha de carga:</i></td>
<td><i>
<asp:Literal runat="server" ID="LtFechaArchivo" Text=""></asp:Literal></i></td>
</tr>
<tr>
<td><i>Usuario:</i></td>
<td><i>
<asp:Literal runat="server" ID="LtUsuario" Text=""></asp:Literal></i></td>
</tr>
</table>
</center>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-12" style="text-align: center;">
<asp:Button ID="BtnProcesarExcel" OnClick="BtnProcesarExcel_Click" Visible="false" Text="Procesar Excel" Width="200px" class="btn btn-primary" runat="server" />
</div>
</div>
<div class="row">
<div class="col-md-2 pull-right" style="text-align: right;">
<asp:Label Text="" ID="LbNumeroRegistros" runat="server" />
</div>
</div>
<asp:GridView ID="GvDatos" ClientIDMode="Static" runat="server" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="False" GridLines="None">
<Columns>
<asp:BoundField HeaderText="RNM" DataField="RNM" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Direccion" DataField="Direccion" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Colonia" DataField="Colonia" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Telefono" DataField="Telefono" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Correo" DataField="Correo" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Tendencia" DataField="Tendencia" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Coordinador" DataField="Coordinador" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="TelefonoCoordinador" DataField="TelefonoCoordinador" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Lider" DataField="Lider" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="TelefonoLider" DataField="TelefonoLider" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Movilizador" DataField="Movilizador" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="TelefonoMovilizador" DataField="TelefonoMovilizador" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="ModalUploadExcel" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Carga Padron Excel</h4>
</div>
<div class="modal-body">
<asp:UpdatePanel ID="UpUpFotos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div>
<asp:TextBox ID="TxtUpExcel" 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="BtnCargarExcel" Text="Cargar Excel" runat="server" ClientIDMode="Static" CssClass="btn btn-primary" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script>
<script type="text/javascript">
function OrdenarGV() {
var Tam = TamañoVentana();
var Alto = Tam.height - 330;
if (Alto < 100) {
Alto = 100;
}
$('#GvDatos').DataTable({
scrollY: Alto + 'px',
scrollCollapse: true,
paging: false,
searching: false,
info: false
});
$('#GvDatos').parent().parent().children().first().css("position", "static");
}
</script>
</asp:Content>

233
ZDG/ActualizaPadron.aspx.vb Normal file
View File

@@ -0,0 +1,233 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports System.IO
Imports DocumentFormat.OpenXml.Spreadsheet
Partial Class ZDG_ActualizaPadron
Inherits ClsPaginas
#Region " PROPIEDADES "
Private Property DTExcel As DataTable
Get
DTExcel = CType(ViewState("DTExcel"), DataTable)
End Get
Set(value As DataTable)
ViewState("DTExcel") = value
End Set
End Property
Private Property NombreArchivo As String
Get
NombreArchivo = ViewState("NombreArchivo").ToString
End Get
Set(value As String)
ViewState("NombreArchivo") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDatos()
End If
End Sub
#Region "C A R G A - D A T O S"
Public Sub CargaDatos()
Dim ObjDG As New ClsDG
If ObjDG.GetActualizaPadron And ObjDG.DtResultados.Rows.Count = 1 Then
DivArchivoCargado.Visible = True
Dim Dr = ObjDG.DtResultados.Rows(0)
LtNombreArchivo.Text = Dr("NombreArchivo").ToString
LtRegistrosActualizados.Text = Dr("RegistrosActualizados").ToString
LtFechaArchivo.Text = Dr("Fecha").ToString.ToDateTime.ToString("dd/MM/yyyy hh:mm tt")
LtUsuario.Text = Dr("Usuario").ToString
End If
ObjDG.Dispose()
End Sub
#End Region
#Region " DESCARGA PLANTILLA "
Private Sub DescargaPlantillaExcel()
Dim Path As String = String.Format("{0}Temp\PlantillaExcel.xlsx", UsuarioActual.Empresa.Ruta)
Dim Archivo As New System.IO.FileInfo(Path)
If Archivo.Exists Then
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "application/xml", "application/pdf")
HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
HttpContext.Current.Response.TransmitFile(Path)
'HttpContext.Current.Response.Flush()
HttpContext.Current.Response.End()
End If
Archivo = Nothing
End Sub
#End Region
#Region "E X C E L"
Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
Dim Ruta = ""
If FUExcel.HasFile Then
'GUARDA ARCHIVO TEMPORAL PARA LECTURA
NombreArchivo = Path.GetFileName(FUExcel.PostedFile.FileName)
Dim FilePath As String = Server.MapPath(String.Format("{0}Temp\{1}", Request.ApplicationPath, NombreArchivo))
FUExcel.SaveAs(FilePath)
LeerExcel(FilePath)
Else
Alert("No se ha cargado ningun archivo Excel para actualizar. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
End If
End Sub
Private Sub LeerExcel(rutaExcel As String)
Dim conn As Odbc.OdbcConnection = Nothing
Dim ErrorExcel = False
DTExcel = New DataTable
Try
conn = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" & rutaExcel)
conn.Open()
Dim cmd = conn.CreateCommand()
cmd.CommandType = CommandType.Text
cmd.CommandText = "SELECT * FROM [Padron$]"
Dim da = New Odbc.OdbcDataAdapter(cmd)
da.Fill(DTExcel)
Catch ex As Exception
ErrorExcel = True
Alert("Ocurrió un error al leer el Excel: " + ex.ToString, TipoMensaje.MsgError)
End Try
conn.Close()
'CAMBIA NOMBRE COLUMNAS
If Not ErrorExcel Then
DTExcel.Columns(0).ColumnName = "RNM"
DTExcel.Columns(1).ColumnName = "Direccion"
DTExcel.Columns(2).ColumnName = "Colonia"
DTExcel.Columns(3).ColumnName = "Telefono"
DTExcel.Columns(4).ColumnName = "Correo"
DTExcel.Columns(5).ColumnName = "Tendencia"
DTExcel.Columns(6).ColumnName = "Coordinador"
DTExcel.Columns(7).ColumnName = "TelefonoCoordinador"
DTExcel.Columns(8).ColumnName = "Lider"
DTExcel.Columns(9).ColumnName = "TelefonoLider"
DTExcel.Columns(10).ColumnName = "Movilizador"
DTExcel.Columns(11).ColumnName = "TelefonoMovilizador"
End If
LbNumeroRegistros.Text = String.Format("Numero de registros: <b>{0}</b>", DTExcel.Rows.Count)
GvDatos.DataSource = DTExcel
GvDatos.DataBind()
If (GvDatos.Rows.Count > 0) Then
GvDatos.UseAccessibleHeader = True
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
RegistraScript("OrdenarGV();")
BtnProcesarExcel.Visible = True
End If
UpDatos.Update()
End Sub
Protected Sub BtnProcesarExcel_Click(sender As Object, e As EventArgs)
If DTExcel.Rows.Count > 0 Then
ProcesarExcel()
Else
Alert("No hay ningun registro a actualizar.", TipoMensaje.MsgAdvertencia)
End If
End Sub
Private Sub ProcesarExcel()
Dim ObjDG As New ClsDG
ObjDG.IniciaTransacSQL()
Dim ErrorActualizacion = False
Dim RegistrosActualizados = 0
'LEE LINEA POR LINEA
For Each Dr As DataRow In DTExcel.Rows
If ObjDG.UpdatePadron(LimpiarTexto(Dr("RNM").ToString.Trim), Dr("Direccion").ToString, Dr("Colonia").ToString, Dr("Telefono").ToString, Dr("Correo").ToString, Dr("Tendencia").ToString.ToEntero,
Dr("Coordinador").ToString, Dr("TelefonoCoordinador").ToString, Dr("Lider").ToString, Dr("TelefonoLider").ToString, Dr("Movilizador").ToString, Dr("TelefonoMovilizador").ToString) Then
RegistrosActualizados += ObjDG.RegistrosAfectados
Else
ErrorActualizacion = True
Exit For
End If
Next
'ACTUALIZA BITACORA
If Not ErrorActualizacion Then
If Not ObjDG.AddActualizacionPadron(NombreArchivo, RegistrosActualizados, DateTime.Now, UsuarioActual.Usuario) Then
ErrorActualizacion = True
End If
End If
If Not ErrorActualizacion Then
ObjDG.Commit()
Alert("La actualización fue exitosa.", TipoMensaje.MsgInformacion)
Else
ObjDG.RollBack()
Alert("Ocurrió un error en la actualización del Padron. Por favor verifique el archivo excel e intente de nuevo.", TipoMensaje.MsgError)
End If
ObjDG.Dispose()
DTExcel.Rows.Clear()
GvDatos.DataSource = DTExcel
GvDatos.DataBind()
BtnProcesarExcel.Visible = False
CargaDatos()
UpDatos.Update()
End Sub
#End Region
Function LimpiarTexto(texto As String) As String
Dim consignos As String = "áàäéèëíìïóòöúùuñÁÀÄÉÈËÍÌÏÓÒÖÚÙÜÑçÇ"
Dim sinsignos As String = "aaaeeeiiiooouuunAAAEEEIIIOOOUUUNcC"
Dim textoSinAcentos As System.Text.StringBuilder = New System.Text.StringBuilder(texto.Length)
Dim indexConAcento As Integer
For Each caracter As Char In texto
indexConAcento = consignos.IndexOf(caracter)
If (indexConAcento > -1) Then
textoSinAcentos.Append(sinsignos.Substring(indexConAcento, 1))
Else
textoSinAcentos.Append(caracter)
End If
Next
Dim regex As New Regex("[ ](?=[ ])|[^A-Za-z0-9]+")
Return regex.Replace(textoSinAcentos.ToString, "")
End Function
End Class

91
ZDG/CapturaManual.aspx Normal file
View File

@@ -0,0 +1,91 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CapturaManual.aspx.vb" Inherits="ZDG_CapturaManual" %>
<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="E" runat="Server">
Registro Manual
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<div class="row">
<div class="col-md-4">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Votos Registrados</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="false" CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Consecutivo" DataField="Consecutivo" ItemStyle-Width="100%" ItemStyle-HorizontalAlign="Left" />
<%--<asp:BoundField HeaderText="Hora Registro" DataField="Fecha" DataFormatString="{0:N0}" ItemStyle-Width="50%" ItemStyle-HorizontalAlign="Center" />--%>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
<div class="col-md-4">
<div class="portlet light smmallpadding bordered">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Registrar Voto</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Panel runat="server" DefaultButton="BtnRegistrarVoto">
Número:
<asp:TextBox ID="TxtConsecutivo" min="20000" CausesValidation="true" MaxLength="5" Width="100px" runat="server" />
<ajax:FilteredTextBoxExtender ID="SoloNumeros" runat="server" TargetControlID="TxtConsecutivo" FilterType="Numbers" />
<asp:RangeValidator ID="RVConsecutivo" runat="server" Type="Integer" MinimumValue="20001" MaximumValue="44733" ErrorMessage="Valor incorrecto" ControlToValidate="TxtConsecutivo" Display="None" ValidationGroup="GrpGuardar"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCEDocumentoImporteFE" runat="server" HighlightCssClass="vco" TargetControlID="RVConsecutivo" Width="150px"></ajax:ValidatorCalloutExtender>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="BtnRegistrarVoto" Text="Registrar Voto" runat="server" CssClass="btn btn-primary" OnClick="BtnRegistrarVoto_Click" ValidationGroup="GrpGuardar" />
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

86
ZDG/CapturaManual.aspx.vb Normal file
View File

@@ -0,0 +1,86 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class ZDG_CapturaManual
Inherits ClsPaginas
#Region " PROPIEDADES "
Private Property TempDT As DataTable
Get
TempDT = CType(ViewState("TempDT"), DataTable)
End Get
Set(value As DataTable)
ViewState("TempDT") = 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
CreaDT()
End If
End Sub
Private Sub CreaDT()
TempDT = New DataTable
TempDT.Columns.Add("Consecutivo", GetType(Integer))
TempDT.Columns.Add("Hora", GetType(DateTime))
TempDT.Columns.Add("Resultado", GetType(Boolean))
End Sub
Protected Sub BtnRegistrarVoto_Click(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
Dim Dr = TempDT.NewRow
Dr("Consecutivo") = TxtConsecutivo.Text.ToEntero
Dr("Hora") = DateTime.Now
Dr("Resultado") = False
If ObjDG.RegistrarVoto(TxtConsecutivo.Text.ToEntero) Then
If ObjDG.RegistrosAfectados = 1 Then
Dr("Resultado") = True
End If
ObjDG.Dispose()
TempDT.Rows.Add(Dr)
TempDT.AcceptChanges()
If TempDT.Rows.Count > 20 Then
TempDT.Rows.RemoveAt(0)
End If
CargaRegistros()
Else
ObjDG.Dispose()
Alert("Ocurrió un error al registar el voto. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
TxtConsecutivo.Text = ""
TxtConsecutivo.Focus()
End Sub
#Region " GV DATOS "
Private Sub CargaRegistros()
GvDatos.DataSource = TempDT.FiltraParametros("", "Hora DESC")
GvDatos.DataBind()
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.DBCampo("Resultado") = "True" Then
e.Row.Cells(0).ForeColor = Drawing.Color.Green
Else
e.Row.Cells(0).ForeColor = Drawing.Color.Red
End If
End If
End Sub
#End Region
End Class

View File

@@ -0,0 +1,29 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="MensajeAutomatico.aspx.vb" Inherits="ZDG_MensajeAutomatico" %>
<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="E" runat="Server">
Mensaje Automatico
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div style="height: 100%; width: 100%; vertical-align: middle; text-align: center;">
<asp:Button ID="BtnTest" Text="Prueba Mensaje Automatico" CssClass="btn btn-primary" OnClick="BtnTest_Click" runat="server" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -0,0 +1,215 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class ZDG_MensajeAutomatico
Inherits System.Web.UI.Page
#Region " PROPIEDADES "
Private Property EmpresaTemp As Empresa
Get
Return CType(ViewState("EmpresaTemp"), Empresa)
End Get
Set(value As Empresa)
ViewState("EmpresaTemp") = 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
CreaObjetoEmpresa(1)
'Dim Pass = IfNull(Request("ADS"), "-1").ToString
'If Pass = "123" Then
' MandaMensajeAutomatico()
'End If
'If Pass = "456" Then
' MandaMensajeTest()
'End If
End If
End Sub
Protected Sub BtnTest_Click(sender As Object, e As EventArgs)
MandaMensajeAutomatico()
End Sub
Private Sub MandaMensajeTest()
Dim ObjDG As New ClsDG
ObjDG.EnviarMensajeWS("6313186706,6621317425,6621430964,6621190043", "PRUEBAS FINALES DE MENSAJE AUTOMATICO. BUEN DÍA EQUIPO. SALUDOS")
ObjDG.Dispose()
End Sub
Private Sub MandaMensajeAutomatico()
Dim pag As New ClsPaginas
pag.Alert("TODO FRENADO!!", TipoMensaje.MsgAdvertencia)
pag.Dispose()
Exit Sub
GuardaLog(" ----------------------------- ENVIO AUTOMATICO DG | INICIO ----------------------------- ")
'CORREO
Dim ObjMail As New ClsSisMail
Dim ObjDG As New ClsDG
If ObjDG.MensajeAutomatico() AndAlso ObjDG.DtResultados.Rows.Count > 0 Then
Dim Contador = 1, ContadorSMS = 1
Dim TelefonoActual = "-1"
Dim MovilizadorActual = "-1"
Dim Mensaje As New StringBuilder
Dim Str2 As New StringBuilder
For Each Dr As DataRow In ObjDG.DtResultados.Rows
'PRIMER VUELTA
If MovilizadorActual = "-1" Then
MovilizadorActual = Dr("Movilizador").ToString
TelefonoActual = Dr("Telefono").ToString
End If
'CAMBIO NUMERO (MOVILIZADOR) : ENVIAR MENSAJE
If MovilizadorActual <> Dr("Movilizador").ToString Then
If ObjDG.EnviarMensajeWS(TelefonoActual, Mensaje.ToString) Then
If ObjDG.MensajeAdd(2, TelefonoActual, Mensaje.ToString, 100) Then
Str2.AppendFormat("#{0} | Num: {1} - Mensaje: {2}<br/><br/>", ContadorSMS, TelefonoActual, Mensaje.ToString)
ContadorSMS += 1
End If
End If
'ObjMail.SendMail(EmpresaTemp, "ing.israelpina@hotmail.com", $"MENSAJE SMS AUTOMATICO DG - {MovilizadorActual}", Mensaje.ToString, "israel.pina@adsistemas.mx,rene.molina@adsistemas.mx,julian@adsistemas.mx,jjaguilarv@hotmail.com")
'Str2.AppendFormat("#{0} | Num: {1} - Mensaje: {2}<br/><br/>", ContadorSMS, TelefonoActual, Mensaje.ToString)
Mensaje.Clear()
Contador = 1
MovilizadorActual = Dr("Movilizador").ToString
TelefonoActual = Dr("Telefono").ToString
End If
'AGREGA NUEVO CONSECUTIVO (CONCATENAR)
Mensaje.AppendFormat("{0}{1}", If(Mensaje.ToString <> "", ",", ""), Dr("Consecutivo"))
'LIMITE CARACTERES : ENVIAR MENSAJE
If Contador = 25 Then
If ObjDG.EnviarMensajeWS(TelefonoActual, Mensaje.ToString) Then
If ObjDG.MensajeAdd(2, TelefonoActual, Mensaje.ToString, 100) Then
Str2.AppendFormat("#{0} | Num: {1} - Mensaje: {2}<br/><br/>", ContadorSMS, TelefonoActual, Mensaje.ToString)
ContadorSMS += 1
End If
End If
'ObjMail.SendMail(EmpresaTemp, "ing.israelpina@hotmail.com", $"MENSAJE SMS AUTOMATICO DG - {MovilizadorActual}", Mensaje.ToString, "israel.pina@adsistemas.mx,rene.molina@adsistemas.mx,julian@adsistemas.mx,jjaguilarv@hotmail.com")
'Str2.AppendFormat("#{0} | Num: {1} - Mensaje: {2}<br/><br/>", ContadorSMS, TelefonoActual, Mensaje.ToString)
Mensaje.Clear()
Contador = 0
End If
Contador += 1
Next
' ENVIA ULTIMO MENSAJE (EL QUE SE SALE DEL FOR Y QUE NO SE HALLA ENVIADO)
If Mensaje.ToString <> "" Then
If ObjDG.EnviarMensajeWS(TelefonoActual, Mensaje.ToString) Then
If ObjDG.MensajeAdd(2, TelefonoActual, Mensaje.ToString, 100) Then
Str2.AppendFormat("#{0} | Num: {1} - Mensaje: {2}<br/><br/>", ContadorSMS, TelefonoActual, Mensaje.ToString)
ContadorSMS += 1
End If
End If
'ObjMail.SendMail(EmpresaTemp, "ing.israelpina@hotmail.com", $"MENSAJE SMS AUTOMATICO DG - {MovilizadorActual}", Mensaje.ToString, "israel.pina@adsistemas.mx,rene.molina@adsistemas.mx,julian@adsistemas.mx,jjaguilarv@hotmail.com")
'Str2.AppendFormat("#{0} | Num: {1} - Mensaje: {2}<br/><br/>", ContadorSMS, TelefonoActual, Mensaje.ToString)
End If
'MENSAJES A IPP
If ObjDG.EnviarMensajeWS("6313186706", String.Format("SE ENVIO SMS AUTOMATICO - Hora: {0}", Now.ToString("HH:mm:ss"))) Then
If ObjDG.MensajeAdd(2, "6313186706", String.Format("SE ENVIO SMS AUTOMATICO - Hora: {0}", Now.ToString("HH:mm:ss")), 100) Then
End If
End If
'MENSAJES A JA
If ObjDG.EnviarMensajeWS("6621317425", String.Format("SE ENVIO SMS AUTOMATICO - Hora: {0}", Now.ToString("HH:mm:ss"))) Then
If ObjDG.MensajeAdd(2, "6621317425", String.Format("SE ENVIO SMS AUTOMATICO - Hora: {0}", Now.ToString("HH:mm:ss")), 100) Then
End If
End If
'CORREO
ObjMail.SendMail(EmpresaTemp, "ing.israelpina@hotmail.com", "MENSAJE SMS AUTOMATICO DG", Str2.ToString, "israel.pina@adsistemas.mx,rene.molina@adsistemas.mx,julian@adsistemas.mx,jjaguialrv@hotmail.com")
GuardaLog(" ----------------------------- ENVIO AUTOMATICO DG | TERMINA ----------------------------- ")
'Dim pag As New ClsPaginas
'pag.Alert(Str2.ToString)
'pag.Dispose()
End If
ObjDG.Dispose()
End Sub
Private Sub CreaObjetoEmpresa(CveEmpresa As Integer)
Dim ObjEmpresa As New ClsSisEmpresas()
If ObjEmpresa.GetEmpresas(CveEmpresa, "-1", "-1", "-1", "-1") Then
'Session("Empresa") = ObjEmpresa
If ObjEmpresa.GetEmpresasFuncionalidades(CveEmpresa) Then
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
Dim EmpresasFuncionalidades As New HybridDictionary
For Each Row As Data.DataRow In dttmp.Rows
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
Next
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
End If
EmpresaTemp = ObjEmpresa.Empresa
Else
Session("Empresa") = Nothing
End If
ObjEmpresa.Dispose()
End Sub
'Private Sub CreaXML()
' Dim dt As New DataTable
' dt.Columns.Add("ID")
' Dim dr As DataRow = dt.NewRow
' dr("ID") = 1
' dt.Rows.Add(dr)
' Dim ds As New DataSet
' ds.Tables.Add(dt)
' Dim stringXML As String = ds.GetXml
' Dim pag As New ClsPaginas
' pag.Alert(stringXML)
' pag.Dispose()
'End Sub
End Class

177
ZDG/MensajeManual.aspx Normal file
View File

@@ -0,0 +1,177 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="MensajeManual.aspx.vb" Inherits="ZDG_MensajeManual" %>
<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="E" runat="Server">
Envio de Mensajes
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-4 pull-right">
<h3 style="text-align: right">Mensajes Enviados:
<asp:Label Text="0" ID="LbMensajesEnviados" runat="server" />
</h3>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<div class="row">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="col-md-4">
<div class="portlet smmallpadding light bordered">
<div class="portlet-title">
<div class="tools">
<a href="javascript;" data-idchekbox="<%= chkexpand3.ClientID%>" class=" <%= IIf(chkexpand3.Checked = True, "collapse", "expand")%>"></a>
<asp:CheckBox ID="chkexpand3" Checked="true" CssClass="hidden" runat="server" />
</div>
<div class="caption uppercase" style="position: relative;">
<i class="fa fa-info-circle"></i>Destinatarios
</div>
</div>
<div class="portlet-body">
<table style="width: 100%">
<tr>
<td>Municipio:</td>
<td>
<asp:DropDownList ID="DdlMunicipio" AutoPostBack="true" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" runat="server" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>Para:</td>
<td>
<asp:CheckBox ID="ChkCoordinadores" AutoPostBack="true" OnCheckedChanged="ChkCoordinadores_CheckedChanged" Text=" Coordinadores" runat="server" />
</td>
<td>
<asp:Label ID="LbCoordinadores" Text="0" runat="server" />
</td>
</tr>
<tr>
<td></td>
<td>
<asp:CheckBox ID="ChkLideres" AutoPostBack="true" OnCheckedChanged="ChkLideres_CheckedChanged" Text=" Lideres" runat="server" />
</td>
<td>
<asp:Label ID="LbLideres" Text="0" runat="server" />
</td>
</tr>
<tr>
<td></td>
<td>
<asp:CheckBox ID="ChkMovilizadores" AutoPostBack="true" OnCheckedChanged="ChkMovilizadores_CheckedChanged" Text=" Movilizadores" runat="server" />
</td>
<td>
<asp:Label ID="LbMovilizadores" Text="0" runat="server" />
</td>
</tr>
<tr>
<td></td>
<td style="text-align: right;">Total:</td>
<td>
<asp:Label Text="0" ID="LbTotal" runat="server" />
</td>
</tr>
</table>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<div class="col-md-6">
<div class="portlet smmallpadding light bordered">
<div class="portlet-title">
<div class="tools">
<a href="javascript;" data-idchekbox="<%= CheckBox1.ClientID%>" class=" <%= IIf(chkexpand3.Checked = True, "collapse", "expand")%>"></a>
<asp:CheckBox ID="CheckBox1" Checked="true" CssClass="hidden" runat="server" />
</div>
<div class="caption uppercase" style="position: relative;">
<i class="fa fa-info-circle"></i>Mensaje
</div>
</div>
<div class="portlet-body">
<asp:TextBox ID="TxtMensaje" TextMode="MultiLine" Width="100%" Rows="5" Wrap="false" MaxLength="160" onkeypress="return CheckLength();" onkeyup="GetRestantes();" runat="server" />
<div style="text-align: right; width: 100%">
<asp:Literal Text="Caracteres restantes: " runat="server" />
<asp:TextBox ClientIDMode="Static" ID="LbRestantes" CssClass="TextBoxAsLabel" Text="150" runat="server" />
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<hr />
<div class="row">
<div class="col-md-12" style="text-align: center;">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button ID="BtnEnviar" OnClick="BtnEnviar_Click" Text="Enviar" CssClass="btn btn-primary" runat="server" />
<asp:Button ID="BtnCancelar" OnClick="BtnCancelar_Click" Text="Cancelar" CssClass="btn btn-danger" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script>
$(document).on("pageload", function () {
var textbox = document.getElementById("<%=TxtMensaje.ClientID%>");
textbox.onpaste = function (e) {
var max = textbox.getAttribute("maxlength") - textbox.value.trim().length;
e.clipboardData.getData('text/plain').slice(0, max);
};
});
function CheckLength() {
var textbox = document.getElementById("<%=TxtMensaje.ClientID%>");
if (textbox.value.trim().length >= 150) {
return false;
}
else {
return true;
}
}
function GetRestantes() {
var textbox = document.getElementById("<%=TxtMensaje.ClientID%>");
$get("LbRestantes").value = 150 - textbox.value.trim().length;
textbox.value = textbox.value.substring(0, 150);
}
</script>
</asp:Content>

351
ZDG/MensajeManual.aspx.vb Normal file
View File

@@ -0,0 +1,351 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class ZDG_MensajeManual
Inherits ClsPaginas
#Region " PROPIEDADES "
Private Property DtCoordinadores As DataTable
Get
Return CType(ViewState("DtCoordinadores"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtCoordinadores") = value
End Set
End Property
Private Property DtLideres As DataTable
Get
Return CType(ViewState("DtLideres"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtLideres") = value
End Set
End Property
Private Property DtMovilizadores As DataTable
Get
Return CType(ViewState("DtMovilizadores"), DataTable)
End Get
Set(value As DataTable)
ViewState("DtMovilizadores") = 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
SetValues()
Else
LbRestantes.Text = (160 - TxtMensaje.Text.Length).ToString
End If
End Sub
#Region " SET VALUES "
Private Sub SetValues()
Dim ObjDG As New ClsDG
'CargaMunicipios
If ObjDG.GetMunicipios() Then
DdlMunicipio.DataSource = ObjDG.DtResultados
Else
DdlMunicipio.DataSource = Nothing
End If
'Carga # Mensajes
If ObjDG.MensajeGet() AndAlso ObjDG.DtResultados.Rows.Count = 1 Then
LbMensajesEnviados.Text = ObjDG.DtResultados.Rows(0)("NumeroMensajes").ToString
Else
Alert("Ocurrió un error al obtener el numero de mensajes Enviados.", TipoMensaje.MsgError)
End If
ObjDG.Dispose()
DdlMunicipio.DataBind()
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DtCoordinadores = Nothing
If ChkCoordinadores.Checked Then
If ObjDG.GetCoordinadores("-1", DdlMunicipio.SelectedValue.ToEntero) Then
DtCoordinadores = ObjDG.DtResultados
Else
Alert("Ocurrió un error al cargar los Coordinadores. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
End If
DtLideres = Nothing
If ChkLideres.Checked Then
If ObjDG.GetLideres("-1", DdlMunicipio.SelectedValue.ToEntero) Then
DtLideres = ObjDG.DtResultados
Else
Alert("Ocurrió un error al cargar los Lideres. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
End If
DtMovilizadores = Nothing
If ChkMovilizadores.Checked Then
If ObjDG.GetMovilizadores("-1", DdlMunicipio.SelectedValue.ToEntero) Then
DtMovilizadores = ObjDG.DtResultados
Else
Alert("Ocurrió un error al cargar los Movilizadores. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
End If
ObjDG.Dispose()
CalculaTotales()
End Sub
Protected Sub ChkCoordinadores_CheckedChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DtCoordinadores = Nothing
If ChkCoordinadores.Checked Then
If ObjDG.GetCoordinadores("-1", DdlMunicipio.SelectedValue.ToEntero) Then
DtCoordinadores = ObjDG.DtResultados
Else
Alert("Ocurrió un error al cargar los Coordinadores. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
End If
ObjDG.Dispose()
CalculaTotales()
End Sub
Protected Sub ChkLideres_CheckedChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DtLideres = Nothing
If ChkLideres.Checked Then
If ObjDG.GetLideres("-1", DdlMunicipio.SelectedValue.ToEntero) Then
DtLideres = ObjDG.DtResultados
Else
Alert("Ocurrió un error al cargar los Lideres. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
End If
ObjDG.Dispose()
CalculaTotales()
End Sub
Protected Sub ChkMovilizadores_CheckedChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DtMovilizadores = Nothing
If ChkMovilizadores.Checked Then
If ObjDG.GetMovilizadores("-1", DdlMunicipio.SelectedValue.ToEntero) Then
DtMovilizadores = ObjDG.DtResultados
Else
Alert("Ocurrió un error al cargar los Movilizadores. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
End If
ObjDG.Dispose()
CalculaTotales()
End Sub
Private Sub CalculaTotales()
LbCoordinadores.Text = If(DtCoordinadores IsNot Nothing, DtCoordinadores.COUNT("RNM").ToString, "0")
LbLideres.Text = If(DtLideres IsNot Nothing, DtLideres.COUNT("RNM").ToString, "0")
LbMovilizadores.Text = If(DtMovilizadores IsNot Nothing, DtMovilizadores.COUNT("RNM").ToString, "0")
LbTotal.Text = (LbCoordinadores.Text.ToEntero + LbLideres.Text.ToEntero + LbMovilizadores.Text.ToEntero).ToString
End Sub
#End Region
#Region " ENVIAR "
Protected Sub BtnEnviar_Click(sender As Object, e As EventArgs)
'Alert(LimpiarMensaje(TxtMensaje.Text))
'Exit Sub
'Dim X As New WSTecnoMovil.SendSmsWS
'Dim Response As WSTecnoMovil.sendSmsResponseTO
'Response = X.sendSms("AD", "SISTEMAS", "SALUDO GABRIELA, TE QUERIAMOS DECIR QUE TIENES EL MEJOR ESPOSO DEL MUNDO.", "6624297448", 99, False)
'Exit Sub
'Dim ObjDG As New ClsDG
'If ObjDG.EnviarMensajeWS(1234567890, "Hola") Then
'Else
' Alert("Ocurrió un Error al mandar el mensaje: ", TipoMensaje.MsgError)
'End If
'ObjDG.Dispose()
'Exit Sub
''CORREO
'Dim ObjMail As New ClsSisMail
'ObjMail.SendMail(UsuarioActual.Empresa, "ing.israelpina@hotmail.com", "MENSAJE SMS DG", "TEST", "israel.pina@adsistemas.mx")
'Alert("TODO FRENADO!!", TipoMensaje.MsgAdvertencia)
'Exit Sub
If TxtMensaje.Text = "" Then
Alert("No hay mensaje que enviar. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If ChkCoordinadores.Checked = False And ChkLideres.Checked = False And ChkMovilizadores.Checked = False Then
Alert("No hay destinatarios a los que enviar el mensaje. Por favor rectifique y vuelva a intentar", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim ObjDG As New ClsDG
Dim Str As New StringBuilder
Dim Acum = 1
Dim MensajeLimpio = ""
'COORDINADORES
If DtCoordinadores IsNot Nothing Then
For Each Dr As DataRow In DtCoordinadores.Rows
MensajeLimpio = If(LimpiarMensaje(TxtMensaje.Text).Length > 150, LimpiarMensaje(TxtMensaje.Text).Substring(0, 150), LimpiarMensaje(TxtMensaje.Text))
'MensajeLimpio = $"C: {MensajeLimpio}"
If ObjDG.EnviarMensajeWS(Dr("Telefono").ToString, MensajeLimpio) Then
If ObjDG.MensajeAdd(1, Dr("Telefono").ToString, MensajeLimpio, UsuarioActual.CveUsuario) Then
Str.AppendFormat("#{0} - Coordinador: {1} {2} <br/>", Acum, Dr("Nombre"), Dr("Telefono"))
Acum += 1
End If
End If
Next
End If
'LIDERES
If DtLideres IsNot Nothing Then
For Each Dr As DataRow In DtLideres.Rows
MensajeLimpio = If(LimpiarMensaje(TxtMensaje.Text).Length > 150, LimpiarMensaje(TxtMensaje.Text).Substring(0, 150), LimpiarMensaje(TxtMensaje.Text))
'MensajeLimpio = $"L: {MensajeLimpio}"
If ObjDG.EnviarMensajeWS(Dr("Telefono").ToString, MensajeLimpio) Then
If ObjDG.MensajeAdd(1, Dr("Telefono").ToString, MensajeLimpio, UsuarioActual.CveUsuario) Then
Str.AppendFormat("#{0} - Lider: {1} {2} <br/>", Acum, Dr("Nombre"), Dr("Telefono"))
Acum += 1
End If
End If
Next
End If
'MOVILIZADORES
If DtMovilizadores IsNot Nothing Then
For Each Dr As DataRow In DtMovilizadores.Rows
MensajeLimpio = If(LimpiarMensaje(TxtMensaje.Text).Length > 150, LimpiarMensaje(TxtMensaje.Text).Substring(0, 150), LimpiarMensaje(TxtMensaje.Text))
'MensajeLimpio = $"M: {MensajeLimpio}"
If ObjDG.EnviarMensajeWS(Dr("Telefono").ToString, MensajeLimpio) Then
If ObjDG.MensajeAdd(1, Dr("Telefono").ToString, MensajeLimpio, UsuarioActual.CveUsuario) Then
Str.AppendFormat("#{0} - Movilizador: {1} {2} <br/>", Acum, Dr("Nombre"), Dr("Telefono"))
Acum += 1
End If
End If
Next
End If
'MENSAJES A ALGUIEN
MensajeLimpio = If(LimpiarMensaje(TxtMensaje.Text).Length > 150, LimpiarMensaje(TxtMensaje.Text).Substring(0, 150), LimpiarMensaje(TxtMensaje.Text))
If ObjDG.EnviarMensajeWS("5545112326", MensajeLimpio) Then
If ObjDG.MensajeAdd(1, "5545112326", MensajeLimpio, UsuarioActual.CveUsuario) Then
End If
End If
'MENSAJES A IPP
If ObjDG.EnviarMensajeWS("6313186706", String.Format("SE ENVIO SMS MANUAL - Hora:{0}", Now.ToString("HH:mm:ss"))) Then
If ObjDG.MensajeAdd(1, "6313186706", String.Format("SE ENVIO SMS MANUAL - Hora:{0}", Now.ToString("HH:mm:ss")), UsuarioActual.CveUsuario) Then
End If
End If
'MENSAJES A JA
If ObjDG.EnviarMensajeWS("6621317425", String.Format("SE ENVIO SMS MANUAL - Hora: {0}", Now.ToString("HH:mm:ss"))) Then
If ObjDG.MensajeAdd(1, "6621317425", String.Format("SE ENVIO SMS MANUAL - Hora:{0}", Now.ToString("HH:mm:ss")), UsuarioActual.CveUsuario) Then
End If
End If
'CORREO
Dim ObjMail As New ClsSisMail
ObjMail.SendMail(UsuarioActual.Empresa, "ing.israelpina@hotmail.com", "MENSAJE SMS MANUAL DG", Str.ToString, "israel.pina@adsistemas.mx,rene.molina@adsistemas.mx,julian@adsistemas.mx,jjaguialrv@hotmail.com")
'Alert(Str.ToString)
Alert("Mensaje enviado exitosamente.", TipoMensaje.MsgInformacion)
ObjDG.Dispose()
Limpiar()
End Sub
#End Region
#Region " CANCELAR "
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
Limpiar()
End Sub
Private Sub Limpiar()
DtCoordinadores = Nothing
DtLideres = Nothing
DtMovilizadores = Nothing
TxtMensaje.Text = ""
ChkCoordinadores.Checked = False
ChkLideres.Checked = False
ChkMovilizadores.Checked = False
LbCoordinadores.Text = "0"
LbLideres.Text = "0"
LbMovilizadores.Text = "0"
LbRestantes.Text = "150"
LbTotal.Text = "0"
DdlMunicipio.SelectedValueExist("-1")
'Carga # Mensajes
Dim ObjDG As New ClsDG
If ObjDG.MensajeGet() AndAlso ObjDG.DtResultados.Rows.Count = 1 Then
LbMensajesEnviados.Text = ObjDG.DtResultados.Rows(0)("NumeroMensajes").ToString
Else
Alert("Ocurrió un error al obtener el numero de mensajes Enviados.", TipoMensaje.MsgError)
End If
ObjDG.Dispose()
End Sub
#End Region
Function LimpiarMensaje(texto As String) As String
Dim consignos As String = "áàäéèëíìïóòöúùuñÁÀÄÉÈËÍÌÏÓÒÖÚÙÜÑçÇ"
Dim sinsignos As String = "aaaeeeiiiooouuunAAAEEEIIIOOOUUUNcC"
Dim textoSinAcentos As System.Text.StringBuilder = New System.Text.StringBuilder(texto.Length)
Dim indexConAcento As Integer
For Each caracter As Char In texto
indexConAcento = consignos.IndexOf(caracter)
If (indexConAcento > -1) Then
textoSinAcentos.Append(sinsignos.Substring(indexConAcento, 1))
Else
textoSinAcentos.Append(caracter)
End If
Next
Dim regex As New Regex("[ ](?=[ ])|[^,.A-Za-z0-9 ]+")
Return regex.Replace(textoSinAcentos.ToString, "")
End Function
End Class

View File

@@ -0,0 +1,177 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpBuscarMilitante.aspx.vb" Inherits="ZDG_PopUpBuscarMilitante" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
#divContenido {
overflow-x:hidden;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Búsqueda Militante
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="PnlPrincipal" runat="server" DefaultButton="BtnBuscar" Width="100%">
<table width="100%">
<tr>
<td class="Titulos" colspan="9">Filtros para búsqueda</td>
</tr>
<tr>
<td class="text-right" style="width: 10%"><b>RNM:</b></td>
<td style="width: 12.5%">
<asp:TextBox ID="TxtRNM" Text="" Width="100%" runat="server" />
</td>
<td class="text-right" style="width: 10%"><b>Paterno:</b></td>
<td style="width: 12.5%">
<asp:TextBox ID="TxtPaterno" Text="" Width="100%" runat="server" />
</td>
<td class="text-right" style="width: 10%"><b>Materno:</b></td>
<td style="width: 12.5%">
<asp:TextBox ID="TxtMaterno" Text="" Width="100%" runat="server" />
</td>
<td class="text-right" style="width: 10%"><b>Nombre:</b></td>
<td style="width: 12.5%">
<asp:TextBox ID="TxtNombre" Text="" Width="100%" runat="server" />
</td>
<td style="width: 10%" ></td>
</tr>
<tr>
<td class="text-right" ><b>Municipio:</b></td>
<td colspan="3">
<asp:DropDownList ID="DdlMunicipio" AutoPostBack="true" runat="server" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</td>
<td class="text-right"><b>Coordinador:</b></td>
<td colspan="3">
<asp:DropDownList ID="DdlCoordinadores" AutoPostBack="true" runat="server" DataTextField="Nombre" DataValueField="RNM" OnSelectedIndexChanged="DdlCoordinadores_SelectedIndexChanged" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-2"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="text-right"><b>Lider:</b></td>
<td colspan="3" >
<asp:DropDownList ID="DdlLideres" AutoPostBack="true" runat="server" DataTextField="Nombre" DataValueField="RNM" OnSelectedIndexChanged="DdlLideres_SelectedIndexChanged" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-2"></asp:ListItem>
</asp:DropDownList>
</td>
<td class="text-right"><b>Movilizador:</b></td>
<td colspan="3" >
<asp:DropDownList ID="DdlMovilizadores" runat="server" DataTextField="Nombre" DataValueField="RNM" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-2"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td style="text-align: center;" align="center" colspan="9">
<br />
<asp:Button ID="BtnBuscar" runat="server" Text="Buscar" class="btn btn-primary" Width="200px" />
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-3 pull-right">
<asp:Label Text="" ID="LbNumeroRegistros" runat="server" />
</div>
</div>
<asp:GridView ID="GvDatos" ClientIDMode="Static" runat="server" CssClass="table table-striped table-hover Widthall" AutoGenerateColumns="False" GridLines="None">
<Columns>
<asp:BoundField HeaderText="RNM" DataField="RNM" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Nombre" DataField="Nombre" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Consec" DataField="Consecutivo" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Municipio" DataField="Municipio" ItemStyle-Width="12.5%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Coordinador" DataField="Coordinador" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Tel" DataField="TelefonoCoordinador" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Lider" DataField="Lider" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Tel" DataField="TelefonoLider" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Movilizador" DataField="Movilizador" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Tel" DataField="TelefonoMovilizador" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Voto" DataField="VotoTexto" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script type="text/javascript">
function OrdenarGV() {
var Tam = TamañoVentana();
var Alto = Tam.height - 330;
if (Alto < 100) {
Alto = 100;
}
$('#GvDatos').DataTable({
scrollY: Alto + 'px',
scrollCollapse: true,
paging: false,
searching: false,
info: false
});
$('#GvDatos').parent().parent().children().first().css("position", "static");
}
</script>
</asp:Content>

View File

@@ -0,0 +1,167 @@
Option Explicit On
Option Strict On
Imports Extensiones
Imports System.Data
Partial Class ZDG_PopUpBuscarMilitante
Inherits ClsPaginas
#Region "PROPIEDADES"
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CType(Me.Master, BaseMasterPage).EsPopup = True
CargaCombos()
End If
End Sub
#Region " CARGA COMBOS "
Private Sub CargaCombos()
Dim ObjDG As New ClsDG
'CARGA MUNICIPIOS
If ObjDG.GetMunicipios() Then
DdlMunicipio.DataSource = ObjDG.DtResultados
Else
DdlMunicipio.DataSource = Nothing
End If
ObjDG.Dispose()
DdlMunicipio.DataBind()
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click
'VALIDA QUE ESTE CON VALOR MINIMO UN FILTRO
If TxtRNM.Text.Trim = "" And TxtNombre.Text.Trim = "" And TxtPaterno.Text.Trim = "" And TxtMaterno.Text.Trim = "" And DdlMunicipio.SelectedValue.ToEntero < 0 And DdlCoordinadores.SelectedValue.ToEntero < 0 And DdlLideres.SelectedValue.ToEntero < 0 And DdlMovilizadores.SelectedValue.ToEntero < 0 Then
Alert("Debe especificar mínimo un filtro para la busqueda. Por favor rectifique y vuleva a intentar", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim ObjDG As New ClsDG
If ObjDG.GetMilitantes(TxtRNM.Text.Trim, TxtNombre.Text.Trim.Replace(" ", "%"), TxtPaterno.Text.Trim.Replace(" ", "%"), TxtMaterno.Text.Trim.Replace(" ", "%"), DdlMunicipio.SelectedValue.ToEntero, DdlCoordinadores.SelectedValue, DdlLideres.SelectedValue, DdlMovilizadores.SelectedValue) Then
GvDatos.DataSource = ObjDG.DtResultados
Else
GvDatos.DataSource = Nothing
End If
LbNumeroRegistros.Text = String.Format("Numero de registros: <b>{0}</b>", ObjDG.DtResultados.Rows.Count)
ObjDG.Dispose()
GvDatos.DataBind()
If (GvDatos.Rows.Count > 0) Then
GvDatos.UseAccessibleHeader = True
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
RegistraScript("OrdenarGV();")
End If
UpDatos.Update()
End Sub
#End Region
#Region " GV DATOS "
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("Voto") = "True" Then
e.Row.Cells(10).ForeColor = Drawing.Color.Green
Else
e.Row.Cells(10).ForeColor = Drawing.Color.Red
End If
End If
End Sub
#End Region
#Region " SELECTED INDEX CHANGED "
Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DdlCoordinadores.Items.Clear()
'CARGA COORDINADORES
If ObjDG.GetCoordinadores("-1", DdlMunicipio.SelectedValue.ToEntero) Then
DdlCoordinadores.DataSource = ObjDG.DtResultados
Else
DdlCoordinadores.DataSource = Nothing
End If
DdlCoordinadores.DataBind()
ObjDG.Dispose()
DdlCoordinadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlCoordinadores.SelectedValueExist("-2")
DdlLideres.Items.Clear()
DdlLideres.Items.Insert(0, New ListItem("Todos", "-2"))
DdlLideres.SelectedValueExist("-2")
DdlMovilizadores.Items.Clear()
DdlMovilizadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlMovilizadores.SelectedValueExist("-2")
End Sub
Protected Sub DdlCoordinadores_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DdlLideres.Items.Clear()
'CARGA LIDERES
If ObjDG.GetLideres("-1", DdlMunicipio.SelectedValue.ToEntero, DdlCoordinadores.SelectedValue) Then
DdlLideres.DataSource = ObjDG.DtResultados
Else
DdlLideres.DataSource = Nothing
End If
DdlLideres.DataBind()
ObjDG.Dispose()
DdlLideres.Items.Insert(0, New ListItem("Todos", "-2"))
DdlLideres.SelectedValueExist("-2")
DdlMovilizadores.Items.Clear()
DdlMovilizadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlMovilizadores.SelectedValueExist("-2")
End Sub
Protected Sub DdlLideres_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DdlMovilizadores.Items.Clear()
'CARGA MOVILIZADORES
If ObjDG.GetMovilizadores("-1", DdlMunicipio.SelectedValue.ToEntero, DdlCoordinadores.SelectedValue, DdlLideres.SelectedValue) Then
DdlMovilizadores.DataSource = ObjDG.DtResultados
Else
DdlMovilizadores.DataSource = Nothing
End If
DdlMovilizadores.DataBind()
ObjDG.Dispose()
DdlMovilizadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlMovilizadores.SelectedValueExist("-2")
End Sub
#End Region
End Class

240
ZDG/RepGeneral.aspx Normal file
View File

@@ -0,0 +1,240 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepGeneral.aspx.vb" Inherits="ZDG_RepGeneral" %>
<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="E" runat="Server">
Reporte General
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline">
<ContentTemplate>
<div class="btn-group pull-right btn-separete">
<asp:Button ID="BtnConsultar" runat="server" Text="Actualizar" class="btn btn-fit-height btnopaco" />
<asp:Timer runat="server" ID="TimmerRefresh" Interval="170000" OnTick="TimmerRefresh_Tick"></asp:Timer>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-1 truncate">Municipio</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlMunicipio" AutoPostBack="true" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" runat="server" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<%--<label class="col-md-1 truncate">Actualización</label>
<div class="col-md-2">
<asp:CheckBox Text="Actualización automatica" ID="ChkUpdate" ClientIDMode="Static" runat="server" />
<asp:Button Text="" OnClick="BtnUpdate_Click" ClientIDMode="Static" ID="BtnUpdate" Style="display: none;" runat="server" />
</div>--%>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row">
<div class="col-md-4 pull-right" style="text-align: right;">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<code>
<asp:Literal Text="" runat="server" ID="LtActualizado" />
</code>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-6">
<%--GRAFICA 1--%>
<div class="row">
<div class="col-md-12">
<div id="Grafica1" style="min-width: 310px; height: 300px; margin: 0 auto"></div>
</div>
</div>
<%--GRAFICA 2--%>
<div class="row">
<div class="col-md-12">
<div id="Grafica2" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
</div>
</div>
</div>
<%--GRAFICA 3--%>
<div class="col-md-6">
<div class="row">
<div class="col-md-12">
<div id="Grafica3" style="min-width: 310px; height: 700px; margin: 0 auto"></div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script type="text/javascript">
//$(function () {
// $(document).ready(function () {
// // Build the chart
// $('#Grafica3').highcharts({
// chart: {
// plotBackgroundColor: null,
// plotBorderWidth: null,
// plotShadow: false,
// type: 'pie'
// },
// title: {
// text: 'AVANCE'
// },
// tooltip: {
// pointFormat: '{series.name}: <b>{point.y} ,{point.percentage:.1f}%</b>'
// },
// plotOptions: {
// pie: {
// allowPointSelect: true,
// cursor: 'pointer',
// dataLabels: {
// enabled: true,
// distance: -50
// },
// showInLegend: true
// }
// },
// series: [{
// name: 'AVANCE',
// colorByPoint: true,
// data: [
// {
// name: 'DG',
// y: 56.33,
// color: '#5C7FD9',
// sliced: true,
// selected: true
// },
// {
// name: 'EM',
// y: 24.03,
// color: '#EBB32F'
// },
// {
// name: 'AE',
// y: 10.38,
// color: '#A2A2A2'
// },
// {
// name: 'NI',
// y: 4.77,
// color: '#F2E832'
// },
// ]
// }]
// });
// });
//});
//$(function () {
// $('#Grafica1').highcharts({
// chart: {
// type: 'column'
// },
// title: {
// text: 'AVANCE POR TENDENCIA'
// },
// xAxis: {
// categories: ['DG', 'EM', 'AE', 'NI']
// },
// yAxis: {
// min: 0,
// title: {
// text: 'VOTOS'
// },
// stackLabels: {
// enabled: true,
// style: {
// fontWeight: 'bold',
// color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
// }
// }
// },
// tooltip: {
// headerFormat: '<b>{point.x}</b><br/>',
// pointFormat: '{series.name}: {point.y}'
// },
// plotOptions: {
// column: {
// stacking: 'normal',
// dataLabels: {
// enabled: true,
// colorByPoint: true,
// color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white',
// style: {
// textShadow: '0 0 3px black'
// }
// }
// }
// },
// series: [
// {
// name: 'Meta',
// showInLegend: false,
// data: [
// { y: 3606, color: '#A9C0FB' },
// { y: 2785, color: '#F0D390' },
// { y: 3606, color: '#E2E2E2' },
// { y: 3606, color: '#F0EC9C' }
// ]
// },
// {
// name: 'Avance',
// showInLegend: false,
// data: [
// { y: 3606, color: '#5C7FD9' },
// { y: 2785, color: '#EBB32F' },
// { y: 3606, color: '#A2A2A2' },
// { y: 3606, color: '#F2E832' }
// ]
// }
// ],
// credits: {
// enabled: false
// }
// });
//});
</script>
</asp:Content>

336
ZDG/RepGeneral.aspx.vb Normal file
View File

@@ -0,0 +1,336 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class ZDG_RepGeneral
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
SetValues()
CargaDatos()
End If
End Sub
#Region " SET VALUES "
Private Sub SetValues()
'CargaMunicipios
Dim ObjDG As New ClsDG
If ObjDG.GetMunicipios() Then
DdlMunicipio.DataSource = ObjDG.DtResultados
Else
DdlMunicipio.DataSource = Nothing
End If
ObjDG.Dispose()
DdlMunicipio.DataBind()
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
UPDatos.Update()
End Sub
Protected Sub TimmerRefresh_Tick(sender As Object, e As EventArgs)
CargaDatos()
UpDatos.Update()
End Sub
Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaDatos()
UpDatos.Update()
End Sub
Private Sub CargaDatos()
Dim ObjDG As New ClsDG
Dim Script = ""
LtActualizado.Text = String.Format("Actualizado: {0}", Now.ToString("HH:mm:ss tt"))
TimmerRefresh.Enabled = False
TimmerRefresh.Enabled = True
If ObjDG.GetGrafica1(DdlMunicipio.SelectedValue.ToEntero) AndAlso ObjDG.DtResultados.Rows.Count = 1 Then
Script += GeneraGrafica1(ObjDG.DtResultados.Rows(0))
Else
Alert("Ocurrió un error al generar el Grafico. Por favor actualice la página.", TipoMensaje.MsgAdvertencia)
End If
If ObjDG.GetGrafica2(DdlMunicipio.SelectedValue.ToEntero) AndAlso ObjDG.DtResultados.Rows.Count = 1 Then
Script += GeneraGrafica2(ObjDG.DtResultados.Rows(0))
Else
Alert("Ocurrió un error al generar el Grafico. Por favor actualice la página.", TipoMensaje.MsgAdvertencia)
End If
If ObjDG.GetGrafica3(DdlMunicipio.SelectedValue.ToEntero) AndAlso ObjDG.DtResultados.Rows.Count = 1 Then
Script += GeneraGrafica3(ObjDG.DtResultados.Rows(0))
Else
Alert("Ocurrió un error al generar el Grafico. Por favor actualice la página.", TipoMensaje.MsgAdvertencia)
End If
RegistraScript(Script)
ObjDG.Dispose()
UpDatos.Update()
End Sub
#End Region
#Region " GRAFICA 1 "
Private Function GeneraGrafica1(Datos As DataRow) As String
Dim ScriptTemp As New StringBuilder
ScriptTemp.Append(" $(function () { ")
ScriptTemp.Append(" $('#Grafica1').highcharts({ ")
ScriptTemp.Append(" chart: { ")
ScriptTemp.Append(" type: 'column' ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" title: { ")
ScriptTemp.Append(" text: 'AVANCE POR TENDENCIA' ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" xAxis: { ")
ScriptTemp.Append(" categories: ['DG', 'EM', 'AE', 'NI'] ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" yAxis: { ")
ScriptTemp.Append(" min: 0, ")
ScriptTemp.Append(" title: { ")
ScriptTemp.Append(" text: 'VOTOS' ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" stackLabels: { ")
ScriptTemp.Append(" enabled: true, ")
ScriptTemp.Append(" style: { ")
ScriptTemp.Append(" fontWeight: 'bold', ")
ScriptTemp.Append(" color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray' ")
ScriptTemp.Append(" } ")
ScriptTemp.Append(" } ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" tooltip: { ")
ScriptTemp.Append(" headerFormat: '<b>{point.x}</b><br/>', ")
ScriptTemp.Append(" pointFormat: '{series.name}: {point.y}' ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" plotOptions: { ")
ScriptTemp.Append(" column: { ")
ScriptTemp.Append(" stacking: 'normal', ")
ScriptTemp.Append(" dataLabels: { ")
ScriptTemp.Append(" enabled: true, ")
ScriptTemp.Append(" colorByPoint: true, ")
ScriptTemp.Append(" color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white', ")
ScriptTemp.Append(" style: { ")
ScriptTemp.Append(" textShadow: '0 0 3px black' ")
ScriptTemp.Append(" } ")
ScriptTemp.Append(" } ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" series: { ")
ScriptTemp.Append(" pointPadding: 0,")
ScriptTemp.Append(" groupPadding: 0")
ScriptTemp.Append(" }")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" series: [ ")
ScriptTemp.Append(" { ")
ScriptTemp.Append(" name: 'Meta', ")
ScriptTemp.Append(" showInLegend: false, ")
ScriptTemp.Append(" data: [ ")
ScriptTemp.Append(" { y: " + Datos("RestantesT1").ToString.ToEntero.ToString + ", color: '#A9C0FB' }, ")
ScriptTemp.Append(" { y: " + Datos("RestantesT2").ToString.ToEntero.ToString + ", color: '#F0D390' }, ")
ScriptTemp.Append(" { y: " + Datos("RestantesT3").ToString.ToEntero.ToString + ", color: '#E2E2E2' }, ")
ScriptTemp.Append(" { y: " + Datos("RestantesT4").ToString.ToEntero.ToString + ", color: '#F0EC9C' } ")
ScriptTemp.Append(" ] ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" { ")
ScriptTemp.Append(" name: 'Avance', ")
ScriptTemp.Append(" showInLegend: false, ")
ScriptTemp.Append(" data: [ ")
ScriptTemp.Append(" { y: " + Datos("VotosT1").ToString.ToEntero.ToString + ", color: '#5C7FD9' }, ")
ScriptTemp.Append(" { y: " + Datos("VotosT2").ToString.ToEntero.ToString + ", color: '#E59400' }, ")
ScriptTemp.Append(" { y: " + Datos("VotosT3").ToString.ToEntero.ToString + ", color: '#A2A2A2' }, ")
ScriptTemp.Append(" { y: " + Datos("VotosT4").ToString.ToEntero.ToString + ", color: '#F2E832' } ")
ScriptTemp.Append(" ] ")
ScriptTemp.Append(" } ")
ScriptTemp.Append(" ], ")
ScriptTemp.Append(" credits: { ")
ScriptTemp.Append(" enabled: false ")
ScriptTemp.Append(" } ")
ScriptTemp.Append(" }); ")
ScriptTemp.Append(" }); ")
'RegistraScript(ScriptTemp.ToString)
Return ScriptTemp.ToString
End Function
#End Region
#Region " GRAFICA 2 "
Private Function GeneraGrafica2(Datos As DataRow) As String
Dim ScriptTemp As New StringBuilder
ScriptTemp.Append(" $(function () { ")
ScriptTemp.Append(" $(document).ready(function () { ")
ScriptTemp.Append(" ")
ScriptTemp.Append(" $('#Grafica3').highcharts({ ")
ScriptTemp.Append(" chart: { ")
ScriptTemp.Append(" plotBackgroundColor: null, ")
ScriptTemp.Append(" plotBorderWidth: null, ")
ScriptTemp.Append(" plotShadow: false, ")
ScriptTemp.Append(" type: 'pie' ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" title: { ")
ScriptTemp.Append(" text: 'AVANCE' ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" tooltip: { ")
ScriptTemp.Append(" pointFormat: '{series.name}: <b>{point.y} ,{point.percentage:.2f}%</b>' ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" plotOptions: { ")
ScriptTemp.Append(" pie: { ")
ScriptTemp.Append(" allowPointSelect: true, ")
ScriptTemp.Append(" cursor: 'pointer', ")
ScriptTemp.Append(" dataLabels: { ")
ScriptTemp.Append(" enabled: true, ")
ScriptTemp.Append(" distance: -50 ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" showInLegend: true ")
ScriptTemp.Append(" } ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" series: [{ ")
ScriptTemp.Append(" name: 'AVANCE', ")
ScriptTemp.Append(" colorByPoint: true, ")
ScriptTemp.Append(" dataLabels: { ")
ScriptTemp.Append(" formatter: function () {")
ScriptTemp.Append(" return this.y > 0 ? '<b>' + this.point.name + ':</b> ' + this.y + ' (' + this.percentage.toFixed(2) + '%)' : null;")
ScriptTemp.Append(" },")
ScriptTemp.Append(" color: '#ffffff',")
ScriptTemp.Append(" distance: -70")
ScriptTemp.Append(" },")
ScriptTemp.Append(" data: [ ")
ScriptTemp.Append(" { ")
ScriptTemp.Append(" name: 'DG', ")
ScriptTemp.AppendFormat(" y: {0}, ", Datos("VotosT1").ToString.ToEntero)
ScriptTemp.Append(" color: '#5C7FD9', ")
ScriptTemp.Append(" sliced: true, ")
ScriptTemp.Append(" selected: true ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" { ")
ScriptTemp.Append(" name: 'EM', ")
ScriptTemp.AppendFormat(" y: {0}, ", Datos("VotosT2").ToString.ToEntero)
ScriptTemp.Append(" color: '#E59400' ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" { ")
ScriptTemp.Append(" name: 'AE', ")
ScriptTemp.AppendFormat(" y: {0}, ", Datos("VotosT3").ToString.ToEntero)
ScriptTemp.Append(" color: '#A2A2A2' ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" { ")
ScriptTemp.Append(" name: 'NI', ")
ScriptTemp.AppendFormat(" y: {0}, ", Datos("VotosT4").ToString.ToEntero)
ScriptTemp.Append(" color: '#F2E832' ")
ScriptTemp.Append(" } ")
ScriptTemp.Append(" ] ")
ScriptTemp.Append(" }], ")
ScriptTemp.Append(" credits: { ")
ScriptTemp.Append(" enabled: false ")
ScriptTemp.Append(" } ")
ScriptTemp.Append(" }); ")
ScriptTemp.Append(" }); ")
ScriptTemp.Append(" }); ")
'RegistraScript(ScriptTemp.ToString)
Return ScriptTemp.ToString
End Function
#End Region
#Region " GRAFICA 3 "
Private Function GeneraGrafica3(Datos As DataRow) As String
Dim ScriptTemp As New StringBuilder
ScriptTemp.Append(" $(function () { ")
ScriptTemp.Append(" $('#Grafica2').highcharts({ ")
ScriptTemp.Append(" chart: { ")
ScriptTemp.Append(" type: 'bar' ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" title: { ")
ScriptTemp.Append(" text: 'PARTICIPACIÓN' ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" xAxis: { ")
ScriptTemp.Append(" categories: ['NI', 'AE', 'EM', 'DG'] ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" yAxis: { ")
ScriptTemp.Append(" min: 0, ")
ScriptTemp.Append(" title: { ")
ScriptTemp.Append(" text: 'VOTOS' ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" legend: { ")
ScriptTemp.Append(" reversed: true ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" plotOptions: { ")
ScriptTemp.Append(" series: { ")
ScriptTemp.Append(" stacking: 'normal', ")
ScriptTemp.Append(" pointPadding: 0.03,")
ScriptTemp.Append(" groupPadding: 0.03")
ScriptTemp.Append(" } ")
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" colors: [ ")
ScriptTemp.Append(" '#E9E6E6', ")
ScriptTemp.Append(" '#00326B' ")
ScriptTemp.Append(" ], ")
ScriptTemp.Append(" series: [ ")
ScriptTemp.Append(" { ")
ScriptTemp.Append(" showInLegend: false, ")
ScriptTemp.Append(" name: 'X VOTAR', ")
ScriptTemp.AppendFormat(" data: [{0}, {1}, {2}, {3}] ", Datos("RestaTotalesVotosT4").ToString.ToEntero, Datos("RestaTotalesVotosT3").ToString.ToEntero, Datos("RestaTotalesVotosT2").ToString.ToEntero, Datos("RestaTotalesVotosT1").ToString.ToEntero)
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" { ")
ScriptTemp.Append(" showInLegend: false, ")
ScriptTemp.Append(" name: 'VOTOS', ")
ScriptTemp.AppendFormat(" data: [{0}, {1}, {2}, {3}] ", Datos("RestaVotosT4").ToString.ToEntero, Datos("RestaVotosT3").ToString.ToEntero, Datos("RestaVotosT2").ToString.ToEntero, Datos("RestaVotosT1").ToString.ToEntero)
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" { ")
ScriptTemp.Append(" name: 'META', ")
ScriptTemp.Append(" showInLegend: false, ")
ScriptTemp.Append(" data: [ ")
ScriptTemp.Append(" { y: " + Datos("RestantesT4").ToString.ToEntero.ToString + ", color: '#F0EC9C' }, ")
ScriptTemp.Append(" { y: " + Datos("RestantesT3").ToString.ToEntero.ToString + ", color: '#E2E2E2' }, ")
ScriptTemp.Append(" { y: " + Datos("RestantesT2").ToString.ToEntero.ToString + ", color: '#F0D390' }, ")
ScriptTemp.Append(" { y: " + Datos("RestantesT1").ToString.ToEntero.ToString + ", color: '#A9C0FB' } ")
ScriptTemp.Append(" ] ")
'Datos("RestantesT4").ToString, Datos("RestantesT3").ToString, Datos("RestantesT2").ToString, Datos("RestantesT1").ToString)
ScriptTemp.Append(" }, ")
ScriptTemp.Append(" { ")
ScriptTemp.Append(" name: 'AVANCE', ")
ScriptTemp.Append(" showInLegend: false, ")
ScriptTemp.Append(" data: [ ")
ScriptTemp.Append(" { y: " + Datos("VotosT4").ToString.ToEntero.ToString + ", color: '#F2E832' }, ")
ScriptTemp.Append(" { y: " + Datos("VotosT3").ToString.ToEntero.ToString + ", color: '#A2A2A2' }, ")
ScriptTemp.Append(" { y: " + Datos("VotosT2").ToString.ToEntero.ToString + ", color: '#E59400' }, ")
ScriptTemp.Append(" { y: " + Datos("VotosT1").ToString.ToEntero.ToString + ", color: '#5C7FD9' } ")
ScriptTemp.Append(" ] ")
'Datos("VotosT4").ToString, Datos("VotosT3").ToString, Datos("VotosT2").ToString, Datos("VotosT1").ToString)
ScriptTemp.Append(" } ")
ScriptTemp.Append(" ], ")
ScriptTemp.Append(" credits: { ")
ScriptTemp.Append(" enabled: false ")
ScriptTemp.Append(" } ")
ScriptTemp.Append(" }); ")
ScriptTemp.Append(" }); ")
'RegistraScript(ScriptTemp.ToString)
Return ScriptTemp.ToString
End Function
#End Region
End Class

294
ZDG/RepMunicipios.aspx Normal file
View File

@@ -0,0 +1,294 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepMunicipios.aspx.vb" Inherits="ZDG_RepMunicipios" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.sinlink td a {
pointer-events: none;
cursor: default;
color: black;
font-size: small;
}
.white a{
color: white !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte Municipios
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-ad-excel"></i> Exportar Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<div class="btn-group pull-right btn-separete">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-fit-height btnopaco" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-1 truncate">Municipio</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlMunicipio" runat="server" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="dvCa" style="width: 100%; top: 40px">
<table id="dTable" class="table Widthall ">
<tr>
<td width="22.5%" id="TH1"></td>
<td width="15%" id="TH2" style="font-size:medium; text-align: center!important; background-color: #dddddd;"><strong>Votación</strong> </td>
<td width="20%" id="TH3" style="font-size:medium; text-align: center!important; background-color: #b9b9b9;"><strong>Tendencia</strong> </td>
<td width="12.5%" id="TH4" style="font-size:medium; text-align: center!important; background-color: #dddddd;"><strong>Ventaja</strong></td>
<td width="30%" id="TH5" style="font-size:medium; text-align: center!important; background-color: #b9b9b9;"><strong>Seguimiento DG</strong> </td>
</tr>
</table>
</div>
<asp:GridView ID="GvDatos" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
<Columns>
<%--<asp:BoundField HeaderText="Municipio" DataField="Municipio" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />--%>
<asp:TemplateField HeaderText="Municipio" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<asp:HyperLink ID="HLMunicipio" Text='<%# Eval("Municipio") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Padron" DataField="Padron" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="Padron" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLPadron" Text='<%# Eval("Padron", "{0:###,##0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Votos" DataField="Votos" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="Total" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<asp:HyperLink ID="HLVotos" Text='<%# Eval("Votos", "{0:###,##0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Votos %" DataField="VotosPorcentaje" DataFormatString="{0:N2}%" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="%" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLVotosPorcentaje" Text='<%# Eval("VotosPorcentaje") %>' DataFormatString="{0:N2}" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Votos 1" DataField="VT1" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="DG" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<asp:HyperLink ID="HLVotos1" Text='<%# Eval("VT1", "{0:###,##0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Votos 2" DataField="VT2" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="EM" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLVotos2" Text='<%# Eval("VT2", "{0:###,##0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Votos 3" DataField="VT3" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="AE" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<asp:HyperLink ID="HLVotos3" Text='<%# Eval("VT3", "{0:###,##0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Votos 4" DataField="VT4" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="NI" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLVotos4" Text='<%# Eval("VT4", "{0:###,##0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Ventaja Votos" DataField="VentajaVotos" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="Votos" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<asp:HyperLink ID="HLVentajaVotos" Text='<%# Eval("VentajaVotos", "{0:###,##0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField Visible="true" HeaderText="Pts %" DataField="VentajaVotosPorcentaje" DataFormatString="{0:N2}%" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField Visible="false" HeaderText="Pts %" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<div class="row" style="width: 100%;">
<%--<div style="width: 80%;">
<div runat="server" id="DivVentajaPorcentaje" style="height: 15px; background-color: cornflowerblue; float: left;"></div>
</div>--%>
<div class="col-md-6">
<asp:Literal ID="LiVentajaVotosPorcentaje" Text='<%# Eval("VentajaVotosPorcentaje", "{0:N2}%") %>' runat="server" />
</div>
<div class="col-md-6">
<div runat="server" id="DivVentaja" style="width: 100%; height: 25px;"></div>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField Visible="true" HeaderText="Avance DG %" DataField="Avance" DataFormatString="{0:N2}%" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Avance" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Right" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<div class="row" style="width: 90%; margin: 0;">
<div class="col-md-9" style="padding: 0px 5px 0px 0px;">
<div runat="server" id="DivAvancePorcentaje" style="height: 25px; background-color: cornflowerblue; float: left;"></div>
</div>
<div class="col-md-2">
<asp:Literal ID="LiAvance" Text='<%# Eval("Avance", "{0:N2}%") %>' runat="server" />
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Faltan X Votar" DataField="FaltanPorVotar" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="F. X Votar" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLFaltanVotar" Text='<%# Eval("FaltanPorVotar", "{0:###,##0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Asignados" ItemStyle-Width="7.5%" ItemStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<asp:HyperLink ID="HLAsignados" Text='<%# Eval("Cantidad", "{0:###,##0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script type="text/javascript">
function OrdenarGV() {
var Tam = TamañoVentana();
var Alto = Tam.height - 270;
if (Alto < 100) {
Alto = 100;
}
$('#GvDatos').DataTable({
scrollY: Alto + 'px',
scrollCollapse: true,
paging: false,
searching: false,
info: false,
"columnDefs": [
{ "orderable": false, "targets": [4, 5, 6, 7] }
]
});
$('#GvDatos').parent().parent().children().first().css("position", "static");
}
<%-- $(window).resize(function () {
subHeaders();
dTable.columns.adjust().draw();
});
function subHeaders() {
var recco = 0;
$("#<%=GvDatos.ClientID %> tr").each(function() {
if (!this.rowIndex) return;
var celdas = [];
$(this).find('td').each(function (column, td) {
celdas.push($(td).width());
});
var ancho = 0
ancho += celdas[0];
ancho += celdas[1];
$('#TH1').width(ancho);
ancho = 0;
ancho += celdas[2];
ancho += celdas[3];
ancho += celdas[4];
ancho += celdas[5];
ancho += celdas[6];
ancho += celdas[7];
$('#TH2').width(ancho);
ancho = 0;
ancho += celdas[8];
ancho += celdas[9];
$('#TH3').width(ancho);
ancho = 0;
ancho += celdas[10];
ancho += celdas[11];
ancho += celdas[12];
$('#TH4').width(ancho);
return false;
});
}--%>
</script>
</asp:Content>

145
ZDG/RepMunicipios.aspx.vb Normal file
View File

@@ -0,0 +1,145 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class ZDG_RepMunicipios
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
SetValues()
CargaDatos()
End If
End Sub
#Region " SET VALUES "
Private Sub SetValues()
'CargaMunicipios
Dim ObjDG As New ClsDG
If ObjDG.GetMunicipios() Then
DdlMunicipio.DataSource = ObjDG.DtResultados
Else
DdlMunicipio.DataSource = Nothing
End If
ObjDG.Dispose()
DdlMunicipio.DataBind()
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
UPDatos.Update()
End Sub
Private Sub CargaDatos()
Dim ObjDG As New ClsDG
If ObjDG.GetRepMunicipios(DdlMunicipio.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjDG.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjDG.Dispose()
GvDatos.DataBind()
If (GvDatos.Rows.Count > 0) Then
GvDatos.UseAccessibleHeader = True
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
RegistraScript("OrdenarGV();")
End If
'GvDatos.Columns(9).Visible = False
GvDatos.Columns(11).Visible = False
UPDatos.Update()
End Sub
#End Region
#Region " GV DATOS "
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'CType(e.Row.FindControl("DivVentajaPorcentaje"), HtmlContainerControl).Attributes.Add("style", String.Format("height: 15px;background-color:cornflowerblue;float:left;width:{0}%;", e.Row.DBCampo("VentajaVotosPorcentaje")))
CType(e.Row.FindControl("DivAvancePorcentaje"), HtmlContainerControl).Attributes.Add("style", String.Format("height:25px;background-color:cornflowerblue;float:left;width:{0}%;", e.Row.DBCampo("Avance")))
'CType(e.Row.FindControl("DivVentaja"), HtmlContainerControl).Attributes.Add("style", String.Format("height:25px;background-color:{0};width:100%;", If(e.Row.DBCampo("VentajaVotosPorcentaje").ToDecimal > 0, "cornflowerblue", If(e.Row.DBCampo("VentajaVotosPorcentaje").ToDecimal = 0, "", "crimson"))))
If e.Row.DBCampo("VentajaVotosPorcentaje").ToDecimal < 0 Then
e.Row.Cells(8).BackColor = Drawing.Color.Crimson
e.Row.Cells(9).BackColor = Drawing.Color.Crimson
e.Row.Cells(8).ForeColor = Drawing.Color.White
e.Row.Cells(8).CssClass = "white"
e.Row.Cells(9).ForeColor = Drawing.Color.White
End If
If e.Row.DBCampo("Municipio") = " Total" Then
e.Row.CssClass = "SubTotales2 sinlink"
e.Row.Font.Italic = True
e.Row.Attributes.Add("style", "background:#CCCCCC !important")
Else
Dim Liga = String.Format("/ZDG/RepMunicipiosCoordinadores.aspx?CM={0}", e.Row.DBCampo("CveMunicipio"))
e.Row.FCHyperLink("HLMunicipio").NavigateUrl = Liga
e.Row.FCHyperLink("HLPadron").NavigateUrl = Liga
e.Row.FCHyperLink("HLVotos").NavigateUrl = Liga
e.Row.FCHyperLink("HLVotosPorcentaje").NavigateUrl = Liga
e.Row.FCHyperLink("HLVotos1").NavigateUrl = Liga
e.Row.FCHyperLink("HLVotos2").NavigateUrl = Liga
e.Row.FCHyperLink("HLVotos3").NavigateUrl = Liga
e.Row.FCHyperLink("HLVotos4").NavigateUrl = Liga
e.Row.FCHyperLink("HLVentajaVotos").NavigateUrl = Liga
e.Row.FCHyperLink("HLFaltanVotar").NavigateUrl = Liga
e.Row.FCHyperLink("HLAsignados").NavigateUrl = Liga
End If
'e.Row.FCHyperLink("HLPadron").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), -1, -1)
'e.Row.FCHyperLink("HLVotos").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), 1, -1)
'e.Row.FCHyperLink("HLVotos1").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), 1, 1)
'e.Row.FCHyperLink("HLVotos2").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), 1, 2)
'e.Row.FCHyperLink("HLVotos3").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), 1, 3)
'e.Row.FCHyperLink("HLVotos4").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), 1, 4)
'e.Row.FCHyperLink("HLFaltanVotar").NavigateUrl = String.Format("/ZDG/RepMunicipiosSeguimiento.aspx?CM={0}&CV={1}&CT={2}", e.Row.DBCampo("CveMunicipio"), 0, 1)
End If
End Sub
#End Region
#Region " SELECTED INDEX CHANGED "
Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaDatos()
End Sub
#End Region
Protected Sub ImgExcel_Click(sender As Object, e As System.EventArgs) Handles ImgExcel.Click
GvDatos.Columns(9).Visible = True
GvDatos.Columns(10).Visible = False
GvDatos.Columns(11).Visible = True
GvDatos.Columns(12).Visible = False
GvDatos.ExportToExcel("ReporteMunicipios")
GvDatos.Columns(9).Visible = False
'GvDatos.Columns(10).Visible = True
GvDatos.Columns(11).Visible = False
GvDatos.Columns(12).Visible = True
End Sub
End Class

View File

@@ -0,0 +1,181 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepMunicipiosCoordinadores.aspx.vb" Inherits="ZDG_RepMunicipiosSeguimiento" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.sinlink td a{
pointer-events: none;
cursor: default;
color: black;
font-size: small;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte Municipios - Coordinadores
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-ad-excel"></i> Exportar Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<div class="btn-group pull-right btn-separete">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" ValidationGroup="GrpConsultar" class="btn btn-fit-height btnopaco" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-1 truncate">Municipio</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlMunicipio" AutoPostBack="true" runat="server" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</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 seleccione uno." InitialValue="-1" ValidationGroup="GrpConsultar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMunicipio" runat="server" HighlightCssClass="vco" TargetControlID="RFVMunicipio" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<label class="col-md-1 truncate">Coordinador</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlCoordinadores" AutoPostBack="true" OnSelectedIndexChanged="DdlCoordinadores_SelectedIndexChanged" runat="server" DataTextField="Nombre" DataValueField="RNM" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-2"></asp:ListItem>
<%--<asp:ListItem Text="Sin Coordinador" Value="-1"></asp:ListItem>--%>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<%--<asp:BoundField HeaderText="Coordinador" DataField="Coordinador" ItemStyle-Width="75%" ItemStyle-HorizontalAlign="Left" />--%>
<asp:TemplateField HeaderText="Coordinador" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<asp:HyperLink ID="HLCoordinador" Text='<%# Eval("Coordinador") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Telefono" DataField="Telefono" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />--%>
<asp:TemplateField HeaderText="Telefono" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLTelefono" Text='<%# Eval("Telefono") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Faltan Por Votar" DataField="FaltanPorVotar" DataFormatString="{0:N0}" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="Faltan Por Votar" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<asp:HyperLink ID="HLFaltanPorVotar" Text='<%# Eval("FaltanPorVotar", "{0:N0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Ya Votaron" DataField="YaVotaron" DataFormatString="{0:N0}" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="Ya Votaron" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLYaVotaron" Text='<%# Eval("YaVotaron", "{0:N0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField Visible="true" HeaderText="Avance DG %" DataField="Avance" DataFormatString="{0:N2}%" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Avance DG" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Right" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<div class="row" style="width: 90%; margin: 0;">
<div class="col-md-9" style="padding: 0px 5px 0px 0px;">
<div runat="server" id="DivAvancePorcentaje" style="height: 25px; background-color: cornflowerblue; float: left;"></div>
</div>
<div class="col-md-2">
<asp:HyperLink ID="HLAvance" Text='<%# Eval("Avance", "{0:N2}%") %>' runat="server" />
<%--<asp:Literal ID="LiAvance" Text='<%# Eval("Avance", "{0:N2}%") %>' runat="server" />--%>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Asignados" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLAsignados" Text='<%# Eval("Total", "{0:###,##0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script type="text/javascript">
function OrdenarGV() {
var Tam = TamañoVentana();
var Alto = Tam.height - 270;
if (Alto < 100) {
Alto = 100;
}
$('#GvDatos').DataTable({
scrollY: Alto + 'px',
scrollCollapse: true,
paging: false,
searching: false,
info: false
});
$('#GvDatos').parent().parent().children().first().css("position", "static");
}
</script>
</asp:Content>

View File

@@ -0,0 +1,164 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class ZDG_RepMunicipiosSeguimiento
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Private Property CveMunicipio As Integer
Get
Return ViewState("CveMunicipio").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveMunicipio") = 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
CargaParametrosUrl()
CargaCombos()
SetValues()
CargaDatos()
End If
End Sub
#Region " SET VALUES "
Private Sub CargaCombos()
Dim ObjDG As New ClsDG
'CARGA MUNICIPIOS
If ObjDG.GetMunicipios() Then
DdlMunicipio.DataSource = ObjDG.DtResultados
Else
DdlMunicipio.DataSource = Nothing
End If
'CARGA COORDINADORES
If ObjDG.GetCoordinadores("-1", CveMunicipio) Then
DdlCoordinadores.DataSource = ObjDG.DtResultados
Else
DdlCoordinadores.DataSource = Nothing
End If
ObjDG.Dispose()
DdlMunicipio.DataBind()
DdlCoordinadores.DataBind()
End Sub
Private Sub SetValues()
DdlMunicipio.SelectedValueExist(CveMunicipio)
End Sub
#End Region
#Region " CARGA PARAMETROS URL "
Private Sub CargaParametrosUrl()
CveMunicipio = IfNull(Request("CM"), "-1").ToString().ToEntero
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim ObjDG As New ClsDG
If ObjDG.GetRepMunicipiosCoordinadores(DdlMunicipio.SelectedValue.ToEntero, DdlCoordinadores.SelectedValue) Then
GvDatos.DataSource = ObjDG.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjDG.Dispose()
GvDatos.DataBind()
If (GvDatos.Rows.Count > 0) Then
GvDatos.UseAccessibleHeader = True
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
RegistraScript("OrdenarGV();")
End If
GvDatos.Columns(4).Visible = False
GvDatos.Columns(5).Visible = True
UPDatos.Update()
End Sub
#End Region
#Region " GV DATOS "
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("Coordinador") = " TOTAL" Then
e.Row.CssClass = "SubTotales2 sinlink"
e.Row.Font.Italic = True
e.Row.Attributes.Add("style", "background:#CCCCCC !important")
Else
e.Row.FCHyperLink("HLCoordinador").NavigateUrl = String.Format("/ZDG/RepMunicipiosLideres.aspx?CM={0}&CC={1}", DdlMunicipio.SelectedValue, e.Row.DBCampo("CveCoordinador"))
e.Row.FCHyperLink("HLTelefono").NavigateUrl = String.Format("/ZDG/RepMunicipiosLideres.aspx?CM={0}&CC={1}", DdlMunicipio.SelectedValue, e.Row.DBCampo("CveCoordinador"))
e.Row.FCHyperLink("HLFaltanPorVotar").NavigateUrl = String.Format("/ZDG/RepMunicipiosLideres.aspx?CM={0}&CC={1}", DdlMunicipio.SelectedValue, e.Row.DBCampo("CveCoordinador"))
e.Row.FCHyperLink("HLYaVotaron").NavigateUrl = String.Format("/ZDG/RepMunicipiosLideres.aspx?CM={0}&CC={1}", DdlMunicipio.SelectedValue, e.Row.DBCampo("CveCoordinador"))
e.Row.FCHyperLink("HLAvance").NavigateUrl = String.Format("/ZDG/RepMunicipiosLideres.aspx?CM={0}&CC={1}", DdlMunicipio.SelectedValue, e.Row.DBCampo("CveCoordinador"))
e.Row.FCHyperLink("HLAsignados").NavigateUrl = String.Format("/ZDG/RepMunicipiosLideres.aspx?CM={0}&CC={1}", DdlMunicipio.SelectedValue, e.Row.DBCampo("CveCoordinador"))
End If
CType(e.Row.FindControl("DivAvancePorcentaje"), HtmlContainerControl).Attributes.Add("style", String.Format("height:25px;background-color:cornflowerblue;float:left;width:{0}%;", e.Row.DBCampo("Avance")))
End If
End Sub
#End Region
#Region " SELECTED INDEX CHANGED "
Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DdlCoordinadores.Items.Clear()
'CARGA COORDINADORES
If ObjDG.GetCoordinadores("-1", DdlMunicipio.SelectedValue.ToEntero) Then
DdlCoordinadores.DataSource = ObjDG.DtResultados
Else
DdlCoordinadores.DataSource = Nothing
End If
DdlCoordinadores.DataBind()
ObjDG.Dispose()
DdlCoordinadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlCoordinadores.SelectedValueExist("-2")
CargaDatos()
End Sub
Protected Sub DdlCoordinadores_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaDatos()
End Sub
#End Region
Protected Sub ImgExcel_Click(sender As Object, e As System.EventArgs) Handles ImgExcel.Click
GvDatos.Columns(4).Visible = True
GvDatos.Columns(5).Visible = False
GvDatos.ExportToExcel("ReporteMunicipiosCoordinadores")
GvDatos.Columns(4).Visible = False
GvDatos.Columns(5).Visible = True
End Sub
End Class

View File

@@ -0,0 +1,217 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepMunicipiosLideres.aspx.vb" Inherits="ZDG_RepMunicipiosSeguimientoDetalle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.sinlink td a{
pointer-events: none;
cursor: default;
color: black;
font-size: small;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte Municipios - Lideres
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-ad-excel"></i> Exportar Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<div class="btn-group pull-right btn-separete">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" ValidationGroup="GrpConsultar" class="btn btn-fit-height btnopaco" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-1 truncate">Municipio</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlMunicipio" AutoPostBack="true" runat="server" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</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 seleccione uno." InitialValue="-1" ValidationGroup="GrpConsultar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMunicipio" runat="server" HighlightCssClass="vco" TargetControlID="RFVMunicipio" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<%-- <label class="col-md-1 truncate">Voto</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlVoto" runat="server" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="SI Voto" Value="1"></asp:ListItem>
<asp:ListItem Text="NO Voto" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 truncate">Tendencia</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlTendencia" runat="server" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="1" Value="1"></asp:ListItem>
<asp:ListItem Text="2" Value="2"></asp:ListItem>
<asp:ListItem Text="3" Value="3"></asp:ListItem>
<asp:ListItem Text="4" Value="4"></asp:ListItem>
</asp:DropDownList>--%>
<label class="col-md-1 truncate">Coordinador</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlCoordinadores" AutoPostBack="true" runat="server" DataTextField="Nombre" DataValueField="RNM" OnSelectedIndexChanged="DdlCoordinadores_SelectedIndexChanged" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-2"></asp:ListItem>
<%--<asp:ListItem Text="Sin Coordinador" Value="-1"></asp:ListItem>--%>
</asp:DropDownList>
<%--<asp:RequiredFieldValidator ID="RFVCoordinadores" runat="server" ControlToValidate="DdlCoordinadores" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Coordinador''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpConsultar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECoordinadores" runat="server" HighlightCssClass="vco" TargetControlID="RFVCoordinadores" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div>
<label class="col-md-1 truncate">Lider</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlLideres" AutoPostBack="true" OnSelectedIndexChanged="DdlLideres_SelectedIndexChanged" runat="server" DataTextField="Nombre" DataValueField="RNM" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-2"></asp:ListItem>
<%--<asp:ListItem Text="Sin Lider" Value="-1"></asp:ListItem>--%>
</asp:DropDownList>
<%-- <asp:RequiredFieldValidator ID="RFVLideres" runat="server" ControlToValidate="DdlLideres" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lider''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpConsultar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCELideres" runat="server" HighlightCssClass="vco" TargetControlID="RFVLideres" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div>
<%-- <label class="col-md-1 truncate">Movilizador</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlMovilizadores" runat="server" DataTextField="Movilizador" DataValueField="CveMovilizador" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-2"></asp:ListItem>
<asp:ListItem Text="Sin Movilizador" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVMovilizadores" runat="server" ControlToValidate="DdlMovilizadores" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Movilizador''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpConsultar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMovilizadores" runat="server" HighlightCssClass="vco" TargetControlID="RFVMovilizadores" Width="300px"></ajax:ValidatorCalloutExtender>
</div>--%>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<%--<asp:BoundField HeaderText="Lider" DataField="Lider" ItemStyle-Width="75%" ItemStyle-HorizontalAlign="Left" />--%>
<asp:TemplateField HeaderText="Lider" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<asp:HyperLink ID="HLLider" Text='<%# Eval("Lider") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Telefono" DataField="Telefono" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />--%>
<asp:TemplateField HeaderText="Telefono" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLTelefono" Text='<%# Eval("Telefono") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Faltan Por Votar" DataField="FaltanPorVotar" DataFormatString="{0:N0}" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="Faltan Por Votar" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<asp:HyperLink ID="HLFaltanPorVotar" Text='<%# Eval("FaltanPorVotar", "{0:N0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Ya Votaron" DataField="YaVotaron" DataFormatString="{0:N0}" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="Ya Votaron" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLYaVotaron" Text='<%# Eval("YaVotaron", "{0:N0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField Visible="true" HeaderText="Avance DG %" DataField="Avance" DataFormatString="{0:N2}%" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Avance DG" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Right" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<div class="row" style="width: 90%; margin: 0;">
<div class="col-md-9" style="padding: 0px 5px 0px 0px;">
<div runat="server" id="DivAvancePorcentaje" style="height: 25px; background-color: cornflowerblue; float: left;"></div>
</div>
<div class="col-md-2">
<asp:HyperLink ID="HLAvance" Text='<%# Eval("Avance", "{0:N2}%") %>' runat="server" />
<%--<asp:Literal ID="LiAvance" Text='<%# Eval("Avance", "{0:N2}%") %>' runat="server" />--%>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Asignados" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLAsignados" Text='<%# Eval("Total", "{0:###,##0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script type="text/javascript">
function OrdenarGV() {
var Tam = TamañoVentana();
var Alto = Tam.height - 270;
if (Alto < 100) {
Alto = 100;
}
$('#GvDatos').DataTable({
scrollY: Alto + 'px',
scrollCollapse: true,
paging: false,
searching: false,
info: false
});
$('#GvDatos').parent().parent().children().first().css("position", "static");
}
</script>
</asp:Content>

View File

@@ -0,0 +1,206 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class ZDG_RepMunicipiosSeguimientoDetalle
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Private Property CveMunicipio As Integer
Get
Return ViewState("CveMunicipio").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveMunicipio") = value
End Set
End Property
Private Property CveCoordinador As String
Get
Return ViewState("CveCoordinador").ToString
End Get
Set(value As String)
ViewState("CveCoordinador") = 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
CargaParametrosUrl()
CargaCombos()
SetValues()
CargaDatos()
End If
End Sub
#Region " SET VALUES "
Private Sub CargaCombos()
Dim ObjDG As New ClsDG
'CARGA MUNICIPIOS
If ObjDG.GetMunicipios() Then
DdlMunicipio.DataSource = ObjDG.DtResultados
Else
DdlMunicipio.DataSource = Nothing
End If
'CARGA COORDINADORES
If ObjDG.GetCoordinadores("-1", CveMunicipio) Then
DdlCoordinadores.DataSource = ObjDG.DtResultados
Else
DdlCoordinadores.DataSource = Nothing
End If
'CARGA LIDERES
If ObjDG.GetLideres("-1", CveMunicipio, CveCoordinador) Then
DdlLideres.DataSource = ObjDG.DtResultados
Else
DdlLideres.DataSource = Nothing
End If
ObjDG.Dispose()
DdlMunicipio.DataBind()
DdlCoordinadores.DataBind()
DdlLideres.DataBind()
End Sub
Private Sub SetValues()
DdlMunicipio.SelectedValueExist(CveMunicipio)
DdlCoordinadores.SelectedValueExist(CveCoordinador)
End Sub
#End Region
#Region " CARGA PARAMETROS URL "
Private Sub CargaParametrosUrl()
CveMunicipio = IfNull(Request("CM"), "-1").ToString().ToEntero
CveCoordinador = IfNull(Request("CC"), "-1").ToString()
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim ObjDG As New ClsDG
If ObjDG.GetRepMunicipiosLideres(DdlMunicipio.SelectedValue.ToEntero, DdlCoordinadores.SelectedValue, DdlLideres.SelectedValue) Then
GvDatos.DataSource = ObjDG.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjDG.Dispose()
GvDatos.DataBind()
If (GvDatos.Rows.Count > 0) Then
GvDatos.UseAccessibleHeader = True
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
RegistraScript("OrdenarGV();")
End If
GvDatos.Columns(4).Visible = False
GvDatos.Columns(5).Visible = True
UPDatos.Update()
End Sub
#End Region
#Region " GV DATOS "
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("Lider") = " TOTAL" Then
e.Row.CssClass = "SubTotales2 sinlink"
e.Row.Font.Italic = True
e.Row.Attributes.Add("style", "background:#CCCCCC !important")
Else
e.Row.FCHyperLink("HLLider").NavigateUrl = String.Format("/ZDG/RepMunicipiosMovilizadores.aspx?CM={0}&CC={1}&CL={2}", DdlMunicipio.SelectedValue, DdlCoordinadores.SelectedValue, e.Row.DBCampo("CveLider"))
e.Row.FCHyperLink("HLTelefono").NavigateUrl = String.Format("/ZDG/RepMunicipiosMovilizadores.aspx?CM={0}&CC={1}&CL={2}", DdlMunicipio.SelectedValue, DdlCoordinadores.SelectedValue, e.Row.DBCampo("CveLider"))
e.Row.FCHyperLink("HLFaltanPorVotar").NavigateUrl = String.Format("/ZDG/RepMunicipiosMovilizadores.aspx?CM={0}&CC={1}&CL={2}", DdlMunicipio.SelectedValue, DdlCoordinadores.SelectedValue, e.Row.DBCampo("CveLider"))
e.Row.FCHyperLink("HLYaVotaron").NavigateUrl = String.Format("/ZDG/RepMunicipiosMovilizadores.aspx?CM={0}&CC={1}&CL={2}", DdlMunicipio.SelectedValue, DdlCoordinadores.SelectedValue, e.Row.DBCampo("CveLider"))
e.Row.FCHyperLink("HLAvance").NavigateUrl = String.Format("/ZDG/RepMunicipiosMovilizadores.aspx?CM={0}&CC={1}&CL={2}", DdlMunicipio.SelectedValue, DdlCoordinadores.SelectedValue, e.Row.DBCampo("CveLider"))
e.Row.FCHyperLink("HLAsignados").NavigateUrl = String.Format("/ZDG/RepMunicipiosMovilizadores.aspx?CM={0}&CC={1}&CL={2}", DdlMunicipio.SelectedValue, DdlCoordinadores.SelectedValue, e.Row.DBCampo("CveLider"))
End If
CType(e.Row.FindControl("DivAvancePorcentaje"), HtmlContainerControl).Attributes.Add("style", String.Format("height:25px;background-color:cornflowerblue;float:left;width:{0}%;", e.Row.DBCampo("Avance")))
End If
End Sub
#End Region
#Region " SELECTED INDEX CHANGED "
Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DdlCoordinadores.Items.Clear()
'CARGA COORDINADORES
If ObjDG.GetCoordinadores("-1", DdlMunicipio.SelectedValue.ToEntero) Then
DdlCoordinadores.DataSource = ObjDG.DtResultados
Else
DdlCoordinadores.DataSource = Nothing
End If
DdlCoordinadores.DataBind()
ObjDG.Dispose()
DdlCoordinadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlCoordinadores.SelectedValueExist("-2")
DdlLideres.Items.Clear()
DdlLideres.Items.Insert(0, New ListItem("Todos", "-2"))
DdlLideres.SelectedValueExist("-2")
CargaDatos()
End Sub
Protected Sub DdlCoordinadores_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DdlLideres.Items.Clear()
'CARGA LIDERES
If ObjDG.GetLideres("-1", DdlMunicipio.SelectedValue.ToEntero, DdlCoordinadores.SelectedValue) Then
DdlLideres.DataSource = ObjDG.DtResultados
Else
DdlLideres.DataSource = Nothing
End If
DdlLideres.DataBind()
ObjDG.Dispose()
DdlLideres.Items.Insert(0, New ListItem("Todos", "-2"))
DdlLideres.SelectedValueExist("-2")
CargaDatos()
End Sub
Protected Sub DdlLideres_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaDatos()
End Sub
#End Region
Protected Sub ImgExcel_Click(sender As Object, e As System.EventArgs) Handles ImgExcel.Click
GvDatos.Columns(4).Visible = True
GvDatos.Columns(5).Visible = False
GvDatos.ExportToExcel("ReporteMunicipiosLideres")
GvDatos.Columns(4).Visible = False
GvDatos.Columns(5).Visible = True
End Sub
End Class

View File

@@ -0,0 +1,181 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepMunicipiosMilitantes.aspx.vb" Inherits="ZDG_RepMunicipiosMilitantes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.sinlink td a {
pointer-events: none;
cursor: default;
color: black;
font-size: small;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte Municipios - Militantes
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-ad-excel"></i> Exportar Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<div class="btn-group pull-right btn-separete">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" ValidationGroup="GrpConsultar" class="btn btn-fit-height btnopaco" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-1 truncate">Municipio</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlMunicipio" AutoPostBack="true" runat="server" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</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 seleccione uno." InitialValue="-1" ValidationGroup="GrpConsultar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMunicipio" runat="server" HighlightCssClass="vco" TargetControlID="RFVMunicipio" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<%-- <label class="col-md-1 truncate">Voto</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlVoto" runat="server" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="SI Voto" Value="1"></asp:ListItem>
<asp:ListItem Text="NO Voto" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 truncate">Tendencia</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlTendencia" runat="server" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="1" Value="1"></asp:ListItem>
<asp:ListItem Text="2" Value="2"></asp:ListItem>
<asp:ListItem Text="3" Value="3"></asp:ListItem>
<asp:ListItem Text="4" Value="4"></asp:ListItem>
</asp:DropDownList>--%>
<label class="col-md-1 truncate">Coordinador</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlCoordinadores" AutoPostBack="true" runat="server" DataTextField="Nombre" DataValueField="RNM" OnSelectedIndexChanged="DdlCoordinadores_SelectedIndexChanged" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-2"></asp:ListItem>
<%--<asp:ListItem Text="Sin Coordinador" Value="-1"></asp:ListItem>--%>
</asp:DropDownList>
<%--<asp:RequiredFieldValidator ID="RFVCoordinadores" runat="server" ControlToValidate="DdlCoordinadores" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Coordinador''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpConsultar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECoordinadores" runat="server" HighlightCssClass="vco" TargetControlID="RFVCoordinadores" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div>
<label class="col-md-1 truncate">Lider</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlLideres" AutoPostBack="true" runat="server" DataTextField="Nombre" DataValueField="RNM" OnSelectedIndexChanged="DdlLideres_SelectedIndexChanged" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-2"></asp:ListItem>
<%--<asp:ListItem Text="Sin Lider" Value="-1"></asp:ListItem>--%>
</asp:DropDownList>
<%-- <asp:RequiredFieldValidator ID="RFVLideres" runat="server" ControlToValidate="DdlLideres" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lider''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpConsultar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCELideres" runat="server" HighlightCssClass="vco" TargetControlID="RFVLideres" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div>
<label class="col-md-1 truncate">Movilizador</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlMovilizadores" AutoPostBack="true" runat="server" DataTextField="Nombre" DataValueField="RNM" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-2"></asp:ListItem>
<%--<asp:ListItem Text="Sin Movilizador" Value="-1"></asp:ListItem>--%>
</asp:DropDownList>
<%-- <asp:RequiredFieldValidator ID="RFVMovilizadores" runat="server" ControlToValidate="DdlMovilizadores" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Movilizador''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpConsultar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMovilizadores" runat="server" HighlightCssClass="vco" TargetControlID="RFVMovilizadores" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Militante" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Left" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<asp:HyperLink ID="HLMilitante" Text='<%# Eval("Militante") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Consecutivo" DataField="Consecutivo" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Telefono" DataField="Telefono" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#b9b9b9" />
<asp:BoundField HeaderText="Asignados" DataField="Cantidad" DataFormatString="{0:N0}" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Center" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script type="text/javascript">
function OrdenarGV() {
var Tam = TamañoVentana();
var Alto = Tam.height - 270;
if (Alto < 100) {
Alto = 100;
}
$('#GvDatos').DataTable({
scrollY: Alto + 'px',
scrollCollapse: true,
paging: false,
searching: false,
info: false
});
$('#GvDatos').parent().parent().children().first().css("position", "static");
}
</script>
</asp:Content>

View File

@@ -0,0 +1,241 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class ZDG_RepMunicipiosMilitantes
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Private Property CveMunicipio As Integer
Get
Return ViewState("CveMunicipio").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveMunicipio") = value
End Set
End Property
Private Property CveCoordinador As String
Get
Return ViewState("CveCoordinador").ToString
End Get
Set(value As String)
ViewState("CveCoordinador") = value
End Set
End Property
Private Property CveLider As String
Get
Return ViewState("CveLider").ToString
End Get
Set(value As String)
ViewState("CveLider") = value
End Set
End Property
Private Property CveMovilizador As String
Get
Return ViewState("CveMovilizador").ToString
End Get
Set(value As String)
ViewState("CveMovilizador") = 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
CargaParametrosUrl()
CargaCombos()
SetValues()
CargaDatos()
End If
End Sub
#Region " SET VALUES "
Private Sub CargaCombos()
Dim ObjDG As New ClsDG
'CARGA MUNICIPIOS
If ObjDG.GetMunicipios() Then
DdlMunicipio.DataSource = ObjDG.DtResultados
Else
DdlMunicipio.DataSource = Nothing
End If
'CARGA COORDINADORES
If ObjDG.GetCoordinadores("-1", CveMunicipio) Then
DdlCoordinadores.DataSource = ObjDG.DtResultados
Else
DdlCoordinadores.DataSource = Nothing
End If
'CARGA LIDERES
If ObjDG.GetLideres("-1", CveMunicipio, CveCoordinador) Then
DdlLideres.DataSource = ObjDG.DtResultados
Else
DdlLideres.DataSource = Nothing
End If
'CARGA MOVILIZADORES
If ObjDG.GetMovilizadores("-1", CveMunicipio, CveCoordinador, CveLider) Then
DdlMovilizadores.DataSource = ObjDG.DtResultados
Else
DdlMovilizadores.DataSource = Nothing
End If
ObjDG.Dispose()
DdlMunicipio.DataBind()
DdlCoordinadores.DataBind()
DdlLideres.DataBind()
DdlMovilizadores.DataBind()
End Sub
Private Sub SetValues()
DdlMunicipio.SelectedValueExist(CveMunicipio)
DdlCoordinadores.SelectedValueExist(CveCoordinador)
DdlLideres.SelectedValueExist(CveLider)
DdlMovilizadores.SelectedValueExist(CveMovilizador)
End Sub
#End Region
#Region " CARGA PARAMETROS URL "
Private Sub CargaParametrosUrl()
CveMunicipio = IfNull(Request("CM"), "-1").ToString().ToEntero
CveCoordinador = IfNull(Request("CC"), "-1").ToString()
CveLider = IfNull(Request("CL"), "-1").ToString()
CveMovilizador = IfNull(Request("CMO"), "-1").ToString()
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim ObjDG As New ClsDG
If ObjDG.GetRepMunicipiosMilitantes(DdlMunicipio.SelectedValue.ToEntero, DdlCoordinadores.SelectedValue, DdlLideres.SelectedValue, DdlMovilizadores.SelectedValue) Then
GvDatos.DataSource = ObjDG.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjDG.Dispose()
GvDatos.DataBind()
If (GvDatos.Rows.Count > 0) Then
GvDatos.UseAccessibleHeader = True
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
RegistraScript("OrdenarGV();")
End If
UPDatos.Update()
End Sub
#End Region
#Region " GV DATOS "
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("Militante") = " TOTAL" Then
e.Row.CssClass = "SubTotales2 sinlink"
e.Row.Font.Italic = True
e.Row.Attributes.Add("style", "background:#CCCCCC !important")
End If
End If
End Sub
#End Region
#Region " SELECTED INDEX CHANGED "
Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DdlCoordinadores.Items.Clear()
'CARGA COORDINADORES
If ObjDG.GetCoordinadores("-1", DdlMunicipio.SelectedValue.ToEntero) Then
DdlCoordinadores.DataSource = ObjDG.DtResultados
Else
DdlCoordinadores.DataSource = Nothing
End If
DdlCoordinadores.DataBind()
ObjDG.Dispose()
DdlCoordinadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlCoordinadores.SelectedValueExist("-2")
DdlLideres.Items.Clear()
DdlLideres.Items.Insert(0, New ListItem("Todos", "-2"))
DdlLideres.SelectedValueExist("-2")
DdlMovilizadores.Items.Clear()
DdlMovilizadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlMovilizadores.SelectedValueExist("-2")
CargaDatos()
End Sub
Protected Sub DdlCoordinadores_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DdlLideres.Items.Clear()
'CARGA LIDERES
If ObjDG.GetLideres("-1", DdlMunicipio.SelectedValue.ToEntero, DdlCoordinadores.SelectedValue) Then
DdlLideres.DataSource = ObjDG.DtResultados
Else
DdlLideres.DataSource = Nothing
End If
DdlLideres.DataBind()
ObjDG.Dispose()
DdlLideres.Items.Insert(0, New ListItem("Todos", "-2"))
DdlLideres.SelectedValueExist("-2")
DdlMovilizadores.Items.Clear()
DdlMovilizadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlMovilizadores.SelectedValueExist("-2")
CargaDatos()
End Sub
Protected Sub DdlLideres_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DdlMovilizadores.Items.Clear()
'CARGA MOVILIZADORES
If ObjDG.GetMovilizadores("-1", DdlMunicipio.SelectedValue.ToEntero, DdlCoordinadores.SelectedValue, DdlLideres.SelectedValue) Then
DdlMovilizadores.DataSource = ObjDG.DtResultados
Else
DdlMovilizadores.DataSource = Nothing
End If
DdlMovilizadores.DataBind()
ObjDG.Dispose()
DdlMovilizadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlMovilizadores.SelectedValueExist("-2")
CargaDatos()
End Sub
#End Region
Protected Sub ImgExcel_Click(sender As Object, e As System.EventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("ReporteMunicipiosMilitantes")
End Sub
End Class

View File

@@ -0,0 +1,218 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepMunicipiosMovilizadores.aspx.vb" Inherits="ZDG_RepMunicipiosMovilizadores" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
.Widthall {
width: 100% !important;
}
.dataTables_scrollHeadInner {
width: 100% !important;
background-color: #dddddd;
padding-left: 0px !important;
}
.dataTables_scrollFoot {
display: none;
position: static;
}
.table-scrollable {
margin: 0px !important;
}
.dataTables_scroll {
margin-bottom: 0px;
}
.table.dataTable {
margin-top: 0px !important;
}
.dataTables_scrollBody table th {
padding: 0px !important;
padding-right: 4px !important;
padding-left: 4px !important;
}
.sinlink td a {
pointer-events: none;
cursor: default;
color: black;
font-size: small;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reporte Municipios - Movilizadores
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"> <i class="fa fa-ad-excel"></i> Exportar Excel</asp:LinkButton>
</li>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<div class="btn-group pull-right btn-separete">
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" ValidationGroup="GrpConsultar" class="btn btn-fit-height btnopaco" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle">
<div class="titlefiltros caption ">
<div class="row">
<label class="col-md-1 truncate">Municipio</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlMunicipio" AutoPostBack="true" runat="server" OnSelectedIndexChanged="DdlMunicipio_SelectedIndexChanged" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="Municipio" DataValueField="CveMunicipio">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</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 seleccione uno." InitialValue="-1" ValidationGroup="GrpConsultar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMunicipio" runat="server" HighlightCssClass="vco" TargetControlID="RFVMunicipio" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<%-- <label class="col-md-1 truncate">Voto</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlVoto" runat="server" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="SI Voto" Value="1"></asp:ListItem>
<asp:ListItem Text="NO Voto" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 truncate">Tendencia</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlTendencia" runat="server" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Text="1" Value="1"></asp:ListItem>
<asp:ListItem Text="2" Value="2"></asp:ListItem>
<asp:ListItem Text="3" Value="3"></asp:ListItem>
<asp:ListItem Text="4" Value="4"></asp:ListItem>
</asp:DropDownList>--%>
<label class="col-md-1 truncate">Coordinador</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlCoordinadores" AutoPostBack="true" runat="server" DataTextField="Nombre" DataValueField="RNM" OnSelectedIndexChanged="DdlCoordinadores_SelectedIndexChanged" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-2"></asp:ListItem>
<%--<asp:ListItem Text="Sin Coordinador" Value="-1"></asp:ListItem>--%>
</asp:DropDownList>
<%--<asp:RequiredFieldValidator ID="RFVCoordinadores" runat="server" ControlToValidate="DdlCoordinadores" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Coordinador''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpConsultar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCECoordinadores" runat="server" HighlightCssClass="vco" TargetControlID="RFVCoordinadores" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div>
<label class="col-md-1 truncate">Lider</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlLideres" AutoPostBack="true" runat="server" DataTextField="Nombre" DataValueField="RNM" OnSelectedIndexChanged="DdlLideres_SelectedIndexChanged" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-2"></asp:ListItem>
<%--<asp:ListItem Text="Sin Lider" Value="-1"></asp:ListItem>--%>
</asp:DropDownList>
<%-- <asp:RequiredFieldValidator ID="RFVLideres" runat="server" ControlToValidate="DdlLideres" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lider''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpConsultar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCELideres" runat="server" HighlightCssClass="vco" TargetControlID="RFVLideres" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div>
<label class="col-md-1 truncate">Movilizador</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlMovilizadores" AutoPostBack="true" OnSelectedIndexChanged="DdlMovilizadores_SelectedIndexChanged" runat="server" DataTextField="Nombre" DataValueField="RNM" Width="100%" CssClass="form-control input-sm select2me" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-2"></asp:ListItem>
<%--<asp:ListItem Text="Sin Movilizador" Value="-1"></asp:ListItem>--%>
</asp:DropDownList>
<%-- <asp:RequiredFieldValidator ID="RFVMovilizadores" runat="server" ControlToValidate="DdlMovilizadores" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Movilizador''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpConsultar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEMovilizadores" runat="server" HighlightCssClass="vco" TargetControlID="RFVMovilizadores" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" ClientIDMode="Static" AutoGenerateColumns="false" EmptyDataText="No se encontraron datos con los filtros especificados" CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<%--<asp:BoundField HeaderText="Lider" DataField="Lider" ItemStyle-Width="75%" ItemStyle-HorizontalAlign="Left" />--%>
<asp:TemplateField HeaderText="Movilizador" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<asp:HyperLink ID="HLMovilizador" Text='<%# Eval("Movilizador") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Telefono" DataField="Telefono" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />--%>
<asp:TemplateField HeaderText="Telefono" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLTelefono" Text='<%# Eval("Telefono") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Faltan Por Votar" DataField="FaltanPorVotar" DataFormatString="{0:N0}" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="Faltan Por Votar" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<asp:HyperLink ID="HLFaltanPorVotar" Text='<%# Eval("FaltanPorVotar", "{0:N0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="Ya Votaron" DataField="YaVotaron" DataFormatString="{0:N0}" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Right" />--%>
<asp:TemplateField HeaderText="Ya Votaron" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLYaVotaron" Text='<%# Eval("YaVotaron", "{0:N0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField Visible="true" HeaderText="Avance DG %" DataField="Avance" DataFormatString="{0:N2}%" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Avance DG" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Right" HeaderStyle-BackColor="#b9b9b9">
<ItemTemplate>
<div class="row" style="width: 90%; margin: 0;">
<div class="col-md-9" style="padding: 0px 5px 0px 0px;">
<div runat="server" id="DivAvancePorcentaje" style="height: 25px; background-color: cornflowerblue; float: left;"></div>
</div>
<div class="col-md-2">
<asp:HyperLink ID="HLAvance" Text='<%# Eval("Avance", "{0:N2}%") %>' runat="server" />
<%--<asp:Literal ID="LiAvance" Text='<%# Eval("Avance", "{0:N2}%") %>' runat="server" />--%>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Asignados" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HyperLink ID="HLAsignados" Text='<%# Eval("Total", "{0:###,##0}") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
<script src="/Metronic/assets/global/scripts/datatable.js"></script>
<script src="/Metronic/assets/global/plugins/datatables/all.min.js"></script>
<script type="text/javascript">
function OrdenarGV() {
var Tam = TamañoVentana();
var Alto = Tam.height - 270;
if (Alto < 100) {
Alto = 100;
}
$('#GvDatos').DataTable({
scrollY: Alto + 'px',
scrollCollapse: true,
paging: false,
searching: false,
info: false
});
$('#GvDatos').parent().parent().children().first().css("position", "static");
}
</script>
</asp:Content>

View File

@@ -0,0 +1,257 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Partial Class ZDG_RepMunicipiosMovilizadores
Inherits ClsPaginas
#Region "P R O P I E D A D E S"
Private Property CveMunicipio As Integer
Get
Return ViewState("CveMunicipio").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveMunicipio") = value
End Set
End Property
Private Property CveCoordinador As String
Get
Return ViewState("CveCoordinador").ToString
End Get
Set(value As String)
ViewState("CveCoordinador") = value
End Set
End Property
Private Property CveLider As String
Get
Return ViewState("CveLider").ToString
End Get
Set(value As String)
ViewState("CveLider") = 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
CargaParametrosUrl()
CargaCombos()
SetValues()
CargaDatos()
End If
End Sub
#Region " SET VALUES "
Private Sub CargaCombos()
Dim ObjDG As New ClsDG
'CARGA MUNICIPIOS
If ObjDG.GetMunicipios() Then
DdlMunicipio.DataSource = ObjDG.DtResultados
Else
DdlMunicipio.DataSource = Nothing
End If
'CARGA COORDINADORES
If ObjDG.GetCoordinadores("-1", CveMunicipio) Then
DdlCoordinadores.DataSource = ObjDG.DtResultados
Else
DdlCoordinadores.DataSource = Nothing
End If
'CARGA LIDERES
If ObjDG.GetLideres("-1", CveMunicipio, CveCoordinador) Then
DdlLideres.DataSource = ObjDG.DtResultados
Else
DdlLideres.DataSource = Nothing
End If
'CARGA MOVILIZADORES
If ObjDG.GetMovilizadores("-1", CveMunicipio, CveCoordinador, CveLider) Then
DdlMovilizadores.DataSource = ObjDG.DtResultados
Else
DdlMovilizadores.DataSource = Nothing
End If
ObjDG.Dispose()
DdlMunicipio.DataBind()
DdlCoordinadores.DataBind()
DdlLideres.DataBind()
DdlMovilizadores.DataBind()
End Sub
Private Sub SetValues()
DdlMunicipio.SelectedValueExist(CveMunicipio)
DdlCoordinadores.SelectedValueExist(CveCoordinador)
DdlLideres.SelectedValueExist(CveLider)
End Sub
#End Region
#Region " CARGA PARAMETROS URL "
Private Sub CargaParametrosUrl()
CveMunicipio = IfNull(Request("CM"), "-1").ToString().ToEntero
CveCoordinador = IfNull(Request("CC"), "-1").ToString()
CveLider = IfNull(Request("CL"), "-1").ToString()
DdlMunicipio.SelectedValueExist(CveMunicipio)
DdlCoordinadores.SelectedValueExist(CveCoordinador)
DdlLideres.SelectedValueExist(CveLider)
End Sub
#End Region
#Region " CARGA DATOS "
Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Dim ObjDG As New ClsDG
If ObjDG.GetRepMunicipiosMovilizadores(DdlMunicipio.SelectedValue.ToEntero, DdlCoordinadores.SelectedValue, DdlLideres.SelectedValue, DdlMovilizadores.SelectedValue) Then
GvDatos.DataSource = ObjDG.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjDG.Dispose()
GvDatos.DataBind()
If (GvDatos.Rows.Count > 0) Then
GvDatos.UseAccessibleHeader = True
GvDatos.HeaderRow.TableSection = TableRowSection.TableHeader
RegistraScript("OrdenarGV();")
End If
GvDatos.Columns(4).Visible = False
GvDatos.Columns(5).Visible = True
UPDatos.Update()
End Sub
#End Region
#Region " GV DATOS "
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("Movilizador") = " TOTAL" Then
e.Row.CssClass = "SubTotales2 sinlink"
e.Row.Font.Italic = True
e.Row.Attributes.Add("style", "background:#CCCCCC !important")
Else
e.Row.FCHyperLink("HLMovilizador").NavigateUrl = String.Format("/ZDG/RepMunicipiosMilitantes.aspx?CM={0}&CC={1}&CL={2}&CMO={3}", DdlMunicipio.SelectedValue, DdlCoordinadores.SelectedValue, DdlLideres.SelectedValue, e.Row.DBCampo("CveMovilizador"))
e.Row.FCHyperLink("HLTelefono").NavigateUrl = String.Format("/ZDG/RepMunicipiosMilitantes.aspx?CM={0}&CC={1}&CL={2}&CMO={3}", DdlMunicipio.SelectedValue, DdlCoordinadores.SelectedValue, DdlLideres.SelectedValue, e.Row.DBCampo("CveMovilizador"))
e.Row.FCHyperLink("HLFaltanPorVotar").NavigateUrl = String.Format("/ZDG/RepMunicipiosMilitantes.aspx?CM={0}&CC={1}&CL={2}&CMO={3}", DdlMunicipio.SelectedValue, DdlCoordinadores.SelectedValue, DdlLideres.SelectedValue, e.Row.DBCampo("CveMovilizador"))
e.Row.FCHyperLink("HLYaVotaron").NavigateUrl = String.Format("/ZDG/RepMunicipiosMilitantes.aspx?CM={0}&CC={1}&CL={2}&CMO={3}", DdlMunicipio.SelectedValue, DdlCoordinadores.SelectedValue, DdlLideres.SelectedValue, e.Row.DBCampo("CveMovilizador"))
e.Row.FCHyperLink("HLAvance").NavigateUrl = String.Format("/ZDG/RepMunicipiosMilitantes.aspx?CM={0}&CC={1}&CL={2}&CMO={3}", DdlMunicipio.SelectedValue, DdlCoordinadores.SelectedValue, DdlLideres.SelectedValue, e.Row.DBCampo("CveMovilizador"))
e.Row.FCHyperLink("HLAsignados").NavigateUrl = String.Format("/ZDG/RepMunicipiosMilitantes.aspx?CM={0}&CC={1}&CL={2}&CMO={3}", DdlMunicipio.SelectedValue, DdlCoordinadores.SelectedValue, DdlLideres.SelectedValue, e.Row.DBCampo("CveMovilizador"))
End If
CType(e.Row.FindControl("DivAvancePorcentaje"), HtmlContainerControl).Attributes.Add("style", String.Format("height:25px;background-color:cornflowerblue;float:left;width:{0}%;", e.Row.DBCampo("Avance")))
End If
End Sub
#End Region
#Region " SELECTED INDEX CHANGED "
Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DdlCoordinadores.Items.Clear()
'CARGA COORDINADORES
If ObjDG.GetCoordinadores("-1", DdlMunicipio.SelectedValue.ToEntero) Then
DdlCoordinadores.DataSource = ObjDG.DtResultados
Else
DdlCoordinadores.DataSource = Nothing
End If
DdlCoordinadores.DataBind()
ObjDG.Dispose()
DdlCoordinadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlCoordinadores.SelectedValueExist("-2")
DdlLideres.Items.Clear()
DdlLideres.Items.Insert(0, New ListItem("Todos", "-2"))
DdlLideres.SelectedValueExist("-2")
DdlMovilizadores.Items.Clear()
DdlMovilizadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlMovilizadores.SelectedValueExist("-2")
CargaDatos()
End Sub
Protected Sub DdlCoordinadores_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DdlLideres.Items.Clear()
'CARGA LIDERES
If ObjDG.GetLideres("-1", DdlMunicipio.SelectedValue.ToEntero, DdlCoordinadores.SelectedValue) Then
DdlLideres.DataSource = ObjDG.DtResultados
Else
DdlLideres.DataSource = Nothing
End If
DdlLideres.DataBind()
ObjDG.Dispose()
DdlLideres.Items.Insert(0, New ListItem("Todos", "-2"))
DdlLideres.SelectedValueExist("-2")
DdlMovilizadores.Items.Clear()
DdlMovilizadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlMovilizadores.SelectedValueExist("-2")
CargaDatos()
End Sub
Protected Sub DdlLideres_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ObjDG As New ClsDG
DdlMovilizadores.Items.Clear()
'CARGA MOVILIZADORES
If ObjDG.GetMovilizadores("-1", DdlMunicipio.SelectedValue.ToEntero, DdlCoordinadores.SelectedValue, DdlLideres.SelectedValue) Then
DdlMovilizadores.DataSource = ObjDG.DtResultados
Else
DdlMovilizadores.DataSource = Nothing
End If
DdlMovilizadores.DataBind()
ObjDG.Dispose()
DdlMovilizadores.Items.Insert(0, New ListItem("Todos", "-2"))
DdlMovilizadores.SelectedValueExist("-2")
CargaDatos()
End Sub
Protected Sub DdlMovilizadores_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaDatos()
End Sub
#End Region
Protected Sub ImgExcel_Click(sender As Object, e As System.EventArgs) Handles ImgExcel.Click
GvDatos.Columns(4).Visible = True
GvDatos.Columns(5).Visible = False
GvDatos.ExportToExcel("ReporteMunicipiosMovilizadores")
GvDatos.Columns(4).Visible = False
GvDatos.Columns(5).Visible = True
End Sub
End Class

18
ZDG/WhatsApp.aspx Normal file
View File

@@ -0,0 +1,18 @@
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="WhatsApp.aspx.vb" Inherits="ZDG_WhatsApp" ValidateRequest="false" %>
<!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>

26
ZDG/WhatsApp.aspx.vb Normal file
View File

@@ -0,0 +1,26 @@
Imports Extensiones
Partial Class ZDG_WhatsApp
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Request("p") IsNot Nothing AndAlso Request("p").ToString.Trim <> "" Then
Dim Par As String = Request("p").ToString.Trim
For Each Fol As String In Par.Split(","c)
Dim Folio As Integer = Fol.Trim.ToEntero
If Folio >= 20001 AndAlso Folio <= 45000 Then
Dim ObjDG As New ClsDG
If ObjDG.RegistrarVoto(Folio) Then
Response.Write("1")
End If
ObjDG.Dispose()
End If
Next
End If
End Sub
End Class