Reporte de puntos de interes

This commit is contained in:
2021-02-10 12:53:42 -07:00
parent 2e6d6ee9d3
commit 1d87768d86
2 changed files with 471 additions and 47 deletions

View File

@@ -3,6 +3,7 @@
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<link href="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.css" rel="stylesheet" />
<style> <style>
html, body { html, body {
width: 100%; width: 100%;
@@ -26,6 +27,138 @@
.pac-container.pac-logo { .pac-container.pac-logo {
z-index: 100000; z-index: 100000;
} }
#showdiv1 {
left: 0 !important;
width: 100% !important;
}
#ShowDiv3:hover {
line-height: 34px !important;
-webkit-transition: line-height ease 1s;
-moz-transition: line-height ease 1s;
-o-transition: line-height ease 1s;
transition: line-height ease 1s;
}
.ADScroller-body {
max-height: 400px;
}
.pac-container.pac-logo {
z-index: 100000;
}
#iw-container {
margin-bottom: 10px;
}
#iw-container .iw-title {
font-family: 'Open Sans Condensed', sans-serif;
font-size: 22px;
font-weight: 400;
padding: 10px;
background-color: #48b5e9;
color: white;
margin: 0;
border-radius: 2px 2px 0 0;
}
#iw-container .iw-content {
font-size: 13px;
line-height: 18px;
font-weight: 400;
margin-right: 1px;
padding: 15px 5px 20px 15px;
max-height: 140px;
overflow-y: auto;
overflow-x: hidden;
}
.iw-content img {
float: right;
margin: 0 5px 5px 10px;
}
.iw-subTitle {
font-size: 16px;
font-weight: 700;
padding: 5px 0;
}
.iw-bottom-gradient {
position: absolute;
width: 326px;
height: 25px;
bottom: 10px;
right: 18px;
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
background: -ms-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
}
.modal.fade:not(.in).left .modal-dialog {
-webkit-transform: translate3d(-25%, 0, 0);
transform: translate3d(-25%, 0, 0);
}
.modal.fade:not(.in).right .modal-dialog {
-webkit-transform: translate3d(25%, 0, 0);
transform: translate3d(25%, 0, 0);
}
.modal.fade:not(.in).bottom .modal-dialog {
-webkit-transform: translate3d(0, 25%, 0);
transform: translate3d(0, 25%, 0);
}
/* Alternative Angles */
.modal.fade:not(.in).top-left .modal-dialog {
-webkit-transform: translate3d(-25%, -25%, 0);
transform: translate3d(-25%, -25%, 0);
}
.modal.fade:not(.in).top-right .modal-dialog {
-webkit-transform: translate3d(25%, -25%, 0);
transform: translate3d(25%, -25%, 0);
}
.modal.fade:not(.in).bottom-left .modal-dialog {
-webkit-transform: translate3d(-25%, 25%, 0);
transform: translate3d(-25%, 25%, 0);
}
.modal.fade:not(.in).bottom-right .modal-dialog {
-webkit-transform: translate3d(25%, 25%, 0);
transform: translate3d(25%, 25%, 0);
}
.minicolors {
position: relative;
MARGIN-TOP: 10PX;
WIDTH: 20%;
}
table.dataTable,
table.dataTable th,
table.dataTable td {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.dataTables_scrollBody > .dataTable > thead {
display: none !important;
}
tr td:nth-child(4) {
text-align: center;
}
.form-horizontal .control-label {
text-align: left;
}
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
@@ -66,8 +199,11 @@
<asp:GridView ID="GvPuntos" runat="server" GridLines="None" DataKeyNames="Punto,PuntoDeInteres,CvePuntoDeInteres" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-height="150" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros"> <asp:GridView ID="GvPuntos" runat="server" GridLines="None" DataKeyNames="Punto,PuntoDeInteres,CvePuntoDeInteres" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-height="150" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
<Columns> <Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%"> <asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
<HeaderTemplate>
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClickGR" />
</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:CheckBox runat="server" ID="chkGR" /> <asp:CheckBox runat="server" ID="chkGR" CssClass="ChkAllGR" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="45%" HeaderText="Punto De Interés" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="45%" HeaderText="Punto De Interés" ItemStyle-HorizontalAlign="Left" />
@@ -83,8 +219,11 @@
<asp:GridView ID="GvDispositivos" runat="server" GridLines="None" DataKeyNames="CveDispositivo,SerieVehiculo,DevID,NoEconomico,NombreVehiculo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="800" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros"> <asp:GridView ID="GvDispositivos" runat="server" GridLines="None" DataKeyNames="CveDispositivo,SerieVehiculo,DevID,NoEconomico,NombreVehiculo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-heighterror="800" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
<Columns> <Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%"> <asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
<HeaderTemplate>
<asp:CheckBox runat="server" ID="chkSelectAll" CssClass="ChkAllClickDisp" />
</HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:CheckBox runat="server" ID="chkDis" /> <asp:CheckBox runat="server" ID="chkDis" CssClass="ChkAllDisp" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="25%" HeaderText="Número Económico" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="NoEconomico" ItemStyle-Width="25%" HeaderText="Número Económico" ItemStyle-HorizontalAlign="Left" />
@@ -148,6 +287,43 @@
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div class="modal fade bottom in" style="bottom: unset; z-index: 539" id="h">
<div class="modal-dialog" style="position: fixed; bottom: 0; margin: 0px,0px,0px,0px; width: 100%; padding: 0px, 0px, 0px, 0px; border-style: solid; border-color: rgb(68, 77, 88); z-index: 539;">
<div class="modal-content">
<div class="modal-body" style="padding: 5px;">
<asp:UpdatePanel runat="server" ID="UPGV" UpdateMode="Conditional">
<ContentTemplate>
<div runat="server" id="rowImpresiones" class="row" style="margin: 0px 10px 10px 0px; text-align: right;">
<a onclick="doScaledCLick('#C_btnImprimir');;" class="btn btn-circle btn-sm grey"><i class='fa fa-print' aria-hidden='true'></i></a>
<a onclick="doScaledCLick('#C_BtnImprimirEX');" class="btn btn-circle btn-sm green"><i class='fa fa-file-excel-o' aria-hidden='true'></i></a>
</div>
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
<div style="margin-right: 15px">
<input type="text" id="TxtBusquedaBarra" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaBarra','{0}')", GvBarra.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaBarra','{0}')", GvBarra.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:GridView ID="GvBarra" runat="server" GridLines="None" PageSize="1000" AllowPaging="true" AllowCustomPaging="true" CssClass="table table-striped table-advance table-hover Widthall" data-sort="true" data-height="150px;" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
<Columns>
<asp:BoundField DataField="Vehiculo" ItemStyle-Width="30%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="30%" HeaderText="Punto De Interes" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Visitas" ItemStyle-Width="20%" DataFormatString="{0} Visitas" HeaderText="Visitas" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="UltimaVisita" ItemStyle-Width="20%" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ultima Visita" ItemStyle-HorizontalAlign="Center" />
</Columns>
<PagerSettings Mode="NextPrevious" Visible="true" Position="Top" />
</asp:GridView>
<asp:HiddenField ID="HdnIndexGvBarra" runat="server" ClientIDMode="Static" Value="-1" />
<asp:HiddenField ID="HdnTextFilter" runat="server" ClientIDMode="Static" Value="" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
<div runat="server" class="row" style="margin: 0px 0px 10px 0px; display: none">
<asp:Button runat="server" OnClick="btnImprimir_Click" ID="btnImprimir" CommandArgument="PDF" ToolTip="Imprimir en PDF" CssClass="btn btn-circle btn-sm grey" Text="<i class='fa fa-print' aria-hidden='true'></i>"></asp:Button>
<asp:Button runat="server" OnClick="btnImprimir_Click" ID="BtnImprimirEX" CommandArgument="EXCEL" ToolTip="Imprimir en EXCEL" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-file-excel-o' aria-hidden='true'></i>"></asp:Button>
</div>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="H" runat="Server">
<li> <li>
@@ -158,18 +334,36 @@
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
<script> <script>
function doScaledCLick(boton) {
setTimeout(function () {
$(boton).click();
}, 250);
}
var markers = []; var markers = [];
var lastOpenedInfoWindow; var lastOpenedInfoWindow;
var geocoder; var geocoder;
var map; var map;
var circles = []; var circles = [];
$('body').on('click', '.ChkAllClickGR input', function () { $(".ChkAllGR input").not(this).prop('checked', $('.ChkAllClickGR input').is(':checked')); });
$('body').on('click', '.ChkAllClickDisp input', function () { $(".ChkAllDisp input").not(this).prop('checked', $('.ChkAllClickDisp input').is(':checked')); });
function initMap() { function initMap() {
map = new google.maps.Map(document.getElementById('map'), { map = new google.maps.Map(document.getElementById('map'), {
center: { lat: 19.4326, lng: -99.13329 }, center: { lat: 19.4326, lng: -99.13329 },
zoom: 8 zoom: 8
}); });
var ShowDiv1 = document.createElement('div');
var ShowDivControl = new ShowDiv(ShowDiv1, map);
ShowDiv1.index = 1;
ShowDiv1.id = "showdiv1"
map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(ShowDiv1);
if (navigator.geolocation) { if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) { navigator.geolocation.getCurrentPosition(function (position) {
var pos = { var pos = {
@@ -201,6 +395,178 @@
//service = new google.maps.DistanceMatrixService; //service = new google.maps.DistanceMatrixService;
// map.addListener('click', addLatLng); // map.addListener('click', addLatLng);
} }
//$(document).ready(function () {
// GvBarraPaginator();
// initMap();
// Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
// function EndRequestHandler(sender, args) {
// $("#C_GvBarra_filter > div > input").on("keypress", function (e) {
// HdnTextFilter.value = $(this).val() + String.fromCharCode(e.which);
// });
// }
//});
function GvBarraPaginator() {
$('.table.PaginarGV').each(function () {
var Tthis = $(this);
if (!$.fn.DataTable.isDataTable(Tthis) && Tthis.find("th").length > 0) {
Tthis.prepend(("<thead></thead>"));
Tthis.find('thead').append($("#C_GvBarra").find("tr:first"));
var table = Tthis.DataTable({
//data: datasource,
//columns: [
// { title: "Vehiculo" },
// { title: "Fecha" },
// { title: "TiempoDetenido" },
// { title: "Extn." },
// { title: "Start date" },
// { title: "Salary" }
//],
deferRender: true,
deferLoading: 100,
scrollY: 130,
scrollCollapse: true,
scroller: {
displayBuffer: 20
},
ordering: true
});
var tkeys = new $.fn.dataTable.KeyTable(table, {
// options
});
var parent = Tthis.parent().parent().parent();
$('.dataTables_scrollHeadInner > .table.ADScrollPaginator2').find('th').addClass('importantth');
parent.find(".dataTables_paginate").css("display", "none");
parent.find(".dataTables_length").css("display", "none");
}
});
}
function ShowDiv(controlDiv, map) {
// Set CSS for the control border.
var controlUI = document.createElement('div');
controlUI.style.backgroundColor = '#444d58';
controlUI.style.border = '2px solid #444d58';
controlUI.style.borderRadius = '3px';
controlUI.style.width = '100%'
controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';
controlUI.style.cursor = 'pointer';
controlUI.style.marginRight = '5px';
controlUI.style.marginTop = '5px';
controlUI.style.marginBottom = '0px';
controlUI.style.textAlign = 'center';
// controlUI.title = 'Click para borrar el último punto dibujado';
controlDiv.appendChild(controlUI);
// Set CSS for the control interior.
var controlText = document.createElement('div');
controlText.style.color = '#ebebeb';
controlText.id = "ShowDiv3"
controlText.style.fontFamily = ' "Open Sans", sans-serif; ';
controlText.style.fontSize = '14px';
controlText.style.lineHeight = '20px';
controlText.style.paddingLeft = '5px';
controlText.style.paddingRight = '5px';
controlText.innerHTML = '<i class="fa fa-angle-up" aria-hidden="true"></i>';
controlUI.appendChild(controlText);
// Setup the click event listeners: simply set the map to Chicago.
controlUI.addEventListener('click', function () {
FNShowDiv();
});
}
function FNShowDiv() {
if (open === false) {
//$("#ChkSeguimiento").appendTo("#DivSeguimiento");
//$("#ChkSeguimiento").appendTo("#DivSeguimiento");
$("#h").modal()
$("#ShowDiv3").css("line-height", "34px")
open = true
$("#ShowDiv3").html('<i class="fa fa-angle-down" aria-hidden="true"></i>')
setTimeout(function () {
$('.table.ADScrollPaginator2').DataTable().draw();
}, 150);
if ($("#HdnOpcion").val() === 'All' || $("#HdnOpcion").val() === 'Idle' || $("#HdnOpcion").val() === 'Ralenti') {
$('#btnPlay').css('display', '');
$('#btnPrintExcel').css('display', '');
$('#btnPrintPDF').css('display', '');
$("#btnPlay").click(function () {
pause = !pause;
if (pause) {
stopTimeout();
} else {
if (startPlay) {
startPlay = false;
Play();
} else {
Play();
}
}
if ($('#btnPlay > i').hasClass("fa-pause")) {
$('#btnPlay > i').removeClass("fa-pause").addClass("fa-play");
} else if ($('#btnPlay > i').hasClass("fa-play")) {
$('#btnPlay > i').removeClass("fa-play").addClass("fa-pause");
}
});
$("#btnPrintExcel").click(function () {
var s;
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
}
$("#HdnDirecciones").val(s);
doScaledCLick("#C_BtnImprimirEX")
});
$("#btnPrintPDF").click(function () {
var s = "";
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
}
$("#HdnDirecciones").val(s);
doScaledCLick("#C_btnImprimir")
});
} else if ($("#HdnOpcion").val() === 'Speed') {
$('#btnPrintExcel').css('display', '');
$('#btnPrintPDF').css('display', '');
$("#btnPrintExcel").click(function () {
var s;
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
}
$("#HdnDirecciones").val(s);
doScaledCLick("#C_BtnImprimirEX")
});
$("#btnPrintPDF").click(function () {
var s = "";
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
}
$("#HdnDirecciones").val(s);
doScaledCLick("#C_btnImprimir")
});
} else if ($("#HdnOpcion").val() === 'Last') {
$('#btnPrintExcel').css('display', '');
$("#btnPrintExcel").click(function () {
var s;
for (var i = 0; i < $("#C_GvBarra").DataTable().rows().nodes().length; i++) {
s = s + $("#C_GvBarra").DataTable().row(i).node().cells[2].title.trim() + ';';
}
$("#HdnDirecciones").val(s);
doScaledCLick("#C_BtnImprimirEX");
});
}
} else {
$("#h").modal('hide')
$("#ShowDiv3").css("line-height", "20px")
open = false
$("#ShowDiv3").html('<i class="fa fa-angle-up" aria-hidden="true"></i>')
}
}
function CargaDivs(Tipo) { function CargaDivs(Tipo) {
if (Tipo === "PointGroup") { if (Tipo === "PointGroup") {
$("#C_TxtNombre").val("") $("#C_TxtNombre").val("")
@@ -356,6 +722,8 @@
} }
</script> </script>
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places&callback=initMap", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script> <script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places&callback=initMap", "AIzaSyDsZ4ATb_hVSEpRbBSlS46ZHEOn-0bNIFI") %>"></script>
<script src="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.min.js"></script>
<script src="../Metronic/assets/global/plugins/jquery-minicolors/components-color-pickers.min.js"></script>
</asp:Content> </asp:Content>

View File

@@ -2,6 +2,8 @@
Imports Extensiones Imports Extensiones
Imports System.Data Imports System.Data
Imports Microsoft.Reporting.WebForms
Partial Class GPS_RepPuntosDeInteres Partial Class GPS_RepPuntosDeInteres
Inherits ClsPaginas Inherits ClsPaginas
@@ -14,6 +16,14 @@ Partial Class GPS_RepPuntosDeInteres
ViewState("DispositivosLista") = value ViewState("DispositivosLista") = value
End Set End Set
End Property End Property
Private Property DtDatosReporte As DataTable
Get
Return If(IsNothing(ViewState("DtDatosReporte")), Nothing, CType(ViewState("DtDatosReporte"), DataTable))
End Get
Set(value As DataTable)
ViewState("DtDatosReporte") = value
End Set
End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -22,20 +32,17 @@ Partial Class GPS_RepPuntosDeInteres
End If End If
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
txtFechaI.Text = Now.AddDays(-7).ToString("dd/MM/yyyy")
CargaDispositivos() CargaDispositivos()
Dim gps As New ClsGPS Dim ObjGPS As New ClsGPS
'If gps.PuntoDeInteresGrupoGet(-1, 1) Then If ObjGPS.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, -1) Then
' GvGrupos.DataSource = gps.DtResultados GvPuntos.DataSource = ObjGPS.DtResultados
'Else
' GvGrupos.DataSource = Nothing
'End If
If gps.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, -1) Then
GvPuntos.DataSource = gps.DtResultados
Else Else
GvPuntos.DataSource = Nothing GvPuntos.DataSource = Nothing
End If End If
gps.Dispose() ObjGPS.Dispose()
'GvGrupos.DataBind()
GvPuntos.DataBind() GvPuntos.DataBind()
End Sub End Sub
@@ -59,7 +66,7 @@ Partial Class GPS_RepPuntosDeInteres
End Sub End Sub
Private Sub ReportePuntos(Dispositivos As String) Private Sub ReportePuntos(Dispositivos As String)
Dim GPS As New ClsGPS
Dim FechaI, FechaF As Date Dim FechaI, FechaF As Date
Dim SBBody As New StringBuilder Dim SBBody As New StringBuilder
Dim CoordsPoligono = "" Dim CoordsPoligono = ""
@@ -71,34 +78,47 @@ Partial Class GPS_RepPuntosDeInteres
Dim Color = "" Dim Color = ""
FechaI = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.Trim.ToDate) FechaI = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.Trim.ToDate)
FechaF = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.Trim.ToDate) FechaF = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.Trim.ToDate)
For Each row As GridViewRow In GvPuntos.Rows
SBBody.Clear()
If row.FCCheckBox("chkGR").Checked Then
If GPS.RepPuntosGet(row.DataKey("CvePuntoDeInteres").ToEntero, Dispositivos, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, UsuarioActual.CveCliente) Then
Coords = SQLToGmaps(row.DataKey("Punto").ToString, "POINT")
SBBody.Append($"<div>")
SBBody.Append($"<div><h5><b> Punto: {row.DataKey("PuntoDeInteres")}</b></h5></div>")
If GPS.DtResultados.Rows.Count > 0 Then Dim ObjGPS As New ClsGPS
Color = "#26C281" Try
SBBody.Append($"<div><table>") For Each row As GridViewRow In GvPuntos.Rows
For Each Cve As String In DispositivosLista SBBody.Clear()
If GPS.DtResultados.FiltraParametros($"CveDispositivo = {Cve} ").Rows.Count > 0 Then If row.FCCheckBox("chkGR").Checked Then
SBBody.Append($"<tr><td><b>{GPS.DtResultados.FiltroPrimeroValor("Vehiculo", $"CveDispositivo = {Cve}")}:</b> <a onclick=""CargaGV({Cve}, {row.DataKey("CvePuntoDeInteres")} )"">{GPS.DtResultados.FiltroPrimeroValor("Visitas", $"CveDispositivo = {Cve}")} visitas<a></td></tr>") If ObjGPS.RepPuntosGet(row.DataKey("CvePuntoDeInteres").ToEntero, Dispositivos, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, UsuarioActual.CveCliente) Then
SBBody.Append($"<tr><td>Última Visita: {GPS.DtResultados.FiltroPrimeroValor("UltimaVisita", $"CveDispositivo = {Cve}")}</td></tr>")
End If DtDatosReporte = ObjGPS.DtResultados.Copy()
Next GvBarra.DataSource = DtDatosReporte
SBBody.Append($"</table></div>")
Else Coords = SQLToGmaps(row.DataKey("Punto").ToString, "POINT")
Color = "#e82929" SBBody.Append($"<div>")
SBBody.Append($"<tr><td><b>Este punto de interés no fue visitado en las fechas seleccionadas.</b></td></tr>") SBBody.Append($"<div><h5><b> Punto: {row.DataKey("PuntoDeInteres")}</b></h5></div>")
If ObjGPS.DtResultados.Rows.Count > 0 Then
Color = "#26C281"
SBBody.Append($"<div><table>")
For Each Cve As String In DispositivosLista
If ObjGPS.DtResultados.FiltraParametros($"CveDispositivo = {Cve} ").Rows.Count > 0 Then
SBBody.Append($"<tr><td><b>{ObjGPS.DtResultados.FiltroPrimeroValor("Vehiculo", $"CveDispositivo = {Cve}")}:</b> <a onclick=""CargaGV({Cve}, {row.DataKey("CvePuntoDeInteres")} )"">{ObjGPS.DtResultados.FiltroPrimeroValor("Visitas", $"CveDispositivo = {Cve}")} visitas<a></td></tr>")
SBBody.Append($"<tr><td>Última Visita: {ObjGPS.DtResultados.FiltroPrimeroValor("UltimaVisita", $"CveDispositivo = {Cve}")}</td></tr>")
End If
Next
SBBody.Append($"</table></div>")
Else
Color = "#e82929"
SBBody.Append($"<tr><td><b>Este punto de interés no fue visitado en las fechas seleccionadas.</b></td></tr>")
End If
SBBody.Append($"</div>")
RegistraScript($"CreaCirculo({Coords},'{Color}');CreaMarcador({Coords},'{row.DataKey("PuntoDeInteres")}','{SBBody.ToString}');", row.DataKey("CvePuntoDeInteres"))
End If End If
SBBody.Append($"</div>")
RegistraScript($"CreaCirculo({Coords},'{Color}');CreaMarcador({Coords},'{row.DataKey("PuntoDeInteres")}','{SBBody.ToString}');", row.DataKey("CvePuntoDeInteres"))
End If End If
End If Next
Next Catch ex As Exception
GPS.Dispose() OnError("Ocurrió un error al consultar los puntos de interes", ex)
End Try
ObjGPS.Dispose()
GvBarra.DataBind()
UPGV.Update()
End Sub End Sub
'If GPS.GeoReferenciasEntradasSalidas(GVRow.DataKey("CveDispositivo").ToString.ToEntero, row.DataKey("CveGeoReferencia").ToString.ToEntero, FechaI, FechaF) Then 'If GPS.GeoReferenciasEntradasSalidas(GVRow.DataKey("CveDispositivo").ToString.ToEntero, row.DataKey("CveGeoReferencia").ToString.ToEntero, FechaI, FechaF) Then
@@ -153,4 +173,40 @@ Partial Class GPS_RepPuntosDeInteres
UpdatePanel3.Update() UpdatePanel3.Update()
RegistraScript("$('#dvHistorico').modal()") RegistraScript("$('#dvHistorico').modal()")
End Sub End Sub
'Protected Sub GvBarra_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBarra.RowDataBound
' If e.Row.RowType = DataControlRowType.DataRow Then
' Dim RowID As String = $"row{e.Row.RowIndex}"
' e.Row.Attributes("id") = RowID
' Dim IndexGvBarra As Integer = If(String.IsNullOrEmpty(HdnIndexGvBarra.Value), -1, HdnIndexGvBarra.Value.ToEntero)
' RegistraScript($"GetDireccionesGV({e.Row.DBCampo("Posicion").ToString}, {e.Row.RowIndex}, 1);", $"{RowID}")
' End If
'End Sub
Protected Sub btnImprimir_Click(sender As Object, e As EventArgs)
Dim Btn As Button = CType(sender, Button)
Dim Format = Btn.CommandArgument
EnviarReporteProgramado(Format)
End Sub
Public Sub EnviarReporteProgramado(Format As String)
Dim RutaReporte = "Empresas/Grales/ReportesProgramados/RPTPuntosInteres.rdlc"
Dim NombreReporte = "ReportePuntosInteres"
Try
Dim RptParametro As New List(Of ReportParameter)
RptParametro.Add(New ReportParameter("FechaInicio", txtFechaI.Text))
RptParametro.Add(New ReportParameter("FechaFin", txtFechaF.Text))
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
Dim retorno = StreamPDF(RutaReporte, DtDatosReporte, RptParametro, $"{NombreReporte}{Date.Now.ToShortDateString}", Format, MR:=Nothing, RDSName:="DsOC")
ImprimirbytesPDF(retorno, $"{NombreReporte}{Date.Now.ToShortDateString}", Format)
Catch ex As Exception
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
End Try
End Sub
End Class End Class