Commit inicial Ventas Productivo
This commit is contained in:
69
GPS/AF/CSS/AF.css
Normal file
69
GPS/AF/CSS/AF.css
Normal file
@@ -0,0 +1,69 @@
|
||||
.v-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.pac-container.pac-logo {
|
||||
z-index: 100000;
|
||||
}
|
||||
|
||||
.circuloAmarillo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #c29d0b;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.amarillo {
|
||||
color: #c29d0b;
|
||||
}
|
||||
|
||||
.contenedor {
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
color: #989A8F;
|
||||
width: 450px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.amcharts-chart-div a {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.calificador {
|
||||
height: 270px;
|
||||
width: 75%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.toplistaAmarillo {
|
||||
background-color: #c29d0b;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
#chartdiv {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.tb > tbody > tr {
|
||||
height: 30px !important;
|
||||
}
|
||||
|
||||
#chartdiv > div > div > svg > g:nth-child(15) > g:nth-child(1) {
|
||||
visibility: hidden;
|
||||
}
|
||||
414
GPS/AF/JS/AF.js
Normal file
414
GPS/AF/JS/AF.js
Normal file
@@ -0,0 +1,414 @@
|
||||
// #region R A S T R E O
|
||||
var mapRastreo;
|
||||
var visible = false;
|
||||
var lastOpenedInfoWindow;
|
||||
var markers = [];
|
||||
|
||||
function initMapRastreo() {
|
||||
mapRastreo = new google.maps.Map(document.getElementById('mapRastreo'), {
|
||||
center: { lat: 29.0730, lng: -110.9559 },
|
||||
zoom: 7
|
||||
});
|
||||
}
|
||||
|
||||
function CreaMarcadorWatch(coords, nomEquipo, ContentString, imagen) {
|
||||
if (typeof imagen === 'undefined') { imagen = image; }
|
||||
var markerIcon = {
|
||||
url: imagen,
|
||||
labelOrigin: new google.maps.Point(26, 43)
|
||||
};
|
||||
var myLatLng = new google.maps.LatLng({ lat: coords.lat, lng: coords.lng });
|
||||
var label;
|
||||
if (visible) {
|
||||
label = {
|
||||
text: nomEquipo,
|
||||
fontSize: "12px",
|
||||
color: 'black',
|
||||
fontWeight: 'bolder'
|
||||
}
|
||||
} else {
|
||||
label = null;
|
||||
}
|
||||
var marker = new google.maps.Marker({
|
||||
position: myLatLng,
|
||||
title: nomEquipo,
|
||||
map: mapRastreo,
|
||||
icon: markerIcon
|
||||
});
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: ContentString
|
||||
});
|
||||
marker.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
GetDirecciones(coords, infowindow, marker);
|
||||
infowindow.open(mapRastreo, marker);
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
});
|
||||
marker.Nombre = nomEquipo
|
||||
marker.setLabel(label)
|
||||
markers.push(marker);
|
||||
mapRastreo.setCenter(myLatLng);
|
||||
}
|
||||
|
||||
function creaPolylineRastreo(coords, color, info, lastcoord, nomequipo, Imagen, valueEquipo, Continuo) {
|
||||
|
||||
var lineSymbol = {
|
||||
path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
|
||||
strokeWeight: 1,
|
||||
strokeOpacity: 1,
|
||||
scale: 3,
|
||||
fillOpacity: 0.6
|
||||
};
|
||||
var polyline = new google.maps.Polyline({
|
||||
path: coords,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.6,
|
||||
strokeWeight: 6,
|
||||
fillOpacity: 0.35,
|
||||
icons: [{
|
||||
icon: lineSymbol,
|
||||
offset: '0',
|
||||
repeat: '80px'
|
||||
}]
|
||||
});
|
||||
polyline.setMap(mapRastreo);
|
||||
polylines.push(polyline);
|
||||
if (coordspoly.length <= 0 && typeof (Continuo) === "undefined") {
|
||||
FitBoundsToCoordsWatch(coords);
|
||||
} else {
|
||||
coordspoly.push(coords[coords.length - 1]);
|
||||
}
|
||||
if (lastcoord != "") {
|
||||
CreaMarcadorWatch(lastcoord, nomequipo, info, Imagen);
|
||||
}
|
||||
}
|
||||
function FitBoundsToCoordsWatch(pCoords) {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (var i = 0; i < pCoords.length; i++) {
|
||||
bounds.extend(pCoords[i]);
|
||||
}
|
||||
mapRastreo.fitBounds(bounds)
|
||||
}
|
||||
function DeleteMarkersRastreo() {
|
||||
for (var i = 0; i < markersHistorico.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
markers = [];
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region H I S T O R I C O
|
||||
var mapHistorico;
|
||||
var markersHistorico = [];
|
||||
var polylines = [];
|
||||
var coordspoly = [];
|
||||
|
||||
function initMapHistorico() {
|
||||
mapHistorico = new google.maps.Map(document.getElementById('mapHistorico'), {
|
||||
center: { lat: 29.0730, lng: -110.9559 },
|
||||
zoom: 7
|
||||
});
|
||||
}
|
||||
var marker2;
|
||||
function CreaMarcadorHistorico(coords, nomEquipo, ContentString, click, imagen, indice) {
|
||||
var Circle = new google.maps.Circle({
|
||||
strokeColor: '#b2dbff',
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 2,
|
||||
fillColor: '#b2dbff',
|
||||
fillOpacity: 0.35,
|
||||
map: mapHistorico,
|
||||
center: coords,
|
||||
radius: 10
|
||||
});
|
||||
|
||||
var infowindow2 = new google.maps.InfoWindow({
|
||||
content: ContentString
|
||||
});
|
||||
Circle.addListener('click', function () {
|
||||
if (typeof marker2 != 'undefined') { marker2.setMap(null); }
|
||||
marker2 = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: mapHistorico,
|
||||
icon: imagen
|
||||
});
|
||||
marker2.addListener('click', function () {
|
||||
if ($("#HdnOpcion").val() != "Play") {
|
||||
GetDirecciones(coords, infowindow2, Circle, indice)
|
||||
}
|
||||
closeLastOpenedInfoWindow();
|
||||
infowindow2.open(mapHistorico, marker2);
|
||||
lastOpenedInfoWindow = infowindow2;
|
||||
});
|
||||
google.maps.event.trigger(marker2, 'click')
|
||||
infowindow2.open(mapHistorico, marker2);
|
||||
lastOpenedInfoWindow = infowindow2;
|
||||
});
|
||||
if (click === 1) {
|
||||
google.maps.event.trigger(Circle, 'click', {})
|
||||
}
|
||||
coordspoly.push(coords);
|
||||
}
|
||||
|
||||
function creaPolyline(coords, color, info, lastcoord, nomequipo, Imagen, valueEquipo, Continuo) {
|
||||
var lineSymbol = {
|
||||
path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
|
||||
strokeWeight: 1,
|
||||
strokeOpacity: 1,
|
||||
scale: 3,
|
||||
fillOpacity: 0.6
|
||||
};
|
||||
var polyline = new google.maps.Polyline({
|
||||
path: coords,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.6,
|
||||
strokeWeight: 6,
|
||||
fillOpacity: 0.35,
|
||||
icons: [{
|
||||
icon: lineSymbol,
|
||||
offset: '0',
|
||||
repeat: '80px'
|
||||
}]
|
||||
});
|
||||
polyline.setMap(mapHistorico);
|
||||
polylines.push(polyline);
|
||||
if (coordspoly.length <= 0 && typeof (Continuo) === "undefined") {
|
||||
FitBoundsToCoords(coords);
|
||||
} else {
|
||||
coordspoly.push(coords[coords.length - 1]);
|
||||
}
|
||||
if (lastcoord != "") {
|
||||
CreaMarcador(lastcoord, nomequipo, info, Imagen);
|
||||
}
|
||||
}
|
||||
|
||||
function CreaMarcador(coords, nomEquipo, ContentString, imagen) {
|
||||
if (typeof imagen === 'undefined') { imagen = image; }
|
||||
|
||||
var markerIcon = {
|
||||
url: imagen,
|
||||
labelOrigin: new google.maps.Point(26, 43)
|
||||
};
|
||||
|
||||
var marker = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: mapHistorico,
|
||||
icon: markerIcon
|
||||
});
|
||||
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: ContentString
|
||||
});
|
||||
marker.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
GetDirecciones(coords, infowindow, marker)
|
||||
infowindow.open(mapHistorico, marker);
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
});
|
||||
marker.Nombre = nomEquipo
|
||||
markersHistorico.push(marker);
|
||||
if (markersHistorico.length > 1 && coordspoly.length < 1) {
|
||||
fitBoundsToVisibleMarkers()
|
||||
} else if (markersHistorico.length === 1 && coordspoly.length < 1) {
|
||||
mapHistorico.setZoom(15);
|
||||
mapHistorico.setCenter(coords);
|
||||
}
|
||||
mapHistorico.setCenter(coords);
|
||||
}
|
||||
|
||||
function FitBoundsToCoords(pCoords) {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (var i = 0; i < pCoords.length; i++) {
|
||||
bounds.extend(pCoords[i]);
|
||||
}
|
||||
mapHistorico.fitBounds(bounds)
|
||||
}
|
||||
|
||||
function fitBoundsToVisibleMarkers() {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (var i = 0; i < markersHistorico.length; i++) {
|
||||
if (markersHistorico[i].getVisible()) {
|
||||
bounds.extend(markersHistorico[i].getPosition());
|
||||
}
|
||||
}
|
||||
mapHistorico.fitBounds(bounds);
|
||||
}
|
||||
|
||||
function DeleteMarkersHistorico() {
|
||||
for (var i = 0; i < markersHistorico.length; i++) {
|
||||
markersHistorico[i].setMap(null);
|
||||
}
|
||||
markersHistorico = [];
|
||||
for (var i = 0; i < polylines.length; i++) {
|
||||
polylines[i].setMap(null);
|
||||
}
|
||||
polylines = [];
|
||||
coordspoly = [];
|
||||
}
|
||||
|
||||
// #endregion
|
||||
function closeLastOpenedInfoWindow() {
|
||||
if (lastOpenedInfoWindow) {
|
||||
lastOpenedInfoWindow.close();
|
||||
}
|
||||
}
|
||||
function GetDirecciones(posicion, infowindow, marker) {
|
||||
var lat = posicion.lat
|
||||
var lng = posicion.lng
|
||||
$.getJSON('http://adsistemasof.sytes.net/nominatim/reverse.php?format=jsonv2&lat=' + lat + '&lon=' + lng, function (data) {
|
||||
if (typeof (data.error) === 'undefined') {
|
||||
marker.formatted_address = data.display_name;
|
||||
var contenido = infowindow.getContent();
|
||||
if (contenido.indexOf("direccion") >= 0) {
|
||||
var html = $($.parseHTML(contenido));
|
||||
var dir = html.filter(".direccion");;
|
||||
dir.text("Dirección: " + data.display_name);
|
||||
var htmlstring = "";
|
||||
for (var i = 0; i < html.length; i++) {
|
||||
htmlstring = htmlstring.concat(html[i].outerHTML);
|
||||
}
|
||||
infowindow.setContent(htmlstring);
|
||||
} else {
|
||||
infowindow.setContent(contenido + "<div class='direccion' style='margin-left:5px'>" + "Dirección: " + data.display_name + "</div>");
|
||||
}
|
||||
} else {
|
||||
marker.formatted_address = "Dirección no encontrada";
|
||||
if (contenido.indexOf("direccion") >= 0) {
|
||||
var html = $($.parseHTML(contenido));
|
||||
var dir = html.filter(".direccion");;
|
||||
dir.text("Dirección no encontrada");
|
||||
var htmlstring = "";
|
||||
for (var i = 0; i < html.length; i++) {
|
||||
htmlstring = htmlstring.concat(html[i].outerHTML);
|
||||
}
|
||||
infowindow.setContent(htmlstring);
|
||||
} else {
|
||||
infowindow.setContent(infowindow.getContent() + "<div style='margin-left:5px'> Dirección: No Encontrada </div>");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
function CargaGraficaCombustible() {
|
||||
var data = [];
|
||||
var Gcolor = $('#ChkEncendido').is(':checked') ? "lineColor" : null;
|
||||
eval($("#HdfVGrafica").val());
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"marginRight": 40,
|
||||
"marginLeft": 40,
|
||||
"autoMarginOffset": 20,
|
||||
"dataDateFormat": "YYYY-MM-DD HH:NN:SS",
|
||||
"valueAxes": [{
|
||||
"id": "v1",
|
||||
"axisAlpha": 0,
|
||||
"position": "left",
|
||||
"ignoreAxisWidth": true
|
||||
}],
|
||||
"balloon": {
|
||||
"borderThickness": 1,
|
||||
"shadowAlpha": 0
|
||||
},
|
||||
"graphs": [{
|
||||
"id": "g1",
|
||||
"balloon": {
|
||||
"drop": true,
|
||||
"adjustBorderColor": false,
|
||||
"color": "#ffffff",
|
||||
"type": "smoothedLine"
|
||||
},
|
||||
"fillAlphas": 0.2,
|
||||
"bullet": "round",
|
||||
"bulletBorderAlpha": 1,
|
||||
"bulletColor": "#FFFFFF",
|
||||
"bulletSize": 5,
|
||||
"hideBulletsCount": 50,
|
||||
"lineThickness": 2,
|
||||
"title": "red line",
|
||||
//"useLineColorForBulletBorder": true,
|
||||
"valueField": "value",
|
||||
"lineColorField": Gcolor,
|
||||
"fillColorsField": Gcolor,
|
||||
"balloonText": "<span style='font-size:18px;'>[[value]]</span>"
|
||||
}],
|
||||
"chartScrollbar": {},
|
||||
"chartCursor": {
|
||||
"valueLineEnabled": true,
|
||||
"valueLineBalloonEnabled": true,
|
||||
"cursorAlpha": 0,
|
||||
"zoomable": false,
|
||||
"valueZoomable": true,
|
||||
"valueLineAlpha": 0.5
|
||||
},
|
||||
"categoryField": "date",
|
||||
"categoryAxis": {
|
||||
|
||||
"parseDates": false,
|
||||
"dashLength": 1,
|
||||
"minorGridEnabled": true,
|
||||
},
|
||||
"export": {
|
||||
"enabled": true,
|
||||
"menu": []
|
||||
},
|
||||
"dataProvider": data
|
||||
});
|
||||
}
|
||||
//GEOREFERENCIAS
|
||||
var mapGeo;
|
||||
function initMapGeo() {
|
||||
mapGeo = new google.maps.Map(document.getElementById('mapGeo'), {
|
||||
center: { lat: 29.0730, lng: -110.9559 },
|
||||
zoom: 7
|
||||
});
|
||||
}
|
||||
|
||||
var polygons = [];
|
||||
|
||||
function creaPoligono(coords, color) {
|
||||
var polygon = new google.maps.Polygon({
|
||||
paths: coords,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 2,
|
||||
fillColor: color,
|
||||
fillOpacity: 0.35
|
||||
});
|
||||
polygon.setMap(mapGeo);
|
||||
polygons.push(polygon);
|
||||
//map.setCenter(coords[0]);
|
||||
}
|
||||
var markersGeo = [];
|
||||
|
||||
function CreaMarcadorGeo(coords, nomEquipo, ContentString, imagen) {
|
||||
if (typeof imagen === 'undefined') { imagen = image; }
|
||||
var marker = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: mapGeo,
|
||||
icon: imagen
|
||||
});
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: ContentString
|
||||
});
|
||||
marker.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
GetDirecciones(coords, infowindow, marker);
|
||||
infowindow.open(mapGeo, marker);
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
});
|
||||
markersGeo.push(marker);
|
||||
//map.setCenter(coords);
|
||||
fitBoundsToVisibleMarkersGeo()
|
||||
}
|
||||
function fitBoundsToVisibleMarkersGeo() {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (var i = 0; i < markersGeo.length; i++) {
|
||||
if (markersGeo[i].getVisible()) {
|
||||
bounds.extend(markersGeo[i].getPosition());
|
||||
}
|
||||
}
|
||||
mapGeo.fitBounds(bounds);
|
||||
}
|
||||
522
GPS/Busqueda.aspx
Normal file
522
GPS/Busqueda.aspx
Normal file
@@ -0,0 +1,522 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="Busqueda.aspx.vb" Inherits="GPS_Busqueda" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style type="text/css">
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
#map {
|
||||
position: fixed !important;
|
||||
width: 100%;
|
||||
height: calc(100% - 51px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.pac-container.pac-logo {
|
||||
z-index: 100000;
|
||||
}
|
||||
|
||||
|
||||
#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%);
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="H" ID="Content9" runat="server">
|
||||
<li>
|
||||
<a id="BtnDir" onclick="$('#divDirecciones').modal();">
|
||||
<i class='fa fa-search'></i><span>Buscar Dirección</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="BtnClose" onclick="$('#divAgregarTipo').modal()">
|
||||
<i class='fa fa-taxi'></i><span>Buscar Equipo Más Cercano</span>
|
||||
</a>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="CommandArg" runat="server" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="map"></div>
|
||||
<div id="divAgregarTipo" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Buscar equipo más cercano a:</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyTipoEquipo" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoRastreo" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoRastreo_SelectedIndexChanged" CssClass="form-control select2me js-Impuesto-programmatic" Width="100%">
|
||||
<asp:ListItem Value="Dir" Text="Dirección"></asp:ListItem>
|
||||
<asp:ListItem Value="Coord" Text="Coordenadas"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%=DdlTipoRastreo.ClientID.ToString()%>">Rastrear Por:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="dvDireccion">
|
||||
<asp:TextBox ID="TxtDireccion" runat="server" CssClass="form-control" Width="100%" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVDireccion" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtDireccion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Dirección''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtDireccion.ClientID.ToString()%>">Dirección:</label>
|
||||
</div>
|
||||
<div class="row" id="dvLatLng" style="display: none" runat="server">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtLat" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtLat" ValidationGroup="Grp2" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Latitud''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLat.ClientID.ToString()%>">Latitud:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtLng" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtLng" ValidationGroup="Grp2" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Longitud''</b> es necesario, por favor ingréselo."></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLng.ClientID.ToString()%>">Longitud:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnBuscarEquipoC" runat="server" OnClick="BtnBuscarEquipoC_Click" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='fa fa-search '></i> Buscar</asp:LinkButton>
|
||||
<button id="btnCancelar" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<div id="divDirecciones" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpBusquedaDir" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="H1" runat="server">Buscar Dirección en mapa:</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="Div1">
|
||||
<asp:TextBox ID="TxtDireccion2" runat="server" CssClass="form-control" Width="100%" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtDireccion2.ClientID.ToString()%>">Direccion:</label>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<button class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<asp:UpdatePanel runat="server" ID="UpHidden" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HdnCveDipositivo" runat="server" ClientIDMode="Static" />
|
||||
<asp:Button runat="server" ID="BtnCargaComandos" Style="display: none" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="divComandos" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpComandos" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Comandos para vehículo: </h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:GridView ID="GvComandos" runat="server" DataKeyNames="CveComando, RequiereValor" Style="table-layout: fixed" AutoGenerateColumns="False" ShowHeader="True" EmptyDataText="No se encontraron comandos para este modelo" GridLines="none" ToolTip="Listado de Comandos" data-sort="false" CssClass="table table-striped table-hover Widthall ScrollAD">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Button ID="BtnEnviar" runat="server" CssClass="btn btn-primary" CommandName="EnviarComando" CommandArgument="<%# CType(Container, GridViewRow).RowIndex %>" Text="Enviar" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Comando" DataField="Comando" ItemStyle-Width="40%" FooterStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>Valor</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtValor" Visible="false" Width="99px" runat="server" Text=""></asp:TextBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="UltimaFechaEjecucion" ItemStyle-Width="20%" HeaderText="Última Ejecución" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="FechaRespuesta" ItemStyle-Width="20%" HeaderText="Última Respuesta" ItemStyle-HorizontalAlign="center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="../Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js"></script>
|
||||
<script>
|
||||
var geocoder;
|
||||
var map;
|
||||
var directionsService;
|
||||
var directionsDisplay;
|
||||
|
||||
function initMap() {
|
||||
var uluru = { lat: 29.0730, lng: -110.9559 }
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: uluru,
|
||||
zoom: 10
|
||||
});
|
||||
|
||||
directionsService = new google.maps.DirectionsService;
|
||||
directionsDisplay = new google.maps.DirectionsRenderer;
|
||||
directionsDisplay.setOptions({ suppressMarkers: true });
|
||||
geocoder = new google.maps.Geocoder();
|
||||
directionsDisplay.setMap(map);
|
||||
|
||||
var input = document.getElementById('C_TxtDireccion');
|
||||
var input2 = document.getElementById('C_TxtDireccion2');
|
||||
var searchBox = new google.maps.places.SearchBox(input);
|
||||
var searchBox2 = new google.maps.places.SearchBox(input2);
|
||||
// map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
|
||||
|
||||
map.addListener('bounds_changed', function () {
|
||||
searchBox.setBounds(map.getBounds());
|
||||
searchBox2.setBounds(map.getBounds());
|
||||
});
|
||||
|
||||
map.addListener('bounds_changed', function () {
|
||||
searchBox.setBounds(map.getBounds());
|
||||
searchBox2.setBounds(map.getBounds());
|
||||
});
|
||||
|
||||
searchBox.addListener('places_changed', function () {
|
||||
var places = searchBox.getPlaces();
|
||||
|
||||
if (places.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear out the old markers.
|
||||
markers.forEach(function (marker) {
|
||||
marker.setMap(null);
|
||||
});
|
||||
markers = [];
|
||||
|
||||
// For each place, get the icon, name and location.
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
places.forEach(function (place) {
|
||||
if (!place.geometry) {
|
||||
console.log("Returned place contains no geometry");
|
||||
return;
|
||||
}
|
||||
var icon = {
|
||||
url: place.icon,
|
||||
size: new google.maps.Size(71, 71),
|
||||
origin: new google.maps.Point(0, 0),
|
||||
anchor: new google.maps.Point(17, 34),
|
||||
scaledSize: new google.maps.Size(25, 25)
|
||||
};
|
||||
|
||||
// Create a marker for each place.
|
||||
markers.push(new google.maps.Marker({
|
||||
map: map,
|
||||
icon: icon,
|
||||
title: place.name,
|
||||
position: place.geometry.location
|
||||
}));
|
||||
var lat = place.geometry.location.lat();
|
||||
var lng = place.geometry.location.lng();
|
||||
$('#CommandArg').val(lng + " " + lat);
|
||||
|
||||
if (place.geometry.viewport) {
|
||||
// Only geocodes have viewport.
|
||||
bounds.union(place.geometry.viewport);
|
||||
} else {
|
||||
bounds.extend(place.geometry.location);
|
||||
}
|
||||
});
|
||||
map.fitBounds(bounds);
|
||||
});
|
||||
|
||||
searchBox2.addListener('places_changed', function () {
|
||||
var places = searchBox2.getPlaces();
|
||||
|
||||
if (places.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear out the old markers.
|
||||
markers.forEach(function (marker) {
|
||||
marker.setMap(null);
|
||||
});
|
||||
markers = [];
|
||||
|
||||
// For each place, get the icon, name and location.
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
places.forEach(function (place) {
|
||||
if (!place.geometry) {
|
||||
console.log("Returned place contains no geometry");
|
||||
return;
|
||||
}
|
||||
var icon = {
|
||||
url: place.icon,
|
||||
size: new google.maps.Size(71, 71),
|
||||
origin: new google.maps.Point(0, 0),
|
||||
anchor: new google.maps.Point(17, 34),
|
||||
scaledSize: new google.maps.Size(25, 25)
|
||||
};
|
||||
|
||||
// Create a marker for each place.
|
||||
markers.push(new google.maps.Marker({
|
||||
map: map,
|
||||
icon: icon,
|
||||
title: place.name,
|
||||
position: place.geometry.location
|
||||
}));
|
||||
var lat = place.geometry.location.lat();
|
||||
var lng = place.geometry.location.lng();
|
||||
|
||||
if (place.geometry.viewport) {
|
||||
// Only geocodes have viewport.
|
||||
bounds.union(place.geometry.viewport);
|
||||
} else {
|
||||
bounds.extend(place.geometry.location);
|
||||
}
|
||||
});
|
||||
map.fitBounds(bounds);
|
||||
$("#divDirecciones").modal('hide')
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
function CargaPickers() {
|
||||
$.datetimepicker.setLocale('es');
|
||||
|
||||
$('#C_txtFechaI').datetimepicker({
|
||||
dayOfWeekStart: 1,
|
||||
lang: 'es',
|
||||
format: 'd/m/Y H:i',
|
||||
formatDate: 'd/m/Y H:i',
|
||||
step: 30
|
||||
});
|
||||
$('#C_txtFechaF').datetimepicker({
|
||||
dayOfWeekStart: 1,
|
||||
lang: 'es',
|
||||
format: 'd/m/Y H:i',
|
||||
formatDate: 'd/m/Y H:i',
|
||||
step: 30
|
||||
});
|
||||
|
||||
$('#C_imgCalendario').click(function () {
|
||||
$('#C_txtFechaI').datetimepicker('show');
|
||||
});
|
||||
|
||||
$('#C_imgCalendarioF').click(function () {
|
||||
$('#C_txtFechaF').datetimepicker('show');
|
||||
});
|
||||
|
||||
$('#dvConsulta').modal();
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
initMap();
|
||||
//Sys.Application.add_load(function (s, e) {
|
||||
// initMap();
|
||||
//});
|
||||
});
|
||||
var markers = [];
|
||||
|
||||
function CreaMarcador(coords, nomEquipo, imagen, infowindow) {
|
||||
|
||||
var marker = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: map
|
||||
});
|
||||
|
||||
if (!(imagen == null)) {
|
||||
var markerIcon = {
|
||||
url: "https://sig.adssistemas.mx" + imagen,
|
||||
labelOrigin: new google.maps.Point(26, 43)
|
||||
};
|
||||
marker.setIcon(markerIcon);
|
||||
}
|
||||
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: infowindow
|
||||
});
|
||||
|
||||
marker.addListener('click', function () {
|
||||
infowindow.open(map, marker);
|
||||
});
|
||||
|
||||
markers.push(marker);
|
||||
map.setCenter(coords);
|
||||
|
||||
GetDirecciones(coords, infowindow, marker);
|
||||
}
|
||||
|
||||
function DeleteMarkers() {
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
markers = [];
|
||||
directionsDisplay.setMap(null);
|
||||
}
|
||||
|
||||
function calculateAndDisplayRoute(origin, destination, nombre, infowindow, icono) {
|
||||
directionsService.route({
|
||||
origin: origin,
|
||||
destination: destination,
|
||||
travelMode: 'DRIVING'
|
||||
}, function (response, status) {
|
||||
if (status === 'OK') {
|
||||
directionsDisplay.setDirections(response);
|
||||
directionsDisplay.setMap(map);
|
||||
|
||||
CreaMarcador(origin, "<h5><b>Punto de Referencia</b></h5><br>", null, "<h5><b>Punto de Referencia</b></h5><br>");//punto referencia
|
||||
CreaMarcador(destination, nombre, icono, infowindow);//dispositivo
|
||||
} else {
|
||||
window.alert('Directions request failed due to ' + status);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function EquipoMasCercano(origin, destination, nombre, infowindow, icono) {
|
||||
DeleteMarkers();
|
||||
calculateAndDisplayRoute(origin, destination, nombre, infowindow, icono);
|
||||
}
|
||||
|
||||
function GetDirecciones(posicion, infowindow, marker) {
|
||||
var lat = posicion.lat
|
||||
var lng = posicion.lng
|
||||
var url = '<%= ClsPaginas.UrlDirecciones%>' + 'nominatim/reverse.php?format=jsonv2&lat=' + lat + '&lon=' + lng;
|
||||
|
||||
$.getJSON(url, function (data) {
|
||||
if (typeof (data.error) === 'undefined') {
|
||||
marker.formatted_address = data.display_name;
|
||||
var contenido = infowindow.getContent();
|
||||
debugger;
|
||||
if (contenido.indexOf("direccion") >= 0) {
|
||||
var html = $($.parseHTML(contenido));
|
||||
var dir = html.filter(".direccion");;
|
||||
dir.text("Dirección: " + data.display_name);
|
||||
var htmlstring = "";
|
||||
for (var i = 0; i < html.length; i++) {
|
||||
htmlstring = htmlstring.concat(html[i].outerHTML);
|
||||
}
|
||||
infowindow.setContent(htmlstring);
|
||||
} else {
|
||||
infowindow.setContent(contenido + "<div class='direccion' style='margin-left:5px'>" + "Dirección: " + data.display_name + "</div>");
|
||||
}
|
||||
} else {
|
||||
marker.formatted_address = "Dirección no encontrada";
|
||||
if (contenido.indexOf("direccion") >= 0) {
|
||||
var html = $($.parseHTML(contenido));
|
||||
var dir = html.filter(".direccion");;
|
||||
dir.text("Dirección no encontrada");
|
||||
var htmlstring = "";
|
||||
for (var i = 0; i < html.length; i++) {
|
||||
htmlstring = htmlstring.concat(html[i].outerHTML);
|
||||
}
|
||||
infowindow.setContent(htmlstring);
|
||||
} else {
|
||||
infowindow.setContent(infowindow.getContent() + "<div style='margin-left:5px'> Dirección: No Encontrada </div>");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
var lastOpenedInfoWindow;
|
||||
function closeLastOpenedInfoWindow() {
|
||||
if (lastOpenedInfoWindow) {
|
||||
lastOpenedInfoWindow.close();
|
||||
}
|
||||
}
|
||||
function CargaComandos(Vehiculo, CveDispositivo) {
|
||||
$("#HdnCveDipositivo").val(CveDispositivo)
|
||||
// if (open) { FNShowDiv(); }
|
||||
$("#myModalLabel").text("Comando para vehículo: " + Vehiculo)
|
||||
closeLastOpenedInfoWindow();
|
||||
$("#divComandos").modal('show');
|
||||
$("#C_BtnCargaComandos").click();
|
||||
|
||||
}
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places">
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
|
||||
117
GPS/Busqueda.aspx.vb
Normal file
117
GPS/Busqueda.aspx.vb
Normal file
@@ -0,0 +1,117 @@
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Partial Class GPS_Busqueda
|
||||
Inherits ClsPaginas
|
||||
|
||||
'Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
' If Not Page.IsPostBack Then
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
Protected Sub BtnBuscarEquipoC_Click(sender As Object, e As EventArgs)
|
||||
Dim GPS As New ClsGPS
|
||||
Dim punto As String
|
||||
If DdlTipoRastreo.SelectedValue = "Dir" Then
|
||||
punto = $"POINT({CommandArg.Value})"
|
||||
If GPS.GetPuntoMasCercano(punto, UsuarioActual.CveCliente) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
RegistraScript("$('#divAgregarTipo').modal('hide')", "1")
|
||||
|
||||
Dim CveDispositivo As Integer = GPS.DtResultados.Rows(0)("CveEquipoPosicion").ToString().ToEntero()
|
||||
Dim coord As String = SQLToGmaps(GPS.DtResultados.Rows(0)("Posicion").ToString, "POINT")
|
||||
Dim origin As String = SQLToGmaps(punto, "POINT")
|
||||
Dim Icono As String = "/Imagenes/rsz_11rsz_car.png"
|
||||
If GPS.DtResultados.Rows(0)("SPD").ToString.ToDouble > 1 Then
|
||||
Icono = $"/Imagenes/{GlobalDTDispositivos(UsuarioActual.CveCliente).FiltroPrimeroValor("Icono", $"CveDispositivo = {CveDispositivo}")}green.png"
|
||||
Else
|
||||
Icono = $"/Imagenes/{GlobalDTDispositivos(UsuarioActual.CveCliente).FiltroPrimeroValor("Icono", $"CveDispositivo = {CveDispositivo}")}.png"
|
||||
End If
|
||||
|
||||
Dim Info = InfoWindow($"Vehículo: {GPS.DtResultados.Rows(0)("Vehiculo").ToString}", $"<tr><td>Distancia: {GPS.DtResultados.Rows(0)("Distancia").ToString.ToDouble().FormatoNumero()} Metros</td></tr>", GPS.DtResultados.Rows(0)("CveEquipoPosicion").ToString.ToEntero, GPS.DtResultados.Rows(0))
|
||||
RegistraScript($"EquipoMasCercano({origin}, {coord}, '{GPS.DtResultados.Rows(0)("Vehiculo").ToString}', '{Info}', '{Icono}');", "2")
|
||||
End If
|
||||
End If
|
||||
ElseIf DdlTipoRastreo.SelectedValue = "Coord" Then
|
||||
punto = $"POINT({TxtLng.Text} {TxtLat.Text})"
|
||||
If GPS.GetPuntoMasCercano(punto, UsuarioActual.CveCliente) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
RegistraScript("$('#divAgregarTipo').modal('hide')", "1")
|
||||
|
||||
Dim CveDispositivo As Integer = GPS.DtResultados.Rows(0)("CveEquipoPosicion").ToString().ToEntero()
|
||||
Dim coord As String = SQLToGmaps(GPS.DtResultados.Rows(0)("Posicion").ToString, "POINT")
|
||||
Dim origin As String = SQLToGmaps(punto, "POINT")
|
||||
|
||||
Dim Icono As String = "/Imagenes/rsz_11rsz_car.png"
|
||||
If GPS.DtResultados.Rows(0)("SPD").ToString.ToDouble > 1 Then
|
||||
Icono = $"/Imagenes/{GlobalDTDispositivos(UsuarioActual.CveCliente).FiltroPrimeroValor("Icono", $"CveDispositivo = {CveDispositivo}")}green.png"
|
||||
Else
|
||||
Icono = $"/Imagenes/{GlobalDTDispositivos(UsuarioActual.CveCliente).FiltroPrimeroValor("Icono", $"CveDispositivo = {CveDispositivo}")}.png"
|
||||
End If
|
||||
Dim Info = InfoWindow($"Vehículo: {GPS.DtResultados.Rows(0)("Vehiculo").ToString}", $"<tr><td>Distancia: {GPS.DtResultados.Rows(0)("Distancia").ToString.FormatoNumero} Metros</td></tr>", GPS.DtResultados.Rows(0)("CveEquipoPosicion").ToString.ToEntero, GPS.DtResultados.Rows(0))
|
||||
RegistraScript($"EquipoMasCercano({origin}, {coord}, '{GPS.DtResultados.Rows(0)("Vehiculo").ToString}', '{Info}', '{Icono}');", "2")
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
GPS.Dispose()
|
||||
End Sub
|
||||
Protected Sub DdlTipoRastreo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
If DdlTipoRastreo.SelectedValue = "Dir" Then
|
||||
dvDireccion.Style.Add("display", "")
|
||||
dvLatLng.Style.Add("display", "none")
|
||||
RFVDireccion.ValidationGroup = "GrpObligatorio"
|
||||
RequiredFieldValidator1.ValidationGroup = ""
|
||||
RequiredFieldValidator2.ValidationGroup = ""
|
||||
ElseIf DdlTipoRastreo.SelectedValue = "Coord" Then
|
||||
dvDireccion.Style.Add("display", "none")
|
||||
dvLatLng.Style.Add("display", "")
|
||||
RFVDireccion.ValidationGroup = ""
|
||||
RequiredFieldValidator1.ValidationGroup = "GrpObligatorio"
|
||||
RequiredFieldValidator2.ValidationGroup = "GrpObligatorio"
|
||||
End If
|
||||
End Sub
|
||||
#Region "Herramientas - GPS"
|
||||
|
||||
Protected Sub BtnCargaComandos_Click(sender As Object, e As EventArgs) Handles BtnCargaComandos.Click
|
||||
CargaComandos()
|
||||
End Sub
|
||||
Private Sub CargaComandos()
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetComandosModeloDispositivoUsuarios(HdnCveDipositivo.Value.ToEntero, UsuarioActual.CveUsuario, 1) Then
|
||||
GvComandos.DataSource = ObjGPS.DtResultados
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
GvComandos.DataBind()
|
||||
|
||||
UpHidden.Update()
|
||||
UpComandos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub GvComandos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvComandos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DataKey("RequiereValor").ToEntero = 1 Then
|
||||
e.Row.FCTextBox("TxtValor").Visible = True
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GvComandos_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvComandos.RowCommand
|
||||
If (e.CommandName = "EnviarComando") Then
|
||||
|
||||
Dim ObjHerramientas As New ClsGPSHerramientas
|
||||
|
||||
Dim index As Integer = Convert.ToInt32(e.CommandArgument)
|
||||
Dim row As GridViewRow = GvComandos.Rows(index)
|
||||
|
||||
ObjHerramientas.EjecutarComandoGPRS(row.DataKey("CveComando").ToEntero, HdnCveDipositivo.Value.ToEntero, UsuarioActual.CveUsuario, row.FCTextBox("TxtValor").Text)
|
||||
|
||||
ObjHerramientas.Dispose()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
170
GPS/CatConductores.aspx
Normal file
170
GPS/CatConductores.aspx
Normal file
@@ -0,0 +1,170 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatConductores.aspx.vb" Inherits="GPS_CatConductores" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.ADScroller .ADScroller-body {
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Conductores
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel ID="UpLnkAgregar" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="linkAgregar" runat="server"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- BEGIN SAMPLE TABLE PORTLET-->
|
||||
<div class="portlet light ">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 25px">
|
||||
<i style="font-size: larger" class="fa fa-user font-green"></i>
|
||||
<span class="caption-subject font-green bold uppercase" style="font-size: 18px">Conductores Disponibles</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<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="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvConductores.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvConductores.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<asp:GridView ID="GvConductores" runat="server" GridLines="None" DataKeyNames="CveConductor,Conductor,SerieLicencia,VencimientoLicencia,FechaNacimiento,Estatus,CveCliente,CveUsuario,CveDispositivo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Conductor" ItemStyle-Width="39%" ItemStyle-HorizontalAlign="LEFT">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink Target="_blank" ID="HplConductor" runat="server" Text='<%# Eval("Conductor")%>' CssClass="Texto" NavigateUrl='<%# Eval("CveConductor", "/GPS/Conductores.aspx?CveConductor={0}") %>'></asp:HyperLink></td>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="SerieLicencia" HeaderText="Licencia" ItemStyle-Width="39%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="VencimientoLicencia" DataFormatString="{0:d}" ItemStyle-Width="8%" HeaderText="Vigencia Licencia" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaNacimiento" DataFormatString="{0:d}" ItemStyle-Width="8%" HeaderText="Nacimiento" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="7%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("EstatusT")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" OnClick="imgE_Click" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="3%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="divAgregarTipo" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Datos del Conductor</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyConductor" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtConductor" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtConductor.ClientID.ToString()%>">Conductor:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= TxtFechaVencimiento.ClientID.ToString()%>">Nacimiento Conductor:</label>
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFechaNacimiento" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaNacimiento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="TxtFechaNacimiento" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="TxtFechaNacimiento" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpObligatorio"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtSerieLicencia" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtSerieLicencia.ClientID.ToString()%>">Serie de la Licencia:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= TxtFechaVencimiento.ClientID.ToString()%>">Vigencia Licencia:</label>
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
|
||||
<asp:TextBox ID="TxtFechaVencimiento" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaVencimiento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="TxtFechaVencimiento" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="TxtFechaVencimiento" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="TxtFechaVencimiento" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpObligatorio"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label style="top: 0; margin-bottom: 0; font-size: 13px; opacity: 1; color: #888888;">Estatus: </label>
|
||||
<br />
|
||||
<asp:CheckBox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooterConductor" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregar" OnClick="BtnAgregar_Click" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Guardar</asp:LinkButton>
|
||||
<button id="btnCancelar" class="btn btn-default" data-dismiss="modal" value="Cancelar">Cancelar </button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
119
GPS/CatConductores.aspx.vb
Normal file
119
GPS/CatConductores.aspx.vb
Normal file
@@ -0,0 +1,119 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class GPS_CatConductores
|
||||
Inherits ClsPaginas
|
||||
#Region "Propiedades"
|
||||
Public Property CveConductor As Integer
|
||||
Get
|
||||
Return ViewState("CveConductor").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveConductor") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
EsEditar = 0
|
||||
CargaConductores()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaConductores()
|
||||
Dim ObjGps As New ClsGPS
|
||||
If ObjGps.ConductoresGet(-1, "-1", -1, UsuarioActual.CveCliente) Then
|
||||
GvConductores.DataSource = ObjGps.DtResultados
|
||||
GvConductores.DataBind()
|
||||
End If
|
||||
ObjGps.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub LimpiarDatos()
|
||||
TxtConductor.Text = ""
|
||||
TxtFechaNacimiento.Text = ""
|
||||
TxtSerieLicencia.Text = ""
|
||||
TxtFechaVencimiento.Text = ""
|
||||
chkEstatus.Checked = False
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvConductores_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvConductores.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
If e.Row.DBCampo("Estatus").ToString = "True" Then
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
|
||||
e.Row.FCLinkButton("imgE").CommandArgument = e.Row.DBCampo("CveConductor")
|
||||
e.Row.FCLinkButton("imgD").CommandArgument = e.Row.DBCampo("CveConductor")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvConductores_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvConductores.RowDeleting
|
||||
Dim ObjGps As New ClsGPS
|
||||
Dim CveConductor As Integer = GvConductores.Rows(e.RowIndex).DataKey("CveConductor").ToEntero
|
||||
|
||||
If ObjGps.ConductoresDelete(CveConductor) Then
|
||||
Alert("El Conductor se eliminó correctamente.")
|
||||
CargaConductores()
|
||||
UpDatos.Update()
|
||||
End If
|
||||
|
||||
ObjGps.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
CveConductor = Boton.CommandArgument.ToEntero
|
||||
EsEditar = 1
|
||||
|
||||
TxtConductor.Text = GvRow.DataKey("Conductor").ToString
|
||||
TxtFechaNacimiento.Text = GvRow.DataKey("FechaNacimiento").ToString
|
||||
TxtSerieLicencia.Text = GvRow.DataKey("SerieLicencia").ToString
|
||||
TxtFechaVencimiento.Text = GvRow.DataKey("VencimientoLicencia").ToString
|
||||
|
||||
If GvRow.DataKey("Estatus").ToString = "True" Then chkEstatus.Checked = True Else chkEstatus.Checked = False
|
||||
|
||||
UpAgregar.Update()
|
||||
RegistraScript("$('#divAgregarTipo').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjGps As New ClsGPS
|
||||
If EsEditar = 0 Then
|
||||
If ObjGps.ConductorAdd(TxtConductor.Text, chkEstatus.Checked, UsuarioActual.CveUsuario, TxtSerieLicencia.Text, TxtFechaNacimiento.Text.ToDate, TxtFechaVencimiento.Text.ToDate, UsuarioActual.CveCliente) Then
|
||||
Alert("El Conductor se agregó correctamente.")
|
||||
End If
|
||||
Else
|
||||
If ObjGps.ConductoresUpdate(CveConductor, TxtConductor.Text, chkEstatus.Checked, TxtSerieLicencia.Text, TxtFechaNacimiento.Text.ToDate, TxtFechaVencimiento.Text.ToDate) Then
|
||||
Alert("El Conductor se actualizó correctamente.")
|
||||
End If
|
||||
End If
|
||||
|
||||
LimpiarDatos()
|
||||
CargaConductores()
|
||||
UpDatos.Update()
|
||||
ObjGps.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub linkAgregar_Click(sender As Object, e As EventArgs) Handles linkAgregar.Click
|
||||
LimpiarDatos()
|
||||
RegistraScript("$('#divAgregarTipo').modal()")
|
||||
End Sub
|
||||
End Class
|
||||
98
GPS/CatControlesGraficos.aspx
Normal file
98
GPS/CatControlesGraficos.aspx
Normal file
@@ -0,0 +1,98 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatControlesGraficos.aspx.vb" Inherits="GPS_CatControlesGraficos" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Controladores Gráficos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
<li>
|
||||
<a href="javascript:$('#divAgregar').modal()"><i class="fa fa-plus"></i> Agregar</a>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<div class="row" style="margin-left:0px;margin-top:5px;margin-bottom:5px" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveControladorGrafico,ControladorGrafico,Estatus,UM" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="ControladorGrafico" ItemStyle-Width="40%" HeaderText="Control Grafico" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="UM" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="40%" HeaderText="Unidad de Medida" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Agregar Conductor</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyEstatus" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtControladorGrafico" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVPlataforma" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtControladorGrafico" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Controlador Grafico''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtControladorGrafico.ClientID.ToString()%>">Controlador Grafico:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtUM" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtUM" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Conductor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtUM.ClientID.ToString()%>">Unidad de medida:</label>
|
||||
</div>
|
||||
<div id="dvEstatus" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label>Activo: </label>
|
||||
<br />
|
||||
<asp:Checkbox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px">
|
||||
</asp:Checkbox>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarCatalogo" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
||||
<asp:linkbutton runat="server" id="btnCancelar" text="Cancelar" cssclass="btn btn-default" ></asp:linkbutton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
134
GPS/CatControlesGraficos.aspx.vb
Normal file
134
GPS/CatControlesGraficos.aspx.vb
Normal file
@@ -0,0 +1,134 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class GPS_CatControlesGraficos
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property CveControladorGrafico As Integer
|
||||
Get
|
||||
Return ViewState("CveControladorGrafico").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveControladorGrafico") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = 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
|
||||
CveControladorGrafico = -1
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
CargaDatos(-1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos(CveConductor As Integer)
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.ControladorGraficoGet(-1) Then
|
||||
GvDatos.DataSource = GPS.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveControladorGrafico = Boton.CommandArgument.ToEntero
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
TxtControladorGrafico.Text = GvRow.DataKey("ControladorGrafico").ToString
|
||||
TxtUM.Text = GvRow.DataKey("UM").ToString
|
||||
chkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
||||
EsEditar = 1
|
||||
BtnAgregarCatalogo.Text = "Actualizar"
|
||||
dvEstatus.Visible = True
|
||||
UpBodyEstatus.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If EsEditar = 0 Then
|
||||
If GPS.ControladorGraficoAdd(TxtControladorGrafico.Text.Trim, TxtUM.Text.Trim) Then
|
||||
Alert("El Controlador Gráfico se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If GPS.ControladorGraficoUpdate(TxtControladorGrafico.Text.Trim, TxtUM.Text.Trim, CveControladorGrafico, chkEstatus.Checked) Then
|
||||
Alert("El Controlador Gráfico se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
End If
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
GPS.Dispose()
|
||||
|
||||
TxtControladorGrafico.Text = ""
|
||||
TxtUM.Text = ""
|
||||
|
||||
CargaDatos(-1)
|
||||
UpDatos.Update()
|
||||
UpBodyEstatus.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim GPS As New ClsGPS
|
||||
Dim CveControladorGrafico As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveControladorGrafico").ToEntero
|
||||
If GPS.ControladorGraficoDelete(CveControladorGrafico) Then
|
||||
Alert("El Controlador Gráfico se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaDatos(-1)
|
||||
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
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveControladorGrafico").ToString
|
||||
|
||||
If CBool(e.Row.DBCampo("Estatus")) = True Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
|
||||
EsEditar = 0
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
TxtControladorGrafico.Text = ""
|
||||
TxtUM.Text = ""
|
||||
dvEstatus.Visible = False
|
||||
UpBodyEstatus.Update()
|
||||
UpFooter.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
100
GPS/CatDispositivos.aspx
Normal file
100
GPS/CatDispositivos.aspx
Normal file
@@ -0,0 +1,100 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDispositivos.aspx.vb" Inherits="GPS_CatDispositivos" %>
|
||||
|
||||
<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">
|
||||
Cátalogo de dispositivos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:HyperLink runat="server" NavigateUrl="/GPS/WizardDispositivo.aspx"><i class="fa fa-plus-circle"></i> Agregar</asp:HyperLink>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<div class="row" style="margin-left:0px;margin-top:5px;margin-bottom:5px" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveDispositivo, CveModelo, CveProveedorComunicacionCuenta " CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Modelo" ItemStyle-Width="15%" HeaderText="Modelo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Serie" ItemStyle-Width="30%" HeaderText="Serie" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="IMEI" ItemStyle-Width="20%" HeaderText="IMEI" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="NumeroTelefono" ItemStyle-Width="20%" HeaderText="NumeroTelefono" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Agregar Conductor</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyEstatus" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlModelo" Width="230px" runat="server" DataTextField="Modelo" DataValueField="CveModelo" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlModelo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Módelo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlModelo.ClientID.ToString()%>">Modelo:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlCuentas" Width="230px" runat="server" DataTextField="NumeroTelefono" DataValueField="CveProveedorComunicacionCuenta" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlCuentas" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Módelo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlCuentas.ClientID.ToString()%>">Cuenta Comunicación:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtIMEI" runat="server" CssClass="form-control" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtIMEI" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtIMEI" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Conductor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtIMEI.ClientID.ToString()%>">IMEI:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtSerie" runat="server" CssClass="form-control" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFV3" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtSerie" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Conductor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtSerie.ClientID.ToString()%>">Serie:</label>
|
||||
</div>
|
||||
<div id="dvEstatus" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlEstatus" Width="230px" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Value="1" Text="Activo"></asp:ListItem>
|
||||
<asp:ListItem Value="0" Text="Inactivo"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlEstatus.ClientID.ToString()%>">Estatus:</label>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarCatalogo" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
||||
<asp:linkbutton runat="server" id="btnCancelar" text="Cancelar" cssclass="btn btn-default" ></asp:linkbutton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
132
GPS/CatDispositivos.aspx.vb
Normal file
132
GPS/CatDispositivos.aspx.vb
Normal file
@@ -0,0 +1,132 @@
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class GPS_CatDispositivos
|
||||
Inherits System.Web.UI.Page
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property CveDispositivo As Integer
|
||||
Get
|
||||
Return ViewState("CveDispositivo").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveDispositivo") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = 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
|
||||
|
||||
CveDispositivo = -1
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
CargaDatos(-1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos(CveDispositivo As Integer)
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.DispositivosGet(CveDispositivo, -1, -1) Then
|
||||
GvDatos.DataSource = GPS.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
|
||||
GPS.Dispose()
|
||||
GvDatos.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveDispositivo = Boton.CommandArgument.ToEntero
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
'TxtConductor.Text = GvRow.DataKey("Conductor").ToString
|
||||
EsEditar = 1
|
||||
BtnAgregarCatalogo.Text = "Actualizar"
|
||||
dvEstatus.Visible = True
|
||||
UpBodyEstatus.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
|
||||
'Dim GPS As New ClsGPS
|
||||
|
||||
'If EsEditar = 0 Then
|
||||
' If GPS.DispositivoAdd(DdlModelo.SelectedValue.ToEntero, DdlCuentas.SelectedValue.ToEntero, 4, TxtIMEI.Text, TxtSerie.Text, 1) Then
|
||||
' Alert("El Dispositivo se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
' Else
|
||||
' Alert("Ocurrió un error al agregar el Dispositivo", TipoMensaje.MsgError)
|
||||
' End If
|
||||
'ElseIf EsEditar = 1 Then
|
||||
' If GPS.DispositivosUpdate(CveDispositivo, DdlModelo.SelectedValue.ToEntero, DdlCuentas.SelectedValue.ToEntero, 4, TxtIMEI.Text, TxtSerie.Text, DdlEstatus.SelectedValue) Then
|
||||
' Alert("El Dispositivo se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
' Else
|
||||
' Alert("Ocurrió un error al editar el dispositivo", TipoMensaje.MsgError)
|
||||
' End If
|
||||
' EsEditar = 0
|
||||
' dvEstatus.Visible = True
|
||||
' BtnAgregarCatalogo.Text = "Agregar"
|
||||
'End If
|
||||
'RegistraScript("$('#divAgregar').modal('hide')")
|
||||
'GPS.Dispose()
|
||||
'CargaDatos(-1)
|
||||
'UpDatos.Update()
|
||||
'UpBodyEstatus.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim GPS As New ClsGPS
|
||||
Dim CveDispositivo As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveDispositivo").ToEntero
|
||||
If GPS.DispositivosDelete(CveDispositivo) Then
|
||||
Alert("El Dispositivo se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaDatos(-1)
|
||||
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
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
' e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveDispositivo").ToString
|
||||
|
||||
If e.Row.DBCampo("CveEstatus") = 1 Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
'Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
|
||||
' EsEditar = 0
|
||||
' RegistraScript("$('#divAgregar').modal('hide')")
|
||||
' BtnAgregarCatalogo.Text = "Agregar"
|
||||
' 'TxtConductor.Text = ""
|
||||
' dvEstatus.Visible = False
|
||||
' UpBodyEstatus.Update()
|
||||
' UpFooter.Update()
|
||||
'End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
120
GPS/CatDistribuidoresMaster.aspx
Normal file
120
GPS/CatDistribuidoresMaster.aspx
Normal file
@@ -0,0 +1,120 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDistribuidoresMaster.aspx.vb" Inherits="GPS_CatDistribuidoresMaster" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Distribuidores Master
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" id="BtnOpenDiv"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<div class="row" style="margin-left:0px;margin-top:5px;margin-bottom:5px; text-align:right;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveEmpresa, Empresa, RFC, Telefono, Contacto, Mail, Estatus" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Empresa" ItemStyle-Width="25%" HeaderText="Empresa" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="RFC" ItemStyle-Width="10%" HeaderText="RFC" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Telefono" ItemStyle-Width="10%" HeaderText="Teléfono" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Contacto" ItemStyle-Width="15%" HeaderText="Contacto" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Mail" ItemStyle-Width="15%" HeaderText="Mail" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="divEmpresa" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpdatePanel2" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel3" style="text-align:left" runat="server">Agregar Distribuidor Master</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBody" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEmpresa" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEmpresa" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Empresa''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddEvento"></asp:RequiredFieldValidator>
|
||||
<label for="<%=TxtEmpresa.ClientID.ToString()%>">Nombre Distribuidor/Empresa:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtRFC" CssClass="form-control" runat="server" MaxLength="13"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ID="REVRFC" runat="server" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es incorrecto, por favor ingréselo." ValidationGroup="GrpGuardar" ControlToValidate="TxtRFC" ValidationExpression="^[a-zA-Z.)(/\\&-]{3,4}(\d{6})((\D|\d){2})((\D|\d){1})$"></asp:RegularExpressionValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEREVRFC" runat="server" HighlightCssClass="vco" TargetControlID="REVRFC" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtRFC" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddEvento"></asp:RequiredFieldValidator>
|
||||
<label for="<%=TxtRFC.ClientID.ToString()%>">RFC:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTelefono" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTelefono" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddEvento"></asp:RequiredFieldValidator>
|
||||
<label for="<%=TxtTelefono.ClientID.ToString()%>">Teléfono:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtContacto" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtContacto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Contacto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddEvento"></asp:RequiredFieldValidator>
|
||||
<label for="<%=TxtContacto.ClientID.ToString()%>">Contacto:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtMail" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtImagen" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtMail" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mail''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddEvento"></asp:RequiredFieldValidator>
|
||||
<label for="<%=TxtMail.ClientID.ToString()%>">Correo Electrónico:</label>
|
||||
</div>
|
||||
<div id="dvEstatusEv" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label>Activo: </label>
|
||||
<br />
|
||||
<asp:Checkbox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px">
|
||||
</asp:Checkbox>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarDist" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpAddEvento"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button id="btnCancelar" data-dismiss="modal" class="btn btn-default" >Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
120
GPS/CatDistribuidoresMaster.aspx.exclude
Normal file
120
GPS/CatDistribuidoresMaster.aspx.exclude
Normal file
@@ -0,0 +1,120 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatDistribuidoresMaster.aspx.vb" Inherits="GPS_CatDistribuidoresMaster" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Distribuidores Master
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" id="BtnOpenDiv"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<div class="row" style="margin-left:0px;margin-top:5px;margin-bottom:5px; text-align:right;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveEmpresa, Empresa, RFC, Telefono, Contacto, Mail, Estatus" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Empresa" ItemStyle-Width="25%" HeaderText="Empresa" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="RFC" ItemStyle-Width="10%" HeaderText="RFC" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Telefono" ItemStyle-Width="10%" HeaderText="Teléfono" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Contacto" ItemStyle-Width="15%" HeaderText="Contacto" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Mail" ItemStyle-Width="15%" HeaderText="Mail" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="divEmpresa" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpdatePanel2" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel3" style="text-align:left" runat="server">Agregar Distribuidor Master</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBody" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEmpresa" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEmpresa" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Empresa''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddEvento"></asp:RequiredFieldValidator>
|
||||
<label for="<%=TxtEmpresa.ClientID.ToString()%>">Nombre Distribuidor/Empresa:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtRFC" CssClass="form-control" runat="server" MaxLength="13"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ID="REVRFC" runat="server" Display="Dynamic" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es incorrecto, por favor ingréselo." ValidationGroup="GrpGuardar" ControlToValidate="TxtRFC" ValidationExpression="^[a-zA-Z.)(/\\&-]{3,4}(\d{6})((\D|\d){2})((\D|\d){1})$"></asp:RegularExpressionValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEREVRFC" runat="server" HighlightCssClass="vco" TargetControlID="REVRFC" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtRFC" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddEvento"></asp:RequiredFieldValidator>
|
||||
<label for="<%=TxtRFC.ClientID.ToString()%>">RFC:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTelefono" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTelefono" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddEvento"></asp:RequiredFieldValidator>
|
||||
<label for="<%=TxtTelefono.ClientID.ToString()%>">Teléfono:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtContacto" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtContacto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Contacto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddEvento"></asp:RequiredFieldValidator>
|
||||
<label for="<%=TxtContacto.ClientID.ToString()%>">Contacto:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtMail" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtImagen" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtMail" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Mail''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddEvento"></asp:RequiredFieldValidator>
|
||||
<label for="<%=TxtMail.ClientID.ToString()%>">Correo Electrónico:</label>
|
||||
</div>
|
||||
<div id="dvEstatusEv" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label>Activo: </label>
|
||||
<br />
|
||||
<asp:Checkbox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px">
|
||||
</asp:Checkbox>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarDist" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpAddEvento"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button id="btnCancelar" data-dismiss="modal" class="btn btn-default" >Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
267
GPS/CatDistribuidoresMaster.aspx.vb
Normal file
267
GPS/CatDistribuidoresMaster.aspx.vb
Normal file
@@ -0,0 +1,267 @@
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class GPS_CatDistribuidoresMaster
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property CveEmpresa As Integer
|
||||
Get
|
||||
Return ViewState("CveEmpresa").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveEmpresa") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = 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
|
||||
CveEmpresa = -1
|
||||
EsEditar = 0
|
||||
dvEstatusEv.Visible = False
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim objEmpresas As New ClsSisEmpresas
|
||||
If objEmpresas.GetDistribuidorMaster(-1) Then
|
||||
GvDatos.DataSource = objEmpresas.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
objEmpresas.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveEmpresa = Boton.CommandArgument.ToEntero
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
TxtEmpresa.Text = GvRow.DataKey("Empresa").ToString
|
||||
TxtRFC.Text = GvRow.DataKey("RFC").ToString
|
||||
TxtTelefono.Text = GvRow.DataKey("Telefono").ToString
|
||||
TxtContacto.Text = GvRow.DataKey("Contacto").ToString
|
||||
myModalLabel3.InnerHtml = "Actualizar Distribuidor Master"
|
||||
TxtMail.Text = GvRow.DataKey("Mail").ToString
|
||||
chkEstatus.Checked = CType(GvRow.DataKey("Estatus").ToString, Boolean)
|
||||
EsEditar = 1
|
||||
BtnAgregarDist.Text = "Actualizar"
|
||||
dvEstatusEv.Visible = True
|
||||
UpBody.Update()
|
||||
UpFooter.Update()
|
||||
UpdatePanel2.Update()
|
||||
RegistraScript("$('#divEmpresa').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarDist.Click
|
||||
Dim objEmpresa As New ClsSisEmpresas
|
||||
Dim objUsuarios As New ClsSisUsuarios(objEmpresa.IniciaTransacSQL())
|
||||
Dim objP As New ClsProyectos(objEmpresa.IniciaTransacSQL)
|
||||
Dim objSP As New ClsSubProyectos(objEmpresa.IniciaTransacSQL)
|
||||
Dim objSucursales As New ClsSucursales(objEmpresa.IniciaTransacSQL)
|
||||
Dim HuboError = False
|
||||
If EsEditar = 0 Then
|
||||
If Not objEmpresa.AddDistribuidorMaster(TxtRFC.Text, TxtEmpresa.Text, TxtTelefono.Text, TxtContacto.Text, TxtMail.Text, UsuarioActual.CveUsuario) Then
|
||||
HuboError = True
|
||||
End If
|
||||
If Not HuboError Then
|
||||
If objUsuarios.AddUsuario(TxtMail.Text, ContraseñaPredeterminadaEncriptada, TxtMail.Text.Split("@"c)(0), 1198, TxtMail.Text, -1, -1, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1) = -1 Then
|
||||
HuboError = True
|
||||
End If
|
||||
End If
|
||||
If Not HuboError Then
|
||||
Dim CveProyecto As Integer
|
||||
If objP.AddProyecto("Sin Proyecto", UsuarioActual.CveUsuario, objEmpresa.CveEmpresa) Then
|
||||
CveProyecto = objP.CveProyecto
|
||||
End If
|
||||
If Not objSP.AddSubProyecto(CveProyecto, "Sin SubProyecto", 0, UsuarioActual.CveUsuario, objEmpresa.CveEmpresa) Then
|
||||
HuboError = True
|
||||
End If
|
||||
End If
|
||||
If Not HuboError Then
|
||||
'Dim CveSucursal = objSucursales.AddSucursal("MATRIZ", "M", 0.16, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", "", "", "", "", "", "", "", "", 1)
|
||||
'If CveSucursal < 0 Then HuboError = True
|
||||
End If
|
||||
If Not HuboError Then
|
||||
If Not IO.Directory.Exists(String.Format("{0}\{1}", AppDomain.CurrentDomain.BaseDirectory, objEmpresa.CveEmpresa)) Then
|
||||
IO.Directory.CreateDirectory(String.Format("{0}Empresas\{1}", AppDomain.CurrentDomain.BaseDirectory, objEmpresa.CveEmpresa))
|
||||
End If
|
||||
Alert("El distribuidor se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If objEmpresa.UpdateDistribuidorMaster(TxtRFC.Text, TxtEmpresa.Text, TxtTelefono.Text, TxtContacto.Text, TxtMail.Text, UsuarioActual.CveUsuario, chkEstatus.Checked, CveEmpresa) Then
|
||||
Alert("El distribuidor se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
EsEditar = 0
|
||||
dvEstatusEv.Visible = False
|
||||
BtnAgregarDist.Text = "Agregar"
|
||||
End If
|
||||
RegistraScript("$('#divEmpresa').modal('hide')")
|
||||
If HuboError Then
|
||||
objEmpresa.RollBack()
|
||||
Else
|
||||
objEmpresa.Commit()
|
||||
End If
|
||||
objEmpresa.Dispose()
|
||||
RecargaGlobal()
|
||||
EnviaCorreoGPS()
|
||||
TxtEmpresa.Text = ""
|
||||
TxtContacto.Text = ""
|
||||
TxtMail.Text = ""
|
||||
TxtRFC.Text = ""
|
||||
TxtTelefono.Text = ""
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
UpBody.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim objEmpresa As New ClsSisEmpresas
|
||||
Dim CveEmpresa As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveEmpresa").ToEntero
|
||||
If objEmpresa.DeleteDistribuidorMaster(CveEmpresa) Then
|
||||
Alert("El distribuidor se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
objEmpresa.Dispose()
|
||||
CargaDatos()
|
||||
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
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveEmpresa").ToString
|
||||
|
||||
If CType(e.Row.DBCampo("Estatus"), Boolean) = True Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub RecargaGlobal()
|
||||
Dim ObjEmpresas As New ClsSisEmpresas()
|
||||
If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
|
||||
GlobalDTEmpresas = ObjEmpresas.DtResultados
|
||||
Else
|
||||
Application("GlobalDTEmpresas") = Nothing
|
||||
End If
|
||||
Dim ObjUsuarios As New ClsSisUsuarios()
|
||||
If ObjUsuarios.GetUsuarios(-1, -1, -1) Then
|
||||
GlobalDTUsuarios = ObjUsuarios.DtResultados
|
||||
End If
|
||||
ObjUsuarios.Dispose()
|
||||
ObjEmpresas.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles BtnOpenDiv.Click
|
||||
EsEditar = 0
|
||||
RegistraScript("$('#divEmpresa').modal()")
|
||||
BtnAgregarDist.Text = "Agregar"
|
||||
myModalLabel3.InnerHtml = "Agregar Distribuidor Master"
|
||||
TxtEmpresa.Text = ""
|
||||
TxtContacto.Text = ""
|
||||
TxtMail.Text = ""
|
||||
TxtRFC.Text = ""
|
||||
TxtTelefono.Text = ""
|
||||
dvEstatusEv.Visible = False
|
||||
UpdatePanel2.Update()
|
||||
UpBody.Update()
|
||||
UpFooter.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub EnviaCorreoGPS()
|
||||
Dim objMail As New ClsSisMail()
|
||||
Dim body = GeneraCorreo()
|
||||
Dim archivos As New List(Of ClsSisMail.ArchivoMail)
|
||||
Dim ListArchivoMail As New List(Of ClsSisMail.ArchivoMail)
|
||||
Dim ArchivoMail As New ClsSisMail.ArchivoMail
|
||||
ArchivoMail.Ruta = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\Grales\LogoSinFondo.png"
|
||||
ArchivoMail.NombreArchivo = "LogoSinFondo.png"
|
||||
ListArchivoMail.Add(ArchivoMail)
|
||||
objMail.SendMail(ClsPaginas.EmpresaNotificaciones, TxtMail.Text, "Activación de empresa", body, "", ListArchivoMail)
|
||||
objMail = Nothing
|
||||
End Sub
|
||||
Private Function GeneraCorreo() As String
|
||||
Dim strBody As New StringBuilder
|
||||
strBody.Append("<!DOCTYPE html>")
|
||||
strBody.Append("<html lang=""en""> ")
|
||||
strBody.Append("<body class=""page-header-fixed page-quick-sidebar-over-content "">")
|
||||
strBody.Append("<style>")
|
||||
strBody.Append(".portlet {margin-top: 0px;margin-bottom: 25px;padding: 0px;-webkit-border-radius: 4px;-moz-border-radius: 4px;-ms-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;padding: 0px !important;border: 1px solid #d78184;border-top: 0;background-color: #cb5a5e;}")
|
||||
strBody.Append(".portlet > div {font-family: Helvetica, sans-serif;}")
|
||||
strBody.Append(".portlet > .portlet-title {border-bottom: 0px solid #eee;padding: 0 10px;margin-bottom: 0px;min-height: 41px;-webkit-border-radius: 4px 4px 0 0;-moz-border-radius: 4px 4px 0 0;-ms-border-radius: 4px 4px 0 0;-o-border-radius: 4px 4px 0 0;border-radius: 4px 4px 0 0;color: #fff;}")
|
||||
strBody.Append(".portlet > .portlet-title {background-color: #cb5a5e;}")
|
||||
strBody.Append(".portlet > .portlet-title > div {padding: 11px 0 9px 0;}")
|
||||
strBody.Append(".portlet > .portlet-title > div {float: left;display: inline-block;font-size: 24px;line-height: 18px;padding: 10px 0;}")
|
||||
strBody.Append(".portlet > .portlet-body {background-color: #fff;padding: 10px;} ")
|
||||
strBody.Append(".portlet > .portlet-body {clear: both;-webkit-border-radius: 0 0 4px 4px;-moz-border-radius: 0 0 4px 4px;-ms-border-radius: 0 0 4px 4px;-o-border-radius: 0 0 4px 4px;border-radius: 0 0 4px 4px;}")
|
||||
strBody.Append(".mitablita td:nth-child(1){width: 100px; font-weight:700;}")
|
||||
strBody.Append("a{ color: #666;padding: 3px 9px; line-height: 1.5;background-color: #fff;border: 1px solid #ccc; text-decoration: none;}a:hover{background-color: #ededed;}")
|
||||
strBody.Append(".mitablita tr:nth-child(5) td{ text-align: right;}td{min-width:100px; }")
|
||||
strBody.Append("</style>")
|
||||
strBody.Append(" <div style=""Width:100%;"">")
|
||||
strBody.Append("<div style='text-align:center; font-family: Helvetica, sans-serif;'><table><tr><td style='text-align:center'> <h1> <img src='cid:LogoSinFondo.png' width='46' height='61'> AD Sistemas Soluciones en TI</h1> </td></tr></table> </div> ")
|
||||
strBody.Append(" <div class=""portlet box red "" style=""margin-top: 0px;margin-bottom: 25px;padding: 0px;-webkit-border-radius: 4px;-moz-border-radius: 4px;-ms-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;padding: 0px !important;border: 1px solid #d78184;border-top: 0;background-color: #cb5a5e;"">")
|
||||
strBody.Append(" <div class=""portlet-title"" style="" font-family: Helvetica, sans-serif; background-color: #cb5a5e;border-bottom: 0px solid #eee;padding: 0 10px;margin-bottom: 0px;min-height: 41px;-webkit-border-radius: 4px 4px 0 0;-moz-border-radius: 4px 4px 0 0;-ms-border-radius: 4px 4px 0 0;-o-border-radius: 4px 4px 0 0;border-radius: 4px 4px 0 0;color: #fff;"">")
|
||||
strBody.Append(" <div class=""caption"" style=""padding: 11px 0 9px 0;float: left;display: inline-block;font-size: 24px;line-height: 18px;padding: 10px 0;"">")
|
||||
strBody.Append(" <i class=""fa fa-user""></i>Información de Registro")
|
||||
strBody.Append(" </div>")
|
||||
strBody.Append(" </div>")
|
||||
strBody.Append(" <div class=""portlet-body "" style=""font-family: Helvetica, sans-serif; clear: both;-webkit-border-radius: 0 0 4px 4px;-moz-border-radius: 0 0 4px 4px;-ms-border-radius: 0 0 4px 4px;-o-border-radius: 0 0 4px 4px;border-radius: 0 0 4px 4px;background-color: #fff;padding: 10px;"" >")
|
||||
strBody.Append(" <table class=""mitablita"" style=""font-family: Helvetica, sans-serif;"">")
|
||||
strBody.Append(" <tr>")
|
||||
strBody.Append(" <td>Fecha: ")
|
||||
strBody.Append(DateTime.Now.ToString("dd/MM/yy"))
|
||||
strBody.Append(" </td> <td>")
|
||||
strBody.Append("</td> </tr>")
|
||||
strBody.Append(" <tr>")
|
||||
strBody.AppendFormat(" <td><b>{0}<br/></b> <br/> </td>", TxtEmpresa.Text.Trim)
|
||||
strBody.Append(" <td>")
|
||||
strBody.Append("</td> </tr>")
|
||||
strBody.Append(" <tr></tr> ")
|
||||
strBody.Append(" <tr>")
|
||||
strBody.Append(" <td>Se ha registrado como distribuidor master en SIG GPS</td>")
|
||||
strBody.Append("<tr><td colspan=""4"" >")
|
||||
'strBody.Append(Liga)
|
||||
strBody.AppendFormat("<a href='{0}'>Éste es su liga de acceso al sistema </a> <br/> <br/> </td></tr>", String.Format("{0}\Login.aspx", AppDomain.CurrentDomain.BaseDirectory))
|
||||
strBody.Append("<tr> <td> Sus Datos de Acceso son los siguientes: </td> </tr>")
|
||||
strBody.Append("<tr> <td> ")
|
||||
strBody.Append("<ul>")
|
||||
strBody.AppendFormat("<li>Usuario: {0} </li>", TxtMail.Text)
|
||||
strBody.Append("<li> Contraseña: -acceso- (La contraseña deberá ser cambiada después del primer inicio de sesión) </li> ")
|
||||
strBody.Append("</ul>")
|
||||
strBody.Append(" </td> </tr>")
|
||||
strBody.Append(" </table>")
|
||||
strBody.Append(" </div>")
|
||||
strBody.Append(" </div>")
|
||||
strBody.Append(" </div>")
|
||||
strBody.Append(" </div>")
|
||||
strBody.Append("</body>")
|
||||
strBody.Append("</html>")
|
||||
Return strBody.ToString
|
||||
End Function
|
||||
|
||||
End Class
|
||||
264
GPS/CatDistribuidoresMaster.aspx.vb.exclude
Normal file
264
GPS/CatDistribuidoresMaster.aspx.vb.exclude
Normal file
@@ -0,0 +1,264 @@
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class GPS_CatDistribuidoresMaster
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property CveEmpresa As Integer
|
||||
Get
|
||||
Return ViewState("CveEmpresa").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveEmpresa") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = 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
|
||||
CveEmpresa = -1
|
||||
EsEditar = 0
|
||||
dvEstatusEv.Visible = False
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim objEmpresas As New ClsSisEmpresas
|
||||
If objEmpresas.GetDistribuidorMaster(-1) Then
|
||||
GvDatos.DataSource = objEmpresas.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
objEmpresas.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveEmpresa = Boton.CommandArgument.ToEntero
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
TxtEmpresa.Text = GvRow.DataKey("Empresa").ToString
|
||||
TxtRFC.Text = GvRow.DataKey("RFC").ToString
|
||||
TxtTelefono.Text = GvRow.DataKey("Telefono").ToString
|
||||
TxtContacto.Text = GvRow.DataKey("Contacto").ToString
|
||||
myModalLabel3.InnerHtml = "Actualizar Distribuidor Master"
|
||||
TxtMail.Text = GvRow.DataKey("Mail").ToString
|
||||
chkEstatus.Checked = CType(GvRow.DataKey("Estatus").ToString, Boolean)
|
||||
EsEditar = 1
|
||||
BtnAgregarDist.Text = "Actualizar"
|
||||
dvEstatusEv.Visible = True
|
||||
UpBody.Update()
|
||||
UpFooter.Update()
|
||||
UpdatePanel2.Update()
|
||||
RegistraScript("$('#divEmpresa').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarDist.Click
|
||||
Dim objEmpresa As New ClsSisEmpresas
|
||||
Dim objUsuarios As New ClsSisUsuarios(objEmpresa.IniciaTransacSQL())
|
||||
Dim objP As New ClsProyectos(objEmpresa.IniciaTransacSQL)
|
||||
Dim objSP As New ClsSubProyectos(objEmpresa.IniciaTransacSQL)
|
||||
Dim objSucursales As New ClsSucursales(objEmpresa.IniciaTransacSQL)
|
||||
Dim HuboError = False
|
||||
If EsEditar = 0 Then
|
||||
If Not objEmpresa.AddDistribuidorMaster(TxtRFC.Text, TxtEmpresa.Text, TxtTelefono.Text, TxtContacto.Text, TxtMail.Text, UsuarioActual.CveUsuario) Then
|
||||
HuboError = True
|
||||
End If
|
||||
If Not HuboError Then
|
||||
If objUsuarios.AddUsuario(TxtMail.Text, ContraseñaPredeterminadaEncriptada, TxtMail.Text.Split("@"c)(0), 1198, TxtMail.Text, -1, -1, -1, True, UsuarioActual.CveUsuario, objEmpresa.CveEmpresa, -1) = -1 Then
|
||||
HuboError = True
|
||||
End If
|
||||
End If
|
||||
If Not HuboError Then
|
||||
Dim CveProyecto As Integer = objP.AddProyecto("Sin Proyecto", UsuarioActual.CveUsuario, objEmpresa.CveEmpresa)
|
||||
If Not objSP.AddSubProyecto(CveProyecto, "Sin SubProyecto", 0, UsuarioActual.CveUsuario, objEmpresa.CveEmpresa) Then
|
||||
HuboError = True
|
||||
End If
|
||||
End If
|
||||
If Not HuboError Then
|
||||
Dim CveSucursal = objSucursales.AddSucursal("MATRIZ", "M", 0.16, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", "", "", "", "", "", "", "", "", 1)
|
||||
If CveSucursal < 0 Then HuboError = True
|
||||
End If
|
||||
If Not HuboError Then
|
||||
If Not IO.Directory.Exists(String.Format("{0}\{1}", AppDomain.CurrentDomain.BaseDirectory, objEmpresa.CveEmpresa)) Then
|
||||
IO.Directory.CreateDirectory(String.Format("{0}Empresas\{1}", AppDomain.CurrentDomain.BaseDirectory, objEmpresa.CveEmpresa))
|
||||
End If
|
||||
Alert("El distribuidor se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If objEmpresa.UpdateDistribuidorMaster(TxtRFC.Text, TxtEmpresa.Text, TxtTelefono.Text, TxtContacto.Text, TxtMail.Text, UsuarioActual.CveUsuario, chkEstatus.Checked, CveEmpresa) Then
|
||||
Alert("El distribuidor se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
EsEditar = 0
|
||||
dvEstatusEv.Visible = False
|
||||
BtnAgregarDist.Text = "Agregar"
|
||||
End If
|
||||
RegistraScript("$('#divEmpresa').modal('hide')")
|
||||
If HuboError Then
|
||||
objEmpresa.RollBack()
|
||||
Else
|
||||
objEmpresa.Commit()
|
||||
End If
|
||||
objEmpresa.Dispose()
|
||||
RecargaGlobal()
|
||||
EnviaCorreoGPS()
|
||||
TxtEmpresa.Text = ""
|
||||
TxtContacto.Text = ""
|
||||
TxtMail.Text = ""
|
||||
TxtRFC.Text = ""
|
||||
TxtTelefono.Text = ""
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
UpBody.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim objEmpresa As New ClsSisEmpresas
|
||||
Dim CveEmpresa As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveEmpresa").ToEntero
|
||||
If objEmpresa.DeleteDistribuidorMaster(CveEmpresa) Then
|
||||
Alert("El distribuidor se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
objEmpresa.Dispose()
|
||||
CargaDatos()
|
||||
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
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveEmpresa").ToString
|
||||
|
||||
If CType(e.Row.DBCampo("Estatus"), Boolean) = True Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub RecargaGlobal()
|
||||
Dim ObjEmpresas As New ClsSisEmpresas()
|
||||
If ObjEmpresas.GetEmpresas(-1, "-1", "-1", "-1", "-1") Then
|
||||
GlobalDTEmpresas = ObjEmpresas.DtResultados
|
||||
Else
|
||||
Application("GlobalDTEmpresas") = Nothing
|
||||
End If
|
||||
Dim ObjUsuarios As New ClsSisUsuarios()
|
||||
If ObjUsuarios.GetUsuarios(-1, -1, -1) Then
|
||||
GlobalDTUsuarios = ObjUsuarios.DtResultados
|
||||
End If
|
||||
ObjUsuarios.Dispose()
|
||||
ObjEmpresas.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles BtnOpenDiv.Click
|
||||
EsEditar = 0
|
||||
RegistraScript("$('#divEmpresa').modal()")
|
||||
BtnAgregarDist.Text = "Agregar"
|
||||
myModalLabel3.InnerHtml = "Agregar Distribuidor Master"
|
||||
TxtEmpresa.Text = ""
|
||||
TxtContacto.Text = ""
|
||||
TxtMail.Text = ""
|
||||
TxtRFC.Text = ""
|
||||
TxtTelefono.Text = ""
|
||||
dvEstatusEv.Visible = False
|
||||
UpdatePanel2.Update()
|
||||
UpBody.Update()
|
||||
UpFooter.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub EnviaCorreoGPS()
|
||||
Dim objMail As New ClsSisMail()
|
||||
Dim body = GeneraCorreo()
|
||||
Dim archivos As New List(Of ClsSisMail.ArchivoMail)
|
||||
Dim ListArchivoMail As New List(Of ClsSisMail.ArchivoMail)
|
||||
Dim ArchivoMail As New ClsSisMail.ArchivoMail
|
||||
ArchivoMail.Ruta = $"{AppDomain.CurrentDomain.BaseDirectory}Empresas\Grales\LogoSinFondo.png"
|
||||
ArchivoMail.NombreArchivo = "LogoSinFondo.png"
|
||||
ListArchivoMail.Add(ArchivoMail)
|
||||
objMail.SendMail(ClsPaginas.EmpresaNotificaciones, TxtMail.Text, "Activación de empresa", body, "", ListArchivoMail)
|
||||
objMail = Nothing
|
||||
End Sub
|
||||
Private Function GeneraCorreo() As String
|
||||
Dim strBody As New StringBuilder
|
||||
strBody.Append("<!DOCTYPE html>")
|
||||
strBody.Append("<html lang=""en""> ")
|
||||
strBody.Append("<body class=""page-header-fixed page-quick-sidebar-over-content "">")
|
||||
strBody.Append("<style>")
|
||||
strBody.Append(".portlet {margin-top: 0px;margin-bottom: 25px;padding: 0px;-webkit-border-radius: 4px;-moz-border-radius: 4px;-ms-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;padding: 0px !important;border: 1px solid #d78184;border-top: 0;background-color: #cb5a5e;}")
|
||||
strBody.Append(".portlet > div {font-family: Helvetica, sans-serif;}")
|
||||
strBody.Append(".portlet > .portlet-title {border-bottom: 0px solid #eee;padding: 0 10px;margin-bottom: 0px;min-height: 41px;-webkit-border-radius: 4px 4px 0 0;-moz-border-radius: 4px 4px 0 0;-ms-border-radius: 4px 4px 0 0;-o-border-radius: 4px 4px 0 0;border-radius: 4px 4px 0 0;color: #fff;}")
|
||||
strBody.Append(".portlet > .portlet-title {background-color: #cb5a5e;}")
|
||||
strBody.Append(".portlet > .portlet-title > div {padding: 11px 0 9px 0;}")
|
||||
strBody.Append(".portlet > .portlet-title > div {float: left;display: inline-block;font-size: 24px;line-height: 18px;padding: 10px 0;}")
|
||||
strBody.Append(".portlet > .portlet-body {background-color: #fff;padding: 10px;} ")
|
||||
strBody.Append(".portlet > .portlet-body {clear: both;-webkit-border-radius: 0 0 4px 4px;-moz-border-radius: 0 0 4px 4px;-ms-border-radius: 0 0 4px 4px;-o-border-radius: 0 0 4px 4px;border-radius: 0 0 4px 4px;}")
|
||||
strBody.Append(".mitablita td:nth-child(1){width: 100px; font-weight:700;}")
|
||||
strBody.Append("a{ color: #666;padding: 3px 9px; line-height: 1.5;background-color: #fff;border: 1px solid #ccc; text-decoration: none;}a:hover{background-color: #ededed;}")
|
||||
strBody.Append(".mitablita tr:nth-child(5) td{ text-align: right;}td{min-width:100px; }")
|
||||
strBody.Append("</style>")
|
||||
strBody.Append(" <div style=""Width:100%;"">")
|
||||
strBody.Append("<div style='text-align:center; font-family: Helvetica, sans-serif;'><table><tr><td style='text-align:center'> <h1> <img src='cid:LogoSinFondo.png' width='46' height='61'> AD Sistemas Soluciones en TI</h1> </td></tr></table> </div> ")
|
||||
strBody.Append(" <div class=""portlet box red "" style=""margin-top: 0px;margin-bottom: 25px;padding: 0px;-webkit-border-radius: 4px;-moz-border-radius: 4px;-ms-border-radius: 4px;-o-border-radius: 4px;border-radius: 4px;padding: 0px !important;border: 1px solid #d78184;border-top: 0;background-color: #cb5a5e;"">")
|
||||
strBody.Append(" <div class=""portlet-title"" style="" font-family: Helvetica, sans-serif; background-color: #cb5a5e;border-bottom: 0px solid #eee;padding: 0 10px;margin-bottom: 0px;min-height: 41px;-webkit-border-radius: 4px 4px 0 0;-moz-border-radius: 4px 4px 0 0;-ms-border-radius: 4px 4px 0 0;-o-border-radius: 4px 4px 0 0;border-radius: 4px 4px 0 0;color: #fff;"">")
|
||||
strBody.Append(" <div class=""caption"" style=""padding: 11px 0 9px 0;float: left;display: inline-block;font-size: 24px;line-height: 18px;padding: 10px 0;"">")
|
||||
strBody.Append(" <i class=""fa fa-user""></i>Información de Registro")
|
||||
strBody.Append(" </div>")
|
||||
strBody.Append(" </div>")
|
||||
strBody.Append(" <div class=""portlet-body "" style=""font-family: Helvetica, sans-serif; clear: both;-webkit-border-radius: 0 0 4px 4px;-moz-border-radius: 0 0 4px 4px;-ms-border-radius: 0 0 4px 4px;-o-border-radius: 0 0 4px 4px;border-radius: 0 0 4px 4px;background-color: #fff;padding: 10px;"" >")
|
||||
strBody.Append(" <table class=""mitablita"" style=""font-family: Helvetica, sans-serif;"">")
|
||||
strBody.Append(" <tr>")
|
||||
strBody.Append(" <td>Fecha: ")
|
||||
strBody.Append(DateTime.Now.ToString("dd/MM/yy"))
|
||||
strBody.Append(" </td> <td>")
|
||||
strBody.Append("</td> </tr>")
|
||||
strBody.Append(" <tr>")
|
||||
strBody.AppendFormat(" <td><b>{0}<br/></b> <br/> </td>", TxtEmpresa.Text.Trim)
|
||||
strBody.Append(" <td>")
|
||||
strBody.Append("</td> </tr>")
|
||||
strBody.Append(" <tr></tr> ")
|
||||
strBody.Append(" <tr>")
|
||||
strBody.Append(" <td>Se ha registrado como distribuidor master en SIG GPS</td>")
|
||||
strBody.Append("<tr><td colspan=""4"" >")
|
||||
'strBody.Append(Liga)
|
||||
strBody.AppendFormat("<a href='{0}'>Éste es su liga de acceso al sistema </a> <br/> <br/> </td></tr>", String.Format("{0}\Login.aspx", AppDomain.CurrentDomain.BaseDirectory))
|
||||
strBody.Append("<tr> <td> Sus Datos de Acceso son los siguientes: </td> </tr>")
|
||||
strBody.Append("<tr> <td> ")
|
||||
strBody.Append("<ul>")
|
||||
strBody.AppendFormat("<li>Usuario: {0} </li>", TxtMail.Text)
|
||||
strBody.Append("<li> Contraseña: -acceso- (La contraseña deberá ser cambiada después del primer inicio de sesión) </li> ")
|
||||
strBody.Append("</ul>")
|
||||
strBody.Append(" </td> </tr>")
|
||||
strBody.Append(" </table>")
|
||||
strBody.Append(" </div>")
|
||||
strBody.Append(" </div>")
|
||||
strBody.Append(" </div>")
|
||||
strBody.Append(" </div>")
|
||||
strBody.Append("</body>")
|
||||
strBody.Append("</html>")
|
||||
Return strBody.ToString
|
||||
End Function
|
||||
|
||||
End Class
|
||||
128
GPS/CatEstatusTrayectos.aspx
Normal file
128
GPS/CatEstatusTrayectos.aspx
Normal file
@@ -0,0 +1,128 @@
|
||||
<%@ Page Title="" Language="C#" EnableEventValidation="false" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatEstatusTrayectos.aspx.cs" Inherits="GPS_CatEstatusTrayectos" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.v-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Estatus de Trayectos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" ID="BtnOpenDiv" OnClick="BtnOpenDiv_Click"><i class="fa fa-plus"></i>Agregar Estatus</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- BEGIN SAMPLE TABLE PORTLET-->
|
||||
<div class="portlet light ">
|
||||
<div class="portlet-title">
|
||||
<div class="actions">
|
||||
<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="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvEstatus.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvEstatus.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:GridView ID="GvEstatus" runat="server" GridLines="None" OnRowDataBound="GvEstatus_RowDataBound" DataKeyNames="CveEstatusTrayecto,CveEstatusAnterior,Estatus,EsInicio,EsFin" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" OnRowDeleting="GvEstatus_RowDeleting" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Orden" HeaderText="#" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" Text='<%# Eval("Estatus") %>' runat="server"></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="EstatusAnterior" HeaderText="Estatus Anterior" ItemStyle-Width="30%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="EstatusSiguiente" HeaderText="Estatus Siguiente" ItemStyle-Width="30%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Crear Nuevo Estatus de Trayecto</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpEstatus" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEstatus" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtEstatus.ClientID.ToString()%>">Estatus:</label>
|
||||
<asp:RequiredFieldValidator ID="RFVRuta" runat="server" ControlToValidate="TxtEstatus" Display="Dynamic" ErrorMessage="El campo <b>''Estatus''</b> es requerido por la aplicación, por favor ingrese una." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= RblInicioFin.ClientID.ToString()%>">Tipo Estatus:</label>
|
||||
<asp:RadioButtonList runat="server" ID="RblInicioFin" OnSelectedIndexChanged="RblInicioFin_SelectedIndexChanged" AutoPostBack="true">
|
||||
</asp:RadioButtonList>
|
||||
</div>
|
||||
<div class="row v-center" id="DivEstatus" runat="server" visible="false">
|
||||
<div class="col-md-6 v-center">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= DdlEstatusAnterior.ClientID.ToString()%>">Estatus Anterior:</label>
|
||||
<asp:DropDownList ID="DdlEstatusAnterior" OnSelectedIndexChanged="DdlEstatusAnterior_SelectedIndexChanged" AutoPostBack="true" DataTextField="Estatus" DataValueField="CveEstatusTrayecto" CssClass="form-control select2me" runat="server">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 v-center">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= DdlEstatusSiguiente.ClientID.ToString()%>">Estatus Siguiente:</label>
|
||||
<asp:DropDownList ID="DdlEstatusSiguiente" DataTextField="Estatus" DataValueField="CveEstatusTrayecto" Enabled="false" CssClass="form-control select2me" runat="server">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooterConductor" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarCatalogo" OnClick="BtnAgregarCatalogo_Click" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Guardar</asp:LinkButton>
|
||||
<button id="btnCancelar" class="btn btn-default" data-dismiss="modal" value="Cancelar">Cancelar </button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
272
GPS/CatEstatusTrayectos.aspx.cs
Normal file
272
GPS/CatEstatusTrayectos.aspx.cs
Normal file
@@ -0,0 +1,272 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Data;
|
||||
using Extensiones;
|
||||
using static Extensiones.ModExtensiones;
|
||||
public partial class GPS_CatEstatusTrayectos : ClsPaginas
|
||||
{
|
||||
#region "P R O P I E D A D E S"
|
||||
public int CveEstatusTrayecto { get { return ViewState["CveEstatusTrayecto"].ToString().ToEntero(); } set { ViewState["CveEstatusTrayecto"] = value; } }
|
||||
public int EsEditar { get { return ViewState["EsEditar"].ToString().ToEntero(); } set { ViewState["EsEditar"] = value; } }
|
||||
public DataTable DtEstatus { get { return ((DataTable)ViewState["DtEstatus"]); } set { ViewState["DtEstatus"] = value; } }
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaDatos();
|
||||
}
|
||||
}
|
||||
private void CargaDatos()
|
||||
{
|
||||
using (var ObjGPS = new ClsGPS())
|
||||
{
|
||||
if (ObjGPS.GetEstatusTrayectos(-1, UsuarioActual.CveCliente))
|
||||
{
|
||||
DtEstatus = ObjGPS.DtResultados;
|
||||
GvEstatus.DataSource = DtEstatus;
|
||||
GvEstatus.DataBind();
|
||||
CargaEstatus();
|
||||
LimpiaModal();
|
||||
}
|
||||
}
|
||||
UpDatos.Update();
|
||||
}
|
||||
private void CargaEstatus()
|
||||
{
|
||||
if (DtEstatus != null)
|
||||
{
|
||||
RblInicioFin.Items.Clear();
|
||||
|
||||
var ExisteInicio = DtEstatus.COUNT("EsInicio", "EsInicio = true") > 0;
|
||||
if (!ExisteInicio)
|
||||
{
|
||||
var ExisteInicial = RblInicioFin.Items.Cast<ListItem>().Any(x => x.Text == "Inicial");
|
||||
RblInicioFin.Items.Insert(0, new ListItem("Inicial", "1", true));
|
||||
}
|
||||
|
||||
if (ExisteInicio)
|
||||
{
|
||||
RblInicioFin.Items.Add(new ListItem("Intermedio", "2"));
|
||||
}
|
||||
|
||||
var ExisteFin = DtEstatus.COUNT("EsFin", "EsFin = true") > 0;
|
||||
if (!ExisteFin)
|
||||
{
|
||||
RblInicioFin.Items.Add(new ListItem("Final", "3"));
|
||||
}
|
||||
}
|
||||
}
|
||||
protected void BtnAgregarCatalogo_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsGPS ObjGPS = new ClsGPS();
|
||||
try
|
||||
{
|
||||
string Estatus = TxtEstatus.Text.Trim();
|
||||
bool EsInicio = false;
|
||||
bool EsFin = false;
|
||||
int CveEstatusAnterior = -1;
|
||||
|
||||
switch (RblInicioFin.SelectedValue)
|
||||
{
|
||||
case "1": //INICIO
|
||||
EsInicio = true;
|
||||
EsFin = false;
|
||||
|
||||
int NoEstatusInicio = DtEstatus.COUNT("CveEstatusTrayecto", "EsInicio = True");
|
||||
if (NoEstatusInicio > 0)
|
||||
{
|
||||
this.Alert("Ya existe un estatus de inicio.", TipoMensaje.MsgAdvertencia);
|
||||
ObjGPS.Dispose();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case "2":
|
||||
EsInicio = false;
|
||||
EsFin = false;
|
||||
CveEstatusAnterior = DdlEstatusAnterior.SelectedValue.ToEntero();
|
||||
break;
|
||||
case "3"://FIN
|
||||
EsInicio = false;
|
||||
EsFin = true;
|
||||
int NoEstatusFin = DtEstatus.COUNT("CveEstatusTrayecto", "EsFin = True");
|
||||
if (NoEstatusFin > 0)
|
||||
{
|
||||
this.Alert("Ya existe un estatus de final.", TipoMensaje.MsgAdvertencia);
|
||||
ObjGPS.Dispose();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (RblInicioFin.SelectedValue == "2" && CveEstatusAnterior <= 0)
|
||||
{
|
||||
this.Alert("No se puede agregar el estatus. Debe seleccionar un estatus anterior.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
ObjGPS.Dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
if (ObjGPS.AddEstatusTrayectos(Estatus, EsInicio, EsFin, CveEstatusAnterior, UsuarioActual.CveCliente))
|
||||
{
|
||||
int CveEstatusNuevo = ObjGPS.DtResultados.Rows[0]["CveEstatusTrayecto"].ToString().ToEntero();
|
||||
int CveEstatusSiguiente = DdlEstatusSiguiente.SelectedValue.ToEntero();
|
||||
|
||||
if (CveEstatusSiguiente > 0)
|
||||
{
|
||||
if (ObjGPS.UpdateEstatusTrayectos(CveEstatusSiguiente,"",false,false, CveEstatusNuevo, UsuarioActual.CveCliente))
|
||||
{
|
||||
this.Alert("El estatus se actualizo correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert("Ocurrió un error al actualizar el estatus.", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
this.Alert("El estatus se agrego correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert("Ocurrió un error al agregar el estatus.", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.OnError("Ocurrió un error al agregar el estatus.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ObjGPS.Dispose();
|
||||
CargaDatos();
|
||||
RegistraScript("$('#divAgregar').modal('hide');");
|
||||
}
|
||||
}
|
||||
|
||||
protected void BtnOpenDiv_Click(object sender, EventArgs e)
|
||||
{
|
||||
EsEditar = 0;
|
||||
CargaEstatus();
|
||||
LimpiaModal();
|
||||
DdlEstatusAnterior_SelectedIndexChanged(DdlEstatusAnterior, EventArgs.Empty);
|
||||
UpEstatus.Update();
|
||||
UpAgregar.Update();
|
||||
RegistraScript("$('#divAgregar').modal({backdrop: 'static', keyboard: false});");
|
||||
}
|
||||
private void LimpiaModal()
|
||||
{
|
||||
EsEditar = 0;
|
||||
TxtEstatus.Text = "";
|
||||
RblInicioFin.SelectedIndex = 0;
|
||||
RblInicioFin_SelectedIndexChanged(DdlEstatusAnterior, EventArgs.Empty);
|
||||
}
|
||||
|
||||
protected void RblInicioFin_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
switch (RblInicioFin.SelectedValue)
|
||||
{
|
||||
case "1": //INICIO
|
||||
DivEstatus.Visible = false;
|
||||
break;
|
||||
case "2":
|
||||
DivEstatus.Visible = true;
|
||||
var dt = DtEstatus.FiltraParametros("EsFin=false");
|
||||
if (dt.Rows.Count > 0)
|
||||
{
|
||||
DdlEstatusAnterior.DataSource = dt;
|
||||
DdlEstatusAnterior.DataBind();
|
||||
|
||||
var CveEstatusSeleccion = dt.FiltroPrimeroValor("CveEstatusTrayecto", "CveEstatusSiguiente IS NULL").ToEntero();
|
||||
if (CveEstatusSeleccion <= 0)
|
||||
{
|
||||
CveEstatusSeleccion = DtEstatus.FiltroPrimeroValor("CveEstatusAnterior", "EsFin = true").ToEntero();
|
||||
}
|
||||
DdlEstatusAnterior.SelectedValueExist(CveEstatusSeleccion);
|
||||
}
|
||||
else
|
||||
{
|
||||
DivEstatus.Visible = true;
|
||||
}
|
||||
|
||||
break;
|
||||
case "3"://FIN
|
||||
DivEstatus.Visible = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
UpEstatus.Update();
|
||||
}
|
||||
|
||||
protected void GvEstatus_RowDeleting(object sender, GridViewDeleteEventArgs e)
|
||||
{
|
||||
var ObjGPS = new ClsGPS();
|
||||
try
|
||||
{
|
||||
int CveEstatusTrayecto = GvEstatus.Rows[e.RowIndex].DataKey("CveEstatusTrayecto").ToEntero();
|
||||
|
||||
int CveEstatusAnterior = DtEstatus.FiltroPrimeroValor("CveEstatusAnterior", $"CveEstatusTrayecto = {CveEstatusTrayecto}").ToEntero();
|
||||
int CveEstatusSiguiente = DtEstatus.FiltroPrimeroValor("CveEstatusSiguiente", $"CveEstatusTrayecto = {CveEstatusTrayecto}").ToEntero();
|
||||
|
||||
if (ObjGPS.RemoveEstatusTrayecto(CveEstatusTrayecto))
|
||||
{
|
||||
if (ObjGPS.UpdateEstatusTrayectos(CveEstatusSiguiente,"",false,false, CveEstatusAnterior, UsuarioActual.CveCliente))
|
||||
{
|
||||
this.Alert("El estatus se eliminó correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.OnError("Ocurrió un error al eliminar el estatus.", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ObjGPS.Dispose();
|
||||
CargaDatos();
|
||||
}
|
||||
}
|
||||
|
||||
protected void GvEstatus_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
if (e.Row.DBCampo("EsFin") == "True")
|
||||
{
|
||||
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-primary";
|
||||
}
|
||||
else if (e.Row.DBCampo("EsInicio") == "True")
|
||||
{
|
||||
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-success";
|
||||
}
|
||||
else if (e.Row.DBCampo("EsFin") == "False" && e.Row.DBCampo("EsInicio") == "False")
|
||||
{
|
||||
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-secondary";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void DdlEstatusAnterior_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
int CveEstatusSiguiente = DtEstatus.FiltroPrimeroValor("CveEstatusSiguiente", $"CveEstatusTrayecto = {DdlEstatusAnterior.SelectedValue}").ToEntero();
|
||||
if (CveEstatusSiguiente > 0)
|
||||
{
|
||||
DdlEstatusSiguiente.DataSource = DtEstatus.FiltraParametros($"CveEstatusTrayecto={CveEstatusSiguiente}");
|
||||
DdlEstatusSiguiente.DataBind();
|
||||
}
|
||||
else
|
||||
{
|
||||
DdlEstatusSiguiente.Items.Clear();
|
||||
DdlEstatusSiguiente.Items.Insert(0, new ListItem("Ninguno", "-1"));
|
||||
}
|
||||
}
|
||||
}
|
||||
204
GPS/CatEventos.aspx
Normal file
204
GPS/CatEventos.aspx
Normal file
@@ -0,0 +1,204 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatEventos.aspx.vb" Inherits="GPS_CatEventos" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Eventos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" id="BtnOpenDiv"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align:right" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveEvento, Evento, CSS, Sonido, Imagen" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de eventos">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Evento" ItemStyle-Width="20%" HeaderText="Evento" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="CSS" ItemStyle-Width="10%" HeaderText="CSS" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:ImageField ControlStyle-Width="28" ControlStyle-Height="28" DataAlternateTextField="Imagen" DataImageUrlField="Imagen" DataImageUrlFormatString="~\Imagenes\{0}" ItemStyle-Width="15%" HeaderText="Imagen" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Sonido" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal runat="server" Text='<%# Eval("Sonido") %>'></asp:Literal>
|
||||
<asp:LinkButton runat="server" ID="PlaySonido" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa fa-play'></i>"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="divEventos" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpdatePanel2" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel3" runat="server" style="text-align:left">Agregar Evento</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyEvento" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtEvento" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEvento" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Evento''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddEvento"></asp:RequiredFieldValidator>
|
||||
<label for="<%=TxtEvento.ClientID.ToString()%>">Evento:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCSS" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%=TxtCSS.ClientID.ToString()%>">CSS:</label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label style="margin-bottom: 0; font-size: 13px; color: #888888; opacity: 1; bottom: auto;">Imagen Representativa:</label>
|
||||
<br />
|
||||
<asp:ImageButton runat="server" ID="ImgImagen" Style="height: 25px;" ImageUrl="/Imagenes/AddArchivo.png" OnClientClick="javascript:$('#DivImagen').modal(); return false;" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label style="margin-bottom: 0; font-size: 13px; color: #888888; opacity: 1; bottom: auto;">Sonido:</label>
|
||||
<br />
|
||||
<asp:ImageButton ID="ImgSonido" Height="25px" runat="server" ImageUrl="/Imagenes/AddArchivo.png" OnClientClick="javascript:$('#DivSonido').modal(); return false;"></asp:ImageButton>
|
||||
<asp:LinkButton runat="server" ID="PlaySonidoTmp" Visible="false" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa fa-play'></i>"></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%--<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlControladorGrafico" AppendDataBoundItems="true" runat="server" DataValueField="CveControladorGrafico" DataTextField="ControladorGrafico" CssClass="form-control select2me js-Impuesto-programmatic" Width="250px">
|
||||
<asp:ListItem Selected="true" Value="-1" Text="Seleccione"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlControladorGrafico.ClientID.ToString()%>">Control Gráfico:</label>
|
||||
</div>
|
||||
<div id="dvEstatusEv" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label>Activo: </label>
|
||||
<br />
|
||||
<asp:Checkbox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px">
|
||||
</asp:Checkbox>
|
||||
</div> --%>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooterEvento" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAddEvento" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpAddEvento"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button id="btnCancelar" data-dismiss="modal" class="btn btn-default" >Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpImagen">
|
||||
<ContentTemplate>
|
||||
<div id="DivImagen" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 700px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">Agregar Imagen</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpBodyImagen" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-4 truncate ">Arrastre la imagen:</div>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox ID="TxtUpImagen" CssClass="ADSdropzone hidden" data-maxFile="1" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="btnAddImagen" runat="server" CssClass="btn btn-primary" Text="Guardar" />
|
||||
<button class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpSonido">
|
||||
<ContentTemplate>
|
||||
<div id="DivSonido" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 700px;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">Agregar Sonido</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpBodySonido" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-4 truncate ">Arrastre el archivo de Sonido:</div>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox ID="TxtUpSonido" CssClass="ADSdropzone hidden" data-maxFile="1" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="btnAddSonido" runat="server" CssClass="btn btn-primary" Text="Guardar" />
|
||||
<button class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
function PlaySonidito(Sonido) {
|
||||
var snd = new Audio("/Sonidos/" + Sonido);
|
||||
snd.play();
|
||||
snd.currentTime = 0;
|
||||
}
|
||||
|
||||
function PlaySoniditoTmp(Sonido) {
|
||||
var snd = new Audio("/Temp/" + Sonido);
|
||||
snd.play();
|
||||
snd.currentTime = 0;
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
300
GPS/CatEventos.aspx.vb
Normal file
300
GPS/CatEventos.aspx.vb
Normal file
@@ -0,0 +1,300 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
|
||||
Partial Class GPS_CatEventos
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property CveEvento As Integer
|
||||
Get
|
||||
Return ViewState("CveEvento").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveEvento") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property Sonido As String
|
||||
Get
|
||||
Return ViewState("Sonido").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Sonido") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property Imagen As String
|
||||
Get
|
||||
Return ViewState("Imagen").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Imagen") = 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
|
||||
Imagen = ""
|
||||
Sonido = ""
|
||||
CveEvento = -1
|
||||
EsEditar = 0
|
||||
'dvEstatusEv.Visible = False
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.EventoGet(-1, -1, -1) Then
|
||||
GvDatos.DataSource = GPS.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvDatos.DataBind()
|
||||
CargaDdl()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdl()
|
||||
'Dim GPS As New ClsGPS
|
||||
'If GPS.ControladorGraficoGet(-1) Then
|
||||
' DdlControladorGrafico.DataSource = GPS.DtResultados.FiltraParametros("Estatus = 1")
|
||||
'Else
|
||||
' DdlControladorGrafico.DataSource = Nothing
|
||||
'End If
|
||||
'GPS.Dispose()
|
||||
'DdlControladorGrafico.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveEvento = Boton.CommandArgument.ToEntero
|
||||
myModalLabel3.InnerHtml = "Actualizar Evento"
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
TxtEvento.Text = GvRow.DataKey("Evento").ToString
|
||||
TxtCSS.Text = GvRow.DataKey("CSS").ToString
|
||||
Imagen = GvRow.DataKey("Imagen").ToString
|
||||
Sonido = GvRow.DataKey("Sonido").ToString
|
||||
If Not Sonido.Equals("") Then
|
||||
PlaySonidoTmp.Visible = True
|
||||
PlaySonidoTmp.OnClientClick = $"javascript:PlaySonidito('{Sonido}');return false;"
|
||||
End If
|
||||
EsEditar = 1
|
||||
BtnAddEvento.Text = "Actualizar"
|
||||
'dvEstatusEv.Visible = True
|
||||
'chkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
||||
UpBodyEvento.Update()
|
||||
UpdatePanel2.Update()
|
||||
UpFooterEvento.Update()
|
||||
RegistraScript("$('#divEventos').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAddEvento.Click
|
||||
Dim GPS As New ClsGPS
|
||||
Dim huboerror = False
|
||||
If EsEditar = 0 Then
|
||||
Try
|
||||
If TxtUpImagen.getfiles().Archivos.Count > 0 Then
|
||||
Dim ArchivoImagen As Archivo = TxtUpImagen.getfiles().Archivos(0)
|
||||
Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}Imagenes"
|
||||
If Not Directory.Exists(Path) Then
|
||||
Directory.CreateDirectory(Path)
|
||||
End If
|
||||
Dim directorioNew As String = String.Format("{0}\{1}.{2}", Path, Imagen, ArchivoImagen.Extencion)
|
||||
If File.Exists(directorioNew) Then
|
||||
My.Computer.FileSystem.DeleteFile(directorioNew)
|
||||
End If
|
||||
My.Computer.FileSystem.MoveFile(ArchivoImagen.FileUrl, directorioNew)
|
||||
End If
|
||||
|
||||
If TxtUpSonido.getfiles().Archivos.Count > 0 Then
|
||||
Dim ArchivoSonido As Archivo = TxtUpSonido.getfiles().Archivos(0)
|
||||
Dim PathSonido As String = $"{AppDomain.CurrentDomain.BaseDirectory}Sonidos"
|
||||
Dim dirSonido As String = String.Format("{0}\{1}.{2}", PathSonido, Sonido, ArchivoSonido.Extencion)
|
||||
If File.Exists(dirSonido) Then
|
||||
My.Computer.FileSystem.DeleteFile(dirSonido)
|
||||
End If
|
||||
My.Computer.FileSystem.MoveFile(ArchivoSonido.FileUrl, dirSonido)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
huboerror = True
|
||||
OnError("Ocurrió un error al agregar los archivos", ex)
|
||||
End Try
|
||||
If Not huboerror Then
|
||||
Dim CveControladorGrafico As Integer = -1 'DdlControladorGrafico.SelectedValue.ToEntero
|
||||
If GPS.EventoAdd(TxtEvento.Text, 1, True, TxtCSS.Text.Trim, Imagen, Sonido, UsuarioActual.CveUsuario, CveControladorGrafico, 1) Then
|
||||
Alert("El Evento se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al agregar el Evento", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
Try
|
||||
If TxtUpImagen.getfiles().Archivos.Count > 0 Then
|
||||
Dim ArchivoImagen As Archivo = TxtUpImagen.getfiles().Archivos(0)
|
||||
Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}Imagenes"
|
||||
If Not Directory.Exists(Path) Then
|
||||
Directory.CreateDirectory(Path)
|
||||
End If
|
||||
Dim directorioNew As String = String.Format("{0}\{1}", Path, Imagen)
|
||||
If File.Exists(directorioNew) Then
|
||||
My.Computer.FileSystem.DeleteFile(directorioNew)
|
||||
End If
|
||||
My.Computer.FileSystem.MoveFile(ArchivoImagen.FileUrl, directorioNew)
|
||||
End If
|
||||
|
||||
If TxtUpSonido.getfiles().Archivos.Count > 0 Then
|
||||
Dim ArchivoSonido As Archivo = TxtUpSonido.getfiles().Archivos(0)
|
||||
Dim PathSonido As String = $"{AppDomain.CurrentDomain.BaseDirectory}Sonidos"
|
||||
Dim dirSonido As String = String.Format("{0}\{1}", PathSonido)
|
||||
If File.Exists(dirSonido) Then
|
||||
My.Computer.FileSystem.DeleteFile(dirSonido)
|
||||
End If
|
||||
My.Computer.FileSystem.MoveFile(ArchivoSonido.FileUrl, dirSonido)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
huboerror = True
|
||||
OnError("Ocurrió un error al agregar los archivos", ex)
|
||||
End Try
|
||||
If Not huboerror Then
|
||||
Dim Estatus As Boolean = True 'chkEstatus.Checked
|
||||
Dim CveControladorGrafico = -1 'DdlControladorGrafico.SelectedValue.ToEntero
|
||||
If GPS.EventoUpdate(CveEvento, TxtEvento.Text, 1, Estatus, TxtCSS.Text.Trim, Imagen, Sonido,CveControladorGrafico , 1) Then
|
||||
Alert("El Evento se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al editar al Evento", TipoMensaje.MsgError)
|
||||
End If
|
||||
EsEditar = 0
|
||||
'dvEstatusEv.Visible = False
|
||||
BtnAddEvento.Text = "Agregar"
|
||||
End If
|
||||
End If
|
||||
RegistraScript("$('#divEventos').modal('hide')")
|
||||
GPS.Dispose()
|
||||
TxtEvento.Text = ""
|
||||
TxtCSS.Text = ""
|
||||
Imagen = ""
|
||||
Sonido = ""
|
||||
TxtUpImagen.Text = "[]"
|
||||
TxtUpSonido.Text = "[]"
|
||||
PlaySonidoTmp.Visible = False
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
UpBodyEvento.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim GPS As New ClsGPS
|
||||
Dim CveEvento As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveEvento").ToEntero
|
||||
If GPS.EventoDelete(CveEvento) Then
|
||||
Alert("El conductor se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaDatos()
|
||||
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
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveEvento").ToString
|
||||
If File.Exists($"{AppDomain.CurrentDomain.BaseDirectory}Sonidos/{e.Row.DataKey("Sonido").ToString}") Then
|
||||
e.Row.FCLinkButton("PlaySonido").OnClientClick = $"javascript:PlaySonidito('{e.Row.DataKey("Sonido").ToString}');return false;"
|
||||
Else
|
||||
e.Row.FCLinkButton("PlaySonido").Visible = False
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "UPLOADS"
|
||||
Protected Sub btnAddImagen_Click(sender As Object, e As EventArgs) Handles btnAddImagen.Click
|
||||
Dim Filesgral As List(Of Archivo) = TxtUpImagen.getfiles().Archivos
|
||||
For Each fileItem As Archivo In Filesgral
|
||||
Dim ImagenT = FormatearNombreArchivo(fileItem.filenameO)
|
||||
If Imagen.Length > 199 Then
|
||||
Alert("El nombre del archivo excede los 200 Caracteres permitidos favor de modificarlo.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
Else
|
||||
Imagen = ImagenT
|
||||
End If
|
||||
Next
|
||||
RegistraScript("$('#DivImagen').modal('hide');")
|
||||
UpBodyEvento.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub btnAddSonido_Click(sender As Object, e As EventArgs) Handles btnAddSonido.Click
|
||||
Dim Filesgral As List(Of Archivo) = TxtUpSonido.getfiles().Archivos
|
||||
For Each fileItem As Archivo In Filesgral
|
||||
Dim SonidoT = FormatearNombreArchivo(fileItem.filenameO)
|
||||
If Sonido.Length > 199 Then
|
||||
Alert("El nombre del archivo excede los 200 Caracteres permitidos favor de modificarlo.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
Else
|
||||
Sonido = SonidoT
|
||||
PlaySonidoTmp.Visible = True
|
||||
PlaySonidoTmp.OnClientClick = $"javascript:PlaySoniditoTmp('{fileItem.filename}');return false;"
|
||||
End If
|
||||
Next
|
||||
RegistraScript("$('#DivSonido').modal('hide');")
|
||||
UpBodyEvento.Update()
|
||||
End Sub
|
||||
|
||||
Public Function FormatearNombreArchivo(nombreArchivoOriginal As String) As String
|
||||
Dim nombreArchivoFormateado As String
|
||||
nombreArchivoFormateado = nombreArchivoOriginal.Replace(" ", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("'", "")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace(Chr(34), "")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("$", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("#", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("%", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("!", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("&", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("?", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("¿", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("¡", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("*", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("~", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("^", "_")
|
||||
Return nombreArchivoFormateado
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles BtnOpenDiv.Click
|
||||
EsEditar = 0
|
||||
RegistraScript("$('#divEventos').modal()")
|
||||
BtnAddEvento.Text = "Agregar"
|
||||
myModalLabel3.InnerHtml = "Agregar Evento"
|
||||
TxtEvento.Text = ""
|
||||
TxtCSS.Text = ""
|
||||
Imagen = ""
|
||||
Sonido = ""
|
||||
TxtUpImagen.Text = "[]"
|
||||
TxtUpSonido.Text = "[]"
|
||||
PlaySonidoTmp.Visible = False
|
||||
'dvEstatusEv.Visible = False
|
||||
UpBodyEvento.Update()
|
||||
UpdatePanel2.Update()
|
||||
UpFooterEvento.Update()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
95
GPS/CatEventosTipos.aspx
Normal file
95
GPS/CatEventosTipos.aspx
Normal file
@@ -0,0 +1,95 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatEventosTipos.aspx.vb" Inherits="GPS_CatEventosTipos" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Tipos de Evento
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" id="BtnOpenDiv"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<div class="row" style="margin-left:0px;margin-top:5px;margin-bottom:5px" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveEventoTipo,EventoTipo,Estatus" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="EventoTipo" ItemStyle-Width="40%" HeaderText="Tipo de Evento" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="25%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="25%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" runat="server" style="text-align:left" id="myModalLabel">Agregar Tipo de Evento</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyEstatus" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTipoEvento" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVPlataforma" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTipoEvento" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Conductor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtTipoEvento.ClientID.ToString()%>">Tipo de Evento:</label>
|
||||
</div>
|
||||
<div id="dvEstatus" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label>Activo: </label>
|
||||
<asp:Checkbox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px">
|
||||
</asp:Checkbox>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarCatalogo" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
||||
<button id="btnCancelar" data-dismiss="modal" class="btn btn-default" >Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
130
GPS/CatEventosTipos.aspx.vb
Normal file
130
GPS/CatEventosTipos.aspx.vb
Normal file
@@ -0,0 +1,130 @@
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class GPS_CatEventosTipos
|
||||
Inherits ClsPaginas
|
||||
#Region "Propiedades"
|
||||
Public Property CveEventoTipo As Integer
|
||||
Get
|
||||
Return ViewState("CveEventoTipo").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveEventoTipo") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = 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
|
||||
CveEventoTipo = -1
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
CargaDatos(-1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos(CveEventoTipo As Integer)
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.EventosTiposGet(CveEventoTipo, -1) Then
|
||||
GvDatos.DataSource = GPS.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveEventoTipo = Boton.CommandArgument.ToEntero
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
TxtTipoEvento.Text = GvRow.DataKey("EventoTipo").ToString
|
||||
EsEditar = 1
|
||||
chkEstatus.Checked = CBool(GvRow.DataKey("Estatus").ToString)
|
||||
myModalLabel.InnerHtml = "Actualizar Tipo de Evento"
|
||||
BtnAgregarCatalogo.Text = "Actualizar"
|
||||
dvEstatus.Visible = True
|
||||
UpBodyEstatus.Update()
|
||||
UpAgregar.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If EsEditar = 0 Then
|
||||
If GPS.EventoTipoAdd(TxtTipoEvento.Text.Trim, True, UsuarioActual.CveUsuario) Then
|
||||
Alert("El Tipo De Evento se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al agregar el tipo de evento", TipoMensaje.MsgError)
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If GPS.EventosTiposUpdate(CveEventoTipo, TxtTipoEvento.Text, If(chkEstatus.Checked, 1, 0)) Then
|
||||
Alert("El Tipo De Evento se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
Alert("Ocurrió un error al editar el Tipo De Eventor", TipoMensaje.MsgError)
|
||||
End If
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = True
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
End If
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
GPS.Dispose()
|
||||
TxtTipoEvento.Text = ""
|
||||
CargaDatos(-1)
|
||||
UpDatos.Update()
|
||||
UpBodyEstatus.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim GPS As New ClsGPS
|
||||
Dim CveEventoTipo As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveEventoTipo").ToEntero
|
||||
If GPS.EventoTipoDelete(CveEventoTipo) Then
|
||||
Alert("El conductor se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaDatos(-1)
|
||||
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
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveEventoTipo").ToString
|
||||
|
||||
If e.Row.DBCampo("Estatus") = True Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles BtnOpenDiv.Click
|
||||
EsEditar = 0
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
myModalLabel.InnerHtml = "Agregar Tipo de Evento"
|
||||
TxtTipoEvento.Text = ""
|
||||
dvEstatus.Visible = False
|
||||
UpBodyEstatus.Update()
|
||||
UpFooter.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
141
GPS/CatGrupos.aspx
Normal file
141
GPS/CatGrupos.aspx
Normal file
@@ -0,0 +1,141 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatGrupos.aspx.cs" Inherits="GPS_CatGrupos" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.posicionvalidation
|
||||
{
|
||||
left: 230px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Grupos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel ID="UpLnkAgregar" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="linkAgregar" runat="server" OnClick="linkAgregar_Click"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="portlet light ">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 25px">
|
||||
<i style="font-size: larger" class="fa fa-user font-green"></i>
|
||||
<span class="caption-subject font-green bold uppercase" style="font-size: 18px">Grupos Disponibles</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<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="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvGrupos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvGrupos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<asp:GridView ID="GvGrupos" runat="server" GridLines="None" DataKeyNames="CveDispositivosGrupos, Nombre, CveCliente, FechaIng" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" OnRowDeleting="GvGrupos_RowDeleting">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Nombre" HeaderText="Nombre" ItemStyle-Width="39%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaIng" DataFormatString="{0:d}" ItemStyle-Width="8%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField ItemStyle-Width="10%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" OnClick="imgE_Click" AlternateText="Editar" CommandArgument='<%# Eval("CveDispositivosGrupos")%>' CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar este grupo?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%-- MODAL AGREGAR-EDITAR --%>
|
||||
<div id="DvModalGrupo" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UPConsulta" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel2" runat="server">Grupo</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpModalBody" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtNombre" runat="server" CssClass="form-control" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
<label style="margin-top: -6px" for="<%= TxtNombre.ClientID.ToString()%>">Nombre del Grupo:</label>
|
||||
<asp:RequiredFieldValidator ID="RFVNombre" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtNombre" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre de grupo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlVehiculos" Width="230px" runat="server" DataTextField="NoEconomico" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me "></asp:DropDownList>
|
||||
<label style="margin-top: -6px" for="<%= DdlVehiculos.ClientID.ToString()%>">Vehiculo:</label>
|
||||
<asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlVehiculos" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''vehículo''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAgregarVehiculo"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDispositivo" runat="server" HighlightCssClass="vco posicionvalidation" TargetControlID="RFVDispositivo" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
<asp:LinkButton ID="BtnAgregar" runat="server" Text="Agregar" Style="margin-left: 25px;" OnClick="BtnAgregar_Click" CssClass="btn btn-primary" ValidationGroup="GrpAgregarVehiculo"></asp:LinkButton>
|
||||
|
||||
</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="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDispositivos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDispositivos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:GridView ID="GvDispositivos" runat="server" GridLines="None" data-height="200" DataKeyNames="CveDispositivo, NoEconomico" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" OnRowDeleting="GvDispositivos_RowDeleting" EmptyDataText="Seleccione el vehiculo y presione agregar.">
|
||||
<Columns>
|
||||
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="20%" HeaderText="NoEconomico" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Acciones" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="BtnBorrarDispositivo" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar este dispositivo?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="BtnGuardar" runat="server" Text="Guardar" CssClass="btn btn-primary" OnClick="BtnGuardar_Click" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
||||
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
370
GPS/CatGrupos.aspx.cs
Normal file
370
GPS/CatGrupos.aspx.cs
Normal file
@@ -0,0 +1,370 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
using Extensiones;
|
||||
|
||||
public partial class GPS_CatGrupos : ClsPaginas
|
||||
{
|
||||
#region "PROPIEDADES"
|
||||
private DataTable TmpDT
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DataTable)ViewState["TmpDT"];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["TmpDT"] = value;
|
||||
}
|
||||
}
|
||||
private DataTable TmpDTEdit
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DataTable)ViewState["TmpDTEdit"];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["TmpDTEdit"] = value;
|
||||
}
|
||||
}
|
||||
private int EsEditar
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["EsEditar"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["EsEditar"] = value;
|
||||
}
|
||||
}
|
||||
private int CveGrupo
|
||||
{
|
||||
get
|
||||
{
|
||||
return ViewState["CveGrupo"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveGrupo"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CveGrupo = -1;
|
||||
EsEditar = 0;
|
||||
|
||||
CargaVehiculos();
|
||||
|
||||
CreaTmpDT();
|
||||
CargaDatos();
|
||||
}
|
||||
}
|
||||
|
||||
protected void limpiarCamposModal()
|
||||
{
|
||||
TxtNombre.Text = "";
|
||||
TmpDT.Clear();
|
||||
DdlVehiculos.SelectedValueExist("-1");
|
||||
|
||||
GvDispositivos.DataSource = TmpDT;
|
||||
GvDispositivos.DataBind();
|
||||
|
||||
UPConsulta.Update();
|
||||
}
|
||||
|
||||
#region "CARGAR DATOS"
|
||||
|
||||
protected void CargaVehiculos()
|
||||
{
|
||||
DdlVehiculos.DataSource = get_GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario);
|
||||
DdlVehiculos.DataBind();
|
||||
DdlVehiculos.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
DdlVehiculos.SelectedValue = "-1";
|
||||
|
||||
}
|
||||
|
||||
protected void CreaTmpDT()
|
||||
{
|
||||
TmpDT = new DataTable();
|
||||
|
||||
TmpDT.Columns.Add("CveDispositivo", typeof(String));
|
||||
TmpDT.Columns.Add("NoEconomico", typeof(String));
|
||||
TmpDT.Columns.Add("CveDispositivosGruposDetalle", typeof(String));
|
||||
|
||||
GvDispositivos.DataSource = TmpDT;
|
||||
GvDispositivos.DataBind();
|
||||
|
||||
UPConsulta.Update();
|
||||
}
|
||||
|
||||
protected void CargaDatos()
|
||||
{
|
||||
ClsGPS ObjGPS = new ClsGPS();
|
||||
|
||||
if (ObjGPS.GruposGet(-1, UsuarioActual.CveCliente))
|
||||
{
|
||||
GvGrupos.DataSource = ObjGPS.DtResultados;
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
GvGrupos.DataBind();
|
||||
UpDatos.Update();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region "BOTONES"
|
||||
protected void linkAgregar_Click(object sender, EventArgs e)
|
||||
{
|
||||
limpiarCamposModal();
|
||||
EsEditar = 0;
|
||||
BtnGuardar.Text = "Guardar";
|
||||
UPConsulta.Update();
|
||||
|
||||
this.RegistraScript("$('#DvModalGrupo').modal();");
|
||||
|
||||
}
|
||||
|
||||
protected void BtnAgregar_Click(object sender, EventArgs e)
|
||||
{
|
||||
DataRow dr = TmpDT.NewRow();
|
||||
int CveDispositivo = DdlVehiculos.SelectedValue.ToEntero();
|
||||
|
||||
var filtro = String.Format("CveDispositivo ={0}", CveDispositivo);
|
||||
if (TmpDT.FiltraParametros(filtro).Rows.Count == 0)
|
||||
{
|
||||
dr["CveDispositivo"] = DdlVehiculos.SelectedValue;
|
||||
dr["NoEconomico"] = DdlVehiculos.SelectedItem.Text;
|
||||
TmpDT.Rows.Add(dr);
|
||||
|
||||
GvDispositivos.DataSource = TmpDT;
|
||||
GvDispositivos.DataBind();
|
||||
|
||||
UPConsulta.Update();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("Este dispositivo ya fue seleccionado.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
|
||||
protected void GvDispositivos_RowDeleting(object sender, GridViewDeleteEventArgs e)
|
||||
{
|
||||
TmpDT.Rows.RemoveAt(e.RowIndex);
|
||||
|
||||
GvDispositivos.DataSource = TmpDT;
|
||||
GvDispositivos.DataBind();
|
||||
|
||||
UPConsulta.Update();
|
||||
}
|
||||
|
||||
protected void BtnGuardar_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsGPS ObjGPS = new ClsGPS();
|
||||
|
||||
int CveCliente = UsuarioActual.CveCliente;
|
||||
String NombreGrupo = TxtNombre.Text;
|
||||
|
||||
ObjGPS.IniciaTransacSQL();
|
||||
bool TieneError = false;
|
||||
|
||||
// Agregar Nuevo grupo
|
||||
if (EsEditar == 0)
|
||||
{
|
||||
int CveNuevoGrupo;
|
||||
|
||||
CveNuevoGrupo = ObjGPS.GruposAdd(NombreGrupo, CveCliente);
|
||||
|
||||
if (CveNuevoGrupo == -1)
|
||||
{
|
||||
ObjGPS.RollBack();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
foreach (DataRow row in TmpDT.Rows)
|
||||
{
|
||||
int CveDispositivo = row["CveDispositivo"].ToEntero();
|
||||
TieneError = !ObjGPS.GruposDetallesAdd(CveNuevoGrupo, CveDispositivo);
|
||||
|
||||
if (TieneError)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!TieneError)
|
||||
{
|
||||
ObjGPS.Commit();
|
||||
Alert("El grupo " + NombreGrupo + " fue creado correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjGPS.RollBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
//Editar Grupo
|
||||
else if (EsEditar == 1)
|
||||
{
|
||||
TieneError = !ObjGPS.GruposUpdate(NombreGrupo, CveCliente, CveGrupo);
|
||||
if (TieneError)
|
||||
{
|
||||
ObjGPS.RollBack();
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (GridViewRow row in GvDispositivos.Rows)
|
||||
{
|
||||
var CveDispositivoBuscar = row.DataKey("CveDispositivo");
|
||||
var filtroDispositivos = String.Format("CveDispositivo ={0}", CveDispositivoBuscar);
|
||||
if (TmpDTEdit.FiltraParametros(filtroDispositivos).Rows.Count == 0)
|
||||
{
|
||||
TieneError = !ObjGPS.GruposDetallesAdd(CveGrupo, CveDispositivoBuscar.ToEntero());
|
||||
//Alert(TmpDTEdit.FiltraParametros(filtroDispositivos).Rows.Count.ToString(), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
foreach (DataRow row in TmpDTEdit.Rows)
|
||||
{
|
||||
int CveDispositivoBuscar = row["CveDispositivo"].ToEntero();
|
||||
int CveDetalle = row["CveDispositivosGruposDetalle"].ToEntero();
|
||||
|
||||
var filtroDispositivos = String.Format("CveDispositivo ={0}", CveDispositivoBuscar);
|
||||
if (TmpDT.FiltraParametros(filtroDispositivos).Rows.Count == 0)
|
||||
{
|
||||
TieneError = !ObjGPS.GruposDetallesDelete(CveDetalle);
|
||||
//Alert("No esta" + CveDetalle, ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!TieneError)
|
||||
{
|
||||
ObjGPS.Commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjGPS.RollBack();
|
||||
}
|
||||
|
||||
Alert("El grupo " + NombreGrupo + " fue actualizado correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
}
|
||||
|
||||
ObjGPS.Dispose();
|
||||
limpiarCamposModal();
|
||||
this.RegistraScript("$('#DvModalGrupo').modal('hide');");
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
protected void GvGrupos_RowDeleting(object sender, GridViewDeleteEventArgs e)
|
||||
{
|
||||
ClsGPS ObjGPS = new ClsGPS();
|
||||
ObjGPS.IniciaTransacSQL();
|
||||
|
||||
int CveDispositivosGrupos = GvGrupos.Rows[e.RowIndex].DataKey("CveDispositivosGrupos").ToEntero();
|
||||
|
||||
bool TieneError = !ObjGPS.GruposDetallesGet(CveDispositivosGrupos);
|
||||
|
||||
foreach (DataRow row in ObjGPS.DtResultados.Rows)
|
||||
{
|
||||
int CveDetalle = row["CveDispositivosGruposDetalle"].ToEntero();
|
||||
TieneError = !ObjGPS.GruposDetallesDelete(CveDetalle);
|
||||
if (TieneError)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!TieneError)
|
||||
{
|
||||
TieneError = !ObjGPS.GruposDelete(CveDispositivosGrupos);
|
||||
}
|
||||
|
||||
if (TieneError)
|
||||
{
|
||||
ObjGPS.RollBack();
|
||||
Alert("Error", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjGPS.Commit();
|
||||
Alert("El grupo ha sido eliminado.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
|
||||
ObjGPS.Dispose();
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
protected void imgE_Click(object sender, EventArgs e)
|
||||
{
|
||||
limpiarCamposModal();
|
||||
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
|
||||
CveGrupo = GvRow.DataKey("CveDispositivosGrupos").ToEntero();
|
||||
|
||||
TxtNombre.Text = GvRow.DataKey("Nombre").ToString();
|
||||
|
||||
ClsGPS ObjGPS = new ClsGPS();
|
||||
ObjGPS.IniciaTransacSQL();
|
||||
|
||||
bool TieneError = !ObjGPS.GruposDetallesGet(CveGrupo);
|
||||
|
||||
if (TieneError)
|
||||
{
|
||||
ObjGPS.RollBack();
|
||||
Alert("Error", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (DataRow row in ObjGPS.DtResultados.Rows)
|
||||
{
|
||||
DataRow dr = TmpDT.NewRow();
|
||||
|
||||
dr["CveDispositivo"] = row["CveDispositivo"].ToEntero();
|
||||
dr["NoEconomico"] = row["NoEconomico"];
|
||||
|
||||
dr["CveDispositivosGruposDetalle"] = row["CveDispositivosGruposDetalle"].ToEntero();
|
||||
|
||||
TmpDT.Rows.Add(dr);
|
||||
|
||||
int CveDetalle = row["CveDispositivosGruposDetalle"].ToEntero();
|
||||
}
|
||||
|
||||
TmpDTEdit = TmpDT.Copy();
|
||||
GvDispositivos.DataSource = TmpDT;
|
||||
|
||||
GvDispositivos.DataBind();
|
||||
|
||||
ObjGPS.Commit();
|
||||
|
||||
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
|
||||
EsEditar = 1;
|
||||
BtnGuardar.Text = "Actualizar";
|
||||
UPConsulta.Update();
|
||||
|
||||
this.RegistraScript("$('#DvModalGrupo').modal('show');");
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
56
GPS/CatModelos.aspx
Normal file
56
GPS/CatModelos.aspx
Normal file
@@ -0,0 +1,56 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatModelos.aspx.vb" Inherits="GPS_CatModelos" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Módelos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
<li>
|
||||
<asp:HyperLink runat="server" NavigateUrl="/GPS/WizardModelo.aspx"><i class="fa fa-plus-circle"></i> Agregar</asp:HyperLink>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<div class="row" style="margin-left:0px;margin-top:5px;margin-bottom:5px;text-align:right;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveModelo" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Modelo" ItemStyle-Width="20%" HeaderText="Modelo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Marca" ItemStyle-Width="20%" HeaderText="Marca" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="NumEntradas" ItemStyle-Width="15%" HeaderText="Número de Entradas" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="NumSalidas" ItemStyle-Width="15%" HeaderText="Número de Salidas" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaIng" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-Width="25%" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" />
|
||||
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
52
GPS/CatModelos.aspx.vb
Normal file
52
GPS/CatModelos.aspx.vb
Normal file
@@ -0,0 +1,52 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class GPS_CatModelos
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.ModeloGet(-1, -1) Then
|
||||
GvDatos.DataSource = GPS.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCHyperLink("ImgE").NavigateUrl = $"/GPS/WizardModelo.aspx?CveModelo={e.Row.DataKey("CveModelo").ToString}"
|
||||
|
||||
If e.Row.DBCampo("Estatus") = True Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim GPS As New ClsGPS
|
||||
Dim CveModelo As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveModelo").ToEntero
|
||||
If GPS.ModeloDelete(CveModelo) Then
|
||||
Alert("El modelo se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
138
GPS/CatPlanesDatos.aspx
Normal file
138
GPS/CatPlanesDatos.aspx
Normal file
@@ -0,0 +1,138 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatPlanesDatos.aspx.vb" Inherits="GPS_PlanesDatos" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Planes de Datos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UppAddAcciones" runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPlanesDatos" runat="server" Text="Agregar"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ClientIDMode="Static" runat="server" ID="HdnCveProveedorComunicacion" Value="-1" />
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvPlanesDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvPlanesDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GvPlanesDatos" runat="server" GridLines="None" DataKeyNames="CvePlanDato,Capacidad,UsuarioEmpresa,CveProveedorComunicacion,CveUsuario,PlanDato,Importe,Estatus,FechaIng,ProveedorComunicacion,TechoFacturacion,CostoAdicional,TipoPlan" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Planes de Datos ">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="ProveedorComunicacion" HeaderText="Compañía Telefónica" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="PlanDato" HeaderText="Plan de Datos" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Importe">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblImporte" runat="server" Text='<%# Eval("Importe") %>'>></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Capacidad" HeaderText="Capacidad (MB)" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TipoPlan" HeaderText="Tipo de Datos" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="CostoAdicional" HeaderText="Costo datos adicional" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="TechoFacturacion" HeaderText="Techo de Facturación" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaIng" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'>></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="Edit_Click" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="Delete_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:HiddenField ID="HdnModalidad" runat="server" Value="A" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%--POPUP AGREGAR--%>
|
||||
<div id="divAddPlanesDatos" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddPlanesDatos" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel" style="text-align: left" runat="server">Agregar Plan de Datos</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyPlanDatos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPlanDatos" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVPlanDatos" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPlanDatos" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Plan de Datos''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="TxtPlanDatos" runat="server" Text="Plan de Datos:"></asp:Label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlProveedorComunicacion" DataValueField="CveProveedorComunicacion" DataTextField="ProveedorComunicacion" runat="server" CssClass="form-control select2me" Width="200px"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtImporte" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="DdlProveedorComunicacion" runat="server" Text="Compañía Telefónica:"></asp:Label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtImporte" runat="server" CssClass="form-control" CausesValidation="true" onkeyup="FormatoMoneda(this)"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVImporte" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtImporte" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="TxtImporte" runat="server" Text="Importe:"></asp:Label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCapacidad" runat="server" CssClass="form-control" CausesValidation="true" onkeyup="ipadress"></asp:TextBox>
|
||||
<asp:RangeValidator ID="RGVTxtCapacidad" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtCapacidad" Type="Integer" MaximumValue="32767" MinimumValue="1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />''Valores fuera de rango(1-32767)''</b> " ValidationGroup="GrpObligatorio" />
|
||||
<ajax:FilteredTextBoxExtender ID="FIETxtCapacidad" TargetControlID="TxtCapacidad" FilterType="Numbers" runat="server" />
|
||||
<asp:RequiredFieldValidator ID="RFVCapacidad" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtCapacidad" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Capacidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="TxtCapacidad" runat="server" Text="Capacidad (MB):"></asp:Label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DDLTipoDatos" runat="server" CssClass="form-control select2me" Width="200px">
|
||||
<asp:ListItem Value="NACIONAL">NACIONAL</asp:ListItem>
|
||||
<asp:ListItem Value="EXTRANJERO">EXTRANJERO</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:Label AssociatedControlID="DDLTipoDatos" runat="server" Text="Tipo de Datos"></asp:Label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCostoAdicional" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||
<asp:Label AssociatedControlID="TxtCostoAdicional" runat="server" Text="Costo Adicional"></asp:Label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTechoFacturacion" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||
<asp:Label AssociatedControlID="TxtTechoFacturacion" runat="server" Text="TechoFacturación"></asp:Label>
|
||||
</div>
|
||||
<div id="divEstatus" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label>Activo: </label>
|
||||
<br />
|
||||
<asp:CheckBox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarPlanDatos" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
132
GPS/CatPlanesDatos.aspx.vb
Normal file
132
GPS/CatPlanesDatos.aspx.vb
Normal file
@@ -0,0 +1,132 @@
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class GPS_PlanesDatos
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDdlProveedorComunicacion()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdlProveedorComunicacion()
|
||||
Dim ObjGps As New ClsGPS()
|
||||
If ObjGps.DdlProveedoresComunicacionGet() Then
|
||||
DdlProveedorComunicacion.DataSource = ObjGps.DtResultados
|
||||
DdlProveedorComunicacion.DataBind()
|
||||
End If
|
||||
ObjGps.Dispose()
|
||||
DdlProveedorComunicacion.Items.Insert(0, New ListItem("Seleccione", -1))
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjGps As New ClsGPS()
|
||||
If ObjGps.PlanesDatosGet(UsuarioActual.CveEmpresa) Then
|
||||
GvPlanesDatos.DataSource = ObjGps.DtResultados
|
||||
GvPlanesDatos.DataBind()
|
||||
End If
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnAgregarPlanDatos_Click(sender As Object, e As EventArgs) Handles BtnAgregarPlanDatos.Click
|
||||
Dim ObjGps As New ClsGPS
|
||||
Dim Estatus = 0
|
||||
If ChkEstatus.Checked Then Estatus = 1
|
||||
If HdnModalidad.Value = "A" Then
|
||||
If ObjGps.PlanesDatosAdd(DdlProveedorComunicacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, TxtPlanDatos.Text, TxtImporte.Text, Estatus, TxtCapacidad.Text, DDLTipoDatos.SelectedValue, TxtCostoAdicional.Text, TxtTechoFacturacion.Text, UsuarioActual.CveEmpresa) Then
|
||||
CargaDatos()
|
||||
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ElseIf HdnModalidad.Value = "U" Then
|
||||
If ObjGps.PlanesDatosUpdate(HdnID.Value, DdlProveedorComunicacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, TxtPlanDatos.Text, TxtImporte.Text, Estatus, TxtCapacidad.Text, DDLTipoDatos.SelectedValue, TxtCostoAdicional.Text, TxtTechoFacturacion.Text) Then
|
||||
CargaDatos()
|
||||
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
End If
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddPlanesDatos"))
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnModalidad.Value = "U"
|
||||
HdnID.Value = GvRow.DataKey("CvePlanDato")
|
||||
UpDatos.Update()
|
||||
BtnAgregarPlanDatos.Text = "Actualizar"
|
||||
myModalLabel.InnerText = "Actualizar Plan de Datos"
|
||||
DdlProveedorComunicacion.SelectedValueExist(GvRow.DataKey("CveProveedorComunicacion"))
|
||||
TxtPlanDatos.Text = GvRow.DataKey("PlanDato")
|
||||
TxtImporte.Text = GvRow.DataKey("Importe").ToString().FormatoNumero
|
||||
TxtCapacidad.Text = GvRow.DataKey("Capacidad")
|
||||
DDLTipoDatos.SelectedValueExist(GvRow.DataKey("TipoPlan"))
|
||||
TxtCostoAdicional.Text = GvRow.DataKey("CostoAdicional")
|
||||
TxtTechoFacturacion.Text = GvRow.DataKey("TechoFacturacion")
|
||||
divEstatus.Visible = True
|
||||
ChkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
||||
UpAddPlanesDatos.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddPlanesDatos"))
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Agregar()
|
||||
HdnModalidad.Value = "A"
|
||||
UpDatos.Update()
|
||||
BtnAgregarPlanDatos.Text = "Agregar"
|
||||
myModalLabel.InnerText = "Agregar Plan de Datos"
|
||||
TxtPlanDatos.Text = ""
|
||||
TxtImporte.Text = ""
|
||||
TxtCapacidad.Text = ""
|
||||
TxtCostoAdicional.Text = ""
|
||||
TxtTechoFacturacion.Text = ""
|
||||
CargaDdlProveedorComunicacion()
|
||||
ChkEstatus.Checked = True
|
||||
divEstatus.Visible = False
|
||||
UpAddPlanesDatos.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddPlanesDatos"))
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Delete_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjGps As New ClsGPS()
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnID.Value = GvRow.DataKey("CvePlanDato")
|
||||
UpDatos.Update()
|
||||
If ObjGps.PlanesDatosRemove(HdnID.Value) Then
|
||||
CargaDatos()
|
||||
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub LnkPlanesDatos_Click(sender As Object, e As EventArgs) Handles LnkPlanesDatos.Click
|
||||
Agregar()
|
||||
End Sub
|
||||
|
||||
Private Sub GvPlanesDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPlanesDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("Estatus") = True Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
If e.Row.DBCampo("Importe") = True Then
|
||||
e.Row.FCLabel("LblImporte").Text = "$" + e.Row.FCLabel("LblImporte").Text.FormatoNumero()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
123
GPS/CatProveedorComunicacion.aspx
Normal file
123
GPS/CatProveedorComunicacion.aspx
Normal file
@@ -0,0 +1,123 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProveedorComunicacion.aspx.vb" Inherits="GPS_CatProveedorComunicacion" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Compañías Telefónica
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UppAddAcciones" runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkProveedor1" runat="server" Text="Agregar"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ClientIDMode="Static" runat="server" ID="HdnCveProveedorComunicacion" Value="-1" />
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvProveedorComunicacion.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvProveedorComunicacion.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GvProveedorComunicacion" runat="server" GridLines="None" DataKeyNames="CveProveedorComunicacion,CveTipoComunicacion,ProveedorComunicacion,Estatus,FechaIng,CveUsuario,Usuario,APNIP,APNUSER,APNPASS,Correo" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Proveedores De Comunicacion">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="ProveedorComunicacion" ItemStyle-Width="25%" HeaderText="Compañía Telefónica" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="TipoComunicacion" HeaderText="Tipo Comunicación" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Correo" HeaderText="Correo" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'>></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="Comandos">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="Edit_Click" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="Delete_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:HiddenField ID="HdnModalidad" runat="server" Value="A" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%--POPUP AGREGAR--%>
|
||||
<div id="divAddProveedorComunicacion" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddProveedorComunicacion" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel" style="text-align:left" runat="server" >Agregar Compañía Telefónica</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyProveedor" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtProveedor" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVProveedor" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtProveedor" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Compañía Telefónica''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="TxtProveedor" runat="server" Text="Compañía Telefónica:"></asp:Label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtMail" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="5000"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVMail" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtMail" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Correo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="TxtMail" runat="server" Text="Correo:"></asp:Label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlTipoComunicacion" DataValueField="CveTipoComunicacion" DataTextField="TipoComunicacion" runat="server" CssClass="form-control select2me" Width="200px"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDdlTipoComunicacion" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlTipoComunicacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Comunicacion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="DdlTipoComunicacion" runat="server" Text="Tipo de Comunicación:"></asp:Label>
|
||||
</div>
|
||||
<div id="dvEstatusEv" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label>Activo: </label>
|
||||
<br />
|
||||
<asp:Checkbox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px">
|
||||
</asp:Checkbox>
|
||||
</div>
|
||||
<h4>Datos APN</h4>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAPNIP" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||
<asp:Label runat="server" Text="IP/DNS Operador" AssociatedControlID="TxtAPNIP"></asp:Label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAPNUser" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||
<asp:Label runat="server" Text="Usuario" AssociatedControlID="TxtAPNUser"></asp:Label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAPNPass" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||
<asp:Label runat="server" Text="Contraseña" AssociatedControlID="TxtAPNPass"></asp:Label>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarProveedor" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
127
GPS/CatProveedorComunicacion.aspx.vb
Normal file
127
GPS/CatProveedorComunicacion.aspx.vb
Normal file
@@ -0,0 +1,127 @@
|
||||
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class GPS_CatProveedorComunicacion
|
||||
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region " PROPIEDADES"
|
||||
|
||||
#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
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjGps As New ClsGPS()
|
||||
If ObjGps.TipoComunicacionGet() Then
|
||||
DdlTipoComunicacion.DataSource = ObjGps.DtResultados.FiltraParametros("Estatus = 1")
|
||||
End If
|
||||
If ObjGps.ProveedorComunicacion_Get() Then
|
||||
GvProveedorComunicacion.DataSource = ObjGps.DtResultados
|
||||
Else
|
||||
GvProveedorComunicacion.DataSource = Nothing
|
||||
End If
|
||||
ObjGps.Dispose()
|
||||
GvProveedorComunicacion.DataBind()
|
||||
DdlTipoComunicacion.DataBind()
|
||||
DdlTipoComunicacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub BtnAgregarProveedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarProveedor.Click
|
||||
Dim ObjGps As New ClsGPS
|
||||
Dim Estatus = 0
|
||||
Dim correo As String = TxtMail.Text
|
||||
If ChkEstatus.Checked Then Estatus = 1
|
||||
If HdnModalidad.Value = "A" Then
|
||||
If ObjGps.ProveedorComunicacion_Add(TxtProveedor.Text, Estatus, UsuarioActual.CveUsuario, DdlTipoComunicacion.SelectedValue.ToEntero(), TxtAPNIP.Text, TxtAPNUser.Text, TxtAPNPass.Text, correo) Then
|
||||
CargaDatos()
|
||||
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ElseIf HdnModalidad.Value = "U" Then
|
||||
If ObjGps.ProveedorComunicacion_Update(HdnID.Value, TxtProveedor.Text, Estatus, UsuarioActual.CveUsuario, DdlTipoComunicacion.SelectedValue.ToEntero(), TxtAPNIP.Text, TxtAPNUser.Text, TxtAPNPass.Text, correo) Then
|
||||
CargaDatos()
|
||||
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
End If
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddProveedorComunicacion"))
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnModalidad.Value = "U"
|
||||
HdnID.Value = GvRow.DataKey("CveProveedorComunicacion")
|
||||
UpDatos.Update()
|
||||
BtnAgregarProveedor.Text = "Actualizar"
|
||||
myModalLabel.InnerText = "Actualizar Proveedor de Comunicacion"
|
||||
TxtProveedor.Text = GvRow.DataKey("ProveedorComunicacion")
|
||||
TxtMail.Text = GvRow.DataKey("Correo")
|
||||
TxtAPNIP.Text = GvRow.DataKey("APNIP")
|
||||
TxtAPNUser.Text = GvRow.DataKey("APNUSER")
|
||||
TxtAPNPass.Text = GvRow.DataKey("APNPASS")
|
||||
DdlTipoComunicacion.SelectedValueExist(GvRow.DataKey("CveTipoComunicacion"))
|
||||
dvEstatusEv.Visible = True
|
||||
chkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
||||
UpAddProveedorComunicacion.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddProveedorComunicacion"))
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Agregar()
|
||||
HdnModalidad.Value = "A"
|
||||
UpDatos.Update()
|
||||
BtnAgregarProveedor.Text = "Agregar"
|
||||
myModalLabel.InnerText = "Agregar Proveedor de Comunicacion"
|
||||
TxtProveedor.Text = ""
|
||||
TxtMail.Text = ""
|
||||
TxtAPNIP.Text = ""
|
||||
TxtAPNUser.Text = ""
|
||||
TxtAPNPass.Text = ""
|
||||
chkEstatus.Checked = True
|
||||
dvEstatusEv.Visible = False
|
||||
UpAddProveedorComunicacion.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddProveedorComunicacion"))
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Delete_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjGps As New ClsGPS()
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnID.Value = GvRow.DataKey("CveProveedorComunicacion")
|
||||
UpDatos.Update()
|
||||
If ObjGps.Proveedor_Delete(HdnID.Value) Then
|
||||
CargaDatos()
|
||||
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub LnkProveedor1_Click(sender As Object, e As EventArgs) Handles LnkProveedor1.Click
|
||||
Agregar()
|
||||
End Sub
|
||||
|
||||
Private Sub GvTipoComunicacion_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvProveedorComunicacion.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("Estatus") = True Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
183
GPS/CatProveedoresComunicacionCuentas.aspx
Normal file
183
GPS/CatProveedoresComunicacionCuentas.aspx
Normal file
@@ -0,0 +1,183 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatProveedoresComunicacionCuentas.aspx.vb" Inherits="GPS_CatProveedoresComunicacionCuentas" %>
|
||||
|
||||
<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">
|
||||
Lineas de Teléfono
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UppAddAcciones" runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkProveedor1" runat="server" Text="Agregar"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ClientIDMode="Static" runat="server" ID="HdnCveProveedoresComunicacionCuentas" Value="-1" />
|
||||
<div class="text-right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="FiltrarTabla('TxtBusqueda','GvProveedorComunicacionCuenta')" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="FiltrarTabla('TxtBusqueda','GvProveedorComunicacionCuenta')" style="background-color: #dddddd;" class="btn btn-circle btn-sm "><i class="icon-magnifier"></i></a>
|
||||
|
||||
</div>
|
||||
<table id="theader" class="Widthall">
|
||||
<tr>
|
||||
<th>Compañía Telefónica</th>
|
||||
<th>Plan de Datos</th>
|
||||
<th>SSID</th>
|
||||
<th>IP</th>
|
||||
<th>Número de Télefono</th>
|
||||
<th>Cliente Asignado</th>
|
||||
<th>Resguardante</th>
|
||||
<th>GPS</th>
|
||||
<th>Comandos</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<asp:DropDownList ID="DdlFiltroCompañia" AutoPostBack="true" DataValueField="CveProveedorComunicacion" DataTextField="ProveedorComunicacion" runat="server" CssClass="form-control select2me" Width="200px">
|
||||
</asp:DropDownList>
|
||||
</th>
|
||||
<th>
|
||||
<asp:DropDownList ID="DdlFiltroPlan" DataValueField="CvePlanDato" DataTextField="PlanDato" runat="server" CssClass="form-control select2me" Width="200px">
|
||||
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th>
|
||||
<asp:DropDownList ID="DdlFiltroCliente" DataValueField="CveCliente" DataTextField="Nombre" runat="server" CssClass="form-control select2me" Width="200px">
|
||||
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</th>
|
||||
<th></th>
|
||||
<th colspan="2" style="text-align: right;">
|
||||
<asp:LinkButton ID="LbFiltrar" OnClick="LbFiltrar_Click" runat="server" CausesValidation="true" CssClass=" btn btn-consultar " Text="Consultar" ValidationGroup="GrpFiltrar"></asp:LinkButton>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="GvProveedorComunicacionCuenta" runat="server" GridLines="None" data-tableheader="#theader" data-rows="0" ToolTip="Listado De Cuentas De Proveedores De Comunicacion" ShowHeader="false"
|
||||
CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD " AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ClientIDMode="Static" CellSpacing="0"
|
||||
DataKeyNames="CveProveedorComunicacionCuenta,IP,SSID,NumeroTelefono,CveProveedorComunicacion,CvePlanDato,Estatus,FechaIng,CveUsuario,ProveedorComunicacion,PlanDato,Usuario,CveEmpresa,Imei,CveUsuarioResguardante">
|
||||
<Columns>
|
||||
|
||||
<asp:BoundField DataField="ProveedorComunicacion" HeaderText="Compañía Telefónica" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="PlanDato" HeaderText="Plan de Datos" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="SSID" HeaderText="SSID" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="IP" HeaderText="IP" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="NumeroTelefono" HeaderText="Número de Télefono" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Cliente" HeaderText="Cliente Asignado" NullDisplayText="No Asignado" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Resguardante" HeaderText="Resguardante" NullDisplayText="No Asignado" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<asp:HyperLinkField HeaderText="GPS" DataTextField="NombreVehiculo" DataNavigateUrlFields="CveDispositivo" DataNavigateUrlFormatString="/GPS/Vehiculos.aspx?CveDispositivo={0}" />
|
||||
<asp:BoundField DataField="FechaIng" Visible="false" HeaderText="Fecha Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" Visible="false" HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'>></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="Edit_Click" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="Delete_Click" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:HiddenField ID="HdnModalidad" runat="server" Value="A" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%--POPUP AGREGAR--%>
|
||||
<div id="divAddProveedorComunicacionCuenta" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddProveedorComunicacionCuenta" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel" style="text-align: left" runat="server">Agregar Linea de Teléfono</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyProveedorComunicacionCuenta" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlProveedorComunicacion" AutoPostBack="true" DataValueField="CveProveedorComunicacion" DataTextField="ProveedorComunicacion" runat="server" CssClass="form-control select2me" Width="100%">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVProveedor" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlProveedorComunicacion" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Proveedor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="DdlProveedorComunicacion" runat="server" Text="Compañía Telefónica:"></asp:Label>
|
||||
</div>
|
||||
<asp:Panel runat="server" id="PnlPlanDatos" class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlPlanDatos" DataValueField="CvePlanDato" DataTextField="PlanDato" runat="server" CssClass="form-control select2me" Width="200px">
|
||||
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVPlan" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlPlanDatos" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Plan de Datos''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="DdlPlanDatos" runat="server" Text="Plan de Datos:"></asp:Label>
|
||||
</asp:Panel>
|
||||
<asp:Panel runat="server" id="PnlNumero" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtNumeroTelefono" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<ajax:maskededitextender id="MEENumeroTelefono" runat="server" targetcontrolid="TxtNumeroTelefono" clearmaskonlostfocus="false" masktype="None" mask="(999) 999-9999" messagevalidatortip="true" inputdirection="LeftToRight" errortooltipenabled="True"></ajax:maskededitextender>
|
||||
<asp:RequiredFieldValidator ID="RFVNumeroTelefono" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtNumeroTelefono" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Numero de Telefono''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="TxtNumeroTelefono" runat="server" Text="Número de Teléfono:"></asp:Label>
|
||||
</asp:Panel>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtSSID" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="20"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVSSID" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtSSID" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SSID''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="TxtSSID" runat="server" Text="Número SIM(SSID):"></asp:Label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright hidden">
|
||||
<asp:TextBox ID="TxtIP" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="20"></asp:TextBox>
|
||||
<asp:Label AssociatedControlID="TxtIP" runat="server" Text="IP/DNS:"></asp:Label>
|
||||
</div>
|
||||
<asp:Panel runat="server" id="PnlResguardante" Visible="false" class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DDlResguardante" DataValueField="CveUsuario" DataTextField="Usuario" runat="server" CssClass="form-control select2me" Width="200px">
|
||||
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVResguardante" runat="server" CssClass="help-block errorimput" ControlToValidate="DDlResguardante" InitialValue="-1" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Resguardante''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="DDlResguardante" runat="server" Text="Resguardante:"></asp:Label>
|
||||
</asp:Panel>
|
||||
|
||||
<asp:Panel runat="server" id="PnlImei" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtImei" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="40"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVImei" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtImei" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Imei''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:Label AssociatedControlID="TxtImei" runat="server" Text="Imei:"></asp:Label>
|
||||
</asp:Panel>
|
||||
<div id="divEstatus" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label>Activo: </label>
|
||||
<br />
|
||||
<asp:CheckBox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkReMailActiv" OnClick="LnkReMailActiv_Click" runat="server" CssClass="btn btn-success" ValidationGroup="GrpObligatorio"> <i class='fa fa-envelope'></i> Reenviar </asp:LinkButton>
|
||||
<asp:LinkButton ID="LnkActivar" OnClick="LnkActivar_Click" runat="server" CssClass="btn btn-success" ValidationGroup="GrpObligatorio"> <i class='fa fa-envelope'></i> Activar</asp:LinkButton>
|
||||
<asp:LinkButton ID="BtnAgregarProveedorComunicacionCuenta" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
320
GPS/CatProveedoresComunicacionCuentas.aspx.vb
Normal file
320
GPS/CatProveedoresComunicacionCuentas.aspx.vb
Normal file
@@ -0,0 +1,320 @@
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class GPS_CatProveedoresComunicacionCuentas
|
||||
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(541) = "1" Then
|
||||
PnlPlanDatos.Visible = False
|
||||
PnlNumero.Visible = False
|
||||
PnlResguardante.Visible = True
|
||||
|
||||
Dim ObjGps As New ClsGPS()
|
||||
ObjGps.GetResGuardantesSim(UsuarioActual.CveEmpresa)
|
||||
DDlResguardante.DataSource = ObjGps.DtResultados
|
||||
ObjGps.Dispose()
|
||||
DDlResguardante.DataBind()
|
||||
DDlResguardante.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
Else
|
||||
PnlPlanDatos.Visible = True
|
||||
PnlNumero.Visible = True
|
||||
PnlResguardante.Visible = False
|
||||
End If
|
||||
CargaDdlProveedoresComunicacion()
|
||||
CargaDdlClientes()
|
||||
CargaDdlCompañia()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjGps As New ClsGPS()
|
||||
Dim CveProveedorComunicacionCuenta As Integer = DdlFiltroCompañia.SelectedValue.ToEntero()
|
||||
Dim CveCliente As Integer = DdlFiltroCliente.SelectedValue.ToEntero()
|
||||
Dim CvePlanDato As Integer = DdlFiltroPlan.SelectedValue.ToEntero()
|
||||
If ObjGps.ProveedoresComunicacionCuentasGet(CveProveedorComunicacionCuenta, UsuarioActual.CveEmpresa, CveCliente, CvePlanDato) Then
|
||||
GvProveedorComunicacionCuenta.DataSource = ObjGps.DtResultados
|
||||
GvProveedorComunicacionCuenta.DataBind()
|
||||
End If
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
#Region "Filtros"
|
||||
|
||||
Private Sub CargaDdlClientes()
|
||||
Dim ObjGps As New ClsClientes()
|
||||
If ObjGps.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, -1, -1) Then
|
||||
DdlFiltroCliente.DataSource = ObjGps.DtResultados
|
||||
DdlFiltroCliente.DataBind()
|
||||
End If
|
||||
DdlFiltroCliente.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Private Sub CargaDdlCompañia()
|
||||
Dim ObjGps As New ClsGPS()
|
||||
If ObjGps.DdlProveedoresComunicacionGet() Then
|
||||
DdlFiltroCompañia.DataSource = ObjGps.DtResultados
|
||||
DdlFiltroCompañia.DataBind()
|
||||
End If
|
||||
|
||||
DdlFiltroCompañia.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
DdlFiltroCompañia.SelectedValue = "-1"
|
||||
CargaDdlPlan()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlFiltroCompañia_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFiltroCompañia.SelectedIndexChanged
|
||||
CargaDdlPlan()
|
||||
End Sub
|
||||
Private Sub CargaDdlPlan()
|
||||
Dim ObjGps As New ClsGPS()
|
||||
If ObjGps.DdlPlanDatosGet(UsuarioActual.CveEmpresa, DdlFiltroCompañia.SelectedValue.ToEntero()) Then
|
||||
DdlFiltroPlan.DataSource = ObjGps.DtResultados
|
||||
DdlFiltroPlan.DataBind()
|
||||
End If
|
||||
DdlFiltroPlan.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
Private Sub CargaDdlProveedoresComunicacion()
|
||||
Dim ObjGps As New ClsGPS()
|
||||
If ObjGps.DdlProveedoresComunicacionGet() Then
|
||||
DdlProveedorComunicacion.DataSource = ObjGps.DtResultados
|
||||
DdlProveedorComunicacion.DataBind()
|
||||
End If
|
||||
|
||||
DdlProveedorComunicacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Protected Sub DdlProveedorComunicacion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedorComunicacion.SelectedIndexChanged
|
||||
CargaDdlPlanDatos()
|
||||
End Sub
|
||||
Private Sub CargaDdlPlanDatos()
|
||||
If DdlProveedorComunicacion.SelectedValue = "-1" Then
|
||||
DdlPlanDatos.Items.Clear()
|
||||
DdlPlanDatos.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
Else
|
||||
Dim ObjGps As New ClsGPS()
|
||||
If ObjGps.DdlPlanDatosGet(UsuarioActual.CveEmpresa, DdlProveedorComunicacion.SelectedValue.ToEntero) Then
|
||||
DdlPlanDatos.DataSource = ObjGps.DtResultados
|
||||
DdlPlanDatos.DataBind()
|
||||
End If
|
||||
DdlPlanDatos.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BtnAgregarProveedorComunicacionCuenta_Click(sender As Object, e As EventArgs) Handles BtnAgregarProveedorComunicacionCuenta.Click
|
||||
Dim ObjGps As New ClsGPS
|
||||
Dim Estatus = 0
|
||||
Dim numeroTelefono As String = TxtNumeroTelefono.Text.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", "")
|
||||
Dim Imei As String = TxtImei.Text
|
||||
Dim CveUsuarioResguardante As Integer = DDlResguardante.SelectedValue.ToEntero()
|
||||
If chkEstatus.Checked Then Estatus = 1
|
||||
|
||||
If HdnModalidad.Value = "A" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(541) = "1" Then
|
||||
Estatus = 0
|
||||
End If
|
||||
If ObjGps.ProveedoresComunicacionCuentasAdd(DdlProveedorComunicacion.SelectedValue, DdlPlanDatos.SelectedValue, UsuarioActual.CveUsuario, TxtIP.Text, TxtSSID.Text, numeroTelefono, Estatus, UsuarioActual.CveEmpresa, Imei, CveUsuarioResguardante) Then
|
||||
CargaDatos()
|
||||
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ElseIf HdnModalidad.Value = "U" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(541) = "1" And Estatus = 0 And Imei.Trim().Length > 0 Then
|
||||
envirCorreoActivacion()
|
||||
Estatus = 1
|
||||
End If
|
||||
If ObjGps.ProveedoresComunicacionCuentasUpdate(HdnID.Value, DdlProveedorComunicacion.SelectedValue, DdlPlanDatos.SelectedValue, UsuarioActual.CveUsuario, TxtIP.Text, TxtSSID.Text, numeroTelefono, Estatus, UsuarioActual.CveEmpresa, Imei, CveUsuarioResguardante) Then
|
||||
CargaDatos()
|
||||
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
End If
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddProveedorComunicacionCuenta"))
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
If UsuarioActual.Empresa.Funcionalidad(541) = "1" Then
|
||||
PnlNumero.Visible = False
|
||||
PnlPlanDatos.Visible = False
|
||||
Else
|
||||
PnlNumero.Visible = True
|
||||
End If
|
||||
TxtSSID.Enabled = True
|
||||
TxtImei.Enabled = True
|
||||
DdlProveedorComunicacion.Enabled = True
|
||||
LnkActivar.Visible = False
|
||||
LnkReMailActiv.Visible = False
|
||||
HdnModalidad.Value = "U"
|
||||
HdnID.Value = GvRow.DataKey("CveProveedorComunicacionCuenta")
|
||||
UpDatos.Update()
|
||||
BtnAgregarProveedorComunicacionCuenta.Text = "Actualizar"
|
||||
myModalLabel.InnerText = "Actualizar Linea de Teléfono"
|
||||
DdlProveedorComunicacion.SelectedValueExist(GvRow.DataKey("CveProveedorComunicacion"))
|
||||
CargaDdlPlanDatos()
|
||||
DdlPlanDatos.SelectedValueExist(GvRow.DataKey("CvePlanDato"))
|
||||
TxtIP.Text = GvRow.DataKey("IP")
|
||||
TxtSSID.Text = GvRow.DataKey("SSID")
|
||||
TxtNumeroTelefono.Text = GvRow.DataKey("NumeroTelefono")
|
||||
chkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
||||
UpAddProveedorComunicacionCuenta.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddProveedorComunicacionCuenta"))
|
||||
DDlResguardante.Enabled = False
|
||||
If UsuarioActual.Empresa.Funcionalidad(541) = "1" Then
|
||||
PnlImei.Visible = True
|
||||
divEstatus.Visible = False
|
||||
DDlResguardante.SelectedValueExist(GvRow.DataKey("CveUsuarioResguardante"))
|
||||
TxtImei.Text = GvRow.DataKey("Imei")
|
||||
PnlPlanDatos.Visible = True
|
||||
If chkEstatus.Checked Then
|
||||
If TxtImei.Text.Length = 0 Then TxtImei.Text = "-"
|
||||
TxtSSID.Enabled = False
|
||||
TxtImei.Enabled = False
|
||||
DdlProveedorComunicacion.Enabled = False
|
||||
LnkReMailActiv.Visible = True
|
||||
PnlNumero.Visible = True
|
||||
Else
|
||||
LnkActivar.Visible = TxtImei.Text.Length > 0
|
||||
End If
|
||||
Else
|
||||
PnlImei.Visible = False
|
||||
divEstatus.Visible = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub Agregar()
|
||||
HdnModalidad.Value = "A"
|
||||
LnkActivar.Visible = False
|
||||
If UsuarioActual.Empresa.Funcionalidad(541) = "1" Then
|
||||
PnlNumero.Visible = False
|
||||
PnlPlanDatos.Visible = False
|
||||
Else
|
||||
PnlNumero.Visible = True
|
||||
End If
|
||||
UpDatos.Update()
|
||||
DdlProveedorComunicacion.Enabled = True
|
||||
TxtSSID.Enabled = True
|
||||
TxtImei.Enabled = True
|
||||
PnlImei.Visible = False
|
||||
LnkReMailActiv.Visible = False
|
||||
BtnAgregarProveedorComunicacionCuenta.Text = "Agregar"
|
||||
myModalLabel.InnerText = "Agregar Linea de Teléfono"
|
||||
TxtIP.Text = ""
|
||||
TxtSSID.Text = ""
|
||||
TxtNumeroTelefono.Text = ""
|
||||
CargaDdlProveedoresComunicacion()
|
||||
DDlResguardante.Enabled = True
|
||||
CargaDdlPlanDatos()
|
||||
chkEstatus.Checked = True
|
||||
divEstatus.Visible = False
|
||||
UpAddProveedorComunicacionCuenta.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddProveedorComunicacionCuenta"))
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Delete_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjGps As New ClsGPS()
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnID.Value = GvRow.DataKey("CveProveedorComunicacionCuenta")
|
||||
UpDatos.Update()
|
||||
If ObjGps.ProveedoresComunicacionCuentasRemove(HdnID.Value) Then
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub LnkProveedor1_Click(sender As Object, e As EventArgs) Handles LnkProveedor1.Click
|
||||
Agregar()
|
||||
End Sub
|
||||
|
||||
Private Sub GvProveedorComunicacionCuenta_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvProveedorComunicacionCuenta.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("Estatus") = True Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LbFiltrar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Private Sub EnvirCorreoActivacion()
|
||||
Dim Bodycorreo As New StringBuilder()
|
||||
Bodycorreo.AppendLine("Hola, buen día. Espero que se encuentren muy bien. <br>")
|
||||
Bodycorreo.AppendLine("A traves del presente solicitamos la activación del siguiente SIM: <br><br>")
|
||||
Bodycorreo.AppendLine($"SSID: {TxtSSID.Text } <br>")
|
||||
Bodycorreo.AppendLine($"IMEI: {TxtImei.Text } <br> ")
|
||||
Bodycorreo.AppendLine($"Plan de datos: {DdlPlanDatos.SelectedItem.Text } <br> <br>")
|
||||
Bodycorreo.AppendLine("Espero correo de confirmación. <br> <br>")
|
||||
Bodycorreo.AppendLine("")
|
||||
Bodycorreo.AppendLine("")
|
||||
Bodycorreo.AppendLine("Gracias, <br>")
|
||||
Bodycorreo.AppendLine("Quedamos a sus ordenes, <br>")
|
||||
Bodycorreo.AppendLine("Saludos. <br>")
|
||||
Dim Asunto As String = "Activación SIM"
|
||||
Dim ObjMail As New ClsSisMail()
|
||||
',
|
||||
|
||||
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||
Dim oEm As New Empresa
|
||||
If ObjEmpresa.GetEmpresas(2, "-1", "-1", "-1", "-1") Then
|
||||
oEm = ObjEmpresa.Empresa
|
||||
End If
|
||||
ObjEmpresa.Dispose()
|
||||
|
||||
Dim ObjGPS As New ClsGPS()
|
||||
ObjGPS.ProveedorComunicacion_Get()
|
||||
Dim DT As DataTable = ObjGPS.DtResultados.FiltraParametros(String.Format("CveProveedorComunicacion= {0}", DdlProveedorComunicacion.SelectedValue))
|
||||
Dim Correo As String = "julian@adssistemas.mx;paola@adssistemas.mx;julian@localizacionprecisa.com;paola@localizacionprecisa.com;" & UsuarioActual.Usuario
|
||||
If DT.Rows.Count > 0 Then
|
||||
Correo &= String.Format(";{0}", DT.Rows(0)("Correo").ToString())
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
ObjMail.SendMail(oEm, Correo, Asunto, Bodycorreo.ToString(), "")
|
||||
|
||||
|
||||
End Sub
|
||||
Protected Sub LnkActivar_Click(sender As Object, e As EventArgs)
|
||||
envirCorreoActivacion()
|
||||
Dim ObjGps As New ClsGPS
|
||||
Dim Estatus = 1
|
||||
Dim numeroTelefono As String = TxtNumeroTelefono.Text.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", "")
|
||||
Dim Imei As String = TxtImei.Text
|
||||
Dim CveUsuarioResguardante As Integer = DDlResguardante.SelectedValue.ToEntero()
|
||||
|
||||
If ObjGps.ProveedoresComunicacionCuentasUpdate(HdnID.Value, DdlProveedorComunicacion.SelectedValue, DdlPlanDatos.SelectedValue, UsuarioActual.CveUsuario, TxtIP.Text, TxtSSID.Text, numeroTelefono, Estatus, UsuarioActual.CveEmpresa, Imei, CveUsuarioResguardante) Then
|
||||
CargaDatos()
|
||||
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddProveedorComunicacionCuenta"))
|
||||
ObjGps.Dispose()
|
||||
End Sub
|
||||
Protected Sub LnkReMailActiv_Click(sender As Object, e As EventArgs)
|
||||
envirCorreoActivacion()
|
||||
Alert("Solicitud de reactivacion enviada.")
|
||||
End Sub
|
||||
End Class
|
||||
279
GPS/CatRemisionesVehiculos.aspx
Normal file
279
GPS/CatRemisionesVehiculos.aspx
Normal file
@@ -0,0 +1,279 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="CatRemisionesVehiculos.aspx.vb" Inherits="GPS_CatRemisionesVehiculos" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
html, body, #map {
|
||||
width: 100%;
|
||||
height: 93%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#map {
|
||||
position: fixed !important;
|
||||
}
|
||||
|
||||
.pac-container.pac-logo {
|
||||
z-index: 100000;
|
||||
}
|
||||
.modalPopup {
|
||||
top:132px !important;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="H" ID="Content9" runat="server">
|
||||
<li>
|
||||
<a ID="BtnDir" OnClick="$('#dvConsulta').modal({ backdrop: 'static', keyboard: false });">
|
||||
<i class='fa fa-search'></i><span>Ver Remisiones</span>
|
||||
</a>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<div id="map"></div>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UPModalBusqueda">
|
||||
<ContentTemplate>
|
||||
<div id="dvConsulta" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UPConsulta" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel2" runat="server"><i class="fa fa-bell-o"></i> Remisiones Activas</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="padding: 0px 10px 0px 10px !important">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional" ID="UpCuentasComunicacion">
|
||||
<ContentTemplate>
|
||||
<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="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRemisiones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRemisiones.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvRemisiones" runat="server" GridLines="None" DataKeyNames="FolioRemision, TrackingNumber, NumeroRemolque,NoEconomico, Posicion, Estatus, CveEstatus, CveRemision, CveDispositivo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-heightfijo="100" data-height="175" data-sort="false" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="FolioRemision" ItemStyle-Width="33%" HeaderText="Folio" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="33%" HeaderText="No. Económico" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Estatus" HeaderText="Estatus" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="7%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" HeaderText="Eliminar" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="7%" HeaderText="Historial" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgHistorial" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" OnClick="imgHistorial_Click" CssClass="btn btn-circle btn-sm yellow" Text="<i class='fa fa-book'></i>" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel1">
|
||||
<ContentTemplate>
|
||||
<div id="dvHistorico" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpHistorico" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="H1" runat="server"><i class="fa fa-bell-o"></i>Historial Remision: </h4>
|
||||
</div>
|
||||
<div class="modal-body" >
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional" ID="UpdatePanel3">
|
||||
<ContentTemplate>
|
||||
<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="TxtBusquedaHist" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRemisiones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRemisiones.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GVHistorico" runat="server" GridLines="None" DataKeyNames="FolioRemision, NoEconomico, CveEstatus" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-heightfijo="100" data-height="100" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="FolioRemision" ItemStyle-Width="30%" HeaderStyle-HorizontalAlign="center" HeaderText="Folio" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="30%" HeaderStyle-HorizontalAlign="center" HeaderText="No. Económico" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:BoundField DataField="Estatus" HeaderText="Estatus" HeaderStyle-HorizontalAlign="center" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:HyperLinkField DataNavigateUrlFields="Lat,Lon" HeaderStyle-HorizontalAlign="center" Target="_blank" Text="Ir" HeaderText="Google Maps" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="left" DataNavigateUrlFormatString="https://www.google.com/maps/search/{0},{1}/"/>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<asp:Button ID="BtnMostrarContrato" runat="server" Style="visibility: hidden; display: none;" />
|
||||
<asp:Button ID="BtnCerrarContrato" runat="server" CssClass="btn btn-danger" Style="visibility: hidden; display: none;" />
|
||||
|
||||
<Ajax:ModalPopupExtender ID="MPContrato" runat="server" PopupControlID="PanelContrato" TargetControlID="BtnMostrarContrato"
|
||||
CancelControlID="BtnCerrarContrato" BackgroundCssClass="modalBackground">
|
||||
</Ajax:ModalPopupExtender>
|
||||
<asp:Panel ID="PanelContrato" runat="server" CssClass="modalPopup" align="center" Style="display: none; padding: 10px;">
|
||||
|
||||
<asp:UpdatePanel ID="UpContratos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="AccionContrato" runat="server" style="background-color: white;width:280px;border-color: black;border-width: 1.7px;border-style: solid;">
|
||||
<h5> <b> Actualizar Remisión </b></h5>
|
||||
<div class="row">
|
||||
<div class="form-group form-md-line-input input-iconright" style="width:50%">
|
||||
<asp:TextBox ID="TxtTracking" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtTracking.ClientID.ToString()%>">Tracking Number:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright" style="width:50%">
|
||||
<asp:TextBox ID="TxtNoRemolque" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtNoRemolque.ClientID.ToString()%>">Número remolque:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<asp:Label style=" top: 0;margin-bottom: 0;font-size: 13px;color: #888888; opacity: 1;" runat="server" Text="Estatus"></asp:Label>
|
||||
<br />
|
||||
<asp:DropDownList ID="DdlEstatus" DataValueField="CveEstatus" DataTextField="Estatus" runat="server" CssClass="form-control" Width="80%">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<%--<asp:RadioButtonList ID="RblOpcionContrato" runat="server" CssClass="rbl" RepeatDirection="Horizontal" RepeatLayout="Table">
|
||||
<asp:ListItem Text="Si" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="No" Value="1"></asp:ListItem>
|
||||
</asp:RadioButtonList>--%>
|
||||
<br />
|
||||
|
||||
<asp:LinkButton ID="BtnActualizarEstatus" onclick="BtnActualizarEstatus_Click" runat="server" CssClass="btn btn-success" Text="Aceptar" />
|
||||
<asp:LinkButton ID="BtnCancelar" onclick="BtnCancelar_Click" runat="server" CssClass="btn btn-danger" Text="Cancelar" />
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Panel>
|
||||
|
||||
<%--<asp:UpdatePanel runat="server" ID="UP">
|
||||
<ContentTemplate>
|
||||
<asp:Button runat="server" ID="BtnCargar" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>--%>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
var image = '/Imagenes/rsz_11rsz_car.png';
|
||||
var geocoder;
|
||||
var uluru = { lat: 29.0730, lng: -110.9559 };
|
||||
var map;
|
||||
var directionsService;
|
||||
var directionsDisplay;
|
||||
|
||||
|
||||
|
||||
function initMap() {
|
||||
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: uluru,
|
||||
zoom: 13
|
||||
});
|
||||
|
||||
google.maps.event.addListener(map, "click", function (event) {
|
||||
closeLastOpenedInfoWindow();
|
||||
});
|
||||
|
||||
$("#SideNav").removeClass("nav-is-visible");
|
||||
directionsService = new google.maps.DirectionsService;
|
||||
directionsDisplay = new google.maps.DirectionsRenderer;
|
||||
directionsDisplay.setOptions({ suppressMarkers: true });
|
||||
geocoder = new google.maps.Geocoder();
|
||||
directionsDisplay.setMap(map);
|
||||
$("#dvConsulta").modal({ backdrop: 'static', keyboard: false });
|
||||
}
|
||||
|
||||
var markers = [];
|
||||
var lastOpenedInfoWindow;
|
||||
function CreaMarcador(coords, nomEquipo, ContentString, imagen) {
|
||||
DeleteMarkers();
|
||||
if (typeof imagen === 'undefined') { imagen = image; }
|
||||
var marker = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: map,
|
||||
icon: imagen
|
||||
});
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: ContentString
|
||||
});
|
||||
marker.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
infowindow.open(map, marker);
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
});
|
||||
markers.push(marker);
|
||||
map.setCenter(coords);
|
||||
}
|
||||
|
||||
function fitBoundsToVisibleMarkers() {
|
||||
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].getVisible()) {
|
||||
bounds.extend(markers[i].getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
map.fitBounds(bounds);
|
||||
|
||||
}
|
||||
|
||||
function DeleteMarkers() {
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
markers = [];
|
||||
|
||||
}
|
||||
|
||||
function closeLastOpenedInfoWindow() {
|
||||
if (lastOpenedInfoWindow) {
|
||||
lastOpenedInfoWindow.close();
|
||||
}
|
||||
}
|
||||
function DeleteMarkers() {
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
markers = [];
|
||||
directionsDisplay.setMap(null);
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
initMap();
|
||||
$('#C_BtnCargar').click();
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places">
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
124
GPS/CatRemisionesVehiculos.aspx.vb
Normal file
124
GPS/CatRemisionesVehiculos.aspx.vb
Normal file
@@ -0,0 +1,124 @@
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Partial Class GPS_CatRemisionesVehiculos
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DTEquipos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTEquipos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTEquipos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property Coordenada As String
|
||||
Get
|
||||
Return CType(ViewState("Coordenada"), String)
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Coordenada") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveRemision As Integer
|
||||
Get
|
||||
Return CType(ViewState("Coordenada"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("Coordenada") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjTSoft As New ClsTSoft
|
||||
If ObjTSoft.GetRemisiones(UsuarioActual.CveCliente) Then
|
||||
GvRemisiones.DataSource = ObjTSoft.DtResultados
|
||||
Else
|
||||
GvRemisiones.DataSource = Nothing
|
||||
End If
|
||||
If ObjTSoft.GetEstatusRemisiones() Then
|
||||
DdlEstatus.DataSource = ObjTSoft.DtResultados
|
||||
End If
|
||||
|
||||
ObjTSoft.Dispose()
|
||||
DdlEstatus.DataBind()
|
||||
GvRemisiones.DataBind()
|
||||
UPConsulta.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvRemisiones_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvRemisiones.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Coordenada = SQLToGmaps(e.Row.DBCampo("Posicion"), "POINT")
|
||||
e.Row.FCLinkButton("imgE").CommandArgument = e.Row.DBCampo("CveRemision").ToString
|
||||
e.Row.Attributes.Add("onClick", $"CreaMarcador({Coordenada}, '{e.Row.DBCampo("NoEconomico")}', ' ');")
|
||||
End If
|
||||
End Sub
|
||||
Private Function SQLToGmaps(CoordsSQL As String, Tipo As String) As String
|
||||
Dim CoordsPoligono As String = CoordsSQL.Replace($"{Tipo}", "").Replace(")", "").Replace("(", "")
|
||||
Dim CoordsPuntos() As String = CoordsPoligono.Split(","c)
|
||||
Dim Var As String = ""
|
||||
If CoordsPuntos.Length > 0 Then
|
||||
For Each coordenada As String In CoordsPuntos
|
||||
If coordenada Is CoordsPuntos.Last Then
|
||||
Dim latlng() As String = coordenada.Trim.Split(" "c)
|
||||
If coordenada IsNot Nothing AndAlso coordenada <> "" AndAlso latlng IsNot Nothing AndAlso latlng.Count > 1 Then Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }}"
|
||||
Else
|
||||
Dim latlng() As String = coordenada.Trim.Split(" "c)
|
||||
If coordenada IsNot Nothing AndAlso coordenada <> "" AndAlso latlng IsNot Nothing AndAlso latlng.Count > 1 Then Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }},"
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Return Var
|
||||
End Function
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveRemision = Boton.CommandArgument.ToEntero
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
TxtNoRemolque.Text = GvRow.DataKey("NumeroRemolque").ToString
|
||||
TxtTracking.Text = GvRow.DataKey("TrackingNumber").ToString
|
||||
DdlEstatus.SelectedValueExist(GvRow.DataKey("CveEstatus"))
|
||||
RegistraScript("$('#C_BtnMostrarContrato').click();")
|
||||
UpContratos.Update()
|
||||
End Sub
|
||||
Protected Sub BtnActualizarEstatus_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjSoft As New ClsTSoft
|
||||
Dim TrackingNo As String = If(TxtTracking.Text <> "", TxtTracking.Text, "-1")
|
||||
Dim NumRemolque As String = If(TxtNoRemolque.Text <> "", TxtNoRemolque.Text, "-1")
|
||||
|
||||
If ObjSoft.UpdateEstatusRemisiones(CveRemision, DdlEstatus.SelectedValue.ToEntero, TrackingNo, NumRemolque) Then
|
||||
Alert("El estatus se actualizó correctamente")
|
||||
End If
|
||||
TxtNoRemolque.Text = ""
|
||||
TxtTracking.Text = ""
|
||||
ObjSoft.Dispose()
|
||||
CargaDatos()
|
||||
RegistraScript("$('#C_BtnCerrarContrato').click();")
|
||||
End Sub
|
||||
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs)
|
||||
RegistraScript("$('#C_BtnCerrarContrato').click();")
|
||||
End Sub
|
||||
Protected Sub imgHistorial_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjSoft As New ClsTSoft
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
CveRemision = Boton.CommandArgument.ToEntero
|
||||
If ObjSoft.GETRemisionesHistorial(GvRow.DataKey("FolioRemision").ToString, GvRow.DataKey("NoEconomico").ToString) Then
|
||||
GVHistorico.DataSource = ObjSoft.DtResultados
|
||||
End If
|
||||
ObjSoft.Dispose()
|
||||
H1.InnerText = $"Histórico Remisión: {GvRow.DataKey("FolioRemision").ToString} "
|
||||
GVHistorico.DataBind()
|
||||
UpHistorico.Update()
|
||||
RegistraScript("$('#dvHistorico').modal();")
|
||||
End Sub
|
||||
End Class
|
||||
261
GPS/CatReportesProgramados.aspx
Normal file
261
GPS/CatReportesProgramados.aspx
Normal file
@@ -0,0 +1,261 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatReportesProgramados.aspx.vb" Inherits="GPS_CatReportesProgramados" %>
|
||||
|
||||
<%@ Register Assembly="TimePicker" Namespace="MKB.TimePicker" TagPrefix="cc1" %>
|
||||
<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">
|
||||
Reportes Programados
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel ID="UpLnkAgregar" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="linkAgregar" runat="server"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveReporte,CveReporteProgramado,TinyFrecuencia,Intervalo,FechaI,FechaF,HoraEnvio,Correos,NombreDia,Formato" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Reporte" HeaderText="Reporte" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Frecuencia" HeaderText="Frecuencia" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Formato" HeaderText="Formato" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Intervalo" HeaderText="Intervalo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaI" DataFormatString="{0:d}" HeaderText="Fecha I" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaF" DataFormatString="{0:d}" HeaderText="Fecha F" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="HoraEnvio" HeaderText="Envío" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Correos" HeaderText="Correos" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" style="width: 600px;" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button id="btnCerrar" runat="server" visible="false" type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Configurar Reporte Programado</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyEstatus" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div id="DivExtras" class="col-md-4" runat="server" visible="false">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px" align="left">
|
||||
<input type="text" id="TxtBusquedaExtras" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaExtras','{0}')", GvExtras.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaExtras','{0}')", GvExtras.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpExtras" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvExtras" runat="server" GridLines="None" DataKeyNames="Cve" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-heightfijo="300" data-height="300" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<asp:CheckBox ID="checkAll" type="checkbox" runat="server" />
|
||||
</HeaderTemplate>
|
||||
<HeaderStyle Width="60px" HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="Chk" class="Extras" runat="server" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="60px" HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Nombre" HeaderText="Nombre" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div id="DivCuerpo" runat="server" class="col-md-6" style="border-left: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5;">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin-bottom: 10px;">
|
||||
<asp:DropDownList CssClass="form-control" ID="DdlReporte" AutoPostBack="true" DataValueField="CveReporte" DataTextField="Reporte" runat="server" Width="100%" />
|
||||
<label for="<%= DdlReporte.ClientID.ToString()%>">Reporte:</label>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group input-iconright">
|
||||
<label style="color: #888888;" for="<%= DdlFrecuencia.ClientID.ToString()%>">Frecuencia:</label>
|
||||
<asp:DropDownList CssClass="form-control" ID="DdlFrecuencia" runat="server" AutoPostBack="true" Height="24px" Width="100px">
|
||||
<asp:ListItem Value="D" Text="Diario" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Value="S" Text="Semanal"></asp:ListItem>
|
||||
<asp:ListItem Value="M" Text="Mensual"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-6 form-group input-iconright">
|
||||
<label style="color: #888888;" for="<%= DdlFormato.ClientID.ToString()%>">Formato:</label>
|
||||
<asp:DropDownList CssClass="form-control" ID="DdlFormato" runat="server" Height="24px" Width="100px">
|
||||
<asp:ListItem Value="PDF" Text="PDF" Selected="True"></asp:ListItem>
|
||||
<asp:ListItem Value="Excel" Text="Excel"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div id="DivIntervalo" runat="server" visible="false" class="col-md-4 form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtIntervalo" CssClass="form-control" runat="server" MaxLength="3"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ID="REVIntervalo" runat="server" Display="None" ValidationExpression="\d+" ControlToValidate="TxtIntervalo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Intervalo''</b> solo admite números." ValidationGroup="GrpObligatorio"></asp:RegularExpressionValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEIntervalo" runat="server" HighlightCssClass="vco" TargetControlID="REVIntervalo" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="None" ControlToValidate="TxtIntervalo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Intervalo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= TxtIntervalo.ClientID.ToString()%>">Intervalo:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="DivDia" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
|
||||
<asp:CheckBoxList ID="ChkDiasSemana" runat="server" RepeatDirection="Horizontal">
|
||||
<asp:ListItem Value="LU" Text="Lun"></asp:ListItem>
|
||||
<asp:ListItem Value="MA" Text="Mar"></asp:ListItem>
|
||||
<asp:ListItem Value="MI" Text="Mie"></asp:ListItem>
|
||||
<asp:ListItem Value="JU" Text="Jue"></asp:ListItem>
|
||||
<asp:ListItem Value="VI" Text="Vie"></asp:ListItem>
|
||||
<asp:ListItem Value="SA" Text="Sab"></asp:ListItem>
|
||||
<asp:ListItem Value="DO" Text="Dom"></asp:ListItem>
|
||||
</asp:CheckBoxList>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="DivHoras" runat="server" visible="false" class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= TxtHoraInicio.ClientID.ToString() %>" style="font-size: 13px; color: #888888;">Rango de Horario:</label>
|
||||
<div class="row">
|
||||
<div class="col-md-4 form-group form-md-line-input input-iconright">
|
||||
<cc1:TimeSelector ID="TxtHoraInicio" runat="server" DisplaySeconds="false" DisplayButtons="false">
|
||||
</cc1:TimeSelector>
|
||||
<asp:CustomValidator ID="CVHoraInicio" runat="server" ControlToValidate="TxtHoraInicio" Display="None" ErrorMessage="El campo <b>''Hora''</b> es necesario, por favor seleccione la hora correcta." ValidationGroup="GrpObligatorio" ValidateEmptyText="true"></asp:CustomValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VcoHoraInicio" runat="server" HighlightCssClass="vco" TargetControlID="CVHoraInicio" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 form-group form-md-line-input input-iconright">
|
||||
<cc1:TimeSelector ID="TxtHoraFin" runat="server" Style="" DisplaySeconds="false" DisplayButtons="false">
|
||||
</cc1:TimeSelector>
|
||||
<asp:CustomValidator ID="CVHoraFin" runat="server" ControlToValidate="TxtHoraFin" Display="None" ErrorMessage="El campo <b>''Hora''</b> es necesario, por favor seleccione la hora correcta." ValidationGroup="GrpObligatorio" ValidateEmptyText="true"></asp:CustomValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VcoHoraFin" runat="server" HighlightCssClass="vco" TargetControlID="CVHoraFin" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= txtFechaI.ClientID.ToString() %>" style="font-size: 13px; color: #888888;">Recibir Reporte del:</label>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" Style="width: 90px;" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpObligatorio"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-4">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" Style="width: 90px;" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpObligatorio"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label for="<%= TxtHorarioEnvio.ClientID.ToString() %>" style="font-size: 13px; color: #888888;">Hora de Envío:</label>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<cc1:TimeSelector ID="TxtHorarioEnvio" runat="server" DisplaySeconds="false" DisplayButtons="false">
|
||||
</cc1:TimeSelector>
|
||||
<asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="TxtHorarioEnvio" Display="None" ErrorMessage="El campo <b>''Hora''</b> es necesario, por favor seleccione la hora correcta." ValidationGroup="GrpObligatorio" ValidateEmptyText="true"></asp:CustomValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="CVHoraInicio" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin-bottom: 10px;">
|
||||
<asp:TextBox ID="TxtCorreo" CssClass="form-control" runat="server" MaxLength="300"></asp:TextBox>
|
||||
<asp:RegularExpressionValidator ID="REVEmail" runat="server" Display="None" ValidationExpression="(([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)(\s*;\s*|\s*$))*" ControlToValidate="TxtCorreo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Email''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpObligatorio"></asp:RegularExpressionValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="REVEmail" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVCorreo" runat="server" Display="None" ControlToValidate="TxtCorreo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Correo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVCorreo" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
<label for="<%= TxtCorreo.ClientID.ToString()%>">Correos:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="DivDispositivos" class="col-md-6" runat="server">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px" align="left">
|
||||
<input type="text" id="TxtBusquedaDispositivos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaDispositivos','{0}')", GvDispositivos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaDispositivos','{0}')", GvDispositivos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GvDispositivos" runat="server" GridLines="None" DataKeyNames="CveDispositivo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-heightfijo="300" data-height="300" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<asp:CheckBox ID="checkAll" type="checkbox" runat="server" />
|
||||
</HeaderTemplate>
|
||||
<HeaderStyle Width="60px" HorizontalAlign="Center" />
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="Chk" class="Dispositivos" runat="server" />
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="60px" HorizontalAlign="Center" />
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="NombreVehiculo" HeaderText="Vehiculo" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnAgregarCatalogo" AutoPostBack="True" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:Button>
|
||||
<asp:LinkButton runat="server" ID="btnCancelar" Text="Cancelar" CssClass="btn btn-default"></asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
470
GPS/CatReportesProgramados.aspx.vb
Normal file
470
GPS/CatReportesProgramados.aspx.vb
Normal file
@@ -0,0 +1,470 @@
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports System.IO
|
||||
Imports System.Globalization
|
||||
|
||||
Partial Class GPS_CatReportesProgramados
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property CveReporteProgramado As Integer
|
||||
Get
|
||||
Return ViewState("CveReporteProgramado").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveReporteProgramado") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Dias As String
|
||||
Get
|
||||
Return ViewState("Dias").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Dias") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Dispositivos As String
|
||||
Get
|
||||
Return ViewState("Dispositivos").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Dispositivos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Extras As String
|
||||
Get
|
||||
Return ViewState("Extras").ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Extras") = 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
|
||||
EsEditar = 0
|
||||
Dias = ""
|
||||
Dispositivos = ""
|
||||
Extras = ""
|
||||
CargaDdls()
|
||||
CargaDias()
|
||||
CargaDatos()
|
||||
CargaDispositivos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdls()
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetReportes() Then
|
||||
DdlReporte.DataSource = ObjGPS.DtResultados
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
DdlReporte.DataBind()
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDias()
|
||||
Select Case Now.DayOfWeek.ToString
|
||||
Case "Monday"
|
||||
ChkDiasSemana.Items(0).Selected = True
|
||||
Case "Tuesday"
|
||||
ChkDiasSemana.Items(1).Selected = True
|
||||
Case "Wednesday"
|
||||
ChkDiasSemana.Items(2).Selected = True
|
||||
Case "Thursday"
|
||||
ChkDiasSemana.Items(3).Selected = True
|
||||
Case "Friday"
|
||||
ChkDiasSemana.Items(4).Selected = True
|
||||
Case "Saturday"
|
||||
ChkDiasSemana.Items(5).Selected = True
|
||||
Case "Sunday"
|
||||
ChkDiasSemana.Items(6).Selected = True
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDispositivos()
|
||||
Dim Gps As New ClsGPS
|
||||
If Gps.DispositivosGet(-1, 1, UsuarioActual.CveCliente) Then
|
||||
GvDispositivos.DataSource = Gps.DtResultados
|
||||
GvDispositivos.DataBind()
|
||||
End If
|
||||
Gps.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaExtras(Extra As Integer)
|
||||
Dim Gps As New ClsGPS
|
||||
If Gps.ReportesProgramadosExtrasGet(UsuarioActual.CveCliente, Extra) Then
|
||||
GvExtras.DataSource = Gps.DtResultados
|
||||
GvExtras.DataBind()
|
||||
End If
|
||||
Gps.Dispose()
|
||||
|
||||
UpExtras.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDispositivosReporte(CveReporteProgramado As Integer)
|
||||
Dim Gps As New ClsGPS
|
||||
If Gps.ReportesProgramadosDispositivosGet(CveReporteProgramado) Then
|
||||
For Each row As DataRow In Gps.DtResultados.Rows
|
||||
For Each row2 As GridViewRow In GvDispositivos.Rows
|
||||
If row2.DataKey("CveDispositivo").ToEntero = row("CveDispositivo").ToString.ToEntero Then
|
||||
row2.FCCheckBox("Chk").Checked = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
Gps.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaExtrasReporte(CveReporteProgramado As Integer, Extra As Integer)
|
||||
|
||||
Select Case Extra
|
||||
|
||||
Case 4 'Evento
|
||||
CargaEventosReporte(CveReporteProgramado)
|
||||
Case 6 'Geocerca
|
||||
CargaGeocercasReporte(CveReporteProgramado)
|
||||
Case 7 'PI
|
||||
CargaPIReporte(CveReporteProgramado)
|
||||
End Select
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGeocercasReporte(CveReporteProgramado As Integer)
|
||||
Dim Gps As New ClsGPS
|
||||
If Gps.ReportesProgramadosGeocercasGet(CveReporteProgramado) Then
|
||||
For Each row As DataRow In Gps.DtResultados.Rows
|
||||
For Each row2 As GridViewRow In GvExtras.Rows
|
||||
If row2.DataKey("Cve").ToEntero = row("Cve").ToString.ToEntero Then
|
||||
row2.FCCheckBox("Chk").Checked = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
Gps.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaPIReporte(CveReporteProgramado As Integer)
|
||||
Dim Gps As New ClsGPS
|
||||
If Gps.ReportesProgramadosPIGet(CveReporteProgramado) Then
|
||||
For Each row As DataRow In Gps.DtResultados.Rows
|
||||
For Each row2 As GridViewRow In GvExtras.Rows
|
||||
If row2.DataKey("Cve").ToEntero = row("Cve").ToString.ToEntero Then
|
||||
row2.FCCheckBox("Chk").Checked = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
Gps.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaEventosReporte(CveReporteProgramado As Integer)
|
||||
Dim Gps As New ClsGPS
|
||||
If Gps.ReportesProgramadosEventosGet(CveReporteProgramado) Then
|
||||
For Each row As DataRow In Gps.DtResultados.Rows
|
||||
For Each row2 As GridViewRow In GvExtras.Rows
|
||||
If row2.DataKey("Cve").ToEntero = row("Cve").ToString.ToEntero Then
|
||||
row2.FCCheckBox("Chk").Checked = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
Gps.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjGPS As New ClsGPS
|
||||
|
||||
If ObjGPS.ReportesProgramadosGet(UsuarioActual.CveUsuario) Then
|
||||
GvDatos.DataSource = ObjGPS.DtResultados
|
||||
GvDatos.DataBind()
|
||||
End If
|
||||
|
||||
UpDatos.Update()
|
||||
ObjGPS.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub ImgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
|
||||
CveReporteProgramado = Boton.CommandArgument.ToEntero
|
||||
DdlReporte.SelectedValue = GvRow.DataKey("CveReporte").ToString
|
||||
DdlReporte_SelectedIndexChanged(Nothing, Nothing)
|
||||
DdlFrecuencia.SelectedValue = GvRow.DataKey("TinyFrecuencia").ToString
|
||||
DdlFrecuencia_SelectedIndexChanged(Nothing, Nothing)
|
||||
TxtIntervalo.Text = GvRow.DataKey("Intervalo").ToString
|
||||
'TxtHoraInicio.SetTime(GvRow.DataKey("HorarioInicial").ToDateTime.Hour, GvRow.DataKey("HorarioInicial").ToDateTime.Minute, GvRow.DataKey("HorarioInicial").ToDateTime.Second, If(GvRow.DataKey("HorarioInicial").ToDateTime.ToString("tt", CultureInfo.InvariantCulture) = "PM", MKB.TimePicker.TimeSelector.AmPmSpec.PM, MKB.TimePicker.TimeSelector.AmPmSpec.AM))
|
||||
'TxtHoraFin.SetTime(GvRow.DataKey("HorarioFinal").ToDateTime.Hour, GvRow.DataKey("HorarioFinal").ToDateTime.Minute, GvRow.DataKey("HorarioFinal").ToDateTime.Second, If(GvRow.DataKey("HorarioFinal").ToDateTime.ToString("tt", CultureInfo.InvariantCulture) = "PM", MKB.TimePicker.TimeSelector.AmPmSpec.PM, MKB.TimePicker.TimeSelector.AmPmSpec.AM))
|
||||
TxtHorarioEnvio.SetTime(GvRow.DataKey("HoraEnvio").ToDateTime.Hour, GvRow.DataKey("HoraEnvio").ToDateTime.Minute, GvRow.DataKey("HoraEnvio").ToDateTime.Second, If(GvRow.DataKey("HoraEnvio").ToDateTime.ToString("tt", CultureInfo.InvariantCulture) = "PM", MKB.TimePicker.TimeSelector.AmPmSpec.PM, MKB.TimePicker.TimeSelector.AmPmSpec.AM))
|
||||
txtFechaI.Text = GvRow.DataKey("FechaI").ToString
|
||||
txtFechaF.Text = GvRow.DataKey("FechaF").ToString
|
||||
TxtCorreo.Text = GvRow.DataKey("Correos").ToString
|
||||
DdlFormato.SelectedValue = GvRow.DataKey("Formato").ToString
|
||||
EsEditar = 1
|
||||
|
||||
'Cargamos los Dias
|
||||
If GvRow.DataKey("NombreDia").ToString.Contains("Lunes") Then ChkDiasSemana.Items(0).Selected = True Else ChkDiasSemana.Items(0).Selected = False
|
||||
If GvRow.DataKey("NombreDia").ToString.Contains("Martes") Then ChkDiasSemana.Items(1).Selected = True Else ChkDiasSemana.Items(1).Selected = False
|
||||
If GvRow.DataKey("NombreDia").ToString.Contains("Miercoles") Then ChkDiasSemana.Items(2).Selected = True Else ChkDiasSemana.Items(2).Selected = False
|
||||
If GvRow.DataKey("NombreDia").ToString.Contains("Jueves") Then ChkDiasSemana.Items(3).Selected = True Else ChkDiasSemana.Items(3).Selected = False
|
||||
If GvRow.DataKey("NombreDia").ToString.Contains("Viernes") Then ChkDiasSemana.Items(4).Selected = True Else ChkDiasSemana.Items(4).Selected = False
|
||||
If GvRow.DataKey("NombreDia").ToString.Contains("Sabado") Then ChkDiasSemana.Items(5).Selected = True Else ChkDiasSemana.Items(5).Selected = False
|
||||
If GvRow.DataKey("NombreDia").ToString.Contains("Domingo") Then ChkDiasSemana.Items(6).Selected = True Else ChkDiasSemana.Items(6).Selected = False
|
||||
|
||||
CargaDispositivosReporte(CveReporteProgramado)
|
||||
CargaExtrasReporte(CveReporteProgramado, DdlReporte.SelectedValue.ToEntero)
|
||||
|
||||
UpBodyEstatus.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#C_GvDispositivos_checkAll').click(function () { $(""input[name^='ctl00$C$GvDispositivos']"").not(this).prop('checked', this.checked); });", "4")
|
||||
|
||||
RegistraScript("$('#divAgregar').modal()", "5")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
AgregarDias()
|
||||
AgregarDispositivos()
|
||||
AgregarExtras()
|
||||
|
||||
If Dispositivos = "" AndAlso DdlReporte.SelectedValue <> "9" Then
|
||||
Dias = ""
|
||||
Dispositivos = ""
|
||||
Extras = ""
|
||||
Alert("Debe Seleccionar al menos un Dispostivo", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If DdlReporte.SelectedValue.ToEntero.Contiene(4) AndAlso Extras = "" Then '6, 7, 9
|
||||
Dias = ""
|
||||
Dispositivos = ""
|
||||
Extras = ""
|
||||
|
||||
If DdlReporte.SelectedValue.ToEntero = 4 Then
|
||||
Alert("Debe Seleccionar al menos un Evento", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
'ElseIf DdlReporte.SelectedValue.ToEntero = 6 Then
|
||||
' Alert("Debe Seleccionar al menos una Geocerca", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
'ElseIf DdlReporte.SelectedValue.ToEntero = 7 Then
|
||||
' Alert("Debe Seleccionar al menos un Punto de Interés", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
'ElseIf DdlReporte.SelectedValue.ToEntero = 9 Then
|
||||
' Alert("Debe Seleccionar al menos un Grupo", TipoMensaje.MsgAdvertencia)
|
||||
' Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim Formato As String = DdlFormato.SelectedValue
|
||||
If EsEditar = 0 Then
|
||||
If GPS.ReportesProgramadosAdd(DdlReporte.SelectedValue.ToEntero, TxtCorreo.Text, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, $"{TxtHorarioEnvio.Hour}:{TxtHorarioEnvio.Minute}:{TxtHorarioEnvio.Second} {TxtHorarioEnvio.AmPm}".ToDateTime, DdlFrecuencia.SelectedValue, If(DivIntervalo.Visible, TxtIntervalo.Text.ToEntero, -1), Dias, Dispositivos, Extras, $"{TxtHoraInicio.Hour}: {TxtHoraInicio.Minute}:{TxtHoraInicio.Second} {TxtHoraInicio.AmPm}".ToDateTime, $"{TxtHoraFin.Hour}:{TxtHoraFin.Minute}:{TxtHoraFin.Second} {TxtHoraFin.AmPm}".ToDateTime, Formato, UsuarioActual.CveUsuario, UsuarioActual.CveCliente) Then
|
||||
Alert("La programacion se agregó correctamente.")
|
||||
LimpiarAgregado()
|
||||
RegistraScript("$('#divAgregar').modal('hide')", "11")
|
||||
End If
|
||||
Else
|
||||
'If GPS.ReportesProgramadosUpdate(CveReporteProgramado, DdlReporte.SelectedValue.ToEntero, TxtCorreo.Text, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, $"{TxtHorarioEnvio.Hour}:{TxtHorarioEnvio.Minute}:{TxtHorarioEnvio.Second} {TxtHorarioEnvio.AmPm}".ToDateTime, DdlFrecuencia.SelectedValue, $"00:00:00 AM".ToDateTime, 0.0, $"00:00:00 AM".ToDateTime, 0, $"{TxtHoraInicio.Hour}:{TxtHoraInicio.Minute}:{TxtHoraInicio.Second} {TxtHoraInicio.AmPm}".ToDateTime, $"{TxtHoraFin.Hour}:{TxtHoraFin.Minute}:{TxtHoraFin.Second} {TxtHoraFin.AmPm}".ToDateTime) Then
|
||||
If GPS.ReportesProgramadosUpdate(CveReporteProgramado, DdlReporte.SelectedValue.ToEntero, TxtCorreo.Text, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, $"{TxtHorarioEnvio.Hour}:{TxtHorarioEnvio.Minute}:{TxtHorarioEnvio.Second} {TxtHorarioEnvio.AmPm}".ToDateTime, DdlFrecuencia.SelectedValue, If(DivIntervalo.Visible, TxtIntervalo.Text.ToEntero, -1), Dias, Dispositivos, Extras, $"{TxtHoraInicio.Hour}: {TxtHoraInicio.Minute}:{TxtHoraInicio.Second} {TxtHoraInicio.AmPm}".ToDateTime, $"{TxtHoraFin.Hour}:{TxtHoraFin.Minute}:{TxtHoraFin.Second} {TxtHoraFin.AmPm}".ToDateTime, Formato, UsuarioActual.CveCliente) Then
|
||||
Alert("La programacion se actualizó correctamente.")
|
||||
LimpiarAgregado()
|
||||
RegistraScript("$('#divAgregar').modal('hide')", "11")
|
||||
End If
|
||||
End If
|
||||
|
||||
Dias = ""
|
||||
Dispositivos = ""
|
||||
Extras = ""
|
||||
|
||||
GPS.Dispose()
|
||||
|
||||
CargaDatos()
|
||||
UpBodyEstatus.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub LimpiarAgregado()
|
||||
DdlReporte.SelectedIndex = 0
|
||||
DdlReporte_SelectedIndexChanged(Nothing, Nothing)
|
||||
DdlFrecuencia.SelectedIndex = 0
|
||||
DdlFrecuencia_SelectedIndexChanged(Nothing, Nothing)
|
||||
TxtIntervalo.Text = ""
|
||||
TxtHoraInicio.SetTime(0, 0, 0, MKB.TimePicker.TimeSelector.AmPmSpec.AM)
|
||||
TxtHoraFin.SetTime(0, 0, 0, MKB.TimePicker.TimeSelector.AmPmSpec.AM)
|
||||
TxtHorarioEnvio.SetTime(0, 0, 0, MKB.TimePicker.TimeSelector.AmPmSpec.AM)
|
||||
txtFechaI.Text = ""
|
||||
txtFechaF.Text = ""
|
||||
TxtCorreo.Text = ""
|
||||
Dispositivos = ""
|
||||
Extras = ""
|
||||
EsEditar = 0
|
||||
LimpiarDias()
|
||||
CargaDispositivos()
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub LimpiarDias()
|
||||
For Each Item As ListItem In ChkDiasSemana.Items
|
||||
Item.Selected = False
|
||||
Next
|
||||
|
||||
CargaDias()
|
||||
End Sub
|
||||
|
||||
Private Sub AgregarDias()
|
||||
For Each Item As ListItem In ChkDiasSemana.Items
|
||||
If Item.Selected Then
|
||||
Dias = Dias + Item.Text + ","
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub AgregarDispositivos()
|
||||
'EN EL CASO DE SALIDA DE PARADAS LOS DISPOSITIVOS VIENEN EN EL GRUPO
|
||||
If DdlReporte.SelectedValue <> "9" Then
|
||||
For Each row As GridViewRow In GvDispositivos.Rows
|
||||
If row.FCCheckBox("Chk").Checked Then
|
||||
Dispositivos = Dispositivos + row.DataKey("CveDispositivo") + ","
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
'Dim ObjGPS As New ClsGPS
|
||||
'For Each row As GridViewRow In GvExtras.Rows
|
||||
' If row.FCCheckBox("Chk").Checked Then
|
||||
' Dim CveGrupo As Integer = row.DataKey("Cve").ToEntero
|
||||
' If ObjGPS.GruposDetallesGet(CveGrupo) Then
|
||||
' For Each Grupos
|
||||
' Dispositivos = Dispositivos + row.DataKey("Cve") + ","
|
||||
' End If
|
||||
' End If
|
||||
'Next
|
||||
'ObjGPS.Dispose()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AgregarExtras()
|
||||
For Each row As GridViewRow In GvExtras.Rows
|
||||
If row.FCCheckBox("Chk").Checked Then
|
||||
Extras = Extras + row.DataKey("Cve") + ","
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim GPS As New ClsGPS
|
||||
Dim CveReporteProgramado As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveReporteProgramado").ToEntero
|
||||
|
||||
If GPS.ReportesProgramadosDelete(CveReporteProgramado) Then
|
||||
Alert("La programacion se eliminó correctamente.")
|
||||
End If
|
||||
|
||||
GPS.Dispose()
|
||||
CargaDatos()
|
||||
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
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveReporteProgramado").ToString
|
||||
e.Row.ToolTip = e.Row.DataKey("NombreDia").ToString
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
|
||||
LimpiarAgregado()
|
||||
RegistraScript("$('#divAgregar').modal('hide')", "11")
|
||||
UpBodyEstatus.Update()
|
||||
UpFooter.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub DdlFrecuencia_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFrecuencia.SelectedIndexChanged
|
||||
If DdlFrecuencia.SelectedValue = "S" Then
|
||||
DivDia.Visible = True
|
||||
Else
|
||||
DivDia.Visible = False
|
||||
End If
|
||||
|
||||
If DdlFrecuencia.SelectedValue.Contiene("M", "S") Then
|
||||
DivIntervalo.Visible = True
|
||||
Else
|
||||
DivIntervalo.Visible = False
|
||||
End If
|
||||
|
||||
UpAgregar.Update()
|
||||
RegistraScript("$('#C_GvDispositivos_checkAll').click(function () { $(""input[name^='ctl00$C$GvDispositivos']"").not(this).prop('checked', this.checked); });", "1")
|
||||
|
||||
If DdlReporte.SelectedValue.ToEntero.Contiene(4, 6, 7) Then
|
||||
RegistraScript("$('#C_GvExtras_checkAll').click(function () { $(""input[name^='ctl00$C$GvExtras']"").not(this).prop('checked', this.checked); });", "2")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub linkAgregar_Click(sender As Object, e As EventArgs) Handles linkAgregar.Click
|
||||
LimpiarAgregado()
|
||||
RegistraScript("$('#C_GvDispositivos_checkAll').click(function () { $(""input[name^='ctl00$C$GvDispositivos']"").not(this).prop('checked', this.checked); });", "1")
|
||||
RegistraScript("$('#divAgregar').modal()", "2")
|
||||
End Sub
|
||||
|
||||
Private Sub DdlReporte_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlReporte.SelectedIndexChanged
|
||||
DivDispositivos.Visible = True
|
||||
DivDispositivos.Attributes.Remove("class")
|
||||
DivCuerpo.Attributes.Remove("class")
|
||||
UpAgregar.Attributes.Remove("style")
|
||||
|
||||
If DdlReporte.SelectedValue.ToEntero = 4 Then
|
||||
CargaExtras(3)
|
||||
'ElseIf DdlReporte.SelectedValue.ToEntero = 6 Then
|
||||
' CargaExtras(1)
|
||||
'ElseIf DdlReporte.SelectedValue.ToEntero = 7 Then
|
||||
' CargaExtras(2)
|
||||
'ElseIf DdlReporte.SelectedValue.ToEntero = 9 Then
|
||||
' DivDispositivos.Visible = False
|
||||
' CargaExtras(4)
|
||||
End If
|
||||
|
||||
If DdlReporte.SelectedValue.ToEntero.Contiene(4) Then '6,7,9
|
||||
DivExtras.Visible = True
|
||||
If DdlReporte.SelectedValue.ToEntero <> 9 Then
|
||||
DivDispositivos.Attributes.Add("class", "col-md-4")
|
||||
DivCuerpo.Attributes.Add("class", "col-md-4")
|
||||
DivExtras.Attributes.Add("class", "col-md-4")
|
||||
Else
|
||||
DivExtras.Attributes.Add("class", "col-md-6")
|
||||
DivCuerpo.Attributes.Add("class", "col-md-6")
|
||||
End If
|
||||
RegistraScript("$('#C_UpAgregar').width( 900 )", "1")
|
||||
RegistraScript("$('#C_GvExtras_checkAll').click(function () { $(""input[name^='ctl00$C$GvExtras']"").not(this).prop('checked', this.checked); });", "2")
|
||||
Else
|
||||
DivExtras.Visible = False
|
||||
|
||||
DivDispositivos.Attributes.Add("class", "col-md-6")
|
||||
DivCuerpo.Attributes.Add("class", "col-md-6")
|
||||
RegistraScript("$('#C_UpAgregar').width( 605 )")
|
||||
End If
|
||||
|
||||
RegistraScript("$('#C_GvDispositivos_checkAll').click(function () { $(""input[name^='ctl00$C$GvDispositivos']"").not(this).prop('checked', this.checked); });", "3")
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
End Class
|
||||
99
GPS/CatRutas.aspx
Normal file
99
GPS/CatRutas.aspx
Normal file
@@ -0,0 +1,99 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatRutas.aspx.vb" Inherits="GPS_CatRutas" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Rutas
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" id="BtnOpenDiv"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- BEGIN SAMPLE TABLE PORTLET-->
|
||||
<div class="portlet light ">
|
||||
<div class="portlet-title">
|
||||
<div class="actions">
|
||||
<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="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRutas.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRutas.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:GridView ID="GvRutas" runat="server" GridLines="None" DataKeyNames="CveRuta,Ruta" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Ruta" HeaderText="Ruta o Linea" ItemStyle-Width="90%" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" OnClick="imgE_Click" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Datos de la Ruta</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyConductor" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtRuta" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtRuta.ClientID.ToString()%>">Ruta o Linea:</label>
|
||||
<asp:RequiredFieldValidator ID="RFVRuta" runat="server" ControlToValidate="TxtRuta" Display="None" ErrorMessage="El campo <b>''Ruta''</b> es requerido por la aplicación, por favor ingrese una." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooterConductor" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarCatalogo" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Guardar</asp:LinkButton>
|
||||
<button id="btnCancelar" class="btn btn-default" data-dismiss="modal" value="Cancelar">Cancelar </button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
107
GPS/CatRutas.aspx.vb
Normal file
107
GPS/CatRutas.aspx.vb
Normal file
@@ -0,0 +1,107 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class GPS_CatRutas
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property CveRuta As Integer
|
||||
Get
|
||||
Return ViewState("CveRuta").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveRuta") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = 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
|
||||
CveRuta = -1
|
||||
EsEditar = 0
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.GetRutas(-1, UsuarioActual.CveCliente) Then
|
||||
GvRutas.DataSource = GPS.DtResultados
|
||||
Else
|
||||
GvRutas.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvRutas.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
CveRuta = GvRow.DataKey("CveRuta").ToEntero
|
||||
TxtRuta.Text = GvRow.DataKey("Ruta").ToString
|
||||
EsEditar = 1
|
||||
BtnAgregarCatalogo.Text = "Actualizar"
|
||||
UpAgregar.Update()
|
||||
UpDatos.Update()
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If EsEditar = 0 Then
|
||||
If GPS.AddRuta(TxtRuta.Text, UsuarioActual.CveCliente) Then
|
||||
Alert("La ruta se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If GPS.UpdateRuta(CveRuta, TxtRuta.Text, UsuarioActual.CveCliente) Then
|
||||
Alert("La ruta se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
EsEditar = 0
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
End If
|
||||
GPS.Dispose()
|
||||
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
|
||||
TxtRuta.Text = ""
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
UpAgregar.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvRutas.RowDeleting
|
||||
Dim GPS As New ClsGPS
|
||||
Dim CveRuta As Integer = GvRutas.Rows(e.RowIndex).DataKey("CveRuta").ToEntero
|
||||
If GPS.RemoveRuta(CveRuta) Then
|
||||
Alert("La ruta se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles BtnOpenDiv.Click
|
||||
EsEditar = 0
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
TxtRuta.Text = ""
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
97
GPS/CatTipoComunicacion.aspx
Normal file
97
GPS/CatTipoComunicacion.aspx
Normal file
@@ -0,0 +1,97 @@
|
||||
|
||||
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatTipoComunicacion.aspx.vb" Inherits="GPS_TipoComunicacion" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Tipos de Comunicación
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
<asp:UpdatePanel ID="UppAddAcciones" runat="server">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkTipoComunicacion" runat="server" Text="Agregar"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ClientIDMode="Static" runat="server" ID="HdnCveTipoComunicacion" Value="-1" />
|
||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvTipoComunicacion.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvTipoComunicacion.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GvTipoComunicacion" runat="server" GridLines="None" DataKeyNames="CveTipoComunicacion,TipoComunicacion,Estatus,FechaIng,CveUsuario,Usuario" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Tipos de Comunicacion">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="TipoComunicacion" HeaderText="Tipo de Comunicación" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaIng" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'>></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Comandos">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" OnClick="Edit_Click" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" OnClick="Delete_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:HiddenField ID="HdnModalidad" runat="server" Value="A" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnID" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%--POPUP AGREGAR--%>
|
||||
<div id="divAddTipoComunicacion" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddTipoComunicacion" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" style="text-align:left" runat="server" id="myModalLabel">Agregar Tipo De Comunicación</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyTipoComunicacion" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTipoComunicacion" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTipoComunicacion" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTipoComunicacion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo De Comunicacion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtTipoComunicacion.ClientID.ToString()%>">Tipo De Comunicación:</label>
|
||||
</div>
|
||||
<div runat="server" id="dvEstatus" class="form-group form-md-line-input input-iconright">
|
||||
Activo: <asp:CheckBox ID="ChkEstatus" Text=" " runat="server" CssClass="chksino" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer" style="margin-top:20px">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarTipoComunicacion" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
101
GPS/CatTipoComunicacion.aspx.vb
Normal file
101
GPS/CatTipoComunicacion.aspx.vb
Normal file
@@ -0,0 +1,101 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class GPS_TipoComunicacion
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BtnAgregarTipoComunicacion_Click(sender As Object, e As EventArgs) Handles BtnAgregarTipoComunicacion.Click
|
||||
Dim ObjGps As New ClsGPS
|
||||
Dim Estatus = 0
|
||||
If ChkEstatus.Checked Then Estatus = 1
|
||||
If HdnModalidad.Value = "A" Then
|
||||
If ObjGps.TipoComunicacionAdd(TxtTipoComunicacion.Text, Estatus, UsuarioActual.CveUsuario) Then
|
||||
CargaDatos()
|
||||
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ElseIf HdnModalidad.Value = "U" Then
|
||||
If ObjGps.TipoComunicacionUpdate(HdnID.Value, TxtTipoComunicacion.Text, Estatus, UsuarioActual.CveUsuario) Then
|
||||
CargaDatos()
|
||||
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
dvEstatus.Style.Add("display", "none")
|
||||
End If
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "divAddTipoComunicacion"))
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim ObjGps As New ClsGPS()
|
||||
If ObjGps.TipoComunicacionGet() Then
|
||||
GvTipoComunicacion.DataSource = ObjGps.DtResultados
|
||||
GvTipoComunicacion.DataBind()
|
||||
End If
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Public Sub Edit_Click(sender As Object, e As EventArgs)
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnModalidad.Value = "U"
|
||||
dvEstatus.Style.Add("display", "")
|
||||
HdnID.Value = GvRow.DataKey("CveTipoComunicacion")
|
||||
UpDatos.Update()
|
||||
myModalLabel.InnerHtml = "Actualizar Tipo de Comunicación"
|
||||
BtnAgregarTipoComunicacion.Text = "Actualizar"
|
||||
TxtTipoComunicacion.Text = GvRow.DataKey("TipoComunicacion")
|
||||
ChkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
||||
UpAddTipoComunicacion.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddTipoComunicacion"))
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub LnkTipoComunicacion_Click(sender As Object, e As EventArgs) Handles LnkTipoComunicacion.Click
|
||||
Agregar()
|
||||
End Sub
|
||||
|
||||
Public Sub Delete_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjGps As New ClsGPS()
|
||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
HdnID.Value = GvRow.DataKey("CveTipoComunicacion")
|
||||
UpDatos.Update()
|
||||
If ObjGps.TipoComunicacionDelete(HdnID.Value) Then
|
||||
CargaDatos()
|
||||
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ObjGps.Dispose()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Public Sub Agregar()
|
||||
dvEstatus.Style.Add("display", "none")
|
||||
HdnModalidad.Value = "A"
|
||||
UpDatos.Update()
|
||||
BtnAgregarTipoComunicacion.Text = "Agregar"
|
||||
myModalLabel.InnerHtml = "Agregar Tipo de Comunicación"
|
||||
TxtTipoComunicacion.Text = ""
|
||||
ChkEstatus.Checked = True
|
||||
UpAddTipoComunicacion.Update()
|
||||
RegistraScript(String.Format("$('#{0}').modal('show');", "divAddTipoComunicacion"))
|
||||
End Sub
|
||||
|
||||
Private Sub GvTipoComunicacion_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvTipoComunicacion.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("Estatus") = True Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
94
GPS/CatUMControles.aspx
Normal file
94
GPS/CatUMControles.aspx
Normal file
@@ -0,0 +1,94 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="CatUMControles.aspx.vb" Inherits="GPS_CatUMControles" %>
|
||||
|
||||
<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">
|
||||
Unidades de Medida
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" id="BtnOpenDiv"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<div class="row" style="margin-left:0px;margin-top:5px;margin-bottom:5px;text-align: right;margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveUnidadMedida,UnidadMedida,Estatus" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Compuestos Activos">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="UnidadMedida" ItemStyle-Width="70%" HeaderText="Conductor" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Guardar Compuesto</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyCompuesto" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtUnidadMedida" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVNombrePlantilla" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtUnidadMedida" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad de Medida''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtUnidadMedida.ClientID.ToString()%>">Unidad Medida:</label>
|
||||
</div>
|
||||
<div id="dvEstatus" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label>Activo: </label>
|
||||
<asp:Checkbox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px">
|
||||
</asp:Checkbox>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarCatalogo" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
||||
<button id="btnCancelar" data-dismiss="modal" class="btn btn-default" >Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
126
GPS/CatUMControles.aspx.vb
Normal file
126
GPS/CatUMControles.aspx.vb
Normal file
@@ -0,0 +1,126 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class GPS_CatUMControles
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property CveUnidadMedida As Integer
|
||||
Get
|
||||
Return ViewState("CveUnidadMedida").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveUnidadMedida") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = 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
|
||||
CveUnidadMedida = -1
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.UnidadMedidaGet() Then
|
||||
GvDatos.DataSource = GPS.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveUnidadMedida = Boton.CommandArgument.ToEntero
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
TxtUnidadMedida.Text = GvRow.DataKey("UnidadMedida").ToString
|
||||
chkEstatus.Checked = CBool(GvRow.DataKey("Estatus"))
|
||||
EsEditar = 1
|
||||
BtnAgregarCatalogo.Text = "Actualizar"
|
||||
dvEstatus.Visible = True
|
||||
UpBodyCompuesto.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If EsEditar = 0 Then
|
||||
If GPS.UnidadMedidaAdd(TxtUnidadMedida.Text) Then
|
||||
Alert("La unidad de medida se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If GPS.UnidadMedidalUpdate(TxtUnidadMedida.Text, CveUnidadMedida, chkEstatus.Checked) Then
|
||||
Alert("La unidad de medida se editó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
EsEditar = 0
|
||||
dvEstatus.Visible = False
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
End If
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
GPS.Dispose()
|
||||
TxtUnidadMedida.Text = ""
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
UpBodyCompuesto.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim GPS As New ClsGPS
|
||||
Dim CveUnidadMedida As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveUnidadMedida").ToEntero
|
||||
If GPS.UnidadMedidaDelete(CveUnidadMedida) Then
|
||||
Alert("La unidad de medida se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaDatos()
|
||||
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
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveUnidadMedida").ToString
|
||||
|
||||
If CBool(e.Row.DBCampo("Estatus")) = True Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles BtnOpenDiv.Click
|
||||
EsEditar = 0
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
TxtUnidadMedida.Text = ""
|
||||
dvEstatus.Visible = False
|
||||
UpBodyCompuesto.Update()
|
||||
UpFooter.Update()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
585
GPS/Conductores.aspx
Normal file
585
GPS/Conductores.aspx
Normal file
@@ -0,0 +1,585 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Conductores.aspx.vb" Inherits="GPS_Conductores" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
@import url(https://fonts.googleapis.com/css?family=Droid+Sans:400,700|Droid+Serif:400,700);
|
||||
|
||||
#map {
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
#chartdivEventos {
|
||||
width: 100%;
|
||||
height: 270px;
|
||||
}
|
||||
|
||||
#chartdivVelocidad {
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
.amcharts-chart-div a {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.contenedor {
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
color: #989A8F;
|
||||
width: 450px;
|
||||
}
|
||||
|
||||
.calificador {
|
||||
height: 270px;
|
||||
width: 75%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.toplistaVerde {
|
||||
background-color: #1BA39C;
|
||||
height: 33%;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaAmarillo {
|
||||
background-color: #c29d0b;
|
||||
height: 33%;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaRojo {
|
||||
background-color: #E43A45;
|
||||
height: 33%;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.bottomlista {
|
||||
margin-top: 25%;
|
||||
}
|
||||
|
||||
|
||||
.circuloVerde {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #1BA39C;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.verde {
|
||||
color: #1BA39C;
|
||||
}
|
||||
|
||||
.circuloAmarillo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #c29d0b;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.amarillo {
|
||||
color: #c29d0b;
|
||||
}
|
||||
|
||||
.circuloRojo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #E43A45;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.rojo {
|
||||
color: #E43A45;
|
||||
}
|
||||
|
||||
/*************************Menu Slider****************************/
|
||||
|
||||
.ADSliderMenu > .toggler, .ADSlider > .ADSliderMenu > .toggler {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
opacity: .7;
|
||||
filter: alpha(opacity=70);
|
||||
width: 30px;
|
||||
height: 27px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
background: url(/Metronic/assets/admin/layout/img/sidebar_inline_toggler_icon_light.jpg);
|
||||
}
|
||||
|
||||
|
||||
.ADSlider {
|
||||
width: 100%;
|
||||
display: table;
|
||||
}
|
||||
|
||||
.ADSliderMenu {
|
||||
/*float: left;*/
|
||||
min-width: 45px;
|
||||
display: inline-block;
|
||||
/*padding-top: 30px;*/
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ADSlider:not(.open) > .ADSliderMenu {
|
||||
width: 45px;
|
||||
padding-left: 45px;
|
||||
max-width: 45px;
|
||||
overflow: hidden !important;
|
||||
min-height: 50px;
|
||||
max-height: 60px;
|
||||
}
|
||||
|
||||
.ADSliderBody {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/***********************END Menu Slider****************************/
|
||||
.GvConductores.table > tbody > tr > td, .GvConductores.table > tbody > tr > th, .GvConductores.table > tfoot > tr > td, .GvConductores.table > tfoot > tr > th, .GvConductores.table > thead > tr > td, .GvConductores.table > thead > tr > th {
|
||||
border-top: 0px solid #ddd;
|
||||
background-color: white;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Driving
|
||||
</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>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" ValidationGroup="GrpGuardar" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
|
||||
</div>
|
||||
<div class="titlefiltros caption" style="margin-top: -8px;">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Grupo:
|
||||
<asp:DropDownList ID="DdlGrupo" runat="server" OnSelectedIndexChanged="DdlGrupo_SelectedIndexChanged" AppendDataBoundItems="true" AutoPostBack="true" Width="200px" DataTextField="Nombre" DataValueField="Cve" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Value="-1" Text="Seleccione"></asp:ListItem>
|
||||
<asp:ListItem Value="1" Text="Conductores"></asp:ListItem>
|
||||
<asp:ListItem Value="2" Text="Vehículos"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVGrupo" runat="server" ControlToValidate="DdlGrupo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Grupo''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEGrupo" runat="server" HighlightCssClass="vco" TargetControlID="RFVGrupo" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
<li>
|
||||
<asp:Literal ID="LtlNombre" runat="server" Text="Nombre:"></asp:Literal>
|
||||
<asp:DropDownList AppendDataBoundItems="true" ID="DdlNombre" runat="server" Width="200px" DataTextField="Nombre" DataValueField="Cve" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Value="-1" Text="Seleccione"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVNombre" runat="server" ControlToValidate="DdlNombre" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCENombre" runat="server" HighlightCssClass="vco" TargetControlID="RFVNombre" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
<li>Fecha Inicio:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li>Fecha Fin:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="DvContenido" runat="server" visible="false">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light ">
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 25px">
|
||||
<i style="font-size: larger" class="fa fa-list-alt font-blue"></i>
|
||||
<span class="caption-subject font-blue bold uppercase" style="font-size: 18px">Información general</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:UpdatePanel ID="UpInfo" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Table ID="TbConductor" runat="server" CssClass="table-hover Widthall" Visible="false">
|
||||
<asp:TableRow>
|
||||
<asp:TableCell Font-Bold="true" ForeColor="#333333" Font-Size="13px">
|
||||
<asp:Label runat="server" Text="Conductor:"></asp:Label>
|
||||
</asp:TableCell>
|
||||
<asp:TableCell VerticalAlign="Bottom">
|
||||
<asp:Label ID="LblConductor" runat="server"></asp:Label>
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell>
|
||||
<br />
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell Font-Bold="true" ForeColor="#333333" Font-Size="13px">
|
||||
<asp:Label runat="server" Text="Nacimiento:"></asp:Label>
|
||||
</asp:TableCell>
|
||||
<asp:TableCell>
|
||||
<asp:Label ID="LblFechaNacimiento" runat="server"></asp:Label>
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell>
|
||||
<br />
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell Font-Bold="true" ForeColor="#333333" Font-Size="13px">
|
||||
<asp:Label runat="server" Text="Serie Licencia:"></asp:Label>
|
||||
</asp:TableCell>
|
||||
<asp:TableCell>
|
||||
<asp:Label ID="LblSerieLicencia" runat="server"></asp:Label>
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell>
|
||||
<br />
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell Font-Bold="true" ForeColor="#333333" Font-Size="13px">
|
||||
<asp:Label runat="server" Text="Vigencia:"></asp:Label>
|
||||
</asp:TableCell>
|
||||
<asp:TableCell>
|
||||
<asp:Label ID="LblVigencia" runat="server"></asp:Label>
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell>
|
||||
<br />
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell Font-Bold="true" ForeColor="#333333" Font-Size="13px">
|
||||
<asp:Label runat="server" Text="Estatus:"></asp:Label>
|
||||
</asp:TableCell>
|
||||
<asp:TableCell>
|
||||
<asp:Label ID="LblEstatus" runat="server"></asp:Label>
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
</asp:Table>
|
||||
<asp:Table ID="TbVehiculo" runat="server" CssClass="table-hover Widthall" Visible="false">
|
||||
<asp:TableRow>
|
||||
<asp:TableCell Font-Bold="true" ForeColor="#333333" Font-Size="13px">
|
||||
<asp:Label runat="server" Text="Vehículo:"></asp:Label>
|
||||
</asp:TableCell>
|
||||
<asp:TableCell VerticalAlign="Bottom">
|
||||
<asp:Label ID="LblVehiculo" runat="server"></asp:Label>
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell>
|
||||
<br />
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell Font-Bold="true" ForeColor="#333333" Font-Size="13px">
|
||||
<asp:Label runat="server" Text="NoEconomico:"></asp:Label>
|
||||
</asp:TableCell>
|
||||
<asp:TableCell VerticalAlign="Bottom">
|
||||
<asp:Label ID="LblNoEconomicos" runat="server"></asp:Label>
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell>
|
||||
<br />
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell Font-Bold="true" ForeColor="#333333" Font-Size="13px">
|
||||
<asp:Label runat="server" Text="Modelo:"></asp:Label>
|
||||
</asp:TableCell>
|
||||
<asp:TableCell VerticalAlign="Bottom">
|
||||
<asp:Label ID="LblModelo" runat="server"></asp:Label>
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell>
|
||||
<br />
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell Font-Bold="true" ForeColor="#333333" Font-Size="13px">
|
||||
<asp:Label runat="server" Text="Año:"></asp:Label>
|
||||
</asp:TableCell>
|
||||
<asp:TableCell VerticalAlign="Bottom">
|
||||
<asp:Label ID="LblAnio" runat="server"></asp:Label>
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell>
|
||||
<br />
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
|
||||
<asp:TableRow>
|
||||
<asp:TableCell Font-Bold="true" ForeColor="#333333" Font-Size="13px">
|
||||
<asp:Label runat="server" Text="Limite de Velocidad:"></asp:Label>
|
||||
</asp:TableCell>
|
||||
<asp:TableCell VerticalAlign="Bottom">
|
||||
<asp:Label ID="LblVelocidad" runat="server"></asp:Label>
|
||||
</asp:TableCell>
|
||||
</asp:TableRow>
|
||||
</asp:Table>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light ">
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 25px">
|
||||
<i style="font-size: larger" class="fa fa-tachometer font-blue"></i>
|
||||
<span class="caption-subject font-blue bold uppercase" style="font-size: 18px">Velocidad Máxima</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<div id="chartdivVelocidad"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light ">
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 25px; width: 100%;">
|
||||
<i style="font-size: larger" class="fa fa-map-marker font-blue"></i>
|
||||
<span class="caption-subject font-blue bold uppercase" style="font-size: 18px;">Ultima Posicion</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div id="map"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light ">
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 25px; width: 100%;">
|
||||
<span class="caption-subject font-blue bold uppercase" style="font-size: 18px;">Calificacion</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body contenedor">
|
||||
<div class="calificador">
|
||||
<div id="DivTituloPonderacion" runat="server">
|
||||
<div id="DivCirculoPonderacion" runat="server">
|
||||
<asp:Label runat="server" ID="LblPonderacion" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottomlista">
|
||||
<p>
|
||||
<span style="font-size: 20px !important">Riesgo:
|
||||
<asp:Label ID="LblRiesgo" Font-Bold="true" ForeColor="#808080" runat="server" /></span>
|
||||
</p>
|
||||
<p>
|
||||
<span style="font-size: 20px !important">Desgaste:
|
||||
<asp:Label ID="LblDesgaste" Font-Bold="true" ForeColor="#808080" runat="server" /></span>
|
||||
</p>
|
||||
<p>
|
||||
<span style="font-size: 20px !important">Total Eventos:
|
||||
<asp:Label ID="LblTotalEventos" Font-Bold="true" ForeColor="#808080" runat="server" /></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="portlet light ">
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 25px">
|
||||
<i style="font-size: larger" class="fa fa-exclamation-triangle font-blue"></i>
|
||||
<span class="caption-subject font-blue bold uppercase" style="font-size: 18px">Eventos</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div id="chartdivEventos"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HdnValoresPastel" runat="server" ClientIDMode="Static" Value="[]" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/pie.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/gauge.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
function EstablecerValoresTacometro(velocidadMaxima, velocidad) {
|
||||
|
||||
var gaugeChart = AmCharts.makeChart("chartdivVelocidad", {
|
||||
"type": "gauge",
|
||||
"theme": "none",
|
||||
"axes": [{
|
||||
"axisThickness": 1,
|
||||
"axisAlpha": 0.2,
|
||||
"tickAlpha": 0.2,
|
||||
"valueInterval": 20,
|
||||
"bands": [{
|
||||
"color": "#1BA39C",
|
||||
"endValue": 40,
|
||||
"startValue": 0
|
||||
}, {
|
||||
"color": "#F1C40F",
|
||||
"endValue": velocidadMaxima,
|
||||
"startValue": 40
|
||||
}, {
|
||||
"color": "#ed6b75",
|
||||
"endValue": 180,
|
||||
"innerRadius": "95%",
|
||||
"startValue": velocidadMaxima
|
||||
}],
|
||||
"bottomText": velocidad + " km/h",
|
||||
"bottomTextYOffset": -20,
|
||||
"endValue": 180
|
||||
}],
|
||||
"arrows": [
|
||||
{
|
||||
"value": velocidad
|
||||
}
|
||||
],
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function EstablecerValoresPastel() {
|
||||
var datos = JSON.parse(HdnValoresPastel.value);
|
||||
|
||||
var Pie = AmCharts.makeChart("chartdivEventos", {
|
||||
"type": "pie",
|
||||
"theme": "light",
|
||||
"dataProvider": datos,
|
||||
"valueField": "value",
|
||||
"titleField": "evento",
|
||||
"colorField": "color",
|
||||
"labelColorField": "color",
|
||||
"outlineAlpha": 0.4,
|
||||
"depth3D": 15,
|
||||
"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
|
||||
"angle": 30,
|
||||
"export": {
|
||||
"enabled": false
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var map;
|
||||
function initMap() {
|
||||
debugger;
|
||||
if (document.getElementById('map') != null) {
|
||||
var uluru = { lat: 29.0730, lng: -110.9559 }
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: uluru,
|
||||
zoom: 15
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var markers = [];
|
||||
|
||||
function CreaMarcador(coords, nomEquipo) {
|
||||
var marker = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: map
|
||||
});
|
||||
markers.push(marker);
|
||||
map.setCenter(coords)
|
||||
}
|
||||
function DeleteMarkers() {
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
markers = [];
|
||||
}
|
||||
$(document).ready(function () {
|
||||
initMap();
|
||||
Sys.Application.add_load(function (s, e) {
|
||||
initMap();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAJnZ1CoEUX425C20aqzFw4dYxFL_LfThk&libraries=places"></script>
|
||||
</asp:Content>
|
||||
|
||||
245
GPS/Conductores.aspx.vb
Normal file
245
GPS/Conductores.aspx.vb
Normal file
@@ -0,0 +1,245 @@
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Newtonsoft.Json.Linq
|
||||
Partial Class GPS_Conductores
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property CveConductor As Integer
|
||||
Get
|
||||
Return ViewState("CveConductor").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveConductor") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property CveDispositivo As Integer
|
||||
Get
|
||||
Return ViewState("CveDispositivo").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveDispositivo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaFechas()
|
||||
If Request("CveConductor") IsNot Nothing AndAlso Request("CveConductor").ToString.ToEntero > 0 Then
|
||||
CveConductor = Request("CveConductor").ToString.ToEntero
|
||||
CargaPonderacion()
|
||||
CargaGraficas()
|
||||
CargaConductor(CveConductor)
|
||||
UpDatos.Update()
|
||||
CargaMapa()
|
||||
End If
|
||||
If Request("CveDispositivo") IsNot Nothing AndAlso Request("CveDispositivo").ToString.ToEntero > 0 Then
|
||||
CveDispositivo = Request("CveDispositivo").ToString.ToEntero
|
||||
CveConductor = -1
|
||||
|
||||
DdlGrupo.SelectedValueExist("2")
|
||||
CargaGrupos()
|
||||
DdlNombre.SelectedValueExist(CveDispositivo)
|
||||
CargaPonderacion()
|
||||
CargaGraficas()
|
||||
CargaVehiculo(CveDispositivo)
|
||||
DvContenido.Visible = True
|
||||
UpDatos.Update()
|
||||
CargaMapa()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaFechas()
|
||||
txtFechaI.Text = $"01/{Now.Month}/{Now.Year} 00:00"
|
||||
txtFechaF.Text = DateTime.Now.ToString("dd/MM/yyyy") + " 23:59"
|
||||
End Sub
|
||||
#Region "Conductores"
|
||||
|
||||
Private Sub CargaPonderacion()
|
||||
Dim ObjGps As New ClsGPS
|
||||
Dim Ponderacion As Integer = 100
|
||||
Dim Riesgo As String = "0"
|
||||
Dim Desgaste As String = "0"
|
||||
Dim TotalEventos As String = "0"
|
||||
|
||||
If CveConductor <= 0 AndAlso CveDispositivo > 0 Then
|
||||
If ObjGps.ConductoresGet(-1, "-1", -1, UsuarioActual.CveCliente) AndAlso ObjGps.DtResultados.Rows.Count > 0 Then
|
||||
CveConductor = ObjGps.DtResultados.FiltroPrimeroValor("CveConductor", $"CveDispositivo = {CveDispositivo}").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjGps.GetEventosPonderacionCliente(UsuarioActual.CveCliente, CveConductor, txtFechaI.Text.ToDateTime(), txtFechaF.Text.ToDateTime()) AndAlso ObjGps.DtResultados.Rows.Count > 0 Then
|
||||
Ponderacion = 100 - ObjGps.DtResultados(0)("Total").ToString.ToEntero
|
||||
Riesgo = ObjGps.DtResultados(0)("Riesgo").ToString
|
||||
Desgaste = ObjGps.DtResultados(0)("Desgaste").ToString
|
||||
TotalEventos = ObjGps.DtResultados(0)("TotalEventos").ToString
|
||||
End If
|
||||
|
||||
LblPonderacion.Text = Ponderacion.ToString
|
||||
LblRiesgo.Text = Riesgo
|
||||
LblDesgaste.Text = Desgaste
|
||||
LblTotalEventos.Text = TotalEventos
|
||||
|
||||
If Ponderacion >= 70 Then
|
||||
DivTituloPonderacion.Attributes("class") = "toplistaVerde verde"
|
||||
DivCirculoPonderacion.Attributes("class") = "circuloVerde verde"
|
||||
ElseIf Ponderacion >= 50 Then
|
||||
DivTituloPonderacion.Attributes("class") = "toplistaAmarillo amarillo"
|
||||
DivCirculoPonderacion.Attributes("class") = "circuloAmarillo amarillo"
|
||||
Else
|
||||
DivTituloPonderacion.Attributes("class") = "toplistaRojo rojo"
|
||||
DivCirculoPonderacion.Attributes("class") = "circuloRojo rojo"
|
||||
End If
|
||||
|
||||
ObjGps.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaConductor(CveConductor As Integer)
|
||||
Dim ObjGps As New ClsGPS
|
||||
If ObjGps.ConductoresGet(CveConductor, "-1", -1, UsuarioActual.CveCliente) AndAlso ObjGps.DtResultados.Rows.Count > 0 Then
|
||||
LblConductor.Text = ObjGps.DtResultados(0)("Conductor").ToString
|
||||
LblFechaNacimiento.Text = ObjGps.DtResultados(0)("FechaNacimiento").ToString.ToDateTime.ToShortDateString
|
||||
LblSerieLicencia.Text = ObjGps.DtResultados(0)("SerieLicencia").ToString
|
||||
LblVigencia.Text = ObjGps.DtResultados(0)("VencimientoLicencia").ToString.ToDateTime.ToShortDateString
|
||||
LblEstatus.Text = ObjGps.DtResultados(0)("EstatusT").ToString
|
||||
|
||||
If ObjGps.DtResultados(0)("Estatus").ToString = "True" Then
|
||||
LblEstatus.ForeColor = Drawing.Color.Green
|
||||
Else
|
||||
LblEstatus.ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
End If
|
||||
ObjGps.Dispose()
|
||||
TbConductor.Visible = True
|
||||
TbVehiculo.Visible = False
|
||||
UpInfo.Update()
|
||||
End Sub
|
||||
Private Sub CargaVehiculo(CveDispositivo As Integer)
|
||||
Dim DrVehiculo = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltroPrimero($"CveDispositivo = {CveDispositivo}")
|
||||
If DrVehiculo IsNot Nothing Then
|
||||
LblVehiculo.Text = DrVehiculo("NombreVehiculo").ToString
|
||||
LblNoEconomicos.Text = DrVehiculo("NoEconomico").ToString
|
||||
LblModelo.Text = DrVehiculo("Modelo").ToString
|
||||
LblAnio.Text = DrVehiculo("AñoVehiculo").ToString
|
||||
LblVelocidad.Text = DrVehiculo("VelocidadMaxima").ToString
|
||||
End If
|
||||
TbConductor.Visible = False
|
||||
TbVehiculo.Visible = True
|
||||
UpInfo.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaMapa()
|
||||
Dim ObjGps As New ClsGPS
|
||||
|
||||
If ObjGps.UltimaPosicionEquipoGet(CveDispositivo, txtFechaI.Text.ToDateTime(), txtFechaF.Text.ToDateTime()) AndAlso ObjGps.DtResultados.Rows.Count > 0 Then
|
||||
Dim Coord As String = SQLToGmaps(ObjGps.DtResultados.Rows(0)("Posicion").ToString, "POINT")
|
||||
RegistraScript($"DeleteMarkers();CreaMarcador({Coord},'{ObjGps.DtResultados.Rows(0)("NombreVehiculo")}');")
|
||||
End If
|
||||
|
||||
ObjGps.Dispose()
|
||||
End Sub
|
||||
Private Sub CargaGraficas()
|
||||
Dim ObjGps As New ClsGPS
|
||||
|
||||
Dim Velocidad As String = "0"
|
||||
Dim VelocidadMaxima As String = "0"
|
||||
|
||||
If ObjGps.GetConductoresVelocidades(CveConductor) AndAlso ObjGps.DtResultados.Rows.Count > 0 Then
|
||||
Velocidad = ObjGps.DtResultados(0)("Velocidad").ToString
|
||||
VelocidadMaxima = ObjGps.DtResultados(0)("VelocidadMaxima").ToString
|
||||
CveDispositivo = ObjGps.DtResultados(0)("CveDispositivo").ToString.ToEntero
|
||||
End If
|
||||
|
||||
|
||||
If ObjGps.GetConductoresEventos(CveConductor) Then
|
||||
Dim Random = New Random()
|
||||
Dim JsonArray As New JArray(
|
||||
From dr In ObjGps.DtResultados
|
||||
Let color = String.Format("#{0:X6}", Random.Next(&H1000000))
|
||||
Select New JObject(
|
||||
New JProperty("evento", dr("Evento").ToString),
|
||||
New JProperty("value", dr("Total").ToString),
|
||||
New JProperty("color", color)
|
||||
)
|
||||
)
|
||||
HdnValoresPastel.Value = JsonArray.ToString
|
||||
End If
|
||||
ObjGps.Dispose()
|
||||
RegistraScript($"EstablecerValoresTacometro(""{VelocidadMaxima}"",""{Velocidad}"");", "1")
|
||||
RegistraScript($"EstablecerValoresPastel();", "2")
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function SQLToGmaps(CoordsSQL As String, Tipo As String) As String
|
||||
Dim CoordsPoligono As String = CoordsSQL.Replace($"{Tipo}", "").Replace(")", "").Replace("(", "")
|
||||
Dim CoordsPuntos() As String = CoordsPoligono.Split(","c)
|
||||
Dim Var As String = ""
|
||||
For Each coordenada As String In CoordsPuntos
|
||||
If coordenada Is CoordsPuntos.Last Then
|
||||
Dim latlng() As String = coordenada.Trim.Split(" "c)
|
||||
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }}"
|
||||
Else
|
||||
Dim latlng() As String = coordenada.Trim.Split(" "c)
|
||||
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }},"
|
||||
End If
|
||||
Next
|
||||
Return Var
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
#Region "Lista Conductores"
|
||||
Private Sub CargaGrupos()
|
||||
DdlNombre.Items.Clear()
|
||||
|
||||
Dim ObjGps As New ClsGPS
|
||||
Select Case DdlGrupo.SelectedValue
|
||||
Case "1" 'CONDUCTOR
|
||||
If ObjGps.ConductoresGet(-1, "-1", -1, UsuarioActual.CveCliente) Then
|
||||
Dim Query = From d In ObjGps.DtResultados
|
||||
Select Cve = d("CveConductor").ToString.ToEntero, Nombre = d("Conductor").ToString
|
||||
DdlNombre.DataSource = Query
|
||||
LtlNombre.Text = "Conductor:"
|
||||
End If
|
||||
Case "2" 'VEHICULOS
|
||||
Dim Query = From d In GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario)
|
||||
Select Cve = d("CveDispositivo").ToString.ToEntero, Nombre = d("NoEconomico").ToString
|
||||
DdlNombre.DataSource = Query
|
||||
LtlNombre.Text = "Vehículo:"
|
||||
End Select
|
||||
ObjGps.Dispose()
|
||||
DdlNombre.DataBind()
|
||||
DdlNombre.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
UPFiltros.Update()
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
Protected Sub DdlGrupo_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargaGrupos()
|
||||
End Sub
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Select Case DdlGrupo.SelectedValue
|
||||
Case "1" 'CONDUCTOR
|
||||
CveConductor = DdlNombre.SelectedValue.ToEntero
|
||||
CargaPonderacion()
|
||||
CargaGraficas()
|
||||
CargaConductor(CveConductor)
|
||||
|
||||
Case "2" 'VEHICULOS
|
||||
CveDispositivo = DdlNombre.SelectedValue.ToEntero
|
||||
CveConductor = -1
|
||||
CargaPonderacion()
|
||||
CargaGraficas()
|
||||
CargaVehiculo(CveDispositivo)
|
||||
End Select
|
||||
DvContenido.Visible = True
|
||||
UpDatos.Update()
|
||||
CargaMapa()
|
||||
End Sub
|
||||
End Class
|
||||
154
GPS/ConfiguradorVehiculos.aspx
Normal file
154
GPS/ConfiguradorVehiculos.aspx
Normal file
@@ -0,0 +1,154 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="ConfiguradorVehiculos.aspx.vb" Inherits="GPS_ConfiguradorVehiculos" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
||||
<style>
|
||||
.ADScroller .ADScroller-body {
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpDatos">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- BEGIN SAMPLE TABLE PORTLET-->
|
||||
<div class="portlet light ">
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size:25px">
|
||||
<i class="fa fa-truck font-green"></i>
|
||||
<span class="caption-subject font-green bold uppercase" style="font-size:18px" >Dispositivos Disponibles</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<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="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDispositivos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDispositivos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:GridView ID="GvDispositivos" runat="server" GridLines="None" DataKeyNames="CveDispositivo,SerieVehiculo,DevID,NoEconomico, ModeloVehiculo, NombreVehiculo, PlacasVehiculo,LimiteVelocidad, VelocidadMaxima, DetallesVehiculo, Rendimiento, AñoVehiculo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:hyperlinkfield DataNavigateUrlFields="CveDispositivo" DataTextField="SerieVehiculo" DataNavigateUrlFormatString="/GPS/Vehiculos.aspx?CveDispositivo={0}" ItemStyle-Width="15%" HeaderText="Serie Vehículo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="15%" HeaderText="Numero Económico" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="NombreVehiculo" ItemStyle-Width="10%" HeaderText="Nombre Vehículo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="ModeloVehiculo" ItemStyle-Width="10%" HeaderText="Modelo Vehículo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="AñoVehiculo" ItemStyle-Width="7%" HeaderText="Año Vehículo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="PlacasVehiculo" ItemStyle-Width="5%" HeaderText="Placas Vehículo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Rendimiento" ItemStyle-Width="8%" HeaderText="Rendimiento" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Limite Velocidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblLimiteVelocidad" runat="server" Text=""></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="7%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="imgE" HeaderText="Eliminar" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="divAgregarTipo" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Editar Vehículo</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyTipoEquipo" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtNombreVehiculo" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtNombreVehiculo.ClientID.ToString()%>">Nombre Vehiculo:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtNumeroEconomico" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtNumeroEconomico.ClientID.ToString()%>">Número Económico:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtModeloVehiculo" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtModeloVehiculo.ClientID.ToString()%>">Modelo Vehiculo:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAñoVehiculo" runat="server" MaxLength="4" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtAñoVehiculo.ClientID.ToString()%>">Año Vehiculo:</label>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" TargetControlID="TxtAñoVehiculo" FilterType="Custom, Numbers" ValidChars="." />
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPlacas" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox><asp:Literal runat="server"></asp:Literal>
|
||||
<label for="<%= TxtPlacas.ClientID.ToString()%>" >Placas Vehiculo:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label style=" top: 0;margin-bottom: 0;font-size: 13px;opacity: 1; color: #888888;">Aplica Límite de Velocidad: </label>
|
||||
<br />
|
||||
<asp:CheckBox ID="chkLimiteVelocidad" Text=" " onchange="HabilitaTextBox();" runat="server" CssClass="chksino" Width="250px"></asp:CheckBox>
|
||||
</div>
|
||||
<div id="dvVelocidad" style="display:none" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLimiteVelocidad" runat="server" CssClass="form-control" MaxLength="50" CausesValidation="true"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="SoloNumerosCantidad" runat="server" TargetControlID="TxtLimiteVelocidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<label style="margin-top: -6px" for="<%= TxtLimiteVelocidad.ClientID.ToString()%>">Limite Velocidad (KM/H):</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtDetallesVehiculo" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox><asp:Literal runat="server"></asp:Literal>
|
||||
<label for="<%= TxtDetallesVehiculo.ClientID.ToString()%>">Detalles Vehiculo:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtRendimientoVehiculo" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox><asp:Literal runat="server" ></asp:Literal>
|
||||
<ajax:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="TxtRendimientoVehiculo" FilterType="Custom, Numbers" ValidChars="." />
|
||||
<label for="<%= TxtRendimientoVehiculo.ClientID.ToString()%>">Rendimiento Vehiculo:</label>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnActualizar" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio">Actualizar</asp:LinkButton>
|
||||
<button id="btnCancelarTE" class="btn btn-default" data-dismiss="modal" value="Cancelar"> Cancelar </button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="JS" Runat="Server">
|
||||
<script>
|
||||
function HabilitaTextBox() {
|
||||
if ($("#C_chkLimiteVelocidad")["0"].checked) {
|
||||
$("#C_dvVelocidad").css('display', '')
|
||||
} else {
|
||||
$("#C_dvVelocidad").css('display', 'none')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
71
GPS/ConfiguradorVehiculos.aspx.vb
Normal file
71
GPS/ConfiguradorVehiculos.aspx.vb
Normal file
@@ -0,0 +1,71 @@
|
||||
Imports Extensiones
|
||||
Partial Class GPS_ConfiguradorVehiculos
|
||||
Inherits ClsPaginas
|
||||
|
||||
Public Property CveDispositivo As Integer
|
||||
Get
|
||||
Return ViewState("CveDispositivo").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveDispositivo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDispositivos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDispositivos()
|
||||
Dim ObjGPS As New ClsGPS
|
||||
GvDispositivos.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("Estatus = 1 ")
|
||||
GvDispositivos.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDispositivos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDispositivos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
If e.Row.DBCampo("Estatus").ToString.ToEntero = 1 Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
If CBool(e.Row.DataKey("LimiteVelocidad").ToString) = False Then
|
||||
e.Row.FCLabel("LblLimiteVelocidad").Text = "No Aplica"
|
||||
Else
|
||||
e.Row.FCLabel("LblLimiteVelocidad").Text = e.Row.DBCampo("VelocidadMaxima")
|
||||
End If
|
||||
e.Row.FCHyperLink("ImgE").NavigateUrl = $"/GPS/Vehiculos.aspx?CveDispositivo={e.Row.DataKey("CveDispositivo").ToString}&ATI=7"
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub chkLimiteVelocidad_CheckedChanged(sender As Object, e As EventArgs) Handles chkLimiteVelocidad.CheckedChanged
|
||||
dvVelocidad.Visible = chkLimiteVelocidad.Checked
|
||||
UpBodyTipoEquipo.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
'Protected Sub BtnActualizar_Click(sender As Object, e As EventArgs)
|
||||
' Dim gps As New ClsGPS
|
||||
' If gps.DispositivosUpdatePorCliente(CveDispositivo, TxtModeloVehiculo.Text, TxtAñoVehiculo.Text, "", TxtPlacas.Text, chkLimiteVelocidad.Checked, If(chkLimiteVelocidad.Checked, TxtLimiteVelocidad.Text.ToDouble, 0),
|
||||
' TxtDetallesVehiculo.Text, TxtRendimientoVehiculo.Text.ToDouble, "", "", TxtNombreVehiculo.Text, TxtNumeroEconomico.Text) Then
|
||||
' Alert("La configuración del vehículo se actualizó correctamente")
|
||||
' End If
|
||||
' gps.Dispose()
|
||||
' CargaGlobal()
|
||||
'End Sub
|
||||
|
||||
Private Sub CargaGlobal()
|
||||
Dim gps As New ClsGPS
|
||||
If gps.DispositivosGet(-1, -1, -1) Then
|
||||
GlobalDTDispositivos(-1) = gps.DtResultados
|
||||
Else
|
||||
Application("GlobalDTDispositivos") = Nothing
|
||||
End If
|
||||
gps.Dispose()
|
||||
CargaDispositivos()
|
||||
End Sub
|
||||
End Class
|
||||
995
GPS/DashboardGPS.aspx
Normal file
995
GPS/DashboardGPS.aspx
Normal file
@@ -0,0 +1,995 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="DashboardGPS.aspx.vb" Inherits="DashboardGPS" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
|
||||
<style>
|
||||
@import url(https://fonts.googleapis.com/css?family=Droid+Sans:400,700|Droid+Serif:400,700);
|
||||
|
||||
#chartdivGraficaGrande {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
#chartdivKilometrajeUnidades {
|
||||
width: 100%;
|
||||
height: 230px;
|
||||
}
|
||||
|
||||
#chartdivPIVisitados {
|
||||
width: 100%;
|
||||
height: 230px;
|
||||
}
|
||||
|
||||
#chartdivMejoresConductores {
|
||||
width: 100%;
|
||||
height: 230px;
|
||||
}
|
||||
|
||||
#chartdivUnidadesReportando {
|
||||
width: 100%;
|
||||
height: 230px;
|
||||
}
|
||||
|
||||
#chartdivTiempoPI {
|
||||
width: 100%;
|
||||
height: 230px;
|
||||
}
|
||||
|
||||
#chartdivTiempoOperacion {
|
||||
width: 100%;
|
||||
height: 230px;
|
||||
}
|
||||
|
||||
#chartdivRendimientoCombustible {
|
||||
width: 100%;
|
||||
height: 230px;
|
||||
}
|
||||
|
||||
.amcharts-chart-div a {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.contenedor {
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
color: #989A8F;
|
||||
width: 450px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.calificador {
|
||||
height: 270px;
|
||||
width: 75%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.toplistaVerde {
|
||||
background-color: #1BA39C;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaAmarillo {
|
||||
background-color: #c29d0b;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaRojo {
|
||||
background-color: #E43A45;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaAzul {
|
||||
background-color: #337ab7;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.bottomlista {
|
||||
margin-top: 25%;
|
||||
}
|
||||
|
||||
|
||||
.circuloVerde {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #1BA39C;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.verde {
|
||||
color: #1BA39C;
|
||||
}
|
||||
|
||||
.circuloAmarillo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #c29d0b;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.amarillo {
|
||||
color: #c29d0b;
|
||||
}
|
||||
|
||||
.circuloRojo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #E43A45;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.rojo {
|
||||
color: #E43A45;
|
||||
}
|
||||
|
||||
.circuloAzul {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #337ab7;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.azul {
|
||||
color: #337ab7;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
SIG GPS
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel ID="UpLnkAgregar" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="lnkBusqueda" runat="server"><i class="fa fa-plus"></i>Cambiar Filtros</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpGraficas" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div style="height: 1500px">
|
||||
|
||||
|
||||
<div class="Row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light ">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px">
|
||||
<i style="font-size: larger" class="fa fa-dashboard font-blue"></i>
|
||||
<span class="caption-subject font-blue bold uppercase" style="font-size: 14px">Kilometraje de Unidades</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkKilometraje" runat="server"><i class="fa fa-expand"></i></asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<div id="chartdivKilometrajeUnidades"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light ">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px">
|
||||
<i style="font-size: larger" class="fa fa-map-marker font-green"></i>
|
||||
<span class="caption-subject font-green bold uppercase" style="font-size: 14px">Puntos de Interés Visitados</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<asp:UpdatePanel ID="UpdatePanel5" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkPIVisitados" runat="server"><i class="fa fa-expand"></i></asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<div id="chartdivPIVisitados"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light" style="height: 348px">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px">
|
||||
<i style="font-size: larger" class="fa fa-exclamation-circle font-red"></i>
|
||||
<span class="caption-subject font-red bold uppercase" style="font-size: 14px">Botón de Pánico</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
|
||||
<a href="#" class="fullscreen" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body contenedor">
|
||||
<div class="calificador">
|
||||
<div class="toplistaRojo rojo" runat="server">
|
||||
<div id="DivCirculoPonderacion" class="circuloRojo rojo" runat="server">
|
||||
<asp:Label runat="server" ID="LblBotonPanico" Text="0" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light " style="height: 348px">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px">
|
||||
<i style="font-size: larger" class="fa fa-exclamation-triangle font-yellow"></i>
|
||||
<span class="caption-subject font-yellow bold uppercase" style="font-size: 14px">Ralentí</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
|
||||
<a href="#" class="fullscreen" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body contenedor">
|
||||
<div class="calificador">
|
||||
<div class="toplistaAmarillo amarillo" runat="server">
|
||||
<div class="circuloAmarillo amarillo" runat="server">
|
||||
<asp:Label runat="server" ID="LblRalenti" Text="0" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light ">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px">
|
||||
<i style="font-size: larger" class="fa fa-star font-green"></i>
|
||||
<span class="caption-subject font-green bold uppercase" style="font-size: 14px">Mejores Conductores</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<asp:UpdatePanel ID="UpdatePanel6" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkMejoresConductores" runat="server"><i class="fa fa-expand"></i></asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<div id="chartdivMejoresConductores"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light " style="height: 348px">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px">
|
||||
<i style="font-size: larger" class="fa fa-road font-blue"></i>
|
||||
<span class="caption-subject font-blue bold uppercase" style="font-size: 14px">Trayectos</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
|
||||
<a href="#" class="fullscreen" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body contenedor">
|
||||
<div class="calificador">
|
||||
<div class="toplistaAzul azul" runat="server">
|
||||
<div class="circuloAzul azul" runat="server">
|
||||
<asp:Label runat="server" ID="Label2" Text="7" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light ">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px">
|
||||
<i style="font-size: larger" class="fa fa-check-circle-o font-blue"></i>
|
||||
<span class="caption-subject font-blue bold uppercase" style="font-size: 14px">Unidades Reportando</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<div id="chartdivUnidadesReportando"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light ">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px">
|
||||
<i style="font-size: larger" class="fa fa-car font-yellow"></i>
|
||||
<span class="caption-subject font-yellow bold uppercase" style="font-size: 14px">Tiempos de Operación</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<asp:UpdatePanel ID="UpdatePanel7" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkTiemposOperacion" runat="server"><i class="fa fa-expand"></i></asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<div id="chartdivTiempoOperacion"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light ">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px">
|
||||
<i style="font-size: larger" class="fa fa-flask font-yellow"></i>
|
||||
<span class="caption-subject font-yellow bold uppercase" style="font-size: 14px">Rendimiento de Combustible</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<asp:UpdatePanel ID="UpdatePanel8" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkRendimientoCombustible" runat="server"><i class="fa fa-expand"></i></asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<div id="chartdivRendimientoCombustible"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="Row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light ">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px">
|
||||
<i style="font-size: larger" class="fa fa-clock-o font-green"></i>
|
||||
<span class="caption-subject font-green bold uppercase" style="font-size: 14px">Tiempo en Puntos de Interés</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<asp:UpdatePanel ID="UpdatePanel9" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkTiempoPuntosInteres" runat="server"><i class="fa fa-expand"></i></asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<div id="chartdivTiempoPI"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light " style="height: 348px">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px">
|
||||
<i style="font-size: larger" class="fa fa-battery-quarter font-red"></i>
|
||||
<span class="caption-subject font-red bold uppercase" style="font-size: 14px">Desconexión de Bateria</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
|
||||
<a href="#" class="fullscreen" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body contenedor">
|
||||
<div class="calificador">
|
||||
<div class="toplistaRojo rojo" runat="server">
|
||||
<div id="Div1" class="circuloRojo rojo" runat="server">
|
||||
<asp:Label runat="server" ID="LblDesconexion" Text="0" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="portlet light " style="height: 348px">
|
||||
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px">
|
||||
<i style="font-size: larger" class="fa fa-close font-yellow"></i>
|
||||
<span class="caption-subject font-yellow bold uppercase" style="font-size: 14px">Tiempos Muertos</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
|
||||
<a href="#" class="fullscreen" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body contenedor">
|
||||
<div class="calificador">
|
||||
<div class="toplistaAmarillo amarillo" runat="server">
|
||||
<div class="circuloAmarillo amarillo" runat="server">
|
||||
<asp:Label runat="server" ID="LblTiempoMuerto" Text="11" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel1">
|
||||
<ContentTemplate>
|
||||
<asp:Button runat="server" ID="BtnTrampa" Style="visibility: hidden;" />
|
||||
<asp:HiddenField runat="server" ID="HdnTipoFecha" ClientIDMode="Static" Value="0" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%-- MODAL FIltros de Busqueda --%>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UPModalBusqueda">
|
||||
<ContentTemplate>
|
||||
<div id="dvConsulta" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UPConsulta" class="modal-content rowpadding" style="width: 670px;" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel2" runat="server">Filtros</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-2"></div>
|
||||
<label class="col-md-1 truncate">F.I.:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpObligatorio"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1"></div>
|
||||
<label class="col-md-1 truncate">F.F.:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 140px !important; padding: 0px;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpObligatorio"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<div class="btn-group" data-toggle="buttons">
|
||||
<asp:Label runat="server" onclick="CambiarFechas(1);" ID="LblUltimoDia" class="btn blue" Style="width: 150px;">
|
||||
<input type="radio" class="toggle">
|
||||
Último Día
|
||||
</asp:Label>
|
||||
<asp:Label runat="server" onclick="CambiarFechas(2);" ID="LblUltimaSemana" class="btn blue" Style="width: 150px; margin-left: 10px;">
|
||||
<input type="radio" class="toggle">
|
||||
Última Semana
|
||||
</asp:Label>
|
||||
<asp:Label runat="server" onclick="CambiarFechas(3);" ID="lblUltimoMes" class="btn blue" Style="width: 150px; margin-left: 10px;">
|
||||
<input type="radio" class="toggle">
|
||||
Último Mes
|
||||
</asp:Label>
|
||||
<asp:Label runat="server" onclick="CambiarFechas(4);" ID="LblUltimoAño" class="btn blue" Style="width: 150px; margin-left: 10px;">
|
||||
<input type="radio" class="toggle">
|
||||
Último Año
|
||||
</asp:Label>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<asp:Label runat="server" onclick="CambiarFechas(5);" ID="LblDiaCorriente" class="btn blue" Style="width: 150px;">
|
||||
<input type="radio" class="toggle">
|
||||
Día Corriente
|
||||
</asp:Label>
|
||||
<asp:Label runat="server" onclick="CambiarFechas(6);" ID="LblSemanaCorriente" class="btn blue" Style="width: 150px; margin-left: 10px;">
|
||||
<input type="radio" class="toggle">
|
||||
Semana Corriente
|
||||
</asp:Label>
|
||||
<asp:Label runat="server" onclick="CambiarFechas(7);" ID="LblMesCorriente" class="btn blue" Style="width: 150px; margin-left: 10px;">
|
||||
<input type="radio" class="toggle">
|
||||
Mes Corriente
|
||||
</asp:Label>
|
||||
<asp:Label runat="server" onclick="CambiarFechas(8);" ID="LblAñoCorriente" class="btn blue" Style="width: 150px; margin-left: 10px;">
|
||||
<input type="radio" class="toggle">
|
||||
Año Corriente
|
||||
</asp:Label>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnRastrear" runat="server" autopostback="true" Text="Aceptar" CssClass="btn btn-primary"></asp:Button>
|
||||
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%-- Modal Grafica Grande --%>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel2">
|
||||
<ContentTemplate>
|
||||
<div id="DivGrafica" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpdatePanel3" class="modal-content rowpadding" style="width: 1300px; height: 600px;" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<asp:UpdatePanel ID="UpTituloGraficaGrande" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<h4 class="modal-title" id="H1" runat="server">
|
||||
<asp:Label runat="server" ID="LblGrafica" Text="Gráfica" /></h4>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div id="chartdivGraficaGrande"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/pie.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/gauge.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/plugins/animate/animate.min.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||
|
||||
<script>
|
||||
|
||||
function CambiarFechas(valor) {
|
||||
$('#HdnTipoFecha').val(valor)
|
||||
$("#C_BtnTrampa").click();
|
||||
}
|
||||
|
||||
function KilometrajeDispositivos(datos, div) {
|
||||
|
||||
var KilometrajeDispositivos = AmCharts.makeChart(div, {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"dataProvider": datos,
|
||||
"valueAxes": [{
|
||||
"gridColor": "#FFFFFF",
|
||||
"gridAlpha": 0.2,
|
||||
"dashLength": 0
|
||||
}],
|
||||
"gridAboveGraphs": true,
|
||||
"startDuration": 1,
|
||||
"graphs": [{
|
||||
"balloonText": "[[category]]: <b>[[value]]</b>",
|
||||
"fillAlphas": 0.8,
|
||||
"lineAlpha": 0.2,
|
||||
"type": "column",
|
||||
"valueField": "kilometros",
|
||||
"colorField": "color"
|
||||
}],
|
||||
"chartCursor": {
|
||||
"categoryBalloonEnabled": false,
|
||||
"cursorAlpha": 0,
|
||||
"zoomable": false
|
||||
},
|
||||
"categoryField": "dispositivos",
|
||||
"categoryAxis": {
|
||||
"gridPosition": "start",
|
||||
"labelRotation": 45
|
||||
},
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function MejoresConductores(datos, div) {
|
||||
|
||||
var MejoresConductores = AmCharts.makeChart(div, {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"dataProvider": datos,
|
||||
"valueAxes": [{
|
||||
"gridColor": "#FFFFFF",
|
||||
"minimum": 0,
|
||||
"maximum": 100,
|
||||
"gridAlpha": 0.2,
|
||||
"dashLength": 0
|
||||
}],
|
||||
"gridAboveGraphs": true,
|
||||
"startDuration": 1,
|
||||
"graphs": [{
|
||||
"balloonText": "[[category]]: <b>[[value]]</b>",
|
||||
"fillAlphas": 0.8,
|
||||
"lineAlpha": 0.2,
|
||||
"type": "column",
|
||||
"valueField": "valor",
|
||||
"colorField": "color"
|
||||
}],
|
||||
"chartCursor": {
|
||||
"categoryBalloonEnabled": false,
|
||||
"cursorAlpha": 0,
|
||||
"zoomable": false
|
||||
},
|
||||
"categoryField": "conductor",
|
||||
"categoryAxis": {
|
||||
"gridPosition": "start",
|
||||
"labelRotation": 45
|
||||
},
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function TiempoPuntosInteres(datos, div) {
|
||||
var TiempoPI = AmCharts.makeChart(div, {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"dataProvider": datos,
|
||||
"gridAboveGraphs": true,
|
||||
"startDuration": 1,
|
||||
"graphs": [{
|
||||
"balloonText": "[[category]]: <b>[[value]]</b>",
|
||||
"fillAlphas": 0.8,
|
||||
"lineAlpha": 0.2,
|
||||
"type": "column",
|
||||
"valueField": "duracion",
|
||||
"colorField": "color"
|
||||
}],
|
||||
"chartCursor": {
|
||||
"categoryBalloonEnabled": false,
|
||||
"cursorAlpha": 0,
|
||||
"zoomable": false
|
||||
},
|
||||
"categoryField": "pi",
|
||||
"categoryAxis": {
|
||||
"gridPosition": "start",
|
||||
"labelRotation": 45
|
||||
},
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function PuntosDeInteresDispositivos(total, chart, div) {
|
||||
|
||||
var chartData = chart;
|
||||
|
||||
var currentYear = total;
|
||||
var PIVisitados = AmCharts.makeChart(div, {
|
||||
"type": "pie",
|
||||
"theme": "light",
|
||||
"labelText": "[[percents]]%",
|
||||
"dataProvider": [],
|
||||
"valueField": "size",
|
||||
"colorField": "color",
|
||||
"titleField": "title",
|
||||
"startDuration": 0,
|
||||
"innerRadius": "50%",
|
||||
"pullOutRadius": "2%",
|
||||
"marginTop": 20,
|
||||
"titles": "",
|
||||
"allLabels": [{
|
||||
"y": "50%",
|
||||
"align": "center",
|
||||
"size": 12,
|
||||
"bold": true,
|
||||
"text": currentYear,
|
||||
"color": "#555"
|
||||
}],
|
||||
"listeners": [{
|
||||
"event": "init",
|
||||
"method": function (e) {
|
||||
var chart = e.chart;
|
||||
|
||||
function getCurrentData() {
|
||||
var data = chartData[currentYear];
|
||||
return data;
|
||||
}
|
||||
|
||||
function inicar() {
|
||||
chart.allLabels[0].text = currentYear;
|
||||
var data = getCurrentData();
|
||||
chart.animateData(data, {
|
||||
duration: 0,
|
||||
complete: function () {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
inicar();
|
||||
}
|
||||
}],
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function TiempoDeOperacion(data, div) {
|
||||
|
||||
var tiempoOperacion = AmCharts.makeChart(div, {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"dataProvider": data,
|
||||
"valueAxes": [{
|
||||
"stackType": "regular",
|
||||
"axisAlpha": 0.3,
|
||||
"gridAlpha": 0,
|
||||
"strictMinMax": true
|
||||
}],
|
||||
"graphs": [{
|
||||
"balloonText": "<b>[[title]]</b><br><span style='font-size:14px'>[[category]]: <b>[[value]]</b></span>",
|
||||
"fillColors": "#E43A45",
|
||||
"fillAlphas": 0.8,
|
||||
"labelText": "[[value]] horas",
|
||||
"lineColor": "#000000",
|
||||
"lineAlpha": 0.3,
|
||||
"title": "Apagado",
|
||||
"type": "column",
|
||||
"color": "#000000",
|
||||
"valueField": "apagado"
|
||||
}, {
|
||||
"balloonText": "<b>[[title]]</b><br><span style='font-size:14px'>[[category]]: <b>[[value]]</b></span>",
|
||||
"fillColors": "#1BA39C",
|
||||
"fillAlphas": 0.8,
|
||||
"labelText": "[[value]] horas",
|
||||
"lineColor": "#000000",
|
||||
"lineAlpha": 0.3,
|
||||
"title": "Encendido",
|
||||
"type": "column",
|
||||
"color": "#000000",
|
||||
"valueField": "encendido"
|
||||
}],
|
||||
"categoryField": "dispositivo",
|
||||
"categoryAxis": {
|
||||
"gridPosition": "start",
|
||||
"axisAlpha": 0,
|
||||
"gridAlpha": 0,
|
||||
"position": "left"
|
||||
},
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function RendimientoCombustible(data, div) {
|
||||
|
||||
var rendimientoCombustible = AmCharts.makeChart(div, {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"dataProvider": data,
|
||||
"valueAxes": [{
|
||||
"stackType": "regular",
|
||||
"axisAlpha": 0.3,
|
||||
"gridAlpha": 0
|
||||
}],
|
||||
"graphs": [{
|
||||
"balloonText": "<b>[[title]]</b><br><span style='font-size:14px'>[[category]]: <b>[[value]] lts</b></span>",
|
||||
"fillColors": "#E87E04",
|
||||
"fillAlphas": 0.8,
|
||||
"labelText": "[[value]] lts",
|
||||
"lineColor": "#000000",
|
||||
"lineAlpha": 0.3,
|
||||
"title": "Combustible",
|
||||
"type": "column",
|
||||
"color": "#000000",
|
||||
"valueField": "combustible"
|
||||
}, {
|
||||
"balloonText": "<b>[[title]]</b><br><span style='font-size:14px'>[[category]]: <b>[[value]] km</b></span>",
|
||||
"fillColors": "#2F353B",
|
||||
"fillAlphas": 0.8,
|
||||
"labelText": "[[value]] km",
|
||||
"lineColor": "#000000",
|
||||
"lineAlpha": 0.3,
|
||||
"title": "Kilometraje",
|
||||
"type": "column",
|
||||
"color": "#000000",
|
||||
"valueField": "kilometraje"
|
||||
}],
|
||||
"categoryField": "dispositivo",
|
||||
"categoryAxis": {
|
||||
"gridPosition": "start",
|
||||
"axisAlpha": 0,
|
||||
"gridAlpha": 0,
|
||||
"position": "left"
|
||||
},
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function UnidadesReportando(reportando, total, porcentaje, div) {
|
||||
var unidadesReportando = AmCharts.makeChart(div, {
|
||||
"type": "gauge",
|
||||
"theme": "light",
|
||||
"axes": [{
|
||||
"axisAlpha": 0,
|
||||
"tickAlpha": 0,
|
||||
"labelsEnabled": false,
|
||||
"startValue": 0,
|
||||
"endValue": total,
|
||||
"startAngle": -90,
|
||||
"endAngle": 90,
|
||||
"bands": [{
|
||||
"color": "#eee",
|
||||
"startValue": 0,
|
||||
"endValue": total,
|
||||
"radius": "100%",
|
||||
"innerRadius": "85%"
|
||||
}, {
|
||||
"color": "#08A3CC",
|
||||
"startValue": 0,
|
||||
"endValue": reportando,
|
||||
"radius": "100%",
|
||||
"innerRadius": "85%",
|
||||
"balloonText": porcentaje
|
||||
}]
|
||||
}],
|
||||
"allLabels": [{
|
||||
"text": reportando,
|
||||
"x": "54%",
|
||||
"y": "50%",
|
||||
"size": 60,
|
||||
"bold": true,
|
||||
"color": "#555555",
|
||||
"align": "right"
|
||||
},
|
||||
{
|
||||
"text": total,
|
||||
"x": "83%",
|
||||
"y": "58%",
|
||||
"size": 20,
|
||||
"bold": true,
|
||||
"color": "#BFBFBF",
|
||||
"align": "right"
|
||||
},],
|
||||
"export": {
|
||||
"enabled": true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#mBody').addClass("page-sidebar-closed");
|
||||
$('#ulmenulateralmaster').addClass("page-sidebar-menu-closed");
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=drawing"></script>
|
||||
</asp:Content>
|
||||
|
||||
538
GPS/DashboardGPS.aspx.vb
Normal file
538
GPS/DashboardGPS.aspx.vb
Normal file
@@ -0,0 +1,538 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class DashboardGPS
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Private StrArreglo As StringBuilder
|
||||
|
||||
Public Property FechaI As DateTime
|
||||
Get
|
||||
Return ViewState("FechaI").ToString.ToDateTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
ViewState("FechaI") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FechaF As DateTime
|
||||
Get
|
||||
Return ViewState("FechaF").ToString.ToDateTime
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
ViewState("FechaF") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Public Enum Colores As Integer
|
||||
AzulFuerte = 1
|
||||
Azul = 2
|
||||
Verde = 3
|
||||
Amarillo = 4
|
||||
Naranja = 5
|
||||
Rojo = 6
|
||||
Morado = 7
|
||||
Negro = 8
|
||||
End Enum
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
StrArreglo = New StringBuilder
|
||||
|
||||
txtFechaI.Text = Now.AddMonths(-1).ToShortDateString
|
||||
txtFechaF.Text = Now.ToShortDateString
|
||||
|
||||
FechaI = txtFechaI.Text.ToDate.Add(Now.TimeOfDay).ToDateTime
|
||||
FechaF = txtFechaF.Text.ToDate.Add(Now.TimeOfDay).ToDateTime
|
||||
|
||||
CargarKilometrajeUnidades(5)
|
||||
CargarPuntosInteresVisitados(10)
|
||||
CargarMejoresConductores(5)
|
||||
CargarUnidadesReportando()
|
||||
CargarRendimientoCombustible(5)
|
||||
CargarTiemposOperacion(5)
|
||||
CargarTiempoPuntosInteres(5)
|
||||
CargarEventos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ObtenerColor(color As Colores) As String
|
||||
Select Case color
|
||||
|
||||
Case Colores.AzulFuerte
|
||||
Return "#337ab7"
|
||||
|
||||
Case Colores.Azul
|
||||
Return "#08A3CC"
|
||||
|
||||
Case Colores.Verde
|
||||
Return "#1BA39C"
|
||||
|
||||
Case Colores.Amarillo
|
||||
Return "#F1C40F"
|
||||
|
||||
Case Colores.Naranja
|
||||
Return "#E87E04"
|
||||
|
||||
Case Colores.Rojo
|
||||
Return "#ed6b75"
|
||||
|
||||
Case Colores.Morado
|
||||
Return "#8E44AD"
|
||||
|
||||
Case Colores.Negro
|
||||
Return "#22313F"
|
||||
|
||||
Case Else
|
||||
Return "#337ab7"
|
||||
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Private Sub CargarKilometrajeUnidades(Top As Integer, Optional Div As String = "chartdivKilometrajeUnidades")
|
||||
Dim ObjGPS As New ClsGPS
|
||||
Dim Contador As Integer = 0
|
||||
|
||||
StrArreglo.Clear()
|
||||
|
||||
If ObjGPS.GetKilometrajeDispositivos(UsuarioActual.CveCliente, FechaI, FechaF, Top) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
StrArreglo.Append("[")
|
||||
|
||||
For Each row As DataRow In ObjGPS.DtResultados.Rows
|
||||
|
||||
If Contador > 0 Then
|
||||
StrArreglo.Append(", {")
|
||||
Else
|
||||
StrArreglo.Append("{")
|
||||
End If
|
||||
|
||||
StrArreglo.Append($"""dispositivos"": ""{row("NoEconomico").ToString}"",""kilometros"": {row("Dist").ToString},""color"": ""#337ab7""")
|
||||
StrArreglo.Append("}")
|
||||
|
||||
Contador += 1
|
||||
Next
|
||||
|
||||
StrArreglo.Append("]")
|
||||
|
||||
RegistraScript($"KilometrajeDispositivos({StrArreglo.ToString}, {Div});", "2")
|
||||
End If
|
||||
|
||||
ObjGPS.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargarPuntosInteresVisitados(Top As Integer, Optional Div As String = "chartdivPIVisitados")
|
||||
|
||||
Dim ObjGPS As New ClsGPS
|
||||
Dim Contador As Integer = 0
|
||||
Dim Total As Integer = 0
|
||||
|
||||
StrArreglo.Clear()
|
||||
|
||||
If ObjGPS.GetPuntosDeInteresDispositivos(UsuarioActual.CveCliente, FechaI, FechaF, -1, "-1", Top) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
Total = ObjGPS.DtResultados(0)("Visitas").ToString.ToEntero
|
||||
|
||||
StrArreglo.Append("{ """ + Total.ToString + """: [")
|
||||
|
||||
For Each row As DataRow In ObjGPS.DtResultados.Rows
|
||||
If Contador = 0 Then
|
||||
Contador += 1
|
||||
Continue For
|
||||
Else
|
||||
|
||||
If Contador > 1 Then
|
||||
StrArreglo.Append(", {")
|
||||
Else
|
||||
StrArreglo.Append("{")
|
||||
End If
|
||||
|
||||
StrArreglo.Append($"""title"": ""{row("PuntoDeInteres").ToString}"",""size"": {row("Visitas").ToString},""color"": ""{ObtenerColor(CType(Contador, Colores))}""")
|
||||
StrArreglo.Append("}")
|
||||
|
||||
End If
|
||||
|
||||
Contador += 1
|
||||
Next
|
||||
|
||||
StrArreglo.Append("]}")
|
||||
|
||||
RegistraScript($"PuntosDeInteresDispositivos({Total}, {StrArreglo.ToString}, {Div});", "2")
|
||||
End If
|
||||
|
||||
ObjGPS.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargarMejoresConductores(Top As Integer, Optional Div As String = "chartdivMejoresConductores")
|
||||
Dim ObjGPS As New ClsGPS
|
||||
Dim Contador As Integer = 0
|
||||
Dim Valor As Integer = 1
|
||||
|
||||
StrArreglo.Clear()
|
||||
|
||||
If ObjGPS.GetMejoresConductores(UsuarioActual.CveCliente, Top) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
StrArreglo.Append("[")
|
||||
For Each row As DataRow In ObjGPS.DtResultados.Rows
|
||||
|
||||
If Contador > 0 Then
|
||||
StrArreglo.Append(", {")
|
||||
Else
|
||||
StrArreglo.Append("{")
|
||||
End If
|
||||
|
||||
If row("Total").ToString.ToDouble >= 70 Then
|
||||
Valor = 3
|
||||
ElseIf row("Total").ToString.ToDouble >= 50 Then
|
||||
Valor = 4
|
||||
Else
|
||||
Valor = 6
|
||||
End If
|
||||
|
||||
StrArreglo.Append($"""conductor"": ""{row("Conductor").ToString}"",""valor"": {row("Total").ToString},""color"": ""{ObtenerColor(CType(Valor, Colores))}""")
|
||||
StrArreglo.Append("}")
|
||||
|
||||
Contador += 1
|
||||
|
||||
Next
|
||||
|
||||
StrArreglo.Append("]")
|
||||
|
||||
RegistraScript($"MejoresConductores({StrArreglo.ToString}, {Div});", "2")
|
||||
End If
|
||||
|
||||
ObjGPS.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargarUnidadesReportando()
|
||||
Dim ObjGPS As New ClsGPS
|
||||
Dim Reportando As Double
|
||||
Dim Total As Double
|
||||
Dim Porcentaje As String
|
||||
|
||||
If ObjGPS.GetUnidadesReportando(UsuarioActual.CveCliente) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
Reportando = ObjGPS.DtResultados(0)("Reportando").ToString.ToDouble
|
||||
Total = ObjGPS.DtResultados(0)("Total").ToString.ToDouble
|
||||
Porcentaje = Math.Round(Reportando / Total, 2).ToString
|
||||
RegistraScript($"UnidadesReportando(""{ObjGPS.DtResultados(0)("Reportando").ToString}"",""{ObjGPS.DtResultados(0)("Total").ToString}"", ""{Porcentaje}%"", {"chartdivUnidadesReportando"});", "2")
|
||||
End If
|
||||
|
||||
ObjGPS.Dispose()
|
||||
End Sub
|
||||
|
||||
'[{
|
||||
' "dispositivo": "#01",
|
||||
' "apagado": 6,
|
||||
' "encendido": 18,
|
||||
'}, {
|
||||
' "dispositivo": "#02",
|
||||
' "apagado": 8,
|
||||
' "encendido": 16,
|
||||
'}]
|
||||
Private Sub CargarTiemposOperacion(Top As Integer, Optional Div As String = "chartdivTiempoOperacion")
|
||||
Dim ObjGPS As New ClsGPS
|
||||
Dim Contador As Integer = 0
|
||||
Dim minutesDiff = DateDiff(DateInterval.Minute, FechaI, FechaF) / 3
|
||||
|
||||
StrArreglo.Clear()
|
||||
|
||||
If ObjGPS.GetKilometrajeDispositivos(UsuarioActual.CveCliente, txtFechaI.Text.ToDate.Add(Now.TimeOfDay).ToDateTime, txtFechaF.Text.ToDate.Add(Now.TimeOfDay).ToDateTime, Top) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
StrArreglo.Append("[")
|
||||
|
||||
For Each row As DataRow In ObjGPS.DtResultados.Rows
|
||||
|
||||
If Contador > 0 Then
|
||||
StrArreglo.Append(", {")
|
||||
Else
|
||||
StrArreglo.Append("{")
|
||||
End If
|
||||
|
||||
StrArreglo.Append($"""dispositivo"": ""{row("NoEconomico").ToString}"",""apagado"": {Math.Round((minutesDiff - row("TiempoOperativo").ToString.ToDouble) / 60, 2)},""encendido"": {Math.Round(row("TiempoOperativo").ToString.ToDouble / 60, 2)}")
|
||||
StrArreglo.Append("}")
|
||||
|
||||
Contador += 1
|
||||
Next
|
||||
|
||||
StrArreglo.Append("]")
|
||||
|
||||
RegistraScript($"TiempoDeOperacion({StrArreglo.ToString}, {Div});", "2")
|
||||
End If
|
||||
|
||||
ObjGPS.Dispose()
|
||||
End Sub
|
||||
|
||||
'[{
|
||||
' "dispositivo": "#01",
|
||||
' "combustible": 100,
|
||||
' "kilometraje": 1000,
|
||||
'}, {
|
||||
' "dispositivo": "#02",
|
||||
' "combustible": 200,
|
||||
' "kilometraje": 1500,
|
||||
'}]
|
||||
Private Sub CargarRendimientoCombustible(Top As Integer, Optional Div As String = "chartdivRendimientoCombustible")
|
||||
Dim ObjGPS As New ClsGPS
|
||||
Dim Contador As Integer = 0
|
||||
|
||||
StrArreglo.Clear()
|
||||
|
||||
If ObjGPS.GetKilometrajeDispositivos(UsuarioActual.CveCliente, FechaI, FechaF, Top) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
StrArreglo.Append("[")
|
||||
|
||||
For Each row As DataRow In ObjGPS.DtResultados.Rows
|
||||
|
||||
If Contador > 0 Then
|
||||
StrArreglo.Append(", {")
|
||||
Else
|
||||
StrArreglo.Append("{")
|
||||
End If
|
||||
|
||||
StrArreglo.Append($"""dispositivo"": ""{row("NoEconomico").ToString}"",""combustible"": {Math.Round(row("Dist").ToString.ToDouble / 9.5, 2)},""kilometraje"": {row("Dist").ToString}")
|
||||
StrArreglo.Append("}")
|
||||
|
||||
Contador += 1
|
||||
Next
|
||||
|
||||
StrArreglo.Append("]")
|
||||
|
||||
RegistraScript($"RendimientoCombustible({StrArreglo.ToString},{Div});", "2")
|
||||
End If
|
||||
|
||||
ObjGPS.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargarTiempoPuntosInteres(Top As Integer, Optional Div As String = "chartdivTiempoPI")
|
||||
|
||||
Dim ObjGPS As New ClsGPS
|
||||
Dim Contador As Integer = 0
|
||||
Dim Total As Integer = 0
|
||||
|
||||
StrArreglo.Clear()
|
||||
|
||||
If ObjGPS.GetPuntosDeInteresTiempo(UsuarioActual.CveCliente, FechaI, FechaF, -1, "-1", Top) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
StrArreglo.Append("[")
|
||||
|
||||
For Each row As DataRow In ObjGPS.DtResultados.Rows
|
||||
|
||||
If Contador > 0 Then
|
||||
StrArreglo.Append(", {")
|
||||
Else
|
||||
StrArreglo.Append("{")
|
||||
End If
|
||||
|
||||
StrArreglo.Append($"""pi"": ""{row("PuntoDeInteres").ToString}"",""duracion"": {row("Duracion").ToString.ToDouble.FormatoNumero(2)},""color"": ""{ObtenerColor(CType(2, Colores))}""")
|
||||
StrArreglo.Append("}")
|
||||
|
||||
Contador += 1
|
||||
Next
|
||||
|
||||
StrArreglo.Append("]")
|
||||
|
||||
RegistraScript($"TiempoPuntosInteres({StrArreglo.ToString},{Div});", "2")
|
||||
End If
|
||||
|
||||
ObjGPS.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CargarEventos()
|
||||
Dim ObjGPS As New ClsGPS
|
||||
|
||||
If ObjGPS.GetEventosDashboard(UsuarioActual.CveCliente, FechaI, FechaF) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
LblBotonPanico.Text = ObjGPS.DtResultados(0)("BotonPanico").ToString.ToEntero.ToString
|
||||
LblDesconexion.Text = ObjGPS.DtResultados(0)("DesconexionBateria").ToString.ToEntero.ToString
|
||||
End If
|
||||
|
||||
If ObjGPS.GetRalentiDashboard(UsuarioActual.CveCliente, txtFechaI.Text.ToDate.Add(Now.TimeOfDay).ToDateTime, txtFechaF.Text.ToDate.Add(Now.TimeOfDay).ToDateTime) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
LblRalenti.Text = ObjGPS.DtResultados(0)("Ralenti").ToString.ToEntero.ToString
|
||||
End If
|
||||
|
||||
ObjGPS.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub lnkBusqueda_Click(sender As Object, e As EventArgs) Handles lnkBusqueda.Click
|
||||
RegistraScript("$('#dvConsulta').modal();")
|
||||
End Sub
|
||||
|
||||
Private Sub BtnRastrear_Click(sender As Object, e As EventArgs) Handles BtnRastrear.Click
|
||||
|
||||
If HdnTipoFecha.Value = "5" Then
|
||||
FechaI = txtFechaI.Text.ToDateTime
|
||||
Else
|
||||
FechaI = txtFechaI.Text.ToDate.Add(Now.TimeOfDay).ToDateTime
|
||||
End If
|
||||
|
||||
FechaF = txtFechaF.Text.ToDate.Add(Now.TimeOfDay).ToDateTime
|
||||
|
||||
StrArreglo = New StringBuilder
|
||||
|
||||
CargarKilometrajeUnidades(5)
|
||||
CargarPuntosInteresVisitados(10)
|
||||
CargarMejoresConductores(5)
|
||||
CargarUnidadesReportando()
|
||||
CargarRendimientoCombustible(5)
|
||||
CargarTiemposOperacion(5)
|
||||
CargarTiempoPuntosInteres(5)
|
||||
CargarEventos()
|
||||
|
||||
RegistraScript("$('#dvConsulta').modal('hide')")
|
||||
UpGraficas.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub BtnTrampa_Click(sender As Object, e As EventArgs) Handles BtnTrampa.Click
|
||||
Select Case HdnTipoFecha.Value.ToString.ToEntero
|
||||
|
||||
Case 1 'Ultimo Dia
|
||||
txtFechaI.Text = Now.AddDays(-1).ToShortDateString
|
||||
txtFechaF.Text = Now.ToShortDateString
|
||||
Case 2 'Ultima Semana
|
||||
txtFechaI.Text = Now.AddDays(-7).ToShortDateString
|
||||
txtFechaF.Text = Now.ToShortDateString
|
||||
Case 3 'Ultimo Mes
|
||||
txtFechaI.Text = Now.AddMonths(-1).ToShortDateString
|
||||
txtFechaF.Text = Now.ToShortDateString
|
||||
Case 4 'Ultimo Año
|
||||
txtFechaI.Text = Now.AddYears(-1).ToShortDateString
|
||||
txtFechaF.Text = Now.ToShortDateString
|
||||
Case 5 'Dia Corriente
|
||||
txtFechaI.Text = Now.ToShortDateString
|
||||
txtFechaF.Text = Now.ToShortDateString
|
||||
Case 6 'Semana Corriente
|
||||
Dim DiaSemana = Now.DayOfWeek
|
||||
txtFechaI.Text = Now.AddDays((-1 * DiaSemana) + 1).ToString
|
||||
txtFechaF.Text = Now.ToShortDateString
|
||||
Case 7 'Mes Corriente
|
||||
txtFechaI.Text = DateSerial(Year(Now), Month(Now), 1).ToString
|
||||
txtFechaF.Text = Now.ToShortDateString
|
||||
Case 8 'Año Corriente
|
||||
Dim DiaAño = Now.DayOfYear
|
||||
txtFechaI.Text = Now.AddDays((-1 * DiaAño) + 1).ToString
|
||||
txtFechaF.Text = Now.ToShortDateString
|
||||
|
||||
End Select
|
||||
|
||||
UPConsulta.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub ExtenderGrafica(Grafica As Integer)
|
||||
StrArreglo = New StringBuilder
|
||||
Select Case Grafica
|
||||
Case 1 'Kilometraje
|
||||
CargarKilometrajeUnidades(20, "chartdivGraficaGrande")
|
||||
LblGrafica.Text = "Kilometraje de Unidades"
|
||||
|
||||
Case 2 'Puntos Interes Visitados
|
||||
CargarPuntosInteresVisitados(20, "chartdivGraficaGrande")
|
||||
LblGrafica.Text = "Puntos de Interés Visitados"
|
||||
|
||||
Case 3 'Mejores Conductores
|
||||
CargarMejoresConductores(20, "chartdivGraficaGrande")
|
||||
LblGrafica.Text = "Mejores Conductores"
|
||||
|
||||
Case 4 'Tiempos de Operacion
|
||||
CargarTiemposOperacion(20, "chartdivGraficaGrande")
|
||||
LblGrafica.Text = "Tiempos de Operación"
|
||||
|
||||
Case 5 'Rendimiento De Combustible
|
||||
CargarRendimientoCombustible(20, "chartdivGraficaGrande")
|
||||
LblGrafica.Text = "Rendimiento De Combustible"
|
||||
|
||||
Case 6 'Tiempo en Puntos de Interes
|
||||
CargarTiempoPuntosInteres(20, "chartdivGraficaGrande")
|
||||
LblGrafica.Text = "Tiempo en Puntos de Interés"
|
||||
End Select
|
||||
|
||||
UpTituloGraficaGrande.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub LnkKilometraje_Click(sender As Object, e As EventArgs) Handles LnkKilometraje.Click
|
||||
RegistraScript("$('#DivGrafica').modal();", "1")
|
||||
ExtenderGrafica(1)
|
||||
End Sub
|
||||
|
||||
Private Sub LnkPIVisitados_Click(sender As Object, e As EventArgs) Handles LnkPIVisitados.Click
|
||||
RegistraScript("$('#DivGrafica').modal();", "1")
|
||||
ExtenderGrafica(2)
|
||||
End Sub
|
||||
|
||||
Private Sub LnkTiempoPuntosInteres_Click(sender As Object, e As EventArgs) Handles LnkTiempoPuntosInteres.Click
|
||||
RegistraScript("$('#DivGrafica').modal();", "1")
|
||||
ExtenderGrafica(6)
|
||||
End Sub
|
||||
|
||||
Private Sub LnkRendimientoCombustible_Click(sender As Object, e As EventArgs) Handles LnkRendimientoCombustible.Click
|
||||
RegistraScript("$('#DivGrafica').modal();", "1")
|
||||
ExtenderGrafica(5)
|
||||
End Sub
|
||||
|
||||
Private Sub LnkTiemposOperacion_Click(sender As Object, e As EventArgs) Handles LnkTiemposOperacion.Click
|
||||
RegistraScript("$('#DivGrafica').modal();", "1")
|
||||
ExtenderGrafica(4)
|
||||
End Sub
|
||||
|
||||
Private Sub LnkMejoresConductores_Click(sender As Object, e As EventArgs) Handles LnkMejoresConductores.Click
|
||||
RegistraScript("$('#DivGrafica').modal();", "1")
|
||||
ExtenderGrafica(3)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
'Dona
|
||||
'var chartData = {
|
||||
' "124": [
|
||||
' { "title": "Soriana1", "color": "#337ab7", "size": 3.9 },
|
||||
' { "title": "Soriana2", "color": "#08A3CC", "size": 0.2 },
|
||||
' { "title": "Soriana6", "color": "#1BA39C", "size": 16.6 },
|
||||
' { "title": "Soriana4", "color": "#F1C40F", "size": 2.7 },
|
||||
' { "title": "Soriana5", "color": "#E87E04", "size": 5.6 },
|
||||
' { "title": "Soriana3", "color": "#ed6b75", "size": 14.5 },
|
||||
' { "title": "Soriana7", "color": "#8E44AD", "size": 10.5 },
|
||||
' { "title": "Soriana8", "color": "#22313F", "size": 26.5 }]
|
||||
'};
|
||||
|
||||
'Barras
|
||||
'[{
|
||||
' "country": "#01",
|
||||
' "visits": 2025,
|
||||
' "color": "#08A3CC"
|
||||
'}, {
|
||||
' "country": "#02",
|
||||
' "visits": 1882,
|
||||
' "color": "#08A3CC"
|
||||
'}, {
|
||||
' "country": "#03",
|
||||
' "visits": 1809,
|
||||
' "color": "#08A3CC"
|
||||
'}, {
|
||||
' "country": "#04",
|
||||
' "visits": 1322,
|
||||
' "color": "#08A3CC"
|
||||
'}, {
|
||||
' "country": "#05",
|
||||
' "visits": 1122,
|
||||
' "color": "#08A3CC"
|
||||
'}, {
|
||||
' "country": "#06",
|
||||
' "visits": 1114,
|
||||
' "color": "#08A3CC"
|
||||
'}, {
|
||||
' "country": "#07",
|
||||
' "visits": 984,
|
||||
' "color": "#08A3CC"
|
||||
'}, {
|
||||
' "country": "#08",
|
||||
' "visits": 711,
|
||||
' "color": "#08A3CC"
|
||||
'}, {
|
||||
' "country": "#09",
|
||||
' "visits": 665,
|
||||
' "color": "#08A3CC"
|
||||
'}, {
|
||||
' "country": "",
|
||||
' "visits": ""
|
||||
'}]
|
||||
312
GPS/DispositivosControles.aspx
Normal file
312
GPS/DispositivosControles.aspx
Normal file
@@ -0,0 +1,312 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="DispositivosControles.aspx.vb" Inherits="GPS_DispositivosControles" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Controles y Accesorios
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" ID="BtnOpenDiv"><i class="fa fa-plus"></i>Agregar Sensor de Combustible</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" ID="LbTemp"><i class="fa fa-plus"></i>Agregar Sensor de Temperatura</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li> <li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" ID="LnkPasajeros"><i class="fa fa-plus"></i>Agregar Sensor de Pasajeros</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" ID="LbDescargaFormato" OnClick="LbDescargaFormato_Click"><i class="fa fa-file-excel-o"></i>Descargar Formato</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LbDescargaFormato" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveControl, Control, CveUnidadMedida, Capacidad, Largo, Ancho, Alto, Longitud, Sensor, CveDispositivo, DevID, CveMetrica,CveTipoControl" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Compuestos Activos">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Control" ItemStyle-Width="15%" HeaderText="Control" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Sensor" ItemStyle-Width="15%" HeaderText="Sensor" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Capacidad" ItemStyle-Width="9%" HeaderText="Capacidad" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="UnidadMedida" ItemStyle-Width="10%" HeaderText="Unidad de Medida" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="DevID" ItemStyle-Width="15%" HeaderText="Dispositivo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Calibración" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Editar" OnClick="imgC_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-list'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Largo" ItemStyle-Width="5%" NullDisplayText="" HeaderText="Largo" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Ancho" ItemStyle-Width="5%" NullDisplayText="" HeaderText="Ancho" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Alto" ItemStyle-Width="5%" HeaderText="Alto" NullDisplayText="" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Longitud" ItemStyle-Width="5%" NullDisplayText="" HeaderText="Longitud" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="HTitulo" runat="server">Guardar Compuesto</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyCompuesto" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div style="margin-bottom: 17px" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtControl" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVNombrePlantilla" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtControl" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Compuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtControl.ClientID.ToString()%>">Control:</label>
|
||||
</div>
|
||||
<div class="row" style="margin-bottom: 17px">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCapacidad" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtCapacidad" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Compuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtCapacidad.ClientID.ToString()%>">Capacidad:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlUnidadMedida" Width="230px" runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlUnidadMedida" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlUnidadMedida.ClientID.ToString()%>">Unidad de medida:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-bottom: 17px">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLargo" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtLargo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Largo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLargo.ClientID.ToString()%>">Largo</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAncho" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtAncho" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Ancho''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtAncho.ClientID.ToString()%>">Ancho</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAlto" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtAlto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Alto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtAlto.ClientID.ToString()%>">Alto</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-bottom: 17px" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLongitud" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtLongitud" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Longitud''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLongitud.ClientID.ToString()%>">Longitud:</label>
|
||||
</div>
|
||||
<div style="margin-bottom: 17px" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtSensor" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtSensor" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sensor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtSensor.ClientID.ToString()%>">Sensor:</label>
|
||||
</div>
|
||||
<div class="row" style="margin-bottom: 17px">
|
||||
<div class="col-md-5">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlEquipo" Width="230px" runat="server" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlEquipo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlEquipo.ClientID.ToString()%>">Dispositivo:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5" style="margin-right:2%">
|
||||
<div id="DivTanque" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlNumero" Width="230px" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Value="-1" Text="Seleccione" />
|
||||
<asp:ListItem Value="3" Text="Tanque #1" />
|
||||
<asp:ListItem Value="4" Text="Tanque #2" />
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlEquipo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlEquipo.ClientID.ToString()%>">Número de tanque:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 truncate ">Arrastre el archivo de Calibración:</div>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox ID="TxtCalibración" CssClass="ADSdropzone hidden" data-maxFile="1" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarCatalogo" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
||||
<button id="btnCancelar" data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="dvConsulta" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpdatePanel1" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel2" runat="server">Calibración</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UPCalibracion">
|
||||
<ContentTemplate>
|
||||
<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="TxtBusquedaD" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaD','{0}')", GvCalibracion.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaD','{0}')", GvCalibracion.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvCalibracion" runat="server" GridLines="None" DataKeyNames="Nivel,Valor,CveControl" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Nivel" ItemStyle-Width="50%" HeaderText="Nivel" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Valor" ItemStyle-Width="50%" HeaderText="Valor" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<button data-dismiss="modal" class="btn btn-default">Volver</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="dvAddTemp" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAddTemp" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel3">Guardar Sensor de Temperatura</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UPTempBody" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div style="margin-bottom: 17px" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtControlTemperatura" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtControlTemperatura" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Control''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorioT"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtControlTemperatura.ClientID.ToString()%>">Control:</label>
|
||||
</div>
|
||||
<div class="row" style="margin-bottom: 17px">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCapacidadTemp" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtCapacidadTemp" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Capacidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorioT"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtCapacidadTemp.ClientID.ToString()%>">Temp. Máxima:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlUMTemp" Width="230px" runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlUMTemp" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad Medida''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorioT"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlUMTemp.ClientID.ToString()%>">Unidad de medida:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-bottom: 17px" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtIDSensor" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator17" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtIDSensor" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''ID Sensor''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorioT"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtIDSensor.ClientID.ToString()%>"> ID Sensor:</label>
|
||||
</div>
|
||||
<div class="row" style="margin-bottom: 17px">
|
||||
<div class="col-md-5">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlEquipoTemp" Width="230px" runat="server" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator18" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlEquipoTemp" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorioT"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlEquipoTemp.ClientID.ToString()%>">Dispositivo:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5" style="margin-right:2%">
|
||||
<div id="DivSensor" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlNoSensor" Width="230px" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Value="-1" Text="Seleccione" />
|
||||
<asp:ListItem Value="7" Text="Sensor #1" />
|
||||
<asp:ListItem Value="8" Text="Sensor #2" />
|
||||
<asp:ListItem Value="9" Text="Sensor #3" />
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator19" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlNoSensor" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorioT"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlNoSensor.ClientID.ToString()%>">Número de Sensor:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LbAgregarTemp" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpObligatorioT"></asp:LinkButton>
|
||||
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
467
GPS/DispositivosControles.aspx.vb
Normal file
467
GPS/DispositivosControles.aspx.vb
Normal file
@@ -0,0 +1,467 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports GemBox.Spreadsheet
|
||||
|
||||
Partial Class GPS_DispositivosControles
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property CveControl As Integer
|
||||
Get
|
||||
Return ViewState("CveControl").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveControl") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = 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
|
||||
CveControl = -1
|
||||
EsEditar = 0
|
||||
CargaDatos(-1)
|
||||
CargaDdls()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdls()
|
||||
DdlEquipo.DataSource = GlobalDTDispositivos(-1)
|
||||
DdlEquipo.DataBind()
|
||||
DdlEquipo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlEquipoTemp.DataSource = GlobalDTDispositivos(-1)
|
||||
DdlEquipoTemp.DataBind()
|
||||
DdlEquipoTemp.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.UnidadMedidaGet() Then
|
||||
DdlUnidadMedida.DataSource = GPS.DtResultados
|
||||
DdlUMTemp.DataSource = GPS.DtResultados
|
||||
Else
|
||||
DdlUnidadMedida.DataSource = Nothing
|
||||
DdlUMTemp.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DdlUnidadMedida.DataBind()
|
||||
DdlUnidadMedida.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlUMTemp.DataBind()
|
||||
DdlUMTemp.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos(CveCliente As Integer)
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.ControlesGet(CveCliente) Then
|
||||
GvDatos.DataSource = GPS.DtResultados.FiltraParametros($"CveEmpresa ={UsuarioActual.CveEmpresa}")
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveControl = Boton.CommandArgument.ToEntero
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
DivTanque.Visible = True
|
||||
EsEditar = 1
|
||||
If GvRow.DataKey("CveTipoControl").ToString.ToEntero = 1 Then
|
||||
|
||||
HTitulo.InnerText = "Guardar Compuesto"
|
||||
DdlUnidadMedida.SelectedValueExist(GvRow.DataKey("CveUnidadMedida"))
|
||||
DdlEquipo.SelectedValueExist(GvRow.DataKey("CveDispositivo"))
|
||||
TxtAlto.Text = GvRow.DataKey("Alto")
|
||||
TxtAncho.Text = GvRow.DataKey("Ancho")
|
||||
TxtCalibración.Text = "[]"
|
||||
TxtCapacidad.Text = GvRow.DataKey("Capacidad")
|
||||
TxtControl.Text = GvRow.DataKey("Control")
|
||||
TxtLargo.Text = GvRow.DataKey("Largo")
|
||||
TxtLongitud.Text = GvRow.DataKey("Longitud")
|
||||
TxtSensor.Text = GvRow.DataKey("Sensor")
|
||||
DdlNumero.SelectedValueExist(GvRow.DataKey("CveMetrica"))
|
||||
BtnAgregarCatalogo.Text = "Actualizar"
|
||||
UpAgregar.Update()
|
||||
UpBodyCompuesto.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
ElseIf GvRow.DataKey("CveTipoControl").ToString.ToEntero = 2 Then
|
||||
DdlUMTemp.SelectedValueExist(GvRow.DataKey("CveUnidadMedida"))
|
||||
DdlEquipoTemp.SelectedValueExist(GvRow.DataKey("CveDispositivo"))
|
||||
TxtCapacidadTemp.Text = GvRow.DataKey("Capacidad")
|
||||
TxtIDSensor.Text = GvRow.DataKey("Sensor")
|
||||
DdlNoSensor.SelectedValueExist(GvRow.DataKey("CveMetrica"))
|
||||
LbAgregarTemp.Text = "Actualizar"
|
||||
RegistraScript("$('#dvAddTemp').modal()")
|
||||
UpAddTemp.Update()
|
||||
UPTempBody.Update()
|
||||
UpdatePanel4.Update()
|
||||
ElseIf GvRow.DataKey("CveTipoControl").ToString.ToEntero = 3 Then
|
||||
|
||||
HTitulo.InnerText = "Guardar Sensor de Pasajeros"
|
||||
DdlUnidadMedida.SelectedValueExist(GvRow.DataKey("CveUnidadMedida"))
|
||||
DdlEquipo.SelectedValueExist(GvRow.DataKey("CveDispositivo"))
|
||||
TxtAlto.Text = GvRow.DataKey("Alto")
|
||||
TxtAncho.Text = GvRow.DataKey("Ancho")
|
||||
TxtCalibración.Text = "[]"
|
||||
TxtCapacidad.Text = GvRow.DataKey("Capacidad")
|
||||
TxtControl.Text = GvRow.DataKey("Control")
|
||||
TxtLargo.Text = GvRow.DataKey("Largo")
|
||||
TxtLongitud.Text = GvRow.DataKey("Longitud")
|
||||
TxtSensor.Text = GvRow.DataKey("Sensor")
|
||||
DdlNumero.SelectedValueExist(GvRow.DataKey("CveMetrica"))
|
||||
BtnAgregarCatalogo.Text = "Actualizar"
|
||||
DivTanque.Visible = False
|
||||
UpBodyCompuesto.Update()
|
||||
UpAgregar.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
|
||||
Dim GPS As New ClsGPS
|
||||
GPS.IniciaTransacSQL()
|
||||
Dim huboerror As Boolean = False
|
||||
If EsEditar = 0 Then
|
||||
If TxtCalibración.getfiles().Archivos.Count > 0 Then
|
||||
Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0)
|
||||
If Archivo.Extencion <> "xls" AndAlso Archivo.Extencion <> "xlsx" Then
|
||||
GPS.RollBack()
|
||||
GPS.Dispose()
|
||||
Alert("El archivo de calibración debe de ser un archivo excel.")
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
Dim CveTipoControl As Integer = If(DivTanque.Visible, 1, 3)
|
||||
If GPS.ControlAdd(TxtControl.Text, DdlUnidadMedida.SelectedValue.ToEntero, TxtCapacidad.Text.ToDouble, TxtLargo.Text.ToDouble, TxtAncho.Text.ToDouble, TxtAlto.Text.ToDouble, TxtLongitud.Text.ToDouble, TxtSensor.Text, DdlEquipo.SelectedValue.ToEntero, DdlNumero.SelectedValue.ToEntero, CveTipoControl) Then
|
||||
CveControl = GPS.CveControl
|
||||
Else
|
||||
huboerror = True
|
||||
End If
|
||||
If TxtCalibración.getfiles().Archivos.Count > 0 AndAlso CveControl > 0 AndAlso Not huboerror Then
|
||||
Try
|
||||
Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0)
|
||||
Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}TablasCalibracion"
|
||||
Dim dirSonido As String = String.Format("{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extencion)
|
||||
If File.Exists(dirSonido) Then
|
||||
My.Computer.FileSystem.DeleteFile(dirSonido)
|
||||
End If
|
||||
My.Computer.FileSystem.MoveFile(Archivo.FileUrl, dirSonido)
|
||||
SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet())
|
||||
Dim EF As ExcelFile = ExcelFile.Load(dirSonido)
|
||||
Dim Hoja As ExcelWorksheet = EF.Worksheets(0)
|
||||
Dim Opciones As New CreateDataTableOptions()
|
||||
Opciones.ColumnHeaders = True
|
||||
Opciones.StartRow = 0
|
||||
Opciones.NumberOfColumns = 3
|
||||
Opciones.NumberOfRows = Hoja.Rows.Count
|
||||
Opciones.Resolution = ColumnTypeResolution.AutoPreferStringInvariantCulture
|
||||
Dim TempDT As DataTable = Hoja.CreateDataTable(Opciones)
|
||||
If Not TempDT.Columns(0).ColumnName = "Nivel Varilla" Then
|
||||
Alert("El nombre de la primera columna debe ser 'Nivel Varilla'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||
huboerror = True
|
||||
End If
|
||||
If Not TempDT.Columns(1).ColumnName = "Valor" Then
|
||||
Alert("El nombre de la segunda columna debe ser 'Valor'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||
huboerror = True
|
||||
End If
|
||||
|
||||
If Not huboerror Then
|
||||
|
||||
For Each row As DataRow In TempDT.Rows
|
||||
Dim Nivel As Double = row("Nivel Varilla").ToString.ToDouble
|
||||
Dim Valor As Double = row("Valor").ToString.ToDouble
|
||||
If Not GPS.CalibracionAdd(Nivel, Valor, CveControl) Then
|
||||
huboerror = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
If Not huboerror Then
|
||||
huboerror = Not GPS.EjecutaCalibracion()
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
huboerror = True
|
||||
End Try
|
||||
End If
|
||||
If Not huboerror Then
|
||||
GPS.Commit()
|
||||
Alert("El Control se agregó correctamente")
|
||||
Else
|
||||
GPS.RollBack()
|
||||
Alert("Ocurrió un error al realizar la calibración", TipoMensaje.MsgError)
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If TxtCalibración.getfiles().Archivos.Count > 0 Then
|
||||
Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0)
|
||||
If Archivo.Extencion <> "xls" AndAlso Archivo.Extencion <> "xlsx" Then
|
||||
GPS.RollBack()
|
||||
GPS.Dispose()
|
||||
Alert("El archivo de calibración debe de ser un archivo excel.")
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
If Not GPS.ControlUpdate(TxtControl.Text, DdlUnidadMedida.SelectedValue.ToEntero, TxtCapacidad.Text.ToDouble, TxtLargo.Text.ToDouble, TxtAncho.Text.ToDouble, TxtAlto.Text.ToDouble, TxtLongitud.Text.ToDouble, TxtSensor.Text, DdlEquipo.SelectedValue.ToEntero, CveControl, DdlNumero.SelectedValue.ToEntero,-1) Then
|
||||
huboerror = True
|
||||
End If
|
||||
If TxtCalibración.getfiles().Archivos.Count > 0 AndAlso Not huboerror Then
|
||||
Try
|
||||
huboerror = Not GPS.CalibracionDelete(CveControl)
|
||||
If Not huboerror Then
|
||||
Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0)
|
||||
Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}TablasCalibracion"
|
||||
Dim dirSonido As String = String.Format("{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extencion)
|
||||
If File.Exists(dirSonido) Then
|
||||
My.Computer.FileSystem.DeleteFile(dirSonido)
|
||||
End If
|
||||
My.Computer.FileSystem.MoveFile(Archivo.FileUrl, dirSonido)
|
||||
SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet())
|
||||
Dim EF As ExcelFile = ExcelFile.Load(dirSonido)
|
||||
Dim Hoja As ExcelWorksheet = EF.Worksheets(0)
|
||||
Dim Opciones As New CreateDataTableOptions()
|
||||
Opciones.ColumnHeaders = True
|
||||
Opciones.StartRow = 0
|
||||
Opciones.NumberOfColumns = 3
|
||||
Opciones.NumberOfRows = Hoja.Rows.Count
|
||||
Opciones.Resolution = ColumnTypeResolution.AutoPreferStringInvariantCulture
|
||||
Dim TempDT As DataTable = Hoja.CreateDataTable(Opciones)
|
||||
|
||||
If Not TempDT.Columns(0).ColumnName = "Nivel Varilla" Then
|
||||
Alert("El nombre de la primera columna debe ser 'Nivel Varilla'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||
huboerror = True
|
||||
End If
|
||||
If Not TempDT.Columns(1).ColumnName = "Valor" Then
|
||||
Alert("El nombre de la segunda columna debe ser 'Valor'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||
huboerror = True
|
||||
End If
|
||||
|
||||
If Not huboerror Then
|
||||
|
||||
For Each row As DataRow In TempDT.Rows
|
||||
Dim Nivel As Double = row("Nivel Varilla").ToString.ToDouble
|
||||
Dim Valor As Double = row("Valor").ToString.ToDouble
|
||||
If Not GPS.CalibracionAdd(Nivel, Valor, CveControl) Then
|
||||
huboerror = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
If Not huboerror Then
|
||||
huboerror = Not GPS.EjecutaCalibracion()
|
||||
End If
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
huboerror = True
|
||||
End Try
|
||||
End If
|
||||
If Not huboerror Then
|
||||
GPS.Commit()
|
||||
Alert("El Control se actualizó correctamente")
|
||||
Else
|
||||
GPS.RollBack()
|
||||
Alert("Ocurrió un error al realizar la calibración", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
GPS.Dispose()
|
||||
TxtAlto.Text = ""
|
||||
TxtAncho.Text = ""
|
||||
TxtCalibración.Text = "[]"
|
||||
TxtCapacidad.Text = ""
|
||||
TxtControl.Text = ""
|
||||
TxtLargo.Text = ""
|
||||
TxtLongitud.Text = ""
|
||||
TxtSensor.Text = ""
|
||||
DdlEquipo.SelectedValueExist("-1")
|
||||
DdlUnidadMedida.SelectedValueExist("-1")
|
||||
|
||||
CargaDatos(-1)
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
UpBodyCompuesto.Update()
|
||||
UpFooter.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnAgregarTemp_Click(sender As Object, e As EventArgs) Handles LbAgregarTemp.Click
|
||||
Dim GPS As New ClsGPS
|
||||
Dim huboerror As Boolean = False
|
||||
Dim CveTipoControl As Integer = 2
|
||||
|
||||
If EsEditar = 0 Then
|
||||
If GPS.ControlAdd(TxtControlTemperatura.Text, DdlUMTemp.SelectedValue.ToEntero, TxtCapacidadTemp.Text.ToDouble, -1, -1, -1, -1, TxtIDSensor.Text, DdlEquipoTemp.SelectedValue.ToEntero, DdlNoSensor.SelectedValue.ToEntero, CveTipoControl) Then
|
||||
CveControl = GPS.CveControl
|
||||
Alert("El Control se agregó correctamente")
|
||||
Else
|
||||
huboerror = True
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If Not GPS.ControlUpdate(TxtControlTemperatura.Text, DdlUMTemp.SelectedValue.ToEntero, TxtCapacidadTemp.Text.ToDouble, -1, -1, -1, -1, TxtIDSensor.Text, DdlEquipoTemp.SelectedValue.ToEntero, CveControl, DdlNoSensor.SelectedValue.ToEntero,CveTipoControl) Then
|
||||
huboerror = True
|
||||
Else
|
||||
Alert("El Control se actualizó correctamente")
|
||||
End If
|
||||
End If
|
||||
TxtControlTemperatura.Text = ""
|
||||
TxtIDSensor.Text = ""
|
||||
TxtCapacidadTemp.Text = ""
|
||||
TxtControlTemperatura.Text = ""
|
||||
DdlUnidadMedida.SelectedValueExist("-1")
|
||||
DdlNoSensor.SelectedValueExist("-1")
|
||||
GPS.Dispose()
|
||||
CargaDatos(-1)
|
||||
RegistraScript("$('#dvAddTemp').modal('hide')")
|
||||
UpBodyCompuesto.Update()
|
||||
UpFooter.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim GPS As New ClsGPS
|
||||
Dim CveControl As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveControl").ToEntero
|
||||
If GPS.ControlesDelete(CveControl) Then
|
||||
Alert("El Control se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaDatos(-1)
|
||||
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
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveControl").ToString
|
||||
e.Row.FCLinkButton("ImgC").CommandArgument = e.Row.DataKey("CveControl").ToString
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles BtnOpenDiv.Click
|
||||
EsEditar = 0
|
||||
BtnAgregarCatalogo.Text = "Agregar Compuesto"
|
||||
TxtControl.Text = ""
|
||||
TxtCapacidad.Text = ""
|
||||
TxtLargo.Text = ""
|
||||
TxtAncho.Text = ""
|
||||
TxtAlto.Text = ""
|
||||
TxtLongitud.Text = ""
|
||||
TxtSensor.Text = ""
|
||||
TxtCalibración.Text = "[]"
|
||||
DdlEquipo.SelectedValueExist("-1")
|
||||
DdlUnidadMedida.SelectedValueExist("-1")
|
||||
|
||||
DivTanque.Visible = True
|
||||
UpBodyCompuesto.Update()
|
||||
HTitulo.InnerText = "Guardar Compuesto"
|
||||
UpAgregar.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function FormatearNombreArchivo(nombreArchivoOriginal As String) As String
|
||||
Dim nombreArchivoFormateado As String
|
||||
nombreArchivoFormateado = nombreArchivoOriginal.Replace(" ", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("'", "")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace(Chr(34), "")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("$", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("#", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("%", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("!", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("&", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("?", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("¿", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("¡", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("*", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("~", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("^", "_")
|
||||
Return nombreArchivoFormateado
|
||||
End Function
|
||||
|
||||
|
||||
Protected Sub imgC_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveControl = Boton.CommandArgument.ToEntero
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
myModalLabel2.InnerText = $"Tabla de calibración de {GvRow.DataKey("Control")}"
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.CalibracionGet(0, CveControl) Then
|
||||
GvCalibracion.DataSource = GPS.DtResultados
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvCalibracion.DataBind()
|
||||
EsEditar = 1
|
||||
UPCalibracion.Update()
|
||||
RegistraScript("$('#dvConsulta').modal()")
|
||||
End Sub
|
||||
|
||||
Private Sub LbAgregarTemp_Click(sender As Object, e As EventArgs) Handles LbTemp.Click
|
||||
EsEditar = 0
|
||||
LbAgregarTemp.Text = "Agregar"
|
||||
TxtControlTemperatura.Text = ""
|
||||
TxtCapacidadTemp.Text = ""
|
||||
TxtIDSensor.Text = ""
|
||||
DdlEquipoTemp.SelectedValueExist("-1")
|
||||
DdlUMTemp.SelectedValueExist("-1")
|
||||
UPTempBody.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#dvAddTemp').modal()")
|
||||
End Sub
|
||||
Private Sub LbAgregarPasajeros_Click(sender As Object, e As EventArgs) Handles LnkPasajeros.Click
|
||||
EsEditar = 0
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
TxtControl.Text = ""
|
||||
TxtCapacidad.Text = ""
|
||||
TxtLargo.Text = ""
|
||||
TxtAncho.Text = ""
|
||||
TxtAlto.Text = ""
|
||||
TxtLongitud.Text = ""
|
||||
TxtSensor.Text = ""
|
||||
TxtCalibración.Text = "[]"
|
||||
DdlEquipo.SelectedValueExist("-1")
|
||||
DdlUnidadMedida.SelectedValueExist("-1")
|
||||
|
||||
DivTanque.Visible = False
|
||||
HTitulo.InnerText = "Guardar Sensor de Pasajeros"
|
||||
UpAgregar.Update()
|
||||
UpBodyCompuesto.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
End Sub
|
||||
Protected Sub LbDescargaFormato_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & "Empresas\Grales\FormatoCalibracion.xlsx"
|
||||
Dim Archivo As New IO.FileInfo(Directorio)
|
||||
If Archivo.Exists Then
|
||||
Response.Clear()
|
||||
Response.ClearHeaders()
|
||||
Response.ClearContent()
|
||||
Response.AddHeader("Content-Disposition", "attachment; filename=" + Archivo.Name)
|
||||
Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||
Response.ContentType = "text/plain"
|
||||
Response.Flush()
|
||||
Response.TransmitFile(Archivo.FullName)
|
||||
Response.End()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
211
GPS/DispositivosControles.aspx.vb.aspx.exclude
Normal file
211
GPS/DispositivosControles.aspx.vb.aspx.exclude
Normal file
@@ -0,0 +1,211 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="DispositivosControles.aspx.vb" Inherits="GPS_DispositivosControles" %>
|
||||
|
||||
<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">
|
||||
Catálogo de Controles y Accesorios
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" ID="BtnOpenDiv"><i class="fa fa-plus"></i>Agregar</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveControl, Control, CveUnidadMedida, Capacidad, Largo, Ancho, Alto, Longitud, Sensor, CveDispositivo, DevID, CveMetrica" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Compuestos Activos">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Control" ItemStyle-Width="15%" HeaderText="Control" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Sensor" ItemStyle-Width="15%" HeaderText="Sensor" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Capacidad" ItemStyle-Width="9%" HeaderText="Capacidad" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="UnidadMedida" ItemStyle-Width="10%" HeaderText="Unidad de Medida" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="DevID" ItemStyle-Width="15%" HeaderText="Dispositivo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Calibración" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Editar" OnClick="imgC_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-list'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Largo" ItemStyle-Width="5%" HeaderText="Largo" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Ancho" ItemStyle-Width="5%" HeaderText="Ancho" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Alto" ItemStyle-Width="5%" HeaderText="Alto" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Longitud" ItemStyle-Width="5%" HeaderText="Longitud" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="5%" HeaderText="Eliminar" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Guardar Compuesto</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyCompuesto" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div style="margin-bottom: 17px" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtControl" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVNombrePlantilla" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtControl" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Compuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtControl.ClientID.ToString()%>">Control:</label>
|
||||
</div>
|
||||
<div class="row" style="margin-bottom: 17px">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCapacidad" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtCapacidad" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Compuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtCapacidad.ClientID.ToString()%>">Capacidad:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlUnidadMedida" Width="230px" runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlUnidadMedida" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlUnidadMedida.ClientID.ToString()%>">Unidad de medida:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-bottom: 17px">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLargo" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtLargo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Compuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLargo.ClientID.ToString()%>">Largo</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAncho" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtAncho" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Compuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtAncho.ClientID.ToString()%>">Ancho</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAlto" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtAlto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Compuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtAlto.ClientID.ToString()%>">Alto</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-bottom: 17px" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLongitud" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtLongitud" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Compuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLongitud.ClientID.ToString()%>">Longitud:</label>
|
||||
</div>
|
||||
<div style="margin-bottom: 17px" class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtSensor" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtSensor" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Compuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtSensor.ClientID.ToString()%>">Sensor:</label>
|
||||
</div>
|
||||
<div class="row" style="margin-bottom: 17px">
|
||||
<div class="col-md-5">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlEquipo" Width="230px" runat="server" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlEquipo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlEquipo.ClientID.ToString()%>">Dispositivo:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5" style="margin-right:2%">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlNumero" Width="230px" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Value="-1" Text="Seleccione" />
|
||||
<asp:ListItem Value="3" Text="Tanque #1" />
|
||||
<asp:ListItem Value="4" Text="Tanque #2" />
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlEquipo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlEquipo.ClientID.ToString()%>">Número de tanque:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 truncate ">Arrastre el archivo de Calibración:</div>
|
||||
<div class="col-md-8">
|
||||
<asp:TextBox ID="TxtCalibración" CssClass="ADSdropzone hidden" data-maxFile="1" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarCatalogo" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
||||
<button id="btnCancelar" data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="dvConsulta" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpdatePanel1" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel2" runat="server">Calibración</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UPCalibracion">
|
||||
<ContentTemplate>
|
||||
<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="TxtBusquedaD" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaD','{0}')", GvCalibracion.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaD','{0}')", GvCalibracion.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvCalibracion" runat="server" GridLines="None" DataKeyNames="Nivel,Valor,CveControl" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Nivel" ItemStyle-Width="50%" HeaderText="Nivel" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Valor" ItemStyle-Width="50%" HeaderText="Valor" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<button data-dismiss="modal" class="btn btn-default">Volver</button>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
290
GPS/DispositivosControles.aspx.vb.vb.exclude
Normal file
290
GPS/DispositivosControles.aspx.vb.vb.exclude
Normal file
@@ -0,0 +1,290 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports GemBox.Spreadsheet
|
||||
|
||||
Partial Class GPS_DispositivosControles
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Public Property CveControl As Integer
|
||||
Get
|
||||
Return ViewState("CveControl").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveControl") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = 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
|
||||
CveControl = -1
|
||||
EsEditar = 0
|
||||
CargaDatos(-1)
|
||||
CargaDdls()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdls()
|
||||
DdlEquipo.DataSource = GlobalDTDispositivos(-1)
|
||||
DdlEquipo.DataBind()
|
||||
DdlEquipo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.UnidadMedidaGet() Then
|
||||
DdlUnidadMedida.DataSource = GPS.DtResultados
|
||||
Else
|
||||
DdlUnidadMedida.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DdlUnidadMedida.DataBind()
|
||||
DdlUnidadMedida.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos(CveCliente As Integer)
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.ControlesGet(CveCliente) Then
|
||||
GvDatos.DataSource = GPS.DtResultados
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveControl = Boton.CommandArgument.ToEntero
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
EsEditar = 1
|
||||
DdlUnidadMedida.SelectedValueExist(GvRow.DataKey("CveUnidadMedida"))
|
||||
DdlEquipo.SelectedValueExist(GvRow.DataKey("CveDispositivo"))
|
||||
TxtAlto.Text = GvRow.DataKey("Alto")
|
||||
TxtAncho.Text = GvRow.DataKey("Ancho")
|
||||
TxtCalibración.Text = "[]"
|
||||
TxtCapacidad.Text = GvRow.DataKey("Capacidad")
|
||||
TxtControl.Text = GvRow.DataKey("Control")
|
||||
TxtLargo.Text = GvRow.DataKey("Largo")
|
||||
TxtLongitud.Text = GvRow.DataKey("Longitud")
|
||||
TxtSensor.Text = GvRow.DataKey("Sensor")
|
||||
DdlNumero.SelectedValueExist(GvRow.DataKey("CveMetrica"))
|
||||
BtnAgregarCatalogo.Text = "Actualizar"
|
||||
UpBodyCompuesto.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarCatalogo_Click(sender As Object, e As EventArgs) Handles BtnAgregarCatalogo.Click
|
||||
Dim GPS As New ClsGPS
|
||||
GPS.IniciaTransacSQL()
|
||||
Dim huboerror As Boolean = False
|
||||
If EsEditar = 0 Then
|
||||
If TxtCalibración.getfiles().Archivos.Count > 0 Then
|
||||
Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0)
|
||||
If Archivo.Extencion <> "xls" AndAlso Archivo.Extencion <> "xlsx" Then
|
||||
GPS.RollBack()
|
||||
GPS.Dispose()
|
||||
Alert("El archivo de calibración debe de ser un archivo excel.")
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
If GPS.ControlAdd(TxtControl.Text, 1, TxtCapacidad.Text.ToDouble, TxtLargo.Text.ToDouble, TxtAncho.Text.ToDouble, TxtAlto.Text.ToDouble, TxtLongitud.Text.ToDouble, TxtSensor.Text, DdlEquipo.SelectedValue.ToEntero, DdlNumero.SelectedValue.ToEntero) Then
|
||||
CveControl = GPS.CveControl
|
||||
Else
|
||||
huboerror = True
|
||||
End If
|
||||
If TxtCalibración.getfiles().Archivos.Count > 0 AndAlso CveControl > 0 AndAlso Not huboerror Then
|
||||
Try
|
||||
Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0)
|
||||
Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}TablasCalibracion"
|
||||
Dim dirSonido As String = String.Format("{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extencion)
|
||||
If File.Exists(dirSonido) Then
|
||||
My.Computer.FileSystem.DeleteFile(dirSonido)
|
||||
End If
|
||||
My.Computer.FileSystem.MoveFile(Archivo.FileUrl, dirSonido)
|
||||
SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet())
|
||||
Dim EF As ExcelFile = ExcelFile.Load(dirSonido)
|
||||
Dim Hoja As ExcelWorksheet = EF.Worksheets(0)
|
||||
Dim Opciones As New CreateDataTableOptions()
|
||||
Opciones.ColumnHeaders = True
|
||||
Opciones.StartRow = 0
|
||||
Opciones.NumberOfColumns = 3
|
||||
Opciones.NumberOfRows = Hoja.Rows.Count
|
||||
Opciones.Resolution = ColumnTypeResolution.AutoPreferStringInvariantCulture
|
||||
Dim TempDT As DataTable = Hoja.CreateDataTable(Opciones)
|
||||
For Each row As DataRow In TempDT.Rows
|
||||
If Not GPS.CalibracionAdd(row("Nivel").ToString.ToDouble, row("Valor").ToString.ToDouble, CveControl) Then
|
||||
huboerror = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
huboerror = True
|
||||
End Try
|
||||
End If
|
||||
If Not huboerror Then
|
||||
GPS.Commit()
|
||||
Alert("El Control se agregó correctamente")
|
||||
Else
|
||||
GPS.RollBack()
|
||||
Alert("Ocurrió un error al realizar la calibración", TipoMensaje.MsgError)
|
||||
End If
|
||||
ElseIf EsEditar = 1 Then
|
||||
If TxtCalibración.getfiles().Archivos.Count > 0 Then
|
||||
Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0)
|
||||
If Archivo.Extencion <> "xls" AndAlso Archivo.Extencion <> "xlsx" Then
|
||||
GPS.RollBack()
|
||||
GPS.Dispose()
|
||||
Alert("El archivo de calibración debe de ser un archivo excel.")
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
If Not GPS.ControlUpdate(TxtControl.Text, 1, TxtCapacidad.Text.ToDouble, TxtLargo.Text.ToDouble, TxtAncho.Text.ToDouble, TxtAlto.Text.ToDouble, TxtLongitud.Text.ToDouble, TxtSensor.Text, DdlEquipo.SelectedValue.ToEntero, CveControl, DdlNumero.SelectedValue.ToEntero) Then
|
||||
huboerror = True
|
||||
End If
|
||||
If TxtCalibración.getfiles().Archivos.Count > 0 AndAlso Not huboerror Then
|
||||
Try
|
||||
huboerror = Not GPS.CalibracionDelete(CveControl)
|
||||
If Not huboerror Then
|
||||
Dim Archivo As Archivo = TxtCalibración.getfiles().Archivos(0)
|
||||
Dim Path As String = $"{AppDomain.CurrentDomain.BaseDirectory}TablasCalibracion"
|
||||
Dim dirSonido As String = String.Format("{0}\{1}.{2}", Path, FormatearNombreArchivo(Archivo.filenameO), Archivo.Extencion)
|
||||
If File.Exists(dirSonido) Then
|
||||
My.Computer.FileSystem.DeleteFile(dirSonido)
|
||||
End If
|
||||
My.Computer.FileSystem.MoveFile(Archivo.FileUrl, dirSonido)
|
||||
SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet())
|
||||
Dim EF As ExcelFile = ExcelFile.Load(dirSonido)
|
||||
Dim Hoja As ExcelWorksheet = EF.Worksheets(0)
|
||||
Dim Opciones As New CreateDataTableOptions()
|
||||
Opciones.ColumnHeaders = True
|
||||
Opciones.StartRow = 0
|
||||
Opciones.NumberOfColumns = 3
|
||||
Opciones.NumberOfRows = Hoja.Rows.Count
|
||||
Opciones.Resolution = ColumnTypeResolution.AutoPreferStringInvariantCulture
|
||||
Dim TempDT As DataTable = Hoja.CreateDataTable(Opciones)
|
||||
For Each row As DataRow In TempDT.Rows
|
||||
If Not GPS.CalibracionAdd(row("Nivel").ToString.ToDouble, row("Valor").ToString.ToDouble, CveControl) Then
|
||||
huboerror = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Catch ex As Exception
|
||||
huboerror = True
|
||||
End Try
|
||||
End If
|
||||
If Not huboerror Then
|
||||
GPS.Commit()
|
||||
Alert("El Control se actualizó correctamente")
|
||||
Else
|
||||
GPS.RollBack()
|
||||
Alert("Ocurrió un error al realizar la calibración", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
TxtAlto.Text = ""
|
||||
TxtAncho.Text = ""
|
||||
TxtCalibración.Text = "[]"
|
||||
TxtCapacidad.Text = ""
|
||||
TxtControl.Text = ""
|
||||
TxtLargo.Text = ""
|
||||
TxtLongitud.Text = ""
|
||||
TxtSensor.Text = ""
|
||||
DdlEquipo.SelectedValueExist("-1")
|
||||
DdlUnidadMedida.SelectedValueExist("-1")
|
||||
GPS.Dispose()
|
||||
CargaDatos(-1)
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
UpBodyCompuesto.Update()
|
||||
UpFooter.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatos.RowDeleting
|
||||
Dim GPS As New ClsGPS
|
||||
Dim CveControl As Integer = GvDatos.Rows(e.RowIndex).DataKey("CveControl").ToEntero
|
||||
If GPS.ControlesDelete(CveControl) Then
|
||||
Alert("El Control se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaDatos(-1)
|
||||
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
|
||||
e.Row.VerticalAlign = VerticalAlign.Middle
|
||||
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveControl").ToString
|
||||
e.Row.FCLinkButton("ImgC").CommandArgument = e.Row.DataKey("CveControl").ToString
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles BtnOpenDiv.Click
|
||||
EsEditar = 0
|
||||
BtnAgregarCatalogo.Text = "Agregar"
|
||||
TxtControl.Text = ""
|
||||
TxtCapacidad.Text = ""
|
||||
TxtLargo.Text = ""
|
||||
TxtAncho.Text = ""
|
||||
TxtAlto.Text = ""
|
||||
TxtLongitud.Text = ""
|
||||
TxtSensor.Text = ""
|
||||
TxtCalibración.Text = "[]"
|
||||
DdlEquipo.SelectedValueExist("-1")
|
||||
DdlUnidadMedida.SelectedValueExist("-1")
|
||||
UpBodyCompuesto.Update()
|
||||
UpFooter.Update()
|
||||
RegistraScript("$('#divAgregar').modal()")
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function FormatearNombreArchivo(nombreArchivoOriginal As String) As String
|
||||
Dim nombreArchivoFormateado As String
|
||||
nombreArchivoFormateado = nombreArchivoOriginal.Replace(" ", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("'", "")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace(Chr(34), "")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("$", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("#", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("%", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("!", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("&", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("?", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("¿", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("¡", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("*", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("~", "_")
|
||||
nombreArchivoFormateado = nombreArchivoFormateado.Replace("^", "_")
|
||||
Return nombreArchivoFormateado
|
||||
End Function
|
||||
|
||||
|
||||
Protected Sub imgC_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveControl = Boton.CommandArgument.ToEntero
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
myModalLabel2.InnerText = $"Tabla de calibración de {GvRow.DataKey("Control")}"
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.CalibracionGet(0, CveControl) Then
|
||||
GvCalibracion.DataSource = GPS.DtResultados
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvCalibracion.DataBind()
|
||||
EsEditar = 1
|
||||
UPCalibracion.Update()
|
||||
RegistraScript("$('#dvConsulta').modal()")
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
642
GPS/EntradasSalidasGR.aspx
Normal file
642
GPS/EntradasSalidasGR.aspx
Normal file
@@ -0,0 +1,642 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="EntradasSalidasGR.aspx.vb" Inherits="GPS_Rastreo" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<link href="../Metronic/assets/layouts/layout3/css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<style type="text/css">
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#map {
|
||||
width: 100%;
|
||||
height: calc(100% - 51px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#map {
|
||||
position: fixed !important;
|
||||
}
|
||||
|
||||
.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%);
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="H" ID="Content9" runat="server">
|
||||
<li>
|
||||
<a id="BtnConsulta" onclick="CargaDiv();">
|
||||
<i class='fa fa-exchange'></i><span>Rep. Entradas y Salidas</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkKM" OnClientClick="javascript:$('#DvDescargar').modal('show'); return false;" CommandArgument="KM" Text="<i class='fa fa-line-chart'></i><span>Imprimir PDF</span>" runat="server">
|
||||
</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<div id="map"></div>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UPModalBusqueda">
|
||||
<ContentTemplate>
|
||||
<div id="dvConsulta" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UPConsulta" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel2" runat="server">Reporte de Entrada y Salidas de Geocercas</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="upFechas" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div runat="server" id="dvFechas">
|
||||
<ul class="list-inline" style="font-size: 12px; margin-top: 15px; margin-left: 0px; margin-bottom: 20px;">
|
||||
<li>Fecha Inicio:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpFechas"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
<li>Fecha Fin:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpFechas"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 15px;">
|
||||
<div class="col-md-4">
|
||||
<asp:LinkButton runat="server" Style="width: 150px; text-align: center" ID="BtnUltimas2" OnClientClick="ConsultaFecha('2'); return false;" CssClass="btn default" Text="Últimas dos horas" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:LinkButton runat="server" Style="width: 150px; text-align: center" ID="BtnUltimas8" OnClientClick="ConsultaFecha('8'); return false;" CssClass="btn default" Text="Últimas ocho horas" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:LinkButton runat="server" Style="width: 150px; text-align: center" ID="BtnHoy" OnClientClick="ConsultaFecha('24'); return false;" CssClass="btn default" Text="Hoy" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 25px;">
|
||||
<div class="col-md-4">
|
||||
<asp:LinkButton runat="server" Style="width: 150px; text-align: center" ID="BtnAyer" OnClientClick="ConsultaFecha('48'); return false;" CssClass="btn default" Text="Ayer" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:LinkButton runat="server" Style="width: 150px; text-align: center" ID="BtnSemana" OnClientClick="ConsultaFecha('Week'); return false;" CssClass="btn default" Text="Última Semana" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:LinkButton runat="server" Style="width: 150px; text-align: center" ID="BtnMes" OnClientClick="ConsultaFecha('Month'); return false;" CssClass="btn default" Text="Mes en Curso" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<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="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDispositivos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDispositivos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<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-height="150" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkDis" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="25%" HeaderText="Número Económico" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="ModeloVehiculo" ItemStyle-Width="25%" HeaderText="Modelo Vehículo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="AñoVehiculo" ItemStyle-Width="25%" HeaderText="Año Vehículo" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="PlacasVehiculo" ItemStyle-Width="25%" HeaderText="Placas Vehículo" ItemStyle-HorizontalAlign="center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:UpdatePanel ID="upEventos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="dvEventos" runat="server">
|
||||
<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="TxtBusquedaEventos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaEventos','{0}')", GVGeoreferencias.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaEventos','{0}')", GVGeoreferencias.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GVGeoreferencias" runat="server" GridLines="None" DataKeyNames="Coordenadas,CveGeoReferencia,GeoReferencia,CveDispositivo,Tipo,Color,Estatus,FechaInicio,FechaFin,AplicaLunes,AplicaMartes,AplicaMiercoles,AplicaJueves,AplicaViernes,AplicaSabado,AplicaDomingo, HoraInicio, HoraFin, Tolerancia" 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>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkGR" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Tipo" ItemStyle-Width="20%" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="GeoReferencia" ItemStyle-Width="20%" HeaderText="GeoReferencia" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Color" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgColor" HeaderText="Color" runat="server" Style="height: 20px;" Enabled="false" CausesValidation="False" CssClass="btn btn-circle btn-sm green" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="BtnRastrear" runat="server" Text="Rastreo" CssClass="btn btn-primary"></asp:LinkButton>
|
||||
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DvDescargar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content rowpadding">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="H1" runat="server">Imprimir Reporte de Entrada y Salidas de Geocercas</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:LinkButton ID="LnkPDF" OnClick="LnkPDF_Click" CommandArgument="KM" Text="<i class='fa fa-line-chart'></i><span>Descargar PDF</span>" runat="server">
|
||||
</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<asp:LinkButton ID="LnkPDFDetallado" OnClick="LnkPDFDetallado_Click" CommandArgument="KM" Text="<i class='fa fa-line-chart'></i><span>Descargar PDF Detallado</span>" runat="server">
|
||||
</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button data-dismiss="modal" class="btn btn-danger">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="../Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js"></script>
|
||||
<script>
|
||||
var image = '/Imagenes/rsz_11rsz_car.png';
|
||||
var geocoder;
|
||||
var map;
|
||||
var directionsService;
|
||||
var directionsDisplay;
|
||||
|
||||
|
||||
|
||||
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: { lat: 29.0730, lng: -110.9559 },
|
||||
zoom: 10
|
||||
});
|
||||
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(function (position) {
|
||||
var pos = {
|
||||
lat: position.coords.latitude,
|
||||
lng: position.coords.longitude
|
||||
};
|
||||
map.setCenter(pos);
|
||||
}, function () {
|
||||
handleLocationError(true, infoWindow, map.getCenter());
|
||||
});
|
||||
}
|
||||
|
||||
geocoder = new google.maps.Geocoder();
|
||||
|
||||
google.maps.event.addListener(map, "click", function (event) {
|
||||
closeLastOpenedInfoWindow();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
var polylines = [];
|
||||
|
||||
function creaPolyline(coords, color, info, lastcoord, nomequipo, Imagen) {
|
||||
var lineSymbol = {
|
||||
path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
|
||||
strokeWeight: 1,
|
||||
strokeOpacity: 1,
|
||||
scale: 3,
|
||||
fillOpacity: 0.6
|
||||
};
|
||||
var polyline = new google.maps.Polyline({
|
||||
path: coords,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.6,
|
||||
strokeWeight: 6,
|
||||
fillOpacity: 0.35,
|
||||
icons: [{
|
||||
icon: lineSymbol,
|
||||
offset: '0',
|
||||
repeat: '80px'
|
||||
}]
|
||||
});
|
||||
polyline.setMap(map);
|
||||
polylines.push(polyline);
|
||||
CreaMarcador(lastcoord, nomequipo, info, Imagen);
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
initMap();
|
||||
});
|
||||
var markers = [];
|
||||
var lastOpenedInfoWindow;
|
||||
|
||||
|
||||
function CreaMarcador(coords, nomEquipo, ContentString, imagen) {
|
||||
if (typeof imagen === 'undefined') { imagen = image; }
|
||||
var marker = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: map,
|
||||
icon: imagen
|
||||
});
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: ContentString
|
||||
});
|
||||
marker.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
GetDirecciones(coords, infowindow, marker);
|
||||
infowindow.open(map, marker);
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
});
|
||||
markers.push(marker);
|
||||
//map.setCenter(coords);
|
||||
fitBoundsToVisibleMarkers()
|
||||
}
|
||||
|
||||
function fitBoundsToVisibleMarkers() {
|
||||
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].getVisible()) {
|
||||
bounds.extend(markers[i].getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
map.fitBounds(bounds);
|
||||
|
||||
}
|
||||
|
||||
var polygons = [];
|
||||
|
||||
function creaPoligono(coords, color) {
|
||||
var polygon = new google.maps.Polygon({
|
||||
paths: coords,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 2,
|
||||
fillColor: color,
|
||||
fillOpacity: 0.35
|
||||
});
|
||||
polygon.setMap(map);
|
||||
polygons.push(polygon);
|
||||
//map.setCenter(coords[0]);
|
||||
}
|
||||
|
||||
function closeLastOpenedInfoWindow() {
|
||||
if (lastOpenedInfoWindow) {
|
||||
lastOpenedInfoWindow.close();
|
||||
}
|
||||
}
|
||||
|
||||
var marker2;
|
||||
function CreaMarcadorHistorico(coords, nomEquipo, ContentString, imagen, imagen2) {
|
||||
if (typeof imagen === 'undefined') { imagen = image; }
|
||||
var icon = {
|
||||
url: imagen, // url
|
||||
scaledSize: new google.maps.Size(12.5, 12.5), // scaled size
|
||||
// origin: new google.maps.Point(0, 0), // origin
|
||||
//anchor: new google.maps.Point(0, 0) // anchor
|
||||
};
|
||||
var marker = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: map,
|
||||
icon: icon
|
||||
});
|
||||
var infowindow2 = new google.maps.InfoWindow({
|
||||
content: ContentString
|
||||
});
|
||||
marker.addListener('click', function () {
|
||||
if (typeof marker2 != 'undefined') { marker2.setMap(null); }
|
||||
marker2 = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: map,
|
||||
icon: imagen2
|
||||
});
|
||||
marker2.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
infowindow2.open(map, marker2);
|
||||
lastOpenedInfoWindow = infowindow2;
|
||||
});
|
||||
infowindow2.open(map, marker2);
|
||||
lastOpenedInfoWindow = infowindow2;
|
||||
});
|
||||
markers.push(marker);
|
||||
map.setCenter(coords);
|
||||
}
|
||||
|
||||
function DeleteMarkers() {
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
markers = [];
|
||||
for (var i = 0; i < polylines.length; i++) {
|
||||
polylines[i].setMap(null);
|
||||
}
|
||||
polylines = [];
|
||||
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
polygons[i].setMap(null);
|
||||
}
|
||||
polygons = [];
|
||||
}
|
||||
|
||||
|
||||
function fitBoundsToVisibleMarkers() {
|
||||
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].getVisible()) {
|
||||
bounds.extend(markers[i].getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
map.fitBounds(bounds);
|
||||
|
||||
}
|
||||
|
||||
function CargaDiv() {
|
||||
$("#C_txtFechaI").val("")
|
||||
$("#C_txtFechaF").val("")
|
||||
$('#dvConsulta').modal({ backdrop: 'static', keyboard: false });
|
||||
|
||||
}
|
||||
|
||||
function ConsultaFecha(Opcion) {
|
||||
var today = new Date();
|
||||
switch (Opcion) {
|
||||
case "2":
|
||||
var FechaI = addDate(today, "hour", -2);
|
||||
var FechaF = today;
|
||||
|
||||
$("#C_txtFechaI").val(dateFormat(FechaI, "dd/mm/yyyy HH:mm"));
|
||||
$("#C_txtFechaF").val(dateFormat(FechaF, "dd/mm/yyyy HH:mm"));
|
||||
break;
|
||||
case "8":
|
||||
var FechaI = addDate(today, "hour", -8);
|
||||
var FechaF = today;
|
||||
|
||||
$("#C_txtFechaI").val(dateFormat(FechaI, "dd/mm/yyyy HH:mm"));
|
||||
$("#C_txtFechaF").val(dateFormat(FechaF, "dd/mm/yyyy HH:mm"));
|
||||
break;
|
||||
case "24":
|
||||
$("#C_txtFechaI").val(dateFormat(today, "dd/mm/yyyy") + " 0:00");
|
||||
$("#C_txtFechaF").val(dateFormat(today, "dd/mm/yyyy") + " 23:59");
|
||||
break;
|
||||
case "48":
|
||||
var FechaI = addDate(today, "day", -1);
|
||||
|
||||
$("#C_txtFechaI").val(dateFormat(FechaI, "dd/mm/yyyy") + " 0:00");
|
||||
$("#C_txtFechaF").val(dateFormat(FechaI, "dd/mm/yyyy") + " 23:59");
|
||||
break;
|
||||
case "Week":
|
||||
var FechaI = addDate(today, "day", -7);
|
||||
|
||||
$("#C_txtFechaI").val(dateFormat(FechaI, "dd/mm/yyyy") + " 0:00");
|
||||
$("#C_txtFechaF").val(dateFormat(today, "dd/mm/yyyy HH:mm"));
|
||||
break;
|
||||
case "Month":
|
||||
//var FechaI = addDate(today, "month", -1);
|
||||
var FechaI = '01/' + (today.getMonth() + 1) + '/' + today.getFullYear() + " 0:00";
|
||||
$("#C_txtFechaI").val(FechaI);
|
||||
$("#C_txtFechaF").val(dateFormat(today, "dd/mm/yyyy HH:mm"));
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
//REGION F U N C I O N E S - F E C H A S
|
||||
function addDate(date, interval, units) {
|
||||
var ret = new Date(date); //don't change original date
|
||||
var checkRollover = function () { if (ret.getDate() != date.getDate()) ret.setDate(0); };
|
||||
switch (interval.toLowerCase()) {
|
||||
case 'year': ret.setFullYear(ret.getFullYear() + units); checkRollover(); break;
|
||||
case 'quarter': ret.setMonth(ret.getMonth() + 3 * units); checkRollover(); break;
|
||||
case 'month': ret.setMonth(ret.getMonth() + units); checkRollover(); break;
|
||||
case 'week': ret.setDate(ret.getDate() + 7 * units); break;
|
||||
case 'day': ret.setDate(ret.getDate() + units); break;
|
||||
case 'hour': ret.setTime(ret.getTime() + units * 3600000); break;
|
||||
case 'minute': ret.setTime(ret.getTime() + units * 60000); break;
|
||||
case 'second': ret.setTime(ret.getTime() + units * 1000); break;
|
||||
default: ret = undefined; break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
var dateFormat = function () {
|
||||
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
|
||||
timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
|
||||
timezoneClip = /[^-+\dA-Z]/g,
|
||||
pad = function (val, len) {
|
||||
val = String(val);
|
||||
len = len || 2;
|
||||
while (val.length < len) val = "0" + val;
|
||||
return val;
|
||||
};
|
||||
|
||||
// Regexes and supporting functions are cached through closure
|
||||
return function (date, mask, utc) {
|
||||
var dF = dateFormat;
|
||||
|
||||
// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
|
||||
if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
|
||||
mask = date;
|
||||
date = undefined;
|
||||
}
|
||||
|
||||
// Passing date through Date applies Date.parse, if necessary
|
||||
date = date ? new Date(date) : new Date;
|
||||
if (isNaN(date)) throw SyntaxError("invalid date");
|
||||
|
||||
mask = String(dF.masks[mask] || mask || dF.masks["default"]);
|
||||
|
||||
// Allow setting the utc argument via the mask
|
||||
if (mask.slice(0, 4) == "UTC:") {
|
||||
mask = mask.slice(4);
|
||||
utc = true;
|
||||
}
|
||||
|
||||
var _ = utc ? "getUTC" : "get",
|
||||
d = date[_ + "Date"](),
|
||||
D = date[_ + "Day"](),
|
||||
m = date[_ + "Month"](),
|
||||
y = date[_ + "FullYear"](),
|
||||
H = date[_ + "Hours"](),
|
||||
M = date[_ + "Minutes"](),
|
||||
s = date[_ + "Seconds"](),
|
||||
L = date[_ + "Milliseconds"](),
|
||||
o = utc ? 0 : date.getTimezoneOffset(),
|
||||
flags = {
|
||||
d: d,
|
||||
dd: pad(d),
|
||||
ddd: dF.i18n.dayNames[D],
|
||||
dddd: dF.i18n.dayNames[D + 7],
|
||||
m: m + 1,
|
||||
mm: pad(m + 1),
|
||||
mmm: dF.i18n.monthNames[m],
|
||||
mmmm: dF.i18n.monthNames[m + 12],
|
||||
yy: String(y).slice(2),
|
||||
yyyy: y,
|
||||
h: H % 12 || 12,
|
||||
hh: pad(H % 12 || 12),
|
||||
H: H,
|
||||
HH: pad(H),
|
||||
M: M,
|
||||
MM: pad(M),
|
||||
s: s,
|
||||
ss: pad(s),
|
||||
l: pad(L, 3),
|
||||
L: pad(L > 99 ? Math.round(L / 10) : L),
|
||||
t: H < 12 ? "a" : "p",
|
||||
tt: H < 12 ? "am" : "pm",
|
||||
T: H < 12 ? "A" : "P",
|
||||
TT: H < 12 ? "AM" : "PM",
|
||||
Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
|
||||
o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
|
||||
S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
|
||||
};
|
||||
|
||||
return mask.replace(token, function ($0) {
|
||||
return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
|
||||
});
|
||||
};
|
||||
}();
|
||||
|
||||
// Some common format strings
|
||||
dateFormat.masks = {
|
||||
"default": "ddd mmm dd yyyy HH:MM:ss",
|
||||
shortDate: "m/d/yy",
|
||||
mediumDate: "mmm d, yyyy",
|
||||
longDate: "mmmm d, yyyy",
|
||||
fullDate: "dddd, mmmm d, yyyy",
|
||||
shortTime: "h:MM TT",
|
||||
mediumTime: "h:MM:ss TT",
|
||||
longTime: "h:MM:ss TT Z",
|
||||
isoDate: "yyyy-mm-dd",
|
||||
isoTime: "HH:MM:ss",
|
||||
isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
|
||||
isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
|
||||
};
|
||||
|
||||
// Internationalization strings
|
||||
dateFormat.i18n = {
|
||||
dayNames: [
|
||||
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
|
||||
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
|
||||
],
|
||||
monthNames: [
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
|
||||
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
|
||||
]
|
||||
};
|
||||
//END REGION
|
||||
function GetDirecciones(posicion, infowindow, marker) {
|
||||
if (marker.formatted_address) { return false; }
|
||||
else if (marker.formatted_addressrow) {
|
||||
infowindow.setContent(infowindow.getContent() + "<div style='margin-left:5px'>" + "Dirección: " + marker.formatted_addressrow + "</div>");
|
||||
marker.formatted_address = marker.formatted_addressrow
|
||||
}
|
||||
else {
|
||||
var lat = posicion.lat
|
||||
var lng = posicion.lng
|
||||
var url = '<%= ClsPaginas.UrlDirecciones%>' + '/nominatim/reverse.php?format=jsonv2&lat=' + lat + '&lon=' + lng;
|
||||
$.getJSON(url, function (data) {
|
||||
if (typeof (data.error) === 'undefined') {
|
||||
marker.formatted_address = data.display_name
|
||||
infowindow.setContent(infowindow.getContent() + "<div style='margin-left:5px'>" + "Dirección: " + data.display_name + "</div>");
|
||||
|
||||
} else {
|
||||
marker.formatted_address = "Dirección no encontrada";
|
||||
infowindow.setContent(infowindow.getContent() + "<div style='margin-left:5px'> Dirección: No Encontrada </div>");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places">
|
||||
</script>
|
||||
<%--<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAJnZ1CoEUX425C20aqzFw4dYxFL_LfThk&libraries=places">
|
||||
</script>--%>
|
||||
</asp:Content>
|
||||
|
||||
352
GPS/EntradasSalidasGR.aspx.vb
Normal file
352
GPS/EntradasSalidasGR.aspx.vb
Normal file
@@ -0,0 +1,352 @@
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports System.Net
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
Partial Class GPS_Rastreo
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property TrazarLineaContinuo As Boolean
|
||||
Get
|
||||
Return CType(ViewState("TrazarLineaContinuo"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("TrazarLineaContinuo") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property Filtrado As Boolean
|
||||
Get
|
||||
Return CType(ViewState("Filtrado"), Boolean)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("Filtrado") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property FechaI As DateTime
|
||||
Get
|
||||
Return CType(ViewState("FechaI"), DateTime)
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
ViewState("FechaI") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property FechaF As DateTime
|
||||
Get
|
||||
Return CType(ViewState("FechaF"), DateTime)
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
ViewState("FechaF") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtCoordenadasContinuas As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtCoordenadasContinuas"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtCoordenadasContinuas") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDispositivos()
|
||||
CargaGeoReferencias()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDispositivos()
|
||||
GvDispositivos.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("Estatus = 1 ")
|
||||
GvDispositivos.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGeoReferencias()
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.GeoReferenciaGet(-1, 1, "-1", UsuarioActual.CveCliente) Then
|
||||
GVGeoreferencias.DataSource = GPS.DtResultados.FiltraParametros("Tipo = 'Geocerca'")
|
||||
Else
|
||||
GVGeoreferencias.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GVGeoreferencias.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvGeoreferencias_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVGeoreferencias.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCLinkButton("imgColor").Style.Add("background-color", e.Row.DBCampo("Color").ToString)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCosultar_Click(sender As Object, e As EventArgs) Handles BtnRastrear.Click
|
||||
RegistraScript("DeleteMarkers();", "0")
|
||||
CreaDataTable()
|
||||
For Each row As GridViewRow In GvDispositivos.Rows
|
||||
If row.FCCheckBox("chkDis").Checked Then
|
||||
RastrearEquipo(row, "1")
|
||||
End If
|
||||
Next
|
||||
RegistraScript("$('#dvConsulta').modal('hide');", "00")
|
||||
End Sub
|
||||
|
||||
Private Sub RastrearEquipo(GVRow As GridViewRow, Opcion As String)
|
||||
Dim GPS As New ClsGPS
|
||||
Dim LastCoord As String = ""
|
||||
Dim DtPosiciones As New DataTable
|
||||
Dim Info = ""
|
||||
Dim SBBody As New StringBuilder
|
||||
Dim Icono As String = "/Imagenes/rsz_11rsz_car.png"
|
||||
Dim CoordsPoligono = ""
|
||||
Dim Coords = ""
|
||||
Dim Titulo = ""
|
||||
Dim COUNT = 0
|
||||
Dim GeoCercas = ""
|
||||
|
||||
FechaI = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.Trim.ToDate)
|
||||
FechaF = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.Trim.ToDate)
|
||||
|
||||
For Each row As GridViewRow In GVGeoreferencias.Rows
|
||||
If row.FCCheckBox("chkGR").Checked Then
|
||||
If GPS.GeoReferenciasEntradasSalidas(GVRow.DataKey("CveDispositivo").ToString.ToEntero, row.DataKey("CveGeoReferencia").ToString.ToEntero, FechaI, FechaF) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
CoordsPoligono = SQLToGmaps(row.DataKey("Coordenadas").ToString, "POLYGON")
|
||||
For Each rr As DataRow In GPS.DtResultados.Rows
|
||||
Coords = SQLToGmaps(rr("Posicion").ToString, "POINT")
|
||||
|
||||
Info = InfoWindow(rr("Evento").ToString, If(rr("Pasajeros").ToString = "", $"<tr><td>Vehículo: {GVRow.DataKey("NombreVehiculo").ToString}</td></tr>", $"<tr><td>Vehículo: {GVRow.DataKey("NombreVehiculo").ToString}</td></tr><tr><td>Pasajeros: {rr("Pasajeros").ToString}</td></tr>"), GVRow.DataKey("CveDispositivo").ToString.ToEntero, rr)
|
||||
RegistraScript($"CreaMarcador({Coords},'{GVRow.DataKey("SerieVehiculo").ToString}', '{Info}', '{Icono}');", $"{rr("CveDispositivoEvento").ToString}{COUNT.ToString}")
|
||||
COUNT += 1
|
||||
Dim DrNew = DtDatos.NewRow()
|
||||
|
||||
DrNew("Unidad") = GVRow.DataKey("NombreVehiculo").ToString
|
||||
DrNew("Fecha") = rr("FechaTrama").ToString
|
||||
DrNew("Conductor") = rr("Conductor").ToString
|
||||
DrNew("Geocerca") = row.DataKey("GeoReferencia").ToString
|
||||
DrNew("Liga") = rr("Liga").ToString.Replace("&path=", $"&path={EncodeGeocercaString(row.DataKey("Coordenadas").ToString)}")
|
||||
DrNew("Evento") = rr("Evento").ToString
|
||||
DrNew("Direccion") = ""
|
||||
DrNew("Lat") = rr("Lat").ToString
|
||||
DrNew("Lng") = rr("Lng").ToString
|
||||
|
||||
DtDatos.Rows.Add(DrNew)
|
||||
Next
|
||||
RegistraScript($"creaPoligono([{CoordsPoligono}], '{row.DataKey("Color").ToString}')", $"{row.DataKey("CveGeoReferencia").ToString.ToEntero}{COUNT.ToString}")
|
||||
Else
|
||||
GeoCercas = $"{GeoCercas} {row.DataKey("GeoReferencia").ToString},"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If GeoCercas <> "" Then
|
||||
Alert($"No se encontraron resultados para el Vehículo {GVRow.DataKey("SerieVehiculo").ToString} en las siguientes GeoCercas: {GeoCercas.Substring(0, GeoCercas.Length - 1)} ")
|
||||
End If
|
||||
GPS.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "Carga Fechas Predeterminadas"
|
||||
'Protected Sub BtnUltimas2_Click(sender As Object, e As EventArgs) Handles BtnUltimas2.Click
|
||||
' CargaFechasPredeterminadas("2")
|
||||
'End Sub
|
||||
'Protected Sub BtnUltimas8_Click(sender As Object, e As EventArgs) Handles BtnUltimas8.Click
|
||||
' CargaFechasPredeterminadas("8")
|
||||
'End Sub
|
||||
'Protected Sub BtnHoy_Click(sender As Object, e As EventArgs) Handles BtnHoy.Click
|
||||
' CargaFechasPredeterminadas("24")
|
||||
'End Sub
|
||||
'Protected Sub BtnAyer_Click(sender As Object, e As EventArgs) Handles BtnAyer.Click
|
||||
' CargaFechasPredeterminadas("48")
|
||||
'End Sub
|
||||
'Protected Sub BtnSemana_Click(sender As Object, e As EventArgs) Handles BtnSemana.Click
|
||||
' CargaFechasPredeterminadas("Week")
|
||||
'End Sub
|
||||
'Protected Sub BtnMes_Click(sender As Object, e As EventArgs) Handles BtnMes.Click
|
||||
' CargaFechasPredeterminadas("Month")
|
||||
'End Sub
|
||||
|
||||
|
||||
|
||||
'Private Sub CargaFechasPredeterminadas(Opcion As String)
|
||||
' If Opcion = "2" Then
|
||||
' txtFechaI.Text = DateTime.Now.AddHours(-2).ToString("dd/MM/yyyy hh:mm")
|
||||
' txtFechaF.Text = DateTime.Now.ToString("dd/MM/yyyy hh:mm")
|
||||
' ElseIf Opcion = "8" Then
|
||||
' txtFechaI.Text = DateTime.Now.AddHours(-8).ToString("dd/MM/yyyy hh:mm")
|
||||
' txtFechaF.Text = DateTime.Now.ToString("dd/MM/yyyy hh:mm")
|
||||
' ElseIf Opcion = "24" Then
|
||||
' txtFechaI.Text = $"{DateTime.Now.ToString("dd/MM/yyyy")} 0:00"
|
||||
' txtFechaF.Text = $"{DateTime.Now.ToString("dd/MM/yyyy")} 23:59"
|
||||
' ElseIf Opcion = "48" Then
|
||||
' txtFechaI.Text = $"{DateTime.Now.AddDays(-1).ToString("dd/MM/yyyy")} 0:00"
|
||||
' txtFechaF.Text = $"{DateTime.Now.AddDays(-1).ToString("dd/MM/yyyy")} 23:59"
|
||||
' ElseIf Opcion = "Week" Then
|
||||
' txtFechaI.Text = $"{DateTime.Now.AddDays(-7).ToString("dd/MM/yyyy")} 0:00"
|
||||
' txtFechaF.Text = DateTime.Now.ToString("dd/MM/yyyy hh:mm")
|
||||
' ElseIf Opcion = "Month" Then
|
||||
' txtFechaI.Text = $"{New DateTime(Now.Year, Now.Month, 1).ToString("dd/MM/yyyy")} 0:00"
|
||||
' txtFechaF.Text = DateTime.Now.ToString("dd/MM/yyyy hh:mm")
|
||||
' End If
|
||||
|
||||
' RegistraScript("CargaPickers();")
|
||||
' upFechas.Update()
|
||||
'End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "IMPRESION"
|
||||
|
||||
Public Sub CreaDataTable()
|
||||
DtDatos = New DataTable()
|
||||
DtDatos.Columns.Add("Unidad", GetType(String))
|
||||
DtDatos.Columns.Add("Fecha", GetType(String))
|
||||
DtDatos.Columns.Add("Conductor", GetType(String))
|
||||
DtDatos.Columns.Add("Geocerca", GetType(String))
|
||||
DtDatos.Columns.Add("Direccion", GetType(String))
|
||||
DtDatos.Columns.Add("Liga", GetType(String))
|
||||
DtDatos.Columns.Add("Evento", GetType(String))
|
||||
DtDatos.Columns.Add("Lat", GetType(String))
|
||||
DtDatos.Columns.Add("Lng", GetType(String))
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Public Sub EnviarReporteProgramado()
|
||||
If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then
|
||||
Dim DireccionJSON As String = ""
|
||||
Dim request As WebRequest
|
||||
Dim js As JObject = Nothing
|
||||
|
||||
For Each Row As DataRow In DtDatos.Rows
|
||||
Try
|
||||
request = WebRequest.Create(String.Format("{0}nominatim/reverse.php?format=jsonv2&lat={1}&lon={2}", ClsPaginas.UrlDirecciones, Row("Lat"), Row("Lon")))
|
||||
request.Method = "GET" ' set default credentials
|
||||
Dim response As WebResponse = Request.GetResponse() ' fire this puppy off
|
||||
Dim inputstream1 As Stream = response.GetResponseStream() ' define the stream(must be stream
|
||||
Dim reader As New StreamReader(inputstream1) ' get the data stream set
|
||||
DireccionJSON = reader.ReadToEnd ' get all the chucks
|
||||
inputstream1.Dispose() ' get rid of the stream, we no longer need it
|
||||
reader.Close() ' house keeping
|
||||
response.Close()
|
||||
request = Nothing
|
||||
js = JObject.Parse(DireccionJSON)
|
||||
If js IsNot Nothing Then
|
||||
Row("Direccion") = js("display_name").ToString()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
GuardaLog(ex.ToString)
|
||||
End Try
|
||||
Next
|
||||
|
||||
Dim retorno As Byte()
|
||||
Dim RutaReporte = "Empresas/Grales/ReportesProgramados/RPGeocercas.rdlc"
|
||||
|
||||
Try
|
||||
Dim RptParametro As New List(Of ReportParameter)
|
||||
RptParametro.Add(New ReportParameter("FechaInicio", FechaI.ToShortDateString))
|
||||
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToShortDateString))
|
||||
RptParametro.Add(New ReportParameter("MapaURL", ""))
|
||||
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
|
||||
|
||||
retorno = StreamPDF(RutaReporte, DtDatos, RptParametro, "ReporteProgramado", "PDF", MR:=Nothing, RDSName:="DsOC")
|
||||
|
||||
ImprimirbytesPDF(retorno, "ReporteGeocercas")
|
||||
|
||||
DtDatos.Clear()
|
||||
|
||||
Catch ex As Exception
|
||||
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||
End Try
|
||||
Else
|
||||
Alert("No se pudo imprimir el pdf, ya que no se ha hecho una consulta, o ésta no arrojó resultados.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Public Sub EnviarReporteProgramadoDetallado()
|
||||
If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then
|
||||
Dim DireccionJSON As String = ""
|
||||
Dim request As WebRequest
|
||||
Dim js As JObject = Nothing
|
||||
|
||||
For Each Row As DataRow In DtDatos.Rows
|
||||
Try
|
||||
request = WebRequest.Create(String.Format("{0}nominatim/reverse.php?format=jsonv2&lat={1}&lon={2}", ClsPaginas.UrlDirecciones, Row("Lat"), Row("Lng")))
|
||||
request.Method = "GET" ' set default credentials
|
||||
Dim response As WebResponse = request.GetResponse() ' fire this puppy off
|
||||
Dim inputstream1 As Stream = response.GetResponseStream() ' define the stream(must be stream
|
||||
Dim reader As New StreamReader(inputstream1) ' get the data stream set
|
||||
DireccionJSON = reader.ReadToEnd ' get all the chucks
|
||||
inputstream1.Dispose() ' get rid of the stream, we no longer need it
|
||||
reader.Close() ' house keeping
|
||||
response.Close()
|
||||
request = Nothing
|
||||
js = JObject.Parse(DireccionJSON)
|
||||
If js IsNot Nothing Then
|
||||
Row("Direccion") = js("display_name").ToString()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
GuardaLog(ex.ToString)
|
||||
End Try
|
||||
Next
|
||||
|
||||
Dim retorno As Byte()
|
||||
Dim RutaReporte = "Empresas/Grales/ReportesProgramados/ReporteGRDetallado.rdlc"
|
||||
|
||||
Try
|
||||
Dim RptParametro As New List(Of ReportParameter)
|
||||
RptParametro.Add(New ReportParameter("FechaInicio", FechaI.ToShortDateString))
|
||||
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToShortDateString))
|
||||
RptParametro.Add(New ReportParameter("MapaURL", ""))
|
||||
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
|
||||
|
||||
retorno = StreamPDF(RutaReporte, DtDatos, RptParametro, "ReporteProgramado", "PDF", MR:=Nothing, RDSName:="DsOC")
|
||||
|
||||
' Dim ObjMail As New ClsSisMail()
|
||||
|
||||
'Dim ObjEmpresa As New ClsSisEmpresas()
|
||||
'ObjEmpresa.GetEmpresas(1, "-1", "-1", "-1", "-1")
|
||||
|
||||
|
||||
'Dim ResultadoMail As Integer = 0
|
||||
|
||||
'Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
|
||||
|
||||
'LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.ArchivoBinario = retorno, .NombreArchivo = "ReporteProgramado.pdf"})
|
||||
'LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = Xml})
|
||||
|
||||
ImprimirbytesPDF(retorno, "ReporteGeocercas")
|
||||
|
||||
DtDatos.Clear()
|
||||
|
||||
Catch ex As Exception
|
||||
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||
End Try
|
||||
Else
|
||||
Alert("No se pudo imprimir el pdf, ya que no se ha hecho una consulta, o ésta no arrojó resultados.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
Protected Sub LnkPDF_Click(sender As Object, e As EventArgs)
|
||||
EnviarReporteProgramado()
|
||||
End Sub
|
||||
Protected Sub LnkPDFDetallado_Click(sender As Object, e As EventArgs)
|
||||
EnviarReporteProgramadoDetallado()
|
||||
End Sub
|
||||
End Class
|
||||
168
GPS/FacturacionMasiva.aspx
Normal file
168
GPS/FacturacionMasiva.aspx
Normal file
@@ -0,0 +1,168 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="FacturacionMasiva.aspx.vb" Inherits="Contratos_FacturacionMasiva" %>
|
||||
|
||||
<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">
|
||||
Facturación Masiva
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel ID="UpnRefresh" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="ImgFacturarTodos" runat="server"><i class="fa fa-repeat"></i>
|
||||
Facturar Todas</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpFiltros">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle magindate">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnCargaAsignados" ClientIDMode="Static" runat="server" Text="Consultar" class="btn btn-default" />
|
||||
<a href="javascript:;" id="ex" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Cliente:
|
||||
<asp:DropDownList ID="DdlCliente" runat="server" AppendDataBoundItems="true" DataTextField="NombreComercial" DataValueField="CveCliente" CssClass="form-control input-sm select2me" Style="width: 250px !important;">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
<li>Contrato:
|
||||
<asp:DropDownList ID="DdlContrato" Width="230px" AppendDataBoundItems="true" runat="server" DataTextField="NumeroContrato" DataValueField="CveContrato" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
<li>
|
||||
Sucursal:
|
||||
<asp:DropDownList ID="DdlSucursal" Width="230px" AppendDataBoundItems="true" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display:none">
|
||||
<div class="row">
|
||||
<label class="col-md-1">Fecha I.: </label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<label class="col-md-1">Fecha F.: </label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel UpdateMode="Conditional" ID="UpGv" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvCiclosComerciales" runat="server" DataKeyNames="CveCicloComercial, NumeroContrato, CveSubProyecto" AutoGenerateColumns="False" ShowHeader="True" EmptyDataText="No se encontraron pendientes por facturar" GridLines="none" ToolTip="Listado de Pendientes" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" headertext="" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkDis" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Número Contrato" DataField="NumeroContrato" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Descripción" DataField="DescripcionContrato" ItemStyle-CssClass="truncate" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%" />
|
||||
<asp:BoundField HeaderText="Cliente" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
|
||||
<asp:BoundField HeaderText="Fecha Factura" DataField="FechaVenc" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%" />
|
||||
<asp:HyperLinkField Text="Ir" DataNavigateUrlFields="CveCicloComercial" HeaderText="Factura Manual" ItemStyle-Width="15%" Target="_blank" ItemStyle-HorizontalAlign="center" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveCicloComercial={0}" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
<asp:UpdatePanel ID="upRecargar" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:LinkButton ID="btnFacturarAqui" runat="server" CssClass="btn btn-primary" style="float:right" onclientclick="javascript:$('#divAgregar').modal();return false;" Text="Facturar Seleccionadas" CausesValidation="False" />
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="divAgregar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Agregar Observación</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyEstatus" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright" style="margin-bottom:5px">
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label style="margin-bottom: 0; font-size: 13px; color: #888888; opacity: 1; bottom: auto;">Observaciones:</label>
|
||||
<br />
|
||||
<asp:TextBox ID="TxtObservaciones" CssClass="form-control" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnFacturar" runat="server" Text="Facturar Ahora" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"></asp:LinkButton>
|
||||
<button id="btnCancelar" data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
866
GPS/FacturacionMasiva.aspx.vb
Normal file
866
GPS/FacturacionMasiva.aspx.vb
Normal file
@@ -0,0 +1,866 @@
|
||||
Option Strict On
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Partial Class Contratos_FacturacionMasiva
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Private ReadOnly Property SeGuardoPrePoliza As Boolean
|
||||
Get
|
||||
Return CBool(ViewState("SeGuardoPrePoliza"))
|
||||
End Get
|
||||
End Property
|
||||
Private Property DTCicloComercial As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTCicloComercial"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTCicloComercial") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property Mensaje As String
|
||||
Get
|
||||
Return CType(ViewState("Mensaje"), String)
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("Mensaje") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property ErrorList As List(Of String)
|
||||
Get
|
||||
Return CType(ViewState("ErrorList"), List(Of String))
|
||||
End Get
|
||||
Set(value As List(Of String))
|
||||
ViewState("ErrorList") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DTDetalle As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTDetalle"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDetalle") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property TmpDT As DataTable
|
||||
Get
|
||||
Return CType(ViewState("TmpDT"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("TmpDT") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property MensajeAlert As StringBuilder
|
||||
Get
|
||||
Return CType(ViewState("MensajeAlert"), StringBuilder)
|
||||
End Get
|
||||
Set(value As StringBuilder)
|
||||
ViewState("MensajeAlert") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property ObjFactura As Modelos.Factura
|
||||
Get
|
||||
Return CType(ViewState("ObjFactura"), Modelos.Factura)
|
||||
End Get
|
||||
Set(value As Modelos.Factura)
|
||||
ViewState("ObjFactura") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveCicloComercial As Integer
|
||||
Get
|
||||
Return ViewState("CveCicloComercial").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCicloComercial") = 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
|
||||
CargaCombos()
|
||||
txtFechaI.Text = DateTime.Today.ToString("d")
|
||||
txtFechaF.Text = DateTime.Today.ToString("d")
|
||||
CargaDatos(-1, -1)
|
||||
CreaDTVentas()
|
||||
Mensaje = ""
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
DdlCliente.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
DdlCliente.DataBind()
|
||||
DdlContrato.DataSource = GlobalDTContratos().FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
|
||||
DdlContrato.DataBind()
|
||||
DdlSucursal.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa, 1)
|
||||
DdlSucursal.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaDatos(CveContrato As Integer, CveCliente As Integer)
|
||||
Dim ObjContratos As New ClsContratos
|
||||
If ObjContratos.CicloComercialGet(CveContrato, CveCliente, -1, UsuarioActual.CveEmpresa, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, DdlSucursal.SelectedValue.ToEntero) Then
|
||||
DTCicloComercial = ObjContratos.DtResultados().FiltraParametros($"FueFacturado = 0")
|
||||
GvCiclosComerciales.DataSource = DTCicloComercial
|
||||
End If
|
||||
ObjContratos.Dispose()
|
||||
GvCiclosComerciales.DataBind()
|
||||
UpGv.Update()
|
||||
End Sub
|
||||
Protected Sub GvCiclosComerciales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCiclosComerciales.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If GlobalDTFolios().FiltraParametros($"CveSubProyecto = {e.Row.DBCampo("CveSubProyecto")} AND TipoDocto = 'Ing' ").Rows.Count = 0 Then
|
||||
e.Row.FCCheckBox("chkDis").Enabled = False
|
||||
e.Row.FCCheckBox("chkDis").ToolTip = "La sucursal vinculada con este contrato no tiene folios"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub btnConsultar_Click(sender As Object, e As EventArgs) Handles BtnCargaAsignados.Click
|
||||
CargaDatos(DdlContrato.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero)
|
||||
RegistraScript("$('#ex').removeClass('expand');$('#ex').addClass('collapse');$('.portlet-body').css('display', '');")
|
||||
End Sub
|
||||
|
||||
Protected Sub ImgFacturarTodos_Click(sender As Object, e As EventArgs) Handles BtnFacturar.Click
|
||||
Dim FacturadoCorrecto = True
|
||||
For Each row As GridViewRow In GvCiclosComerciales.Rows
|
||||
If row.FCCheckBox("chkDis").Checked Then
|
||||
FacturadoCorrecto = EmitirImprimir(row.DataKey("CveCicloComercial").ToString.ToEntero)
|
||||
If Not FacturadoCorrecto Then
|
||||
If Mensaje = "" Then
|
||||
Alert("Ocurrió un error al facturar masivamente, por favor contacte a soporte técnico", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
Alert($"{Mensaje} en el contrato {row.DataKey("NumeroContrato").ToString}", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If FacturadoCorrecto Then
|
||||
Alert("Los periodos se facturaron correctamente")
|
||||
TxtObservaciones.Text = ""
|
||||
End If
|
||||
CargaDatos(DdlContrato.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero)
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
UpBodyEstatus.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub btnFacturarAqui_Click(sender As Object, e As EventArgs)
|
||||
CveCicloComercial = CType(sender, LinkButton).CommandArgument.ToEntero
|
||||
CreaObjetosVenta()
|
||||
|
||||
If ObjFactura Is Nothing Or ObjFactura.Cliente Is Nothing Then
|
||||
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
|
||||
ObjFactura = Nothing
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
If ObjFactura.CveCliente > 0 Then
|
||||
If DTDetalle.Rows.Count > 0 Then
|
||||
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjContr As New ClsContratos(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjOS As New ClsOS(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjClientes As New ClsClientes(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjContPaq As ClsContPAQi = Nothing
|
||||
'Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
|
||||
ErrorList = New List(Of String)
|
||||
MensajeAlert = New StringBuilder
|
||||
|
||||
|
||||
'CONTABILIDAD AUTOMATICA Y AC
|
||||
If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||
ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
End If
|
||||
|
||||
|
||||
'GUARDA VENTA
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS)
|
||||
|
||||
If CveCicloComercial > 0 AndAlso ErrorList.Count = 0 Then
|
||||
If Not ObjContr.CicloComercialUpdate(CveCicloComercial, True, UsuarioActual.CveEmpresa) Then
|
||||
ErrorList.Add("No se pudo actualizar ")
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot")) Then
|
||||
ObjVentas.Commit()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
ViewState("CveVenta") = ObjFactura.CveVenta
|
||||
|
||||
|
||||
Dim SeTimbro As Boolean = False
|
||||
'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
|
||||
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant") Then
|
||||
If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso UsuarioActual.Empresa.FacturaProduccion Then
|
||||
|
||||
Dim sw As New Diagnostics.Stopwatch
|
||||
sw.Start()
|
||||
|
||||
'FACTURA INGRESO/EGRESO
|
||||
Dim ObjTimbrado As New Timbrado
|
||||
|
||||
|
||||
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||
|
||||
sw.Stop()
|
||||
GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString, UsuarioActual.Empresa.CvePAC)
|
||||
End If
|
||||
|
||||
|
||||
'MENSAJE PRINCIPAL
|
||||
MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", ObjFactura.TipoDocumento, ObjFactura.SerieFolio))
|
||||
|
||||
|
||||
If SeTimbro Then
|
||||
'XML
|
||||
Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
|
||||
If File.Exists(ArchivoXML) Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", ObjFactura.CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
|
||||
End If
|
||||
|
||||
'IMPRESION
|
||||
GeneraPDFFactura(False)
|
||||
Else
|
||||
MensajeAlert.AppendFormat("La factura no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir o póngase en contacto con soporte técnico.")
|
||||
End If
|
||||
|
||||
'MUESTA ALERT OK
|
||||
Dim Liga = If(UsuarioActual.CveRol = 1165, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={ObjFactura.CveCliente}&Opt=3"";")
|
||||
Alert(MensajeAlert.ToString, TipoMensaje.MsgInformacion)
|
||||
|
||||
ObjFactura = Nothing
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
|
||||
For Each ErrorItem In ErrorList
|
||||
Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
|
||||
Next
|
||||
|
||||
'MUESTA ALERT ERROR
|
||||
Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
ObjConta.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
ObjContr.Dispose()
|
||||
ErrorList = Nothing
|
||||
MensajeAlert = Nothing
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
||||
CargaDatos(DdlContrato.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero)
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
|
||||
For Each ErrorItem In ErrorList
|
||||
Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
|
||||
Next
|
||||
|
||||
'MUESTA ALERT ERROR
|
||||
Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
|
||||
ObjVentas.Dispose()
|
||||
ObjConta.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
ObjContr.Dispose()
|
||||
'ObjFolios.Dispose()
|
||||
ErrorList = Nothing
|
||||
MensajeAlert = Nothing
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
||||
|
||||
End If
|
||||
Else
|
||||
Mensaje = "Las facturas del contrato"
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function EmitirImprimir(pCveCicloComercial As Integer) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
ViewState("CveCicloComercial") = pCveCicloComercial
|
||||
CreaObjetosVenta()
|
||||
If ObjFactura Is Nothing Or ObjFactura.Cliente Is Nothing Then
|
||||
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
|
||||
ObjFactura = Nothing
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
If ObjFactura.CveCliente > 0 Then
|
||||
If DTDetalle.Rows.Count > 0 Then
|
||||
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjContr As New ClsContratos(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjOS As New ClsOS(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjClientes As New ClsClientes(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjContPaq As ClsContPAQi = Nothing
|
||||
'Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
|
||||
ErrorList = New List(Of String)
|
||||
MensajeAlert = New StringBuilder
|
||||
|
||||
|
||||
'CONTABILIDAD AUTOMATICA Y AC
|
||||
If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||
ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
End If
|
||||
|
||||
|
||||
'GUARDA VENTA
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS)
|
||||
|
||||
If pCveCicloComercial > 0 AndAlso ErrorList.Count = 0 Then
|
||||
If Not ObjContr.CicloComercialUpdate(pCveCicloComercial, True, UsuarioActual.CveEmpresa) Then
|
||||
ErrorList.Add("No se pudo actualizar ")
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot")) Then
|
||||
ObjVentas.Commit()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
ViewState("CveVenta") = ObjFactura.CveVenta
|
||||
|
||||
|
||||
Dim SeTimbro As Boolean = False
|
||||
'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
|
||||
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant") Then
|
||||
If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso UsuarioActual.Empresa.FacturaProduccion Then
|
||||
|
||||
Dim sw As New Diagnostics.Stopwatch
|
||||
sw.Start()
|
||||
|
||||
'FACTURA INGRESO/EGRESO
|
||||
Dim ObjTimbrado As New Timbrado
|
||||
|
||||
|
||||
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||
|
||||
sw.Stop()
|
||||
GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString, UsuarioActual.Empresa.CvePAC)
|
||||
End If
|
||||
|
||||
|
||||
'MENSAJE PRINCIPAL
|
||||
MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", ObjFactura.TipoDocumento, ObjFactura.SerieFolio))
|
||||
|
||||
|
||||
If SeTimbro Then
|
||||
'XML
|
||||
Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
|
||||
If File.Exists(ArchivoXML) Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", ObjFactura.CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
|
||||
End If
|
||||
|
||||
'IMPRESION
|
||||
GeneraPDFFactura(False)
|
||||
Else
|
||||
MensajeAlert.AppendFormat("La factura no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir o póngase en contacto con soporte técnico.")
|
||||
End If
|
||||
|
||||
'MUESTA ALERT OK
|
||||
Dim Liga = If(UsuarioActual.CveRol = 1165, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={ObjFactura.CveCliente}&Opt=3"";")
|
||||
retorno = True
|
||||
ObjFactura = Nothing
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
|
||||
For Each ErrorItem In ErrorList
|
||||
Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
|
||||
Next
|
||||
|
||||
'MUESTA ALERT ERROR
|
||||
Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
ObjConta.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
ObjContr.Dispose()
|
||||
ErrorList = Nothing
|
||||
MensajeAlert = Nothing
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
|
||||
For Each ErrorItem In ErrorList
|
||||
Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
|
||||
Next
|
||||
|
||||
'MUESTA ALERT ERROR
|
||||
Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
|
||||
ObjVentas.Dispose()
|
||||
ObjConta.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
ObjContr.Dispose()
|
||||
'ObjFolios.Dispose()
|
||||
ErrorList = Nothing
|
||||
MensajeAlert = Nothing
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
||||
End If
|
||||
Else
|
||||
Mensaje = "No se pudo completar facturación por que no se encontraron partidas "
|
||||
End If
|
||||
End If
|
||||
TmpDT.Clear()
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub CreaDTVentas()
|
||||
TmpDT = New DataTable
|
||||
TmpDT.Columns.Add("CveVenta", GetType(Integer))
|
||||
TmpDT.Columns.Add("Consec", GetType(Integer))
|
||||
TmpDT.Columns.Add("Cantidad", GetType(Double))
|
||||
TmpDT.Columns.Add("Codigo", GetType(String))
|
||||
TmpDT.Columns.Add("CveUM", GetType(Integer))
|
||||
TmpDT.Columns.Add("UM", GetType(String))
|
||||
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
|
||||
TmpDT.Columns.Add("Clasificacion", GetType(String))
|
||||
TmpDT.Columns.Add("CvePS", GetType(Integer))
|
||||
TmpDT.Columns.Add("PS", GetType(String))
|
||||
TmpDT.Columns.Add("CodigoPS", GetType(String))
|
||||
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("SerieLote", GetType(String))
|
||||
TmpDT.Columns.Add("Obs", GetType(String))
|
||||
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
|
||||
TmpDT.Columns.Add("PU", GetType(Double))
|
||||
TmpDT.Columns.Add("IVA", GetType(Double))
|
||||
TmpDT.Columns.Add("IEPS", GetType(Double))
|
||||
TmpDT.Columns.Add("Descuento", GetType(Double))
|
||||
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
|
||||
TmpDT.Columns.Add("Total", GetType(Double))
|
||||
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("Proyecto", GetType(String))
|
||||
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("SubProyecto", GetType(String))
|
||||
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer))
|
||||
End Sub
|
||||
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False)
|
||||
Dim ObjFolios As New ClsGralFolios()
|
||||
Dim Folio As String = ""
|
||||
Dim Serie As String = ""
|
||||
Dim CveProyecto As String = ""
|
||||
Dim CveSubProyecto As String = ""
|
||||
Dim Proyecto As String = ""
|
||||
Dim SubProyecto As String = ""
|
||||
|
||||
|
||||
|
||||
ObjFactura = New Modelos.Factura
|
||||
Dim objContratos As New ClsContratos
|
||||
Dim DR As DataRow = DTCicloComercial.FiltroPrimero($"CveCicloComercial = {CveCicloComercial}")
|
||||
|
||||
ObjFactura.CveUsuario = UsuarioActual.CveUsuario
|
||||
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
ObjFactura.TipoCambio = 20
|
||||
ObjFactura.ConvertirPesos = False
|
||||
ObjFactura.CveMoneda = DR("CveMoneda").ToString.ToEntero
|
||||
ObjFactura.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", $"CveMoneda = {ObjFactura.CveMoneda} ")
|
||||
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DR("CveMoneda").ToString.ToEntero}")
|
||||
ObjFactura.TipoDocto = "Ing"
|
||||
ObjFactura.RefDocto = ""
|
||||
ObjFactura.Folio = Folio.ToEntero
|
||||
'ObjFactura.Folio = If(ExFolioFactura, FolioXML.ToEntero, -1)
|
||||
ObjFactura.Serie = Serie
|
||||
ObjFactura.CveMesa = -1
|
||||
ObjFactura.Fecha = DR("FechaVenc").ToString.ToDate
|
||||
ObjFactura.CvePrePoliza = -1
|
||||
ObjFactura.CveMetodoPago = 1
|
||||
ObjFactura.MetodoPago = "Efectivo"
|
||||
ObjFactura.FechaPago = DateTime.Today
|
||||
ObjFactura.MotivoDescuento = ""
|
||||
ObjFactura.Observaciones = ""
|
||||
ObjFactura.FechaEjecucion = DateTime.Today
|
||||
ObjFactura.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {1}")
|
||||
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
|
||||
ObjFactura.CveCondicionEntrega = -1
|
||||
ObjFactura.CondicionEntrega = ""
|
||||
ObjFactura.NumeroCuenta = ""
|
||||
ObjFactura.CveSucursal = GlobalDTSucursales.FiltroPrimeroValor("CveSucursal", $"CveEmpresa = {UsuarioActual.CveEmpresa}").ToEntero
|
||||
'ObjFactura.Cliente.NumCtaPago = TxtNumCtaPago.Text.Trim
|
||||
ObjFactura.CondicionesPago = 0
|
||||
ObjFactura.FormaPago = 0
|
||||
'ObjFactura.SerieFolio = String.Format("{0}-{1}", LblSerie.Text, TxtFolio.Text)
|
||||
ObjFactura.PedidoContrato = ""
|
||||
ObjFactura.NumeroContrato = DR("NumeroContrato").ToString
|
||||
ObjFactura.DescripcionContrato = DR("DescripcionContrato").ToString
|
||||
ObjFactura.CveCorte = -1
|
||||
ObjFactura.TipoDocumento = "Factura"
|
||||
ObjFactura.Alfa1 = ""
|
||||
ObjFactura.Alfa2 = ""
|
||||
ObjFactura.Alfa3 = ""
|
||||
'Totales, Y se llena TmpDTImpuestos
|
||||
ObjFactura.Descuento = 0
|
||||
ObjFactura.Amortizacion = 0
|
||||
ObjFactura.CveContrato = DR("CveContrato").ToString.ToEntero
|
||||
ObjFactura.RetIVA = 0
|
||||
ObjFactura.RetISR = 0
|
||||
ObjFactura.IEPS = 0
|
||||
CveProyecto = DR("CveProyecto").ToString
|
||||
Proyecto = DR("ProyectoContrato").ToString
|
||||
CveSubProyecto = DR("CveSubProyecto").ToString
|
||||
SubProyecto = DR("SubProyectoContrato").ToString
|
||||
ObjFactura.IVA = GlobalDTSubProyectos(-1, CveSubProyecto.ToEntero, UsuarioActual.CveEmpresa, 1).FiltroPrimeroValor("IVA").ToDecimal
|
||||
|
||||
|
||||
If ObjFolios.GetFolios("Ing", UsuarioActual.CveEmpresa) Then
|
||||
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format($" Estado = 'Activo' AND CveSubProyecto = {CveSubProyecto} "))
|
||||
If DT.Rows.Count > 0 Then
|
||||
Serie = DT.Rows(0)("Serie").ToString
|
||||
Folio = DT.Rows(0)("FActual").ToString
|
||||
End If
|
||||
DT.Dispose()
|
||||
End If
|
||||
ObjFolios.Dispose()
|
||||
|
||||
If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero) Then
|
||||
DTDetalle = objContratos.DtResultados
|
||||
Else
|
||||
DTDetalle = Nothing
|
||||
End If
|
||||
|
||||
objContratos.Dispose()
|
||||
Dim DtR As DataRow
|
||||
ObjFactura.SubTotal = SUM(DTDetalle, "PU").ToDecimal
|
||||
ObjFactura.IVA = ObjFactura.IVA * ObjFactura.SubTotal
|
||||
ObjFactura.Total = ObjFactura.SubTotal + ObjFactura.IVA
|
||||
ObjFactura.Serie = Serie
|
||||
ObjFactura.Folio = Folio.ToEntero
|
||||
|
||||
For Each row As DataRow In DTDetalle.Rows
|
||||
DtR = TmpDT.NewRow
|
||||
DtR("CveVenta") = -1
|
||||
DtR("Codigo") = row("Codigo")
|
||||
DtR("Consec") = TmpDT.Rows.Count + 1
|
||||
DtR("Cantidad") = row("CantidadContratada")
|
||||
DtR("CveUM") = row("CveUM")
|
||||
DtR("UM") = row("UM")
|
||||
DtR("CveClasificacion") = row("CveClasificacion")
|
||||
DtR("Clasificacion") = row("Clasificacion")
|
||||
DtR("CvePS") = row("CvePS")
|
||||
DtR("PS") = row("PS")
|
||||
DtR("CodigoPS") = row("CodigoPS")
|
||||
DtR("Obs") = ""
|
||||
DtR("PU") = row("PU")
|
||||
DtR("Descuento") = 0
|
||||
DtR("TipoDescuento") = 0
|
||||
DtR("Total") = row("Total")
|
||||
DtR("CveProyecto") = CveProyecto
|
||||
DtR("Proyecto") = Proyecto
|
||||
DtR("CveSubProyecto") = CveSubProyecto
|
||||
DtR("IVA") = If(row("IVA").ToString.ToDouble = -1, GlobalDTSubProyectos(-1, CveSubProyecto.ToEntero, UsuarioActual.CveEmpresa, 1).FiltroPrimeroValor("IVA").ToDouble, row("IVA").ToString.ToDouble)
|
||||
DtR("SubProyecto") = SubProyecto
|
||||
DtR("CveVentaDetalle") = 0
|
||||
DtR("CveContratoDetalle") = row("CveContratoDetalle")
|
||||
TmpDT.Rows.Add(DtR)
|
||||
Next
|
||||
|
||||
|
||||
'DETALLES
|
||||
ObjFactura.DtDetalle = TmpDT
|
||||
|
||||
'CLIENTE
|
||||
ObjFactura.CveCliente = DR("CveCliente").ToString.ToEntero
|
||||
ObjFactura.SetCliente()
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub GuardarVenta(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, factura As Modelos.Factura, TmpDTDetalle As DataTable, CveNCaVincular As Integer, objContPaqi As ClsContPAQi, Optional ObjBancos As ClsBancos = Nothing, Optional ObjOS As ClsOS = Nothing)
|
||||
|
||||
Dim Msgok As New StringBuilder
|
||||
Dim CveAlmacenTraspasoOrigen As Integer = -1
|
||||
Dim CveAlmacenTraspasoDestino As Integer = -1
|
||||
Dim EsDevolucionVenta = -1
|
||||
Dim CveSubProyecto = TmpDTDetalle.Rows(0)("CveSubProyecto").ToString.ToEntero
|
||||
|
||||
|
||||
factura.CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardarVenta", factura.CvePlantillaPoliza, factura.Total, factura.Total, factura.CveMoneda, factura.Fecha, factura.Cliente.Nombre, factura.CveUsuario, factura.CveEmpresa)
|
||||
If Not ObjVentas.AddVenta(factura.TipoDocto, factura.Folio, factura.CveCliente, factura.CveClienteSucursal, factura.SubTotalTC, factura.DescuentoTC,
|
||||
factura.AmortizacionTC, factura.IVATC, factura.RetIVATC, factura.RetISRTC,
|
||||
factura.TotalTC, factura.CveMoneda, factura.TipoCambio, factura.CveMetodoPago, factura.CondicionesPago, factura.FormaPago, factura.FechaPago, factura.Fecha, factura.MotivoDescuento,
|
||||
factura.Observaciones, factura.FechaEjecucion, factura.CveVendedor, factura.Alfa1, factura.Alfa2,
|
||||
factura.Alfa3, factura.Num1, factura.Num2, factura.Num3,
|
||||
factura.Fech1, factura.Fech2, factura.Fech3, factura.CveCorte, factura.CveMesa, factura.NumeroPersonas, factura.CvePrePoliza, factura.CveUsuario, factura.CveEmpresa,
|
||||
AtencionA:=factura.AtencionA, TelefonoGenerico:="", CveContrato:=factura.CveContrato, CveVentaPadre:=factura.CveVentaPadre, Det_FechaOrdenCompra:=factura.Det_FechaOrdenCompra, Det_OrdenCompra:=factura.Det_OrdenCompra, otros:=factura.Otros,
|
||||
Entrega:="", Vigencia:=MinFecha,
|
||||
CveAlmacenTraspasoDestino:=CveAlmacenTraspasoDestino, CveAlmacenTraspasoOrigen:=CveAlmacenTraspasoOrigen, CveDireccionEnvio:=-1, CveOC:=-1, IEPS:=factura.IEPSTC, Serie:=factura.Serie, CveCondicionEntrega:=-1,
|
||||
PedidoContrato:="", CveSubProyecto:=CveSubProyecto, CveSubProyectoCobranza:=CveSubProyecto, CveSubProyectoEjecucion:=CveSubProyecto) Then
|
||||
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
End If
|
||||
|
||||
|
||||
If ErrorList.Count = 0 AndAlso ObjVentas.CveVenta > 0 Then
|
||||
|
||||
factura.CveVenta = ObjVentas.CveVenta
|
||||
factura.Serie = ObjVentas.Serie
|
||||
factura.Folio = ObjVentas.Folio
|
||||
ViewState("VentaFolio") = ObjVentas.SerieFolio
|
||||
|
||||
'Se agregan los PS
|
||||
For Each Row As DataRow In TmpDTDetalle.Rows
|
||||
If Not ObjVentas.AddVentaDetalle(ObjVentas.CveVenta, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("CveUM").ToString.ToEntero,
|
||||
Row("PU").ToString.ToDouble(If(ObjFactura.ConvertirPesos, factura.TipoCambio, 1)), Row("IVA").ToString.ToDouble(If(ObjFactura.ConvertirPesos, factura.TipoCambio, 1)), Math.Round((Row("PU").ToString.ToDouble(If(ObjFactura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("IVA").ToString.ToDouble(If(ObjFactura.ConvertirPesos, factura.TipoCambio, 1)))), 3),
|
||||
TxtObservaciones.Text, 0, 0, Row("CveSubProyecto").ToString.ToEntero, -1,
|
||||
TiempoEntrega:="", CveVentaDetallePadre:=-1, CveContratoDetalle:=Row("CveContratoDetalle").ToString.ToEntero, CvePromocionDetalle:=-1, IEPS:=0) Then
|
||||
ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
Exit For
|
||||
Else
|
||||
Dim TmpDr As DataRow = TmpDT.Select($"Consec = {Row("Consec").ToString}")(0)
|
||||
TmpDr("CveVentaDetalle") = ObjVentas.CveVentaDetalle
|
||||
End If
|
||||
Next
|
||||
|
||||
GuardarContratoAvanceEstimaciones(ObjVentas, factura, ErrorList, 1)
|
||||
|
||||
If ErrorList.Count = 0 Then
|
||||
'prepoliza
|
||||
GuardarVentaPrePolizas(ObjConta, factura, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas)
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Sub GuardarVentaPrePolizas(ObjConta As ClsContabilidad, factura As Modelos.Factura, TmpDTDetalleMovimientos As DataTable, CveNCaVincular As Integer, objContPaqi As ClsContPAQi, Optional ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing)
|
||||
|
||||
Dim CveIE As Integer = -1
|
||||
Dim DT As DataTable = Nothing
|
||||
|
||||
|
||||
Dim CveConceptoAfectacion As Integer = 1 'Cliente
|
||||
Dim CveConceptoAntCli As Integer = 3 'Anticipo Cliente
|
||||
Dim CveConceptoVenta As Integer = 4 'Venta
|
||||
Dim CveConceptoCanAnt As Integer = 11 'Cancelacion Anticipos
|
||||
Dim CveConceptoDSV As Integer = 12 ' DSV
|
||||
Dim CveConceptoIVA As Integer = 13 'IVA Trasladado
|
||||
Dim CveConceptoRetIVA As Integer = 8 'Ret IVA
|
||||
Dim CveConceptoRetISR As Integer = 9 'Ret ISR
|
||||
'P R E P O L I Z A S
|
||||
If factura.CvePrePoliza > 0 Then
|
||||
|
||||
If ProcesoPrepolizas(ObjConta, factura, CveIE, TmpDTDetalleMovimientos, objContPaqi, 1, ObjBancos, ObjVentas) Then
|
||||
ErrorList.Add("Ocurrió un error al agregar los Movimientos de la prepoliza.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
End If
|
||||
|
||||
Else
|
||||
ErrorList.Add("Ocurrió un error al agregar los Movimientos de la prepoliza.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ProcesoPrepolizas(ObjConta As ClsContabilidad, ObjFactura As Modelos.Factura, CveIE As Integer, TmpDTDetalle As DataTable, objContPaqi As ClsContPAQi, Optional ValorMultiplicador As Integer = 1, ByRef Optional ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing) As Boolean
|
||||
|
||||
Dim DT As DataTable
|
||||
Dim CvePlantilaPoliza As Integer
|
||||
Dim PorcentajeAmortizacion As Decimal = 0
|
||||
Dim sumaAmorticaciones As Decimal = 0
|
||||
Dim ivaTrasladado As Decimal = 0
|
||||
Dim retIvaTrasladado As Decimal = 0
|
||||
Dim retIsrTrasladado As Decimal = 0
|
||||
Dim ErrorPrepoliza As Boolean = False
|
||||
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
|
||||
Dim idCuentaContabilizacion As Integer = 1
|
||||
Dim tipoCambio As Decimal
|
||||
Dim CuentasContablesInvalidas As New StringBuilder
|
||||
|
||||
If ObjFactura.TipoDocto = "Ing" Or ObjFactura.TipoDocto = "Ant" Or ObjFactura.TipoDocto = "Com" Then
|
||||
CvePlantilaPoliza = 4
|
||||
ElseIf ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
||||
CvePlantilaPoliza = 7
|
||||
ElseIf ObjFactura.TipoDocto = "Rem" Then
|
||||
CvePlantilaPoliza = 4
|
||||
End If
|
||||
|
||||
If ObjFactura.CveMoneda = 2 Then
|
||||
tipoCambio = GlobalTipoCambio(ObjFactura.Fecha).ToString.ToDecimal
|
||||
Else
|
||||
tipoCambio = 1
|
||||
End If
|
||||
|
||||
Dim ConceptoContable As Integer
|
||||
Dim TipoMovimiento As Boolean
|
||||
Dim importeMovimiento As Decimal
|
||||
Dim FechaMovimiento As Date = Date.Today
|
||||
Dim IdCtaContable As Integer
|
||||
Dim IdCtaContableCliente As Integer
|
||||
Dim Concepto As String = ViewState("VentaFolio").ToString
|
||||
Dim Referencia As String = ViewState("VentaFolio").ToString
|
||||
Dim Fecha = ObjFactura.Fecha
|
||||
|
||||
Dim importeMX As Decimal
|
||||
Dim Multiplicador As Integer
|
||||
'Dim CveIEPago As Integer
|
||||
' Dim FolioIE As Long
|
||||
|
||||
If ObjConta.GetPlantillaConceptos(ObjFactura.CveEmpresa, CvePlantilaPoliza) Then
|
||||
For Each Row As DataRow In ObjConta.DtResultados.Rows
|
||||
|
||||
ConceptoContable = Row("CveConcepto").ToString.ToEntero
|
||||
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
|
||||
importeMovimiento = 0
|
||||
IdCtaContable = 0
|
||||
Multiplicador = (Row("Multiplicador").ToString.ToEntero)
|
||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", "")
|
||||
|
||||
Select Case ConceptoContable
|
||||
Case 1 'Cliente
|
||||
If ObjFactura.TipoDocto <> "Egs" Then
|
||||
importeMovimiento = (ObjFactura.Total) * ValorMultiplicador
|
||||
importeMX = importeMovimiento * tipoCambio * Multiplicador
|
||||
FechaMovimiento = ObjFactura.FechaPago
|
||||
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
|
||||
|
||||
If tipoCambio = 1 Then
|
||||
IdCtaContable = ObjFactura.Cliente.IdCtaContClientes
|
||||
Else
|
||||
IdCtaContable = ObjFactura.Cliente.IdCtaContComplementaria
|
||||
If importeMovimiento <> 0 AndAlso IdCtaContable > 0 Then
|
||||
importeMX = importeMovimiento
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, 0, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMovimiento * tipoCambio - importeMovimiento, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento)) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
|
||||
IdCtaContable = ObjFactura.Cliente.IdCtaContMonedaExtranjera
|
||||
End If
|
||||
IdCtaContableCliente = IdCtaContable
|
||||
End If
|
||||
|
||||
Case 4 'Venta Clasificacion
|
||||
|
||||
If ObjFactura.TipoDocto <> "Ant" Then
|
||||
DT = TmpDTDetalle.FiltraParametros($"CvePS <> {0}", "", {"CveClasificacion", "CveSubProyecto"})
|
||||
If DT.Rows.Count > 0 Then
|
||||
'Se agrega movimiento separado por la cuenta de ventas (ER)
|
||||
For Each Row2 As DataRow In DT.Rows
|
||||
importeMovimiento = (TmpDTDetalle.SUM("Total", String.Format("CveClasificacion = {0} AND CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal) * ValorMultiplicador
|
||||
importeMX = importeMovimiento * tipoCambio * Multiplicador
|
||||
FechaMovimiento = ObjFactura.FechaPago
|
||||
Concepto = $"{ViewState("VentaFolio").ToString} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}"
|
||||
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
|
||||
IdCtaContable = GlobalDTClasificaciones(ObjFactura.CveEmpresa).FiltroPrimeroValor("IdCuentaIngresos", String.Format("CveClasificacion = {0}", Row2("CveClasificacion"))).ToEntero
|
||||
If importeMovimiento <> 0 Then
|
||||
|
||||
If IdCtaContable <= 0 Then
|
||||
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString + GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"))
|
||||
idCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, ObjFactura.Fecha, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento)) Then
|
||||
ErrorPrepoliza = True
|
||||
Else
|
||||
ViewState("SeGuardoPrePoliza") = True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
importeMovimiento = 0
|
||||
|
||||
|
||||
|
||||
Case 13 'Iva por Trasladar
|
||||
importeMovimiento = ObjFactura.IVA * ValorMultiplicador
|
||||
importeMX = Math.Round(importeMovimiento, 2) * tipoCambio * Multiplicador
|
||||
FechaMovimiento = ObjFactura.FechaPago
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaIVAxTrasladar
|
||||
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
|
||||
|
||||
|
||||
|
||||
End Select
|
||||
|
||||
If importeMovimiento <> 0 Then
|
||||
|
||||
If IdCtaContable <= 0 Then
|
||||
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
|
||||
idCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento)) Then
|
||||
ErrorPrepoliza = True
|
||||
Else
|
||||
ViewState("SeGuardoPrePoliza") = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
Return ErrorPrepoliza
|
||||
End Function
|
||||
|
||||
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean)
|
||||
|
||||
|
||||
'If Not ImprimeAlert Then
|
||||
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Factura.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
Dim Archivo2 As New System.IO.FileInfo(String.Format("{0}Formatos/Remision.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
|
||||
'CASO NORMAL NEW
|
||||
If Archivo.Exists Or Archivo2.Exists Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}", ObjFactura.CveVenta)))
|
||||
Else
|
||||
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
|
||||
End If
|
||||
|
||||
|
||||
Dim pdf As Byte() = Nothing
|
||||
|
||||
'GUARDA PDF
|
||||
Dim LocalSerieFolio As String = String.Empty
|
||||
Dim LocalTipoDocto As String = String.Empty
|
||||
|
||||
|
||||
'TIMBRADO NUEVO
|
||||
Try
|
||||
pdf = PdfFactura(ObjFactura)
|
||||
' File.WriteAllBytes(String.Format("{0}PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio), pdf)
|
||||
Catch ex As Exception
|
||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
||||
End Try
|
||||
|
||||
LocalSerieFolio = ObjFactura.SerieFolio
|
||||
LocalTipoDocto = ObjFactura.TipoDocto
|
||||
'End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub GuardarContratoAvanceEstimaciones(ObjVentas As ClsVentas, factura As Modelos.Factura, ErrorList As List(Of String), Multiplicador As Integer, Optional CrearAvance As Boolean = False)
|
||||
|
||||
If factura.CveContrato > 0 Then
|
||||
Dim ObjContratos As New ClsContratos(ObjVentas.IniciaTransacSQL())
|
||||
Dim CveEstimacion As Integer = -1
|
||||
|
||||
If ObjContratos.AddEstimaciones(factura.CveContrato, factura.Fecha, -1, factura.CveVenta, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
CveEstimacion = ObjContratos.DtResultados(0)("CveEstimacion").ToString.ToEntero
|
||||
|
||||
For Each row As DataRow In TmpDT.Rows
|
||||
If Not ObjContratos.AddContratosAvance(row("CveContratoDetalle").ToString.ToEntero, row("Cantidad").ToString.ToEntero * Multiplicador, factura.Fecha, UsuarioActual.CveUsuario, CveEstimacion:=CveEstimacion) Then
|
||||
ErrorList.Add("Ocurrió un error al agregar los avances")
|
||||
End If
|
||||
Next
|
||||
|
||||
Else
|
||||
ErrorList.Add("Ocurrió un error al agregar las estimaciones")
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
432
GPS/FacturasSims.aspx
Normal file
432
GPS/FacturasSims.aspx
Normal file
@@ -0,0 +1,432 @@
|
||||
<%@ Page Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="True" CodeFile="FacturasSims.aspx.vb" Inherits="GPS_FacturasSims" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.GVFacturasSims tr td:nth-child(n+14),
|
||||
.GVFacturasSims tr td:nth-child(7) {
|
||||
text-align: right;
|
||||
}
|
||||
/*Mostrar Desglose*/
|
||||
.GVFacturasSims:not(.mostrardesglose) tr > *:nth-child(13) {
|
||||
width: 7px;
|
||||
}
|
||||
|
||||
.GVFacturasSims:not(.mostrardesglose) tr:not(.NoHide) > *:nth-child(n+14):not(:nth-child(n+25)) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.GVFacturasSims:not(.mostrardesglose) .thOcultarDesglose {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.GVFacturasSims.mostrardesglose #LnkMostrarDesglose {
|
||||
display: none;
|
||||
}
|
||||
/*Mostrar Desglose*/
|
||||
/*Mostrar Datos Registrados*/
|
||||
.GVFacturasSims:not(.MostrarDRegistrados) tr > *:nth-child(3) {
|
||||
width: 7px;
|
||||
}
|
||||
|
||||
.GVFacturasSims:not(.MostrarDRegistrados) tr:not(.NoHide) > *:nth-child(n+4):not(:nth-child(n+8)) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.GVFacturasSims:not(.MostrarDRegistrados) .thOcultarDatosRegistrados {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.GVFacturasSims.MostrarDRegistrados #LnkMostrarDRegistrados {
|
||||
display: none;
|
||||
}
|
||||
/*Mostrar Datos Registrados*/
|
||||
/*Mostrar Datos Telcel*/
|
||||
.GVFacturasSims:not(.MostrarDTelcel) tr > *:nth-child(8) {
|
||||
width: 7px;
|
||||
}
|
||||
|
||||
.GVFacturasSims:not(.MostrarDTelcel) tr:not(.NoHide) > *:nth-child(n+9):not(:nth-child(n+13)) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.GVFacturasSims:not(.MostrarDTelcel) .thOcultarDatosTelcel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.GVFacturasSims.MostrarDTelcel #LnkMostrarDTelcel {
|
||||
display: none;
|
||||
}
|
||||
/*Mostrar Datos Telcel*/
|
||||
.ImporteFail {
|
||||
color: #ff0000;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.table-striped > tbody > tr.Titulo,
|
||||
.table-striped > tbody > tr.Titulo:nth-of-type(odd) {
|
||||
background-color: #dddddd;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Facturación
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkAgregarFacturasSims" OnClick="LnkAgregarFact_Click" runat="server"><i class="fa fa-plus"></i>Facturas </asp:LinkButton></li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="upDatosFact" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<table id="theader" class="table table-hover table-striped Widthall GVFacturasSims MostrarDRegistrados">
|
||||
<tr class="NoHide">
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th>
|
||||
<asp:LinkButton ID="LnkMostrarDRegistrados" ClientIDMode="Static" ToolTip="Mostrar Datos Registrados" OnClick="LnkMostrarDRegistrados_Click" runat="server"><i class="fa fa-plus-square"></i></asp:LinkButton>
|
||||
</th>
|
||||
<th class="thOcultarDatosRegistrados" colspan="4">
|
||||
<asp:LinkButton ID="LnkOcultarDRegistrados" ClientIDMode="Static" ToolTip="Ocultar Datos Registrados" OnClick="LnkOcultarDRegistrados_Click" runat="server">Datos Registrados <i class="fa fa-minus-square" ></i></asp:LinkButton></th>
|
||||
<th>
|
||||
<asp:LinkButton ID="LnkMostrarDTelcel" ClientIDMode="Static" ToolTip="Mostrar Datos Telcel" OnClick="LnkMostrarDTelcel_Click" runat="server"><i class="fa fa-plus-square"></i></asp:LinkButton>
|
||||
</th>
|
||||
<th class="thOcultarDatosTelcel" colspan="4">
|
||||
<asp:LinkButton ID="LnkOcultarDTelcel" ClientIDMode="Static" ToolTip="Ocultar Datos Telcel " OnClick="LnkOcultarDTelcel_Click" runat="server">Datos Telcel <i class="fa fa-minus-square" ></i></asp:LinkButton></th>
|
||||
<th>
|
||||
<asp:LinkButton ID="LnkMostrarDesglose" ClientIDMode="Static" ToolTip="Mostrar Desglose" OnClick="LnkMostrarDesglose_Click" runat="server"><i class="fa fa-plus-square"></i></asp:LinkButton></th>
|
||||
<th class="thOcultarDesglose" colspan="11">
|
||||
<asp:LinkButton ID="LnkOcultarDesglose" ClientIDMode="Static" ToolTip="Ocultar Desglose" OnClick="LnkOcultarDesglose_Click" runat="server">Desglose <i class="fa fa-minus-square" ></i></asp:LinkButton></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Número de
|
||||
<br>
|
||||
Teléfono
|
||||
</th>
|
||||
<th>Fecha
|
||||
<br>
|
||||
Corte
|
||||
</th>
|
||||
<th></th>
|
||||
<th>Vehiculo
|
||||
</th>
|
||||
<th>Cliente
|
||||
</th>
|
||||
<th>Plan<br />
|
||||
Registrado
|
||||
</th>
|
||||
<th>Plan<br />
|
||||
Registrado<br />
|
||||
Importe
|
||||
</th>
|
||||
<th></th>
|
||||
<th>Plan
|
||||
</th>
|
||||
<th>Cuenta
|
||||
<br>
|
||||
Padre
|
||||
</th>
|
||||
<th>Cuenta
|
||||
<br>
|
||||
Hija
|
||||
</th>
|
||||
<th>Número de
|
||||
<br>
|
||||
Factura
|
||||
</th>
|
||||
<th></th>
|
||||
<th>Plan Y
|
||||
<br>
|
||||
Servicios
|
||||
<br>
|
||||
contratados</th>
|
||||
<th>Consumos
|
||||
<br>
|
||||
adicionales
|
||||
<br>
|
||||
nacionales
|
||||
</th>
|
||||
<th>Consumos
|
||||
<br>
|
||||
adicionales
|
||||
<br>
|
||||
int. y mund.
|
||||
</th>
|
||||
<th>Servicios
|
||||
<br>
|
||||
Complementarios
|
||||
</th>
|
||||
<th>Ajustes<br>
|
||||
</th>
|
||||
<th>Descuentos<br>
|
||||
</th>
|
||||
<th>Servicios y
|
||||
<br>
|
||||
suscripciones
|
||||
</th>
|
||||
<th>Servicios y
|
||||
<br>
|
||||
suscripciones
|
||||
<br>
|
||||
Terceros
|
||||
</th>
|
||||
<th>Equipo
|
||||
<br>
|
||||
celular
|
||||
</th>
|
||||
<th>Servicios por cuenta y
|
||||
<br>
|
||||
orden de Terceros
|
||||
</th>
|
||||
<th>IVA<br>
|
||||
</th>
|
||||
<th>Total<br>
|
||||
</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>
|
||||
|
||||
<div style="display: inline-block; vertical-align: text-bottom;text-align:center;">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 90px !important; padding: 0px;display: inline-block;">
|
||||
<asp:TextBox ID="TxtPeriodo" runat="server" CssClass="form-control visibleD" placeholder="Mes/Año" Style="width: 90px" MaxLength="10"></asp:TextBox>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEPeriodo" runat="server" TargetControlID="TxtPeriodo" Mask="99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<%--<ajax:CalendarExtender runat="server" ID="CEEPeriodo" TargetControlID="TxtPeriodo" PopupPosition="BottomRight" Enabled="True" Format="MM/yyyy" DefaultView="Months"></ajax:CalendarExtender>--%>
|
||||
</div>
|
||||
</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th>
|
||||
<asp:LinkButton ID="LnkConsultar" OnClick="LnkConsultar_Click" CssClass=" btn btn-default " runat="server">Consultar</asp:LinkButton>
|
||||
</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="GVFacturasSims" runat="server" GridLines="None" data-tableheader="#theader" data-rows="0" ShowHeader="false" data-heighterror="220"
|
||||
CssClass="table table-hover table-striped Widthall GVFacturasSims ScrollAD MostrarDRegistrados" AutoGenerateColumns="False"
|
||||
OnRowDataBound="GVFacturasSims_RowDataBound"
|
||||
DataKeyNames="CveGpsFacturaSim,NTelefono,FechaCorte,CuentaPadre,CuentaHijo,NFactura,Plan,ImportePlanySerContr,ImporteConsuAdicNaci,ImporteConsuAdicInternaci,ImporteServCompl,ImporteAjustes,ImporteDescuentos,ImporteServiciosSusc,ImporteServiciosSuscTerceros,ImporteEquipo,ImporteServXCuentaTerc,ImporteIVA,Importe">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblnTelefono" runat="server" Text='<%# Eval("NTelefono")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblfechaCorte" runat="server" Text='<%# Eval("FechaCorte", "{0:dd/MM/yyyy}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField />
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblVehiculo" runat="server" Text='<%# String.Format("{0}{1}", Eval("NoEconomico"), Eval("NombreVehiculo")) %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="CLiente" />
|
||||
<asp:BoundField DataField="PlanDato" />
|
||||
<asp:BoundField DataField="PlanImporte" DataFormatString="${0:N2}" />
|
||||
<asp:BoundField />
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblplan" runat="server" Text='<%# Eval("Plan")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblcuentaPadre" runat="server" Text='<%# Eval("CuentaPadre")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblcuentaHijo" runat="server" Text='<%# Eval("CuentaHijo")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblnFactura" runat="server" Text='<%# Eval("NFactura")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField />
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblimportePlanySerContr" runat="server" Text='<%# Eval("ImportePlanySerContr", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblimporteConsuAdicNaci" runat="server" Text='<%# Eval("ImporteConsuAdicNaci", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblimporteConsuAdicInternaci" runat="server" Text='<%# Eval("ImporteConsuAdicInternaci", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblimporteServCompl" runat="server" Text='<%# Eval("ImporteServCompl", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblimporteAjustes" runat="server" Text='<%# Eval("ImporteAjustes", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblimporteDescuentos" runat="server" Text='<%# Eval("ImporteDescuentos", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblimporteServiciosSusc" runat="server" Text='<%# Eval("ImporteServiciosSusc", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblimporteServiciosSuscTerceros" runat="server" Text='<%# Eval("ImporteServiciosSuscTerceros", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblimporteEquipo" runat="server" Text='<%# Eval("ImporteEquipo", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblimporteServXCuentaTerc" runat="server" Text='<%# Eval("ImporteServXCuentaTerc", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblimporteIVA" runat="server" Text='<%# Eval("ImporteIVA", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblimporte" runat="server" Text='<%# Eval("Importe", "${0:N2}")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkVerDetalle" runat="server" OnClick="LnkVerDetalle_Click" CssClass="btn btn-circle btn-sm green "> <i class="fa fa-info"></i> </asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DModalConceptos" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpConceptos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">Numero -
|
||||
<asp:Literal ID="LtlNumeroConceptos" runat="server"> </asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<asp:GridView ID="GVGetFacturasSimsDetalle" runat="server" GridLines="None" CssClass="table table-hover table-striped ScrollAD Widthall" AutoGenerateColumns="False"
|
||||
OnRowDataBound="GVGetFacturasSimsDetalle_RowDataBound"
|
||||
DataKeyNames="EsTitulo,Tipo,Conceptos,Incluidos,Consumidos,Excedentes,Total">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Concepto">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblconceptos" runat="server" Text='<%# Eval("Conceptos")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Incluidos">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblincluidos" runat="server" Text='<%# Eval("Incluidos")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Consumidos">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblconsumidos" runat="server" Text='<%# Eval("Consumidos")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Excedentes">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblexcedentes" runat="server" Text='<%# Eval("Excedentes")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Total">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbltotal" runat="server" Text='<%# Eval("Total")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<div class="modal-btn text-right">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div id="DModalFacturasSims" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UPModalFact" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">Cargar Factura</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Arrastre la factura:
|
||||
<asp:TextBox ID="TxtCalibracion" CssClass="ADSdropzone hidden" data-maxFile="1" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
<div class="modal-btn">
|
||||
<asp:Button ID="BtnFactADD" OnClick="BtnFactADD_Click" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="VGMFact" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
284
GPS/FacturasSims.aspx.vb
Normal file
284
GPS/FacturasSims.aspx.vb
Normal file
@@ -0,0 +1,284 @@
|
||||
Option Strict On
|
||||
Imports System.Data
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Linq
|
||||
Imports System.Web
|
||||
Imports System.Web.UI.WebControls
|
||||
Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
|
||||
Partial Class GPS_FacturasSims
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "Propiedades"
|
||||
Private Property RcveGpsFacturaSim() As Int32
|
||||
Get
|
||||
Return If(IsNothing(ViewState("RcveGpsFacturaSim")), 0, CInt(ViewState("RcveGpsFacturaSim")))
|
||||
End Get
|
||||
Set
|
||||
ViewState("RcveGpsFacturaSim") = Value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CcveGpsFacturaSim() As Int32
|
||||
Get
|
||||
Return If(IsNothing(ViewState("CcveGpsFacturaSim")), 0, CInt(ViewState("CcveGpsFacturaSim")))
|
||||
End Get
|
||||
Set
|
||||
ViewState("CcveGpsFacturaSim") = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
CargaFacturasSims()
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub CargaFacturasSims()
|
||||
Dim ObjFact As New ClsGPS()
|
||||
Dim periodo As Integer = 0 ' DateTime.Now.ToString("yyyyMM").ToEntero()
|
||||
TxtPeriodo.Text = TxtPeriodo.Text.Replace("_", "0")
|
||||
If TxtPeriodo.Text.Trim().Length > 6 Then
|
||||
periodo = String.Format("{1}{0}", TxtPeriodo.Text.Substring(0, 2), TxtPeriodo.Text.Substring(3, 4)).ToEntero()
|
||||
'Alert(String.Format("{1}{0}", TxtPeriodo.Text.Substring(0, 2), TxtPeriodo.Text.Substring(3, 4)))
|
||||
ElseIf TxtPeriodo.Text.Trim().Length > 5 Then
|
||||
periodo = String.Format("{1}{0}", TxtPeriodo.Text.Substring(0, 2), TxtPeriodo.Text.Substring(2, 4)).ToEntero()
|
||||
ElseIf TxtPeriodo.Text.Trim().Length > 4 Then
|
||||
periodo = String.Format("0{1}0{0}", TxtPeriodo.Text.Substring(0, 1), TxtPeriodo.Text.Substring(1, 4)).ToEntero()
|
||||
'Alert(String.Format("{1}0{0}", TxtPeriodo.Text.Substring(0, 1), TxtPeriodo.Text.Substring(1, 4)))
|
||||
End If
|
||||
ObjFact.GetFacturasSims(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, periodo)
|
||||
GVFacturasSims.DataSource = ObjFact.DtResultados
|
||||
ObjFact.Dispose()
|
||||
GVFacturasSims.DataBind()
|
||||
upDatosFact.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkAgregarFact_Click(sender As Object, e As EventArgs)
|
||||
RegistraScript("$('#DModalFacturasSims').modal()")
|
||||
BtnFactADD.Visible = True
|
||||
UPModalFact.Update()
|
||||
End Sub
|
||||
Protected Sub BtnFactADD_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim nTelefono As String = ""
|
||||
Dim fechaCorte As String = ""
|
||||
Dim cuentaPadre As Integer = 0
|
||||
Dim cuentaHijo As Integer = 0
|
||||
Dim nFactura As String = ""
|
||||
Dim plan As String = ""
|
||||
Dim importePlanySerContr As Decimal = 0
|
||||
Dim importeConsuAdicNaci As Decimal = 0
|
||||
Dim importeConsuAdicInternaci As Decimal = 0
|
||||
Dim importeServCompl As Decimal = 0
|
||||
Dim importeAjustes As Decimal = 0
|
||||
Dim importeDescuentos As Decimal = 0
|
||||
Dim importeServiciosSusc As Decimal = 0
|
||||
Dim importeServiciosSuscTerceros As Decimal = 0
|
||||
Dim importeEquipo As Decimal = 0
|
||||
Dim importeServXCuentaTerc As Decimal = 0
|
||||
Dim importeIVA As Decimal = 0
|
||||
Dim importe As Decimal = 0
|
||||
|
||||
Dim cveGpsFacturaSim As Integer = 0
|
||||
Dim detTipo As Integer = 0
|
||||
Dim detConceptos As String = ""
|
||||
Dim detincluidos As Decimal = 0
|
||||
Dim detconsumidos As Decimal = 0
|
||||
Dim detexcedentes As Decimal = 0
|
||||
Dim dettotal As Decimal = 0
|
||||
|
||||
|
||||
|
||||
Dim excelfile As Archivo = TxtCalibracion.getfiles().Archivos(0)
|
||||
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet())
|
||||
Dim EF As GemBox.Spreadsheet.ExcelFile = GemBox.Spreadsheet.ExcelFile.Load(excelfile.FileUrl)
|
||||
Dim TempEdcta As New DataTable
|
||||
Dim Tempplanyserv As New DataTable()
|
||||
Dim TempConsumoAdicional As New DataTable
|
||||
Dim TempConsumoAdicionalintmundial As New DataTable
|
||||
If True Then
|
||||
Dim Hoja As ExcelWorksheet = EF.Worksheets(1)
|
||||
Dim Opciones As New CreateDataTableOptions()
|
||||
Opciones.ColumnHeaders = True
|
||||
Opciones.StartRow = 5
|
||||
Opciones.NumberOfColumns = 21
|
||||
Opciones.NumberOfRows = Hoja.Rows.Count
|
||||
Opciones.Resolution = ColumnTypeResolution.AutoPreferStringInvariantCulture
|
||||
TempEdcta = Hoja.CreateDataTable(Opciones)
|
||||
TempEdcta.Columns(4).ColumnName = "AdsTelefono"
|
||||
End If
|
||||
If True Then
|
||||
Dim Hoja As ExcelWorksheet = EF.Worksheets(2)
|
||||
Dim Opciones As New CreateDataTableOptions()
|
||||
Opciones.ColumnHeaders = True
|
||||
Opciones.StartRow = 1
|
||||
Opciones.NumberOfColumns = 11
|
||||
Opciones.NumberOfRows = Hoja.Rows.Count
|
||||
Opciones.Resolution = ColumnTypeResolution.AutoPreferStringInvariantCulture
|
||||
Tempplanyserv = Hoja.CreateDataTable(Opciones)
|
||||
Tempplanyserv.Columns(4).ColumnName = "AdsTelefono"
|
||||
Tempplanyserv.Columns(7).ColumnName = "AdsConceptos"
|
||||
End If
|
||||
If True Then
|
||||
Dim Hoja As ExcelWorksheet = EF.Worksheets(3)
|
||||
Dim Opciones As New CreateDataTableOptions()
|
||||
Opciones.ColumnHeaders = True
|
||||
Opciones.StartRow = 1
|
||||
Opciones.NumberOfColumns = 13
|
||||
Opciones.NumberOfRows = Hoja.Rows.Count
|
||||
Opciones.Resolution = ColumnTypeResolution.AutoPreferStringInvariantCulture
|
||||
TempConsumoAdicional = Hoja.CreateDataTable(Opciones)
|
||||
TempConsumoAdicional.Columns(4).ColumnName = "AdsTelefono"
|
||||
TempConsumoAdicional.Columns(7).ColumnName = "AdsConceptos"
|
||||
End If
|
||||
If True Then
|
||||
Dim Hoja As ExcelWorksheet = EF.Worksheets(4)
|
||||
Dim Opciones As New CreateDataTableOptions()
|
||||
Opciones.ColumnHeaders = True
|
||||
Opciones.StartRow = 1
|
||||
Opciones.NumberOfColumns = 13
|
||||
Opciones.NumberOfRows = Hoja.Rows.Count
|
||||
Opciones.Resolution = ColumnTypeResolution.AutoPreferStringInvariantCulture
|
||||
TempConsumoAdicionalintmundial = Hoja.CreateDataTable(Opciones)
|
||||
TempConsumoAdicionalintmundial.Columns(4).ColumnName = "AdsTelefono"
|
||||
TempConsumoAdicionalintmundial.Columns(7).ColumnName = "AdsConceptos"
|
||||
End If
|
||||
'Dim xs As New StringBuilder()
|
||||
Dim ObjFact As New ClsGPS()
|
||||
ObjFact.IniciaTransacSQL()
|
||||
Dim Continuar As Boolean = True
|
||||
For Each row As DataRow In TempEdcta.Rows
|
||||
|
||||
nTelefono = row(4).ToString()
|
||||
If nTelefono.Length > 5 Then
|
||||
|
||||
fechaCorte = DateTime.ParseExact(row(6).ToString(), "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("yyyy-MM-dd")
|
||||
cuentaPadre = row(2).ToString().ToEntero()
|
||||
cuentaHijo = row(3).ToString().ToEntero()
|
||||
nFactura = row(7).ToString()
|
||||
plan = row(8).ToString()
|
||||
importePlanySerContr = row(9).ToString().ToDecimal()
|
||||
importeConsuAdicNaci = row(10).ToString().ToDecimal()
|
||||
importeConsuAdicInternaci = row(11).ToString().ToDecimal()
|
||||
importeServCompl = row(12).ToString().ToDecimal()
|
||||
importeAjustes = row(13).ToString().ToDecimal()
|
||||
importeDescuentos = row(14).ToString().ToDecimal()
|
||||
importeServiciosSusc = row(15).ToString().ToDecimal()
|
||||
importeServiciosSuscTerceros = row(16).ToString().ToDecimal()
|
||||
importeEquipo = row(17).ToString().ToDecimal()
|
||||
importeServXCuentaTerc = row(18).ToString().ToDecimal()
|
||||
importeIVA = row(19).ToString().ToDecimal()
|
||||
importe = row(20).ToString().ToDecimal()
|
||||
If Continuar Then Continuar = ObjFact.AddFacturasSims(nTelefono, fechaCorte, cuentaPadre, cuentaHijo, nFactura, plan, importePlanySerContr, importeConsuAdicNaci,
|
||||
importeConsuAdicInternaci, importeServCompl, importeAjustes, importeDescuentos, importeServiciosSusc,
|
||||
importeServiciosSuscTerceros, importeEquipo, importeServXCuentaTerc, importeIVA, importe)
|
||||
If Continuar Then
|
||||
cveGpsFacturaSim = ObjFact.DtResultados.Rows(0)("cveGpsFacturaSim").ToString.ToEntero()
|
||||
If Continuar Then
|
||||
For Each rowd As DataRow In Tempplanyserv.FiltraParametros(String.Format("AdsTelefono = '{0}' AND AdsConceptos<> '-'", nTelefono)).Rows
|
||||
|
||||
detTipo = 1
|
||||
detConceptos = rowd(7).ToString()
|
||||
detincluidos = rowd(8).ToString().ToDecimal()
|
||||
detconsumidos = rowd(9).ToString().ToDecimal()
|
||||
detexcedentes = 0
|
||||
dettotal = rowd(10).ToString().ToDecimal()
|
||||
Continuar = ObjFact.AddFacturasSimsDetalle(cveGpsFacturaSim, detTipo, detConceptos, detincluidos, detconsumidos, detexcedentes, dettotal)
|
||||
Next
|
||||
End If
|
||||
If Continuar Then
|
||||
For Each rowd As DataRow In TempConsumoAdicional.FiltraParametros(String.Format("AdsTelefono = '{0}' AND AdsConceptos<> '-'", nTelefono)).Rows
|
||||
detTipo = 2
|
||||
detConceptos = rowd(7).ToString()
|
||||
detincluidos = rowd(9).ToString().ToDecimal()
|
||||
detconsumidos = rowd(10).ToString().ToDecimal()
|
||||
detexcedentes = rowd(11).ToString().ToDecimal()
|
||||
dettotal = rowd(12).ToString().ToDecimal()
|
||||
Continuar = ObjFact.AddFacturasSimsDetalle(cveGpsFacturaSim, detTipo, detConceptos, detincluidos, detconsumidos, detexcedentes, dettotal)
|
||||
|
||||
Next
|
||||
End If
|
||||
If Continuar Then
|
||||
For Each rowd As DataRow In TempConsumoAdicionalintmundial.FiltraParametros(String.Format("AdsTelefono = '{0}' AND AdsConceptos<> '-'", nTelefono)).Rows
|
||||
detTipo = 3
|
||||
detConceptos = rowd(7).ToString()
|
||||
detincluidos = rowd(9).ToString().ToDecimal()
|
||||
detconsumidos = rowd(10).ToString().ToDecimal()
|
||||
detexcedentes = rowd(11).ToString().ToDecimal()
|
||||
dettotal = rowd(12).ToString().ToDecimal()
|
||||
Continuar = ObjFact.AddFacturasSimsDetalle(cveGpsFacturaSim, detTipo, detConceptos, detincluidos, detconsumidos, detexcedentes, dettotal)
|
||||
Next
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
'xs.Append("<br/> Tel. ")
|
||||
'xs.Append(nTelefono)
|
||||
Next
|
||||
If Continuar Then
|
||||
ObjFact.Commit()
|
||||
Else
|
||||
ObjFact.RollBack()
|
||||
End If
|
||||
'Alert(xs.ToString()) '
|
||||
ObjFact.Dispose()
|
||||
If (Continuar) Then
|
||||
RegistraScript("$('#DModalFacturasSims').modal('hide')")
|
||||
CargaFacturasSims()
|
||||
UPModalFact.Update()
|
||||
Alert("La Factura se ha agregado")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkOcultarDesglose_Click(sender As Object, e As EventArgs)
|
||||
GVFacturasSims.CssClass = GVFacturasSims.CssClass.Replace(" mostrardesglose", "")
|
||||
End Sub
|
||||
Protected Sub LnkMostrarDesglose_Click(sender As Object, e As EventArgs)
|
||||
GVFacturasSims.CssClass = String.Format("{0} mostrardesglose", GVFacturasSims.CssClass.Replace(" mostrardesglose", ""))
|
||||
End Sub
|
||||
Protected Sub LnkMostrarDRegistrados_Click(sender As Object, e As EventArgs)
|
||||
GVFacturasSims.CssClass = String.Format("{0} MostrarDRegistrados", GVFacturasSims.CssClass.Replace(" MostrarDRegistrados", ""))
|
||||
End Sub
|
||||
Protected Sub LnkOcultarDRegistrados_Click(sender As Object, e As EventArgs)
|
||||
GVFacturasSims.CssClass = GVFacturasSims.CssClass.Replace(" MostrarDRegistrados", "")
|
||||
End Sub
|
||||
Protected Sub LnkMostrarDTelcel_Click(sender As Object, e As EventArgs)
|
||||
GVFacturasSims.CssClass = String.Format("{0} MostrarDTelcel", GVFacturasSims.CssClass.Replace(" MostrarDTelcel", ""))
|
||||
End Sub
|
||||
Protected Sub LnkOcultarDTelcel_Click(sender As Object, e As EventArgs)
|
||||
GVFacturasSims.CssClass = GVFacturasSims.CssClass.Replace(" MostrarDTelcel", "")
|
||||
End Sub
|
||||
Protected Sub GVFacturasSims_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim PlanImporte As Decimal = e.Row.DBCampo("PlanImporte").ToString().ToDecimal()
|
||||
Dim Importe As Decimal = e.Row.DBCampo("Importe").ToString().ToDecimal()
|
||||
If Importe > PlanImporte Then
|
||||
e.Row.CssClass = "ImporteFail"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub LnkVerDEtalle_Click(sender As Object, e As EventArgs)
|
||||
Dim gvrow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||
LtlNumeroConceptos.Text = gvrow.DataKey("NTelefono")
|
||||
Dim CveGpsFacturaSim As Integer = gvrow.DataKey("CveGpsFacturaSim").ToEntero()
|
||||
Dim objgps As New ClsGPS()
|
||||
objgps.GetFacturasSimsDetalle(CveGpsFacturaSim)
|
||||
GVGetFacturasSimsDetalle.DataSource = objgps.DtResultados
|
||||
objgps.Dispose()
|
||||
GVGetFacturasSimsDetalle.DataBind()
|
||||
RegistraScript("$('#DModalConceptos').modal();")
|
||||
UpConceptos.Update()
|
||||
End Sub
|
||||
Protected Sub GVGetFacturasSimsDetalle_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("EsTitulo").ToString() = "1" Then
|
||||
e.Row.CssClass = "Titulo"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub LnkConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaFacturasSims()
|
||||
End Sub
|
||||
End Class
|
||||
781
GPS/GeoReferencias.aspx
Normal file
781
GPS/GeoReferencias.aspx
Normal file
@@ -0,0 +1,781 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="GeoReferencias.aspx.vb" Inherits="GPS_GeoReferencias" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<link href="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.css" rel="stylesheet" />
|
||||
<link href="../Metronic/assets/layouts/layout3/css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<style type="text/css">
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#map {
|
||||
position: fixed !important;
|
||||
width: 100%;
|
||||
height: calc(100% - 51px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.pac-container.pac-logo {
|
||||
z-index: 100000;
|
||||
}
|
||||
|
||||
.minicolors {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.controls {
|
||||
margin-top: 10px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 2px 0 0 2px;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
height: 32px;
|
||||
outline: none;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
#pac-input {
|
||||
background-color: #fff;
|
||||
font-family: 'Open Sans Condensed', sans-serif;
|
||||
font-size: 13px;
|
||||
font-weight: 300;
|
||||
margin-left: 12px;
|
||||
padding: 0 11px 0 13px;
|
||||
text-overflow: ellipsis;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#pac-input:focus {
|
||||
border-color: #4d90fe;
|
||||
}
|
||||
|
||||
|
||||
#iw-container {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="H" ID="Content9" runat="server">
|
||||
<li>
|
||||
<a id="BorrarGeo" onclick="DeleteMarkers();">
|
||||
<i class='fa fa-trash-o'></i><span>Deshacer Georeferencia</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="BtnAgregar" onclick="AddGeo();">
|
||||
<i class='fa fa-plus'></i><span>Agregar Georeferencia</span>
|
||||
</a>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
<asp:UpdatePanel ID="UpTools" runat="server" style="display: none" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HdnTipo" Value="Geocerca" runat="server" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="CommandArg" runat="server" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="GeoCerca" runat="server" ClientIDMode="Static" />
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Tipo de Georeferencia:
|
||||
<asp:DropDownList ID="DdlTipo" onChange="HabilitaChk(); return false;" Width="100px" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Value="Geocerca" Text="Geocerca"></asp:ListItem>
|
||||
<asp:ListItem Value="Ruta" Text="Ruta"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
<li>Color Georeferencia:
|
||||
<%-- <input type="hidden" onchange="CambiaColor();" id="hidden-input" class="demo" value="#0088FF">--%>
|
||||
<asp:HiddenField ID="hdnColor" runat="server" Value="#0088FF" ClientIDMode="Static" />
|
||||
</li>
|
||||
<li id="liRutaRegreso" style="display: none">Incluir Ruta Regreso
|
||||
<asp:CheckBox runat="server" ID="chkRutaRegreso" />
|
||||
</li>
|
||||
<li>Haga click en los lugares del mapa donde trazará la Georeferencia
|
||||
</li>
|
||||
</ul>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<input id="pac-input" class="controls" type="text" placeholder="Buscar Dirección">
|
||||
<div id="map"></div>
|
||||
<div id="divAgregarTipo" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" style="width: 600px;" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Agregar Georeferencia</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyTipoEquipo" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtNombre" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVEstatusOS" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtNombre" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtNombre.ClientID.ToString()%>">Nombre GeoReferencia:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTolerancia" runat="server" Style="width: 50%; display: inline-block" CssClass="form-control" CausesValidation="true"></asp:TextBox><asp:Literal runat="server" Text="mts"></asp:Literal>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtTolerancia" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTolerancia" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tolerancia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBSerie" runat="server" TargetControlID="TxtTolerancia" FilterType="Numbers" />
|
||||
<label for="<%= TxtTolerancia.ClientID.ToString()%>" style="width: 50%">Tolerancia:</label>
|
||||
</div>
|
||||
<ul class="list-inline" style="font-size: 12px; margin-top: 15px; margin-left: 0px;">
|
||||
<li>Fecha I.:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
<li>Fecha F.:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="list-inline" style="font-size: 12px; margin-top: 15px; margin-left: 0px;">
|
||||
<li>Aplica Días:
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="L" ID="chkLunes" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="M" ID="chkMartes" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="M" ID="chkMiercoles" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="J" ID="chkJueves" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="V" ID="chkViernes" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="S" ID="chkSabado" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="D" ID="chkDomingo" />
|
||||
</li>
|
||||
</ul>
|
||||
<div class="row" style="margin-top: 10px; margin-bottom: 20px;">
|
||||
<div class="col-md-1">Hora Inicio:</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtHoraI" runat="server" CssClass="form-control input-sm hora" CausesValidation="true" MaxLength="18" Width="75px"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">Hora Fin:</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtHoraF" runat="server" CssClass="form-control input-sm hora" CausesValidation="true" MaxLength="18" Width="75px "></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlGrupo" Width="230px" runat="server" DataTextField="Nombre" DataValueField="CveDispositivosGrupos" CssClass="form-control select2me">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlGrupo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregarGrupo"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlGrupo.ClientID.ToString()%>">Grupo:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="margin-top: 12px; text-align:right;">
|
||||
<asp:LinkButton ID="LnkAgregarGrupo" runat="server" CssClass="btn btn-sm btn-success" OnClick="LnkAgregarGrupo_Click" ValidationGroup="GrpAgregarGrupo"><i class='fa fa-plus' aria-hidden='true'></i></asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlEquipo" Width="230px" runat="server" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control select2me">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlEquipo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregarVehiculo"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlEquipo.ClientID.ToString()%>">Equipo:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="margin-top: 12px; text-align:right;">
|
||||
<asp:LinkButton ID="LnkAgregarDisp" runat="server" CssClass="btn btn-sm btn-success" OnClick="LnkAgregarDisp_Click" ValidationGroup="GrpAgregarVehiculo"><i class='fa fa-plus' aria-hidden='true'></i></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvDispositivos" runat="server" GridLines="None" data-height="200" DataKeyNames="CveDispositivo, NoEconomico" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" OnRowDeleting="GvDispositivos_RowDeleting" EmptyDataText="Seleccione el vehiculo y presione agregar.">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="20%" HeaderText="NoEconomico" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Acciones" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="BtnBorrarDispositivo" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar este dispositivo?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarGeoreferencia" OnClick="BtnCrear_Click" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Guardar</asp:LinkButton>
|
||||
<button id="btnCancelarTE" class="btn btn-default" data-dismiss="modal" value="Cancelar">Cancelar </button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="../Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js"></script>
|
||||
<script>
|
||||
|
||||
var directionsService;
|
||||
var directionsDisplay;
|
||||
|
||||
$(document).ready(function () {
|
||||
initMap();
|
||||
});
|
||||
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: { lat: 19.432608, lng: -99.133209 },
|
||||
zoom: 10
|
||||
});
|
||||
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(function (position) {
|
||||
var pos = {
|
||||
lat: position.coords.latitude,
|
||||
lng: position.coords.longitude
|
||||
};
|
||||
map.setCenter(pos);
|
||||
}, function () {
|
||||
handleLocationError(true, infoWindow, map.getCenter());
|
||||
});
|
||||
}
|
||||
|
||||
var input = document.getElementById('pac-input');
|
||||
var searchBox = new google.maps.places.SearchBox(input);
|
||||
map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
|
||||
map.addListener('bounds_changed', function () {
|
||||
searchBox.setBounds(map.getBounds());
|
||||
});
|
||||
|
||||
searchBox.addListener('places_changed', function () {
|
||||
var places = searchBox.getPlaces();
|
||||
|
||||
if (places.length == 0) {
|
||||
return;
|
||||
}
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
places.forEach(function (place) {
|
||||
if (place.geometry.viewport) {
|
||||
// Only geocodes have viewport.
|
||||
bounds.union(place.geometry.viewport);
|
||||
} else {
|
||||
bounds.extend(place.geometry.location);
|
||||
}
|
||||
});
|
||||
map.fitBounds(bounds);
|
||||
});
|
||||
|
||||
directionsService = new google.maps.DirectionsService;
|
||||
directionsDisplay = new google.maps.DirectionsRenderer;
|
||||
directionsDisplay.setOptions({ suppressMarkers: true });
|
||||
directionsDisplay.setMap(map);
|
||||
|
||||
var upControlDiv = document.createElement('div');
|
||||
var upControl = new ControlUltimoPunto(upControlDiv, map);
|
||||
|
||||
upControlDiv.index = 1;
|
||||
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(upControlDiv);
|
||||
|
||||
var SelectControlDiv = document.createElement('div');
|
||||
var SelectControl = new ControlSelect(SelectControlDiv, map);
|
||||
|
||||
SelectControlDiv.index = 1;
|
||||
map.controls[google.maps.ControlPosition.TOP_LEFT].push(SelectControlDiv);
|
||||
|
||||
|
||||
var ColorControlDiv = document.createElement('div');
|
||||
var ColorControl = new ControlColor(ColorControlDiv, map);
|
||||
|
||||
|
||||
ColorControlDiv.index = 1;
|
||||
map.controls[google.maps.ControlPosition.LEFT_TOP].push(ColorControlDiv);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Add a listener for the click event
|
||||
map.addListener('click', addLatLng);
|
||||
$("#C_BtnCrear").prop('disabled', true);
|
||||
$('#C_TxtHoraI').datetimepicker({
|
||||
datepicker: false,
|
||||
lang: 'es',
|
||||
format: 'H:i',
|
||||
formatDate: 'H:i',
|
||||
step: 30
|
||||
});
|
||||
$('#C_TxtHoraF').datetimepicker({
|
||||
datepicker: false,
|
||||
lang: 'es',
|
||||
format: 'H:i',
|
||||
formatDate: 'H:i',
|
||||
step: 30
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
var markers = [];
|
||||
var mcoords = [];
|
||||
var polygon;
|
||||
var UltimoPunto;
|
||||
|
||||
|
||||
function addLatLng(event) {
|
||||
// var path = poly.getPath();
|
||||
// path.push(event.latLng);
|
||||
var lat = event.latLng.lat();
|
||||
var lng = event.latLng.lng();
|
||||
mcoords.push(event.latLng)
|
||||
|
||||
var info = new google.maps.InfoWindow({
|
||||
content: "(" + lat + " " + lng + ")"
|
||||
});
|
||||
|
||||
var marker = new google.maps.Marker({
|
||||
position: event.latLng,
|
||||
title: 'Punto',
|
||||
map: map,
|
||||
draggable: true
|
||||
});
|
||||
markers.push(marker);
|
||||
marker.addListener('click', function () {
|
||||
info.open(map, marker);
|
||||
});
|
||||
if ($("#HdnTipo").val() === 'Georuta') {
|
||||
if (markers.length > 1) {
|
||||
CreaRuta();
|
||||
}
|
||||
}
|
||||
else if ($("#HdnTipo").val() === 'Geocerca') {
|
||||
var h = $('#GeoCerca').val() + lng + " " + lat + ","
|
||||
$('#GeoCerca').val(h)
|
||||
if (markers.length == 1) {
|
||||
$('#CommandArg').val(lng + " " + lat)
|
||||
}
|
||||
if (markers.length === 3) {
|
||||
creaPoligono($("#hidden-input").val());
|
||||
} else if (markers.length > 3) {
|
||||
var path = polygon.getPath();
|
||||
path.push(event.latLng)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function DeleteMarkers() {
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
markers = [];
|
||||
directionsDisplay.setMap(null);
|
||||
mcoords = [];
|
||||
$('#GeoCerca').val('')
|
||||
if (typeof polygon != 'undefined') {
|
||||
polygon.setMap(null);
|
||||
}
|
||||
$("#C_BtnCrear").prop('disabled', true);
|
||||
|
||||
}
|
||||
|
||||
function EliminarUltimoPunto() {
|
||||
if (markers.length > 0) {
|
||||
markers[markers.length - 1].setMap(null)
|
||||
markers.splice((markers.length - 1), 1);
|
||||
mcoords.splice((mcoords.length - 1), 1);
|
||||
if ($("#HdnTipo").val() === 'Georuta') {
|
||||
if (markers.length >= 2) {
|
||||
CreaRuta();
|
||||
} else { directionsDisplay.setMap(null); }
|
||||
}
|
||||
else if ($("#HdnTipo").val() === 'Geocerca') {
|
||||
if (typeof polygon != 'undefined') {
|
||||
polygon.setMap(null);
|
||||
if (markers.length >= 3) {
|
||||
creaPoligono($("#hidden-input").val());
|
||||
}
|
||||
}
|
||||
var h;
|
||||
$('#GeoCerca').val('')
|
||||
for (var i = 0; i < mcoords.length; i++) {
|
||||
var lat = mcoords[i].lat()
|
||||
var lng = mcoords[i].lng()
|
||||
h = $('#GeoCerca').val() + lng + " " + lat + ","
|
||||
$('#GeoCerca').val(h)
|
||||
if (i === 0) {
|
||||
$('#CommandArg').val(lng + " " + lat)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var s = "";
|
||||
var nextSegment;
|
||||
|
||||
|
||||
function CreaRuta() {
|
||||
var start = markers[0].position;
|
||||
var end = markers[markers.length - 1].position;
|
||||
var waypts = [];
|
||||
var fin = 1;
|
||||
s = ""
|
||||
if (document.getElementById("C_chkRutaRegreso").checked) {
|
||||
end = start;
|
||||
fin = 0;
|
||||
}
|
||||
for (var i = 1; i < markers.length - fin; i++) {
|
||||
waypts.push({
|
||||
location: markers[i].position,
|
||||
stopover: true
|
||||
});
|
||||
}
|
||||
directionsService.route({
|
||||
origin: start,
|
||||
destination: end,
|
||||
travelMode: 'DRIVING',
|
||||
waypoints: waypts
|
||||
}, function (response, status) {
|
||||
if (status === 'OK') {
|
||||
directionsDisplay.setDirections(response);
|
||||
directionsDisplay.setMap(map);
|
||||
|
||||
var legs = response.routes[0].legs;
|
||||
for (i = 0; i < legs.length; i++) {
|
||||
var steps = legs[i].steps;
|
||||
for (j = 0; j < steps.length; j++) {
|
||||
var nextSegment = steps[j].path;
|
||||
for (k = 0; k < nextSegment.length; k++) {
|
||||
s = s + nextSegment[k] + '+'
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#CommandArg').val(s);
|
||||
$("#C_BtnCrear").prop('disabled', false);
|
||||
} else {
|
||||
window.alert('Directions request failed due to ' + status);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function creaPoligono(color) {
|
||||
polygon = new google.maps.Polygon({
|
||||
paths: mcoords,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 2,
|
||||
fillColor: color,
|
||||
fillOpacity: 0.35,
|
||||
editable: true
|
||||
});
|
||||
polygon.setMap(map);
|
||||
$("#C_BtnCrear").prop('disabled', false);
|
||||
}
|
||||
|
||||
function CambiaColor() {
|
||||
$("#hdnColor").val($("#hidden-input").val())
|
||||
directionsDisplay.setOptions({
|
||||
polylineOptions: {
|
||||
strokeColor: $("#hidden-input").val(), strokeWeight: 6,
|
||||
strokeOpacity: 0.6
|
||||
}
|
||||
})
|
||||
if ($("#HdnTipo").val() === 'Georuta') {
|
||||
if (directionsDisplay.getDirections() != undefined) {
|
||||
directionsDisplay.setDirections(directionsDisplay.directions);
|
||||
}
|
||||
} else if ($("#HdnTipo").val() === 'Geocerca') {
|
||||
if (typeof polygon != 'undefined') {
|
||||
polygon.setMap(null);
|
||||
creaPoligono($("#hidden-input").val())
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function CargaPickersHora() {
|
||||
$('#C_TxtHoraI').datetimepicker({
|
||||
datepicker: false,
|
||||
lang: 'es',
|
||||
format: 'H:i',
|
||||
formatDate: 'H:i',
|
||||
step: 30
|
||||
});
|
||||
$('#C_TxtHoraF').datetimepicker({
|
||||
datepicker: false,
|
||||
lang: 'es',
|
||||
format: 'H:i',
|
||||
formatDate: 'H:i',
|
||||
step: 30
|
||||
});
|
||||
}
|
||||
function Limpieza() {
|
||||
DeleteMarkers();
|
||||
$('#C_TxtHoraI').datetimepicker({
|
||||
datepicker: false,
|
||||
lang: 'es',
|
||||
format: 'H:i',
|
||||
formatDate: 'H:i',
|
||||
step: 30
|
||||
});
|
||||
$('#C_TxtHoraF').datetimepicker({
|
||||
datepicker: false,
|
||||
lang: 'es',
|
||||
format: 'H:i',
|
||||
formatDate: 'H:i',
|
||||
step: 30
|
||||
});
|
||||
$('#divAgregarTipo').modal('hide');
|
||||
}
|
||||
|
||||
function HabilitaChk() {
|
||||
DeleteMarkers();
|
||||
if ($("#HdnTipo").val() === 'Georuta') {
|
||||
$("#liRutaRegreso").css("display", "")
|
||||
} else {
|
||||
$("#liRutaRegreso").css("display", "none")
|
||||
}
|
||||
}
|
||||
|
||||
function ControlUltimoPunto(controlDiv, map) {
|
||||
|
||||
// Set CSS for the control border.
|
||||
var controlUI = document.createElement('div');
|
||||
controlUI.style.backgroundColor = '#fff';
|
||||
controlUI.style.border = '2px solid #fff';
|
||||
controlUI.style.borderRadius = '3px';
|
||||
controlUI.style.width = '165px'
|
||||
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 = '22px';
|
||||
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 = 'rgb(25,25,25)';
|
||||
controlText.style.fontFamily = ' "Open Sans", sans-serif; ';
|
||||
controlText.style.fontSize = '14px';
|
||||
controlText.style.lineHeight = '38px';
|
||||
controlText.style.paddingLeft = '5px';
|
||||
controlText.style.paddingRight = '5px';
|
||||
controlText.innerHTML = 'Borrar Último Punto';
|
||||
controlUI.appendChild(controlText);
|
||||
|
||||
// Setup the click event listeners: simply set the map to Chicago.
|
||||
controlUI.addEventListener('click', function () {
|
||||
EliminarUltimoPunto();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function ControlSelect(controlDiv, map) {
|
||||
|
||||
// Set CSS for the control border.
|
||||
var controlUI = document.createElement('div');
|
||||
controlUI.style.marginLeft = '10px';
|
||||
controlUI.style.zIndex = '0';
|
||||
controlUI.style.cursor = 'pointer';
|
||||
// controlUI.style.position = 'absolute';
|
||||
controlUI.style.left = "0px";
|
||||
controlUI.style.width = "150px";
|
||||
controlUI.style.marginTop = "10px"
|
||||
controlUI.style.top = "0px";
|
||||
controlUI.className = 'gmnoprint';
|
||||
|
||||
controlDiv.appendChild(controlUI);
|
||||
|
||||
var ControlSub1 = document.createElement('div')
|
||||
ControlSub1.style.float = 'left';
|
||||
ControlSub1.className = 'gm-style-mtc'
|
||||
controlUI.appendChild(ControlSub1)
|
||||
|
||||
var ControlSub2 = document.createElement('div')
|
||||
ControlSub2.style.direction = 'ltr';
|
||||
ControlSub2.style.overflow = 'hidden';
|
||||
ControlSub2.id = "Geocerca"
|
||||
ControlSub2.style.textAlign = 'center';
|
||||
ControlSub2.style.position = 'relative';
|
||||
ControlSub2.style.color = 'rgb(0,0,0)';
|
||||
ControlSub2.style.fontFamily = ' "Open Sans", sans-serif; ';
|
||||
ControlSub2.style.msUserSelect = 'none;';
|
||||
ControlSub2.style.fontSize = '11px'
|
||||
ControlSub2.style.backgroundColor = 'rgb(255,255,255)'
|
||||
ControlSub2.style.padding = '11px'
|
||||
ControlSub2.style.backgroundClip = 'padding-box'
|
||||
ControlSub2.style.minWidth = '28px'
|
||||
ControlSub2.style.fontWeight = '500'
|
||||
ControlSub2.style.boxShadow = '0 1px 4px -1px rgba(0,0,0,.3)';
|
||||
ControlSub2.innerHTML = 'Geocerca'
|
||||
ControlSub1.appendChild(ControlSub2)
|
||||
|
||||
var ControlSub3 = document.createElement('div')
|
||||
ControlSub3.style.float = 'left';
|
||||
ControlSub3.className = 'gm-style-mtc'
|
||||
controlUI.appendChild(ControlSub3)
|
||||
|
||||
var ControlSub4 = document.createElement('div')
|
||||
ControlSub4.style.direction = 'ltr';
|
||||
ControlSub4.style.overflow = 'hidden';
|
||||
ControlSub4.style.textAlign = 'center';
|
||||
ControlSub4.id = "Georuta"
|
||||
ControlSub4.style.position = 'relative';
|
||||
ControlSub4.style.color = 'rgb(86,86,86)';
|
||||
ControlSub4.style.fontFamily = ' "Open Sans", sans-serif; ';
|
||||
ControlSub4.style.msUserSelect = 'none;';
|
||||
ControlSub4.style.fontSize = '11px'
|
||||
ControlSub4.style.backgroundColor = 'rgb(255,255,255)'
|
||||
ControlSub4.style.padding = '11px'
|
||||
ControlSub4.style.backgroundClip = 'padding-box'
|
||||
ControlSub4.style.minWidth = '38px'
|
||||
ControlSub4.style.fontWeight = '500'
|
||||
ControlSub4.style.boxShadow = '0 1px 4px -1px rgba(0,0,0,.3)';
|
||||
ControlSub4.style.borderLeft = '0px;'
|
||||
ControlSub4.innerHTML = 'Georuta'
|
||||
ControlSub3.appendChild(ControlSub4)
|
||||
|
||||
|
||||
// Setup the click event listeners: simply set the map to Chicago.
|
||||
ControlSub3.addEventListener('click', function () {
|
||||
CambiaTipo('Georuta');
|
||||
});
|
||||
|
||||
ControlSub1.addEventListener('click', function () {
|
||||
CambiaTipo('Geocerca');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function ControlColor(controlDiv, map) {
|
||||
|
||||
// Set CSS for the control border.
|
||||
var controlUI = document.createElement('div');
|
||||
controlUI.style.backgroundColor = '#fff';
|
||||
controlUI.style.border = '2px solid #fff';
|
||||
controlUI.style.borderRadius = '3px';
|
||||
controlUI.style.pointer = '3px';
|
||||
controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';
|
||||
controlUI.style.cursor = 'pointer';
|
||||
controlUI.style.marginLeft = '10px';
|
||||
controlUI.style.marginTop = '5px';
|
||||
controlUI.style.marginBottom = '22px';
|
||||
controlUI.style.textAlign = 'center';
|
||||
controlUI.style.color = 'rgb(25,25,25)';
|
||||
controlUI.style.fontFamily = ' "Open Sans", sans-serif; ';
|
||||
controlUI.style.fontSize = '14px';
|
||||
controlUI.style.paddingLeft = '5px';
|
||||
controlUI.style.paddingRight = '5px';
|
||||
controlUI.innerHTML = 'Cambiar Color '
|
||||
controlUI.title = 'Click para cambiar el color del polygono';
|
||||
controlDiv.appendChild(controlUI);
|
||||
|
||||
// Set CSS for the control interior.
|
||||
var controlText = document.createElement('input');
|
||||
controlText.type = 'hidden';
|
||||
controlText.id = 'hidden-input'
|
||||
controlText.className = 'demo'
|
||||
controlText.value = '#0088FF'
|
||||
controlText.onchange = function () { CambiaColor(); };
|
||||
controlUI.appendChild(controlText);
|
||||
|
||||
// Setup the click event listeners: simply set the map to Chicago.
|
||||
controlUI.addEventListener('click', function () {
|
||||
ComponentsColorPickers.init();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
function AddGeo() {
|
||||
|
||||
|
||||
|
||||
if ($("#HdnTipo").val() === 'Geocerca') {
|
||||
if (markers.length === 0) {
|
||||
alert('Dibuje los vértices de la geocerca haciendo click en el mapa.');
|
||||
} else if (markers.length < 3) { alert('Debe dibujar por lo menos 3 vértices para la creación de la geocerca'); }
|
||||
else {
|
||||
debugger;
|
||||
var r = polygon.getPath();
|
||||
var s = "";
|
||||
r.forEach(function (xy, i) { s += xy.lng() + ' ' + xy.lat() + ',' });
|
||||
s += r.j[0].lng() + ' ' + r.j[0].lat();
|
||||
$("#GeoCerca").val(s);
|
||||
|
||||
$('#divAgregarTipo').modal({ backdrop: 'static', keyboard: false });
|
||||
}
|
||||
} else if ($("#HdnTipo").val() === 'Georuta') {
|
||||
if (markers.length === 0) {
|
||||
alert('Traza la ruta click en el mapa.');
|
||||
} else if (markers.length < 2) { alert('Debe dibujar por lo menos 2 puntos en el mapa para la creación de la ruta'); }
|
||||
else {
|
||||
$('#divAgregarTipo').modal({ backdrop: 'static', keyboard: false });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CambiaTipo(Tipo) {
|
||||
DeleteMarkers();
|
||||
if (Tipo === 'Geocerca') {
|
||||
$("#HdnTipo").val('Geocerca')
|
||||
$("#Geocerca").css("font-weight", "bold")
|
||||
$("#Georuta").css("font-weight", "normal")
|
||||
} else if (Tipo === 'Georuta') {
|
||||
$("#HdnTipo").val('Georuta')
|
||||
$("#Geocerca").css("font-weight", "normal")
|
||||
$("#Georuta").css("font-weight", "bold")
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=drawing&libraries=geometry&libraries=places">
|
||||
</script>
|
||||
<%-- <script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAJnZ1CoEUX425C20aqzFw4dYxFL_LfThk&libraries=drawing&libraries=geometry&libraries=places">
|
||||
</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>
|
||||
|
||||
204
GPS/GeoReferencias.aspx.vb
Normal file
204
GPS/GeoReferencias.aspx.vb
Normal file
@@ -0,0 +1,204 @@
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Partial Class GPS_GeoReferencias
|
||||
Inherits ClsPaginas
|
||||
|
||||
Public Property DtVehiculos() As Data.DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtVehiculos"), DataTable)
|
||||
End Get
|
||||
Set(ByVal value As Data.DataTable)
|
||||
ViewState("DtVehiculos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDispositivos()
|
||||
CargaGrupos()
|
||||
CreaTmpDT()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub CreaTmpDT()
|
||||
DtVehiculos = New DataTable
|
||||
Dim pk = DtVehiculos.Columns.Add("CveDispositivo", GetType(Integer))
|
||||
DtVehiculos.Columns.Add("NoEconomico", GetType(String))
|
||||
DtVehiculos.Columns.Add("CveDispositivoGeoReferenciaDetalle", GetType(Integer))
|
||||
DtVehiculos.PrimaryKey = New DataColumn() {pk}
|
||||
|
||||
GvDispositivos.DataSource = DtVehiculos
|
||||
GvDispositivos.DataBind()
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDispositivos()
|
||||
DdlEquipo.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("Estatus = 1")
|
||||
DdlEquipo.DataBind()
|
||||
DdlEquipo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
Private Sub CargaGrupos()
|
||||
Using ObjGPS As New ClsGPS
|
||||
If ObjGPS.GruposGet(-1, UsuarioActual.CveCliente) Then
|
||||
DdlGrupo.DataSource = ObjGPS.DtResultados
|
||||
DdlGrupo.DataBind()
|
||||
End If
|
||||
End Using
|
||||
DdlGrupo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDispositivos_RowDeleting(sender As Object, e As GridViewDeleteEventArgs)
|
||||
DtVehiculos.Rows.RemoveAt(e.RowIndex)
|
||||
|
||||
GvDispositivos.DataSource = DtVehiculos
|
||||
GvDispositivos.DataBind()
|
||||
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
Protected Sub LnkAgregarDisp_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim CveDispositivo As Integer = DdlEquipo.SelectedValue.ToEntero
|
||||
If CveDispositivo > 0 Then
|
||||
Dim NoEconomico As String = DdlEquipo.SelectedItem.Text
|
||||
|
||||
If Not DtVehiculos.Select($"CveDispositivo={CveDispositivo}").Any() Then
|
||||
Dim Dr As DataRow = DtVehiculos.NewRow
|
||||
Dr("CveDispositivo") = CveDispositivo
|
||||
Dr("NoEconomico") = NoEconomico
|
||||
Dr("CveDispositivoGeoReferenciaDetalle") = -1
|
||||
|
||||
DtVehiculos.Rows.Add(Dr)
|
||||
DtVehiculos.AcceptChanges()
|
||||
Else
|
||||
Alert($"El dispositivo '{NoEconomico} ya existe en la tabla.'", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
GvDispositivos.DataSource = DtVehiculos
|
||||
GvDispositivos.DataBind()
|
||||
End If
|
||||
UpAgregar.Update()
|
||||
RegistraScript("CargaPickersHora();", "1")
|
||||
End Sub
|
||||
Protected Sub LnkAgregarGrupo_Click(sender As Object, e As EventArgs)
|
||||
Dim CveGrupo As Integer = DdlGrupo.SelectedValue.ToEntero
|
||||
|
||||
Using ObjGPS As New ClsGPS
|
||||
|
||||
If ObjGPS.GruposDetallesGet(CveGrupo) Then
|
||||
Dim Query = From dr In ObjGPS.DtResultados
|
||||
Select CveDispositivo = dr("CveDispositivo").ToString.ToEntero, NoEconomico = dr("NoEconomico").ToString, CveDispositivoGeoReferenciaDetalle = -1
|
||||
|
||||
Dim dt As DataTable = Query.QueryToDataTable(True)
|
||||
dt.PrimaryKey = New DataColumn() {dt.Columns(0)}
|
||||
DtVehiculos.Merge(dt, True, MissingSchemaAction.Ignore)
|
||||
|
||||
End If
|
||||
|
||||
End Using
|
||||
GvDispositivos.DataSource = DtVehiculos
|
||||
GvDispositivos.DataBind()
|
||||
UpAgregar.Update()
|
||||
RegistraScript("CargaPickersHora();", "1")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCrear_Click(sender As Object, e As EventArgs)
|
||||
Dim TieneError As Boolean = False
|
||||
Dim ObjGPS As New ClsGPS
|
||||
ObjGPS.IniciaTransacSQL()
|
||||
|
||||
Dim GeoRefString As String
|
||||
Try
|
||||
If HdnTipo.Value = "Georuta" Then
|
||||
GeoRefString = CommandArg.Value
|
||||
Dim CoordsPuntos() As String = GeoRefString.Split("+"c)
|
||||
GeoRefString = ""
|
||||
For Each coordenada As String In CoordsPuntos
|
||||
If coordenada Is CoordsPuntos.Last Then
|
||||
Exit For
|
||||
End If
|
||||
coordenada = coordenada.Replace("(", "").Replace(")", "")
|
||||
Dim LatLng() As String = coordenada.Split(","c)
|
||||
GeoRefString = $"{GeoRefString} {LatLng(1).Trim} {LatLng(0).Trim},"
|
||||
Next
|
||||
GeoRefString = GeoRefString.Substring(0, GeoRefString.Length - 1)
|
||||
GeoRefString = $"LINESTRING({GeoRefString})"
|
||||
If ObjGPS.GeoReferenciaAdd(TxtNombre.Text, -1, GeoRefString, "Ruta", True, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, chkLunes.Checked, chkMartes.Checked, chkMiercoles.Checked, chkJueves.Checked, chkViernes.Checked, chkSabado.Checked, chkDomingo.Checked, ($"{Date.Now.ToShortDateString} {TxtHoraI.Text}").ToDateTime, ($"{Date.Now.ToShortDateString} {TxtHoraF.Text}").ToDateTime, hdnColor.Value, TxtTolerancia.Text.ToEntero, UsuarioActual.CveCliente) Then
|
||||
For Each Dr As GridViewRow In GvDispositivos.Rows
|
||||
If Dr.RowType = DataControlRowType.DataRow Then
|
||||
If Not ObjGPS.AddGeoReferenciaDetalle(ObjGPS.CveGeoReferencia, Dr.DataKey("CveDispositivo").ToString.ToEntero) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
'RegistraScript("CreaRuta();")
|
||||
ElseIf HdnTipo.Value = "Geocerca" Then
|
||||
GeoRefString = $"POLYGON(({GeoCerca.Value} {CommandArg.Value}))"
|
||||
If ObjGPS.GeoReferenciaAdd(TxtNombre.Text, -1, GeoRefString, "Geocerca", True, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, chkLunes.Checked, chkMartes.Checked, chkMiercoles.Checked, chkJueves.Checked, chkViernes.Checked, chkSabado.Checked, chkDomingo.Checked, ($"{Date.Now.ToShortDateString} {TxtHoraI.Text}").ToDateTime, ($"{Date.Now.ToShortDateString} {TxtHoraF.Text}").ToDateTime, hdnColor.Value, TxtTolerancia.Text.ToEntero, UsuarioActual.CveCliente) Then
|
||||
For Each Dr As GridViewRow In GvDispositivos.Rows
|
||||
If Dr.RowType = DataControlRowType.DataRow Then
|
||||
If Not ObjGPS.AddGeoReferenciaDetalle(ObjGPS.CveGeoReferencia, Dr.DataKey("CveDispositivo").ToString.ToEntero) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
TieneError = False
|
||||
OnError("Ocurrió un error al agregar la GeoReferencia.", ex)
|
||||
Finally
|
||||
|
||||
If TieneError Then
|
||||
ObjGPS.RollBack()
|
||||
Else
|
||||
ObjGPS.Commit()
|
||||
Alert("Se agregó correctamente la Ruta", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjGPS.Dispose()
|
||||
|
||||
RegistraScript("Limpieza();")
|
||||
GeoRefString = ""
|
||||
TxtNombre.Text = ""
|
||||
DdlEquipo.SelectedValue = "-1"
|
||||
txtFechaI.Text = ""
|
||||
txtFechaF.Text = ""
|
||||
TxtTolerancia.Text = ""
|
||||
chkLunes.Checked = False
|
||||
chkMartes.Checked = False
|
||||
chkMiercoles.Checked = False
|
||||
chkJueves.Checked = False
|
||||
chkViernes.Checked = False
|
||||
chkSabado.Checked = False
|
||||
chkDomingo.Checked = False
|
||||
TxtHoraI.Text = ""
|
||||
TxtHoraF.Text = ""
|
||||
End Try
|
||||
|
||||
|
||||
UpBodyTipoEquipo.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function GetControlThatCausedPostBack(ByVal page As Page) As Control
|
||||
'initialize a control and set it to null
|
||||
Dim ctrl As Control = Nothing
|
||||
'get the event target name and find the control
|
||||
Dim ctrlName As String = page.Request.Params.Get("__EVENTTARGET")
|
||||
If Not String.IsNullOrEmpty(ctrlName) Then
|
||||
ctrl = page.FindControl(ctrlName)
|
||||
End If
|
||||
|
||||
'return the control to the calling method
|
||||
Return ctrl
|
||||
End Function
|
||||
|
||||
End Class
|
||||
254
GPS/InicioGPS.aspx.vb
Normal file
254
GPS/InicioGPS.aspx.vb
Normal file
@@ -0,0 +1,254 @@
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Partial Class GPS_PruebaMaster
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "P R O P I E D A D E S"
|
||||
Public Property Offset() As Integer
|
||||
Get
|
||||
Return DirectCast(IfNull(ViewState("Offset"), 0), Integer)
|
||||
End Get
|
||||
Set(ByVal value As Integer)
|
||||
ViewState("Offset") = value
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property FechaCliente() As DateTime
|
||||
Get
|
||||
Return DateTime.UtcNow.AddMinutes(10).AddMinutes(Offset)
|
||||
End Get
|
||||
End Property
|
||||
Private Property DTEquipos As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTEquipos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTEquipos") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
If UsuarioActual.Contraseña = (ContraseñaPredeterminadaEncriptada) OrElse UsuarioActual.ActCambiarContraseña Then
|
||||
Response.Redirect("/Sistemas/CatContrasenia.aspx")
|
||||
Else
|
||||
CargaDispositivos()
|
||||
CargaZonasHorarias()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaZonasHorarias()
|
||||
Using ObjGPS As New ClsGPS
|
||||
Dim CveZonaHoraria As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveZonaHoraria", $"CveCliente = {UsuarioActual.CveCliente}").ToEntero()
|
||||
If ObjGPS.GetZonasHorarias() Then
|
||||
If ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
Offset = ObjGPS.DtResultados.FiltroPrimeroValor("UTCOffset", $"CveZonaHoraria = {CveZonaHoraria}").ToEntero()
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDispositivos()
|
||||
DTEquipos = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("Estatus = 1")
|
||||
End Sub
|
||||
|
||||
Private Function SQLToGmaps(CoordsSQL As String, Tipo As String) As String
|
||||
Dim CoordsPoligono As String = CoordsSQL.Replace($"{Tipo}", "").Replace(")", "").Replace("(", "")
|
||||
Dim CoordsPuntos() As String = CoordsPoligono.Split(","c)
|
||||
Dim Var As String = ""
|
||||
For Each coordenada As String In CoordsPuntos
|
||||
If coordenada Is CoordsPuntos.Last Then
|
||||
Dim latlng() As String = coordenada.Trim.Split(" "c)
|
||||
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }}"
|
||||
Else
|
||||
Dim latlng() As String = coordenada.Trim.Split(" "c)
|
||||
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }},"
|
||||
End If
|
||||
Next
|
||||
Return Var
|
||||
End Function
|
||||
|
||||
Protected Sub BtnCargar_Click(sender As Object, e As EventArgs) Handles BtnCargar.Click
|
||||
Dim SBBody As New StringBuilder
|
||||
Dim Info As String
|
||||
Dim GPS As New ClsGPS
|
||||
Dim Icono As String = ""
|
||||
Dim SB = New StringBuilder()
|
||||
For Each row As DataRow In DTEquipos.Rows
|
||||
SB.Append($"{row("CveDispositivo")};")
|
||||
Next
|
||||
|
||||
If GPS.UltimaPosicionEquipoGet(SB.ToString, UsuarioActual.CveCliente) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
For Each row As DataRow In GPS.DtResultados.Rows
|
||||
Dim Coord As String '= SQLToGmaps(row("Posicion").ToString, "POINT")
|
||||
|
||||
Try
|
||||
Coord= SQLToGmaps(row("Posicion").ToString, "POINT")
|
||||
|
||||
Catch ex As Exception
|
||||
GuardaLog($"{SB.ToString} {UsuarioActual.CveCliente}{ex.ToString()}")
|
||||
End Tryy
|
||||
Info = InfoWindowCombustible($"Vehículo: {row("Vehiculo").ToString}", "-1", row("CveDispositivo").ToString.ToEntero, row)
|
||||
Dim Fecha = row("FechaTrama").ToString
|
||||
Dim Diferencia As Long = DateDiff(DateInterval.Minute, Fecha.ToDateTime(), FechaCliente)
|
||||
|
||||
If Diferencia >= 30 AndAlso Diferencia < 120 Then
|
||||
Icono = $"/Imagenes/rsz_11rsz_car_disconnected.png"
|
||||
ElseIf Diferencia >= 120 Then
|
||||
Icono = $"/Imagenes/rsz_11rsz_car_disable.png"
|
||||
Else
|
||||
If row("SPD").ToString.ToDouble > 1 Then
|
||||
Icono = $"/Imagenes/{GlobalDTDispositivos(UsuarioActual.CveCliente).FiltroPrimeroValor("Icono", $"CveDispositivo = {row("CveDispositivo").ToString}")}green.png"
|
||||
Else
|
||||
Icono = $"/Imagenes/{GlobalDTDispositivos(UsuarioActual.CveCliente).FiltroPrimeroValor("Icono", $"CveDispositivo = {row("CveDispositivo").ToString}")}.png"
|
||||
End If
|
||||
End If
|
||||
|
||||
SBBody.Append($"</table></div><div></div></div>")
|
||||
RegistraScript($"CreaMarcador({Coord},'{row("Vehiculo").ToString}', '{Info}', '{Icono}');", row("CveDispositivo").ToString)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
RegistraScript("fitBoundsToVisibleMarkers();", "2")
|
||||
GPS.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "Herramientas - GPS"
|
||||
|
||||
Protected Sub BtnCargaComandos_Click(sender As Object, e As EventArgs) Handles BtnCargaComandos.Click
|
||||
CargaComandos()
|
||||
End Sub
|
||||
Private Sub CargaComandos()
|
||||
'Dim ObjGps As New ClsGPS
|
||||
'If ObjGps.GetComandosModeloDispositivo(HdnCveDipositivo.Value.ToEntero) AndAlso ObjGps.DtResultados.Rows.Count > 0 Then
|
||||
' GvComandos.DataSource = ObjGps.DtResultados.FiltraParametros("CveComando IN (6, 7, 32, 36, 8, 9)")
|
||||
' GvComandos.DataBind()
|
||||
' UpBodyTipoEquipo.Update()
|
||||
'End If
|
||||
|
||||
'ObjGps.Dispose()
|
||||
|
||||
Dim ObjGps As New ClsGPS
|
||||
If ObjGps.GetComandosModeloDispositivoUsuarios(HdnCveDipositivo.Value.ToEntero, UsuarioActual.CveUsuario, 1) Then
|
||||
GvComandos.DataSource = ObjGps.DtResultados
|
||||
End If
|
||||
ObjGps.Dispose()
|
||||
GvComandos.DataBind()
|
||||
|
||||
UpBodyTipoEquipo.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub GvComandos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvComandos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
'Select Case e.Row.DBCampo("CveComando").ToEntero
|
||||
' Case 6
|
||||
' e.Row.Cells(1).Text = "Apagar Motor"
|
||||
' Case 7
|
||||
' e.Row.Cells(1).Text = "Encender Motor"
|
||||
' Case 32
|
||||
' e.Row.Cells(1).Text = "Reiniciar Dispositivo"
|
||||
' Case 36
|
||||
' e.Row.Cells(1).Text = "Telefono de Pánico"
|
||||
' Case 8
|
||||
' e.Row.Cells(1).Text = "Abrir Compuerta"
|
||||
' Case 9
|
||||
' e.Row.Cells(1).Text = "Cerrar Compuerta"
|
||||
'End Select
|
||||
|
||||
If e.Row.DataKey("RequiereValor").ToEntero = 1 Then
|
||||
e.Row.FCTextBox("TxtValor").Visible = True
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GvComandos_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvComandos.RowCommand
|
||||
If (e.CommandName = "EnviarComando") Then
|
||||
|
||||
Dim ObjHerramientas As New ClsGPSHerramientas
|
||||
|
||||
Dim index As Integer = Convert.ToInt32(e.CommandArgument)
|
||||
Dim row As GridViewRow = GvComandos.Rows(index)
|
||||
|
||||
ObjHerramientas.EjecutarComandoGPRS(row.DataKey("CveComando").ToEntero, HdnCveDipositivo.Value.ToEntero, UsuarioActual.CveUsuario, row.FCTextBox("TxtValor").Text)
|
||||
|
||||
ObjHerramientas.Dispose()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'Private Sub BtnApagarMotor_Click(sender As Object, e As EventArgs) Handles BtnApagarMotor.Click
|
||||
' 'Comando 6
|
||||
' Dim ObjGPSHerramientas As New ClsGPSHerramientas
|
||||
' ObjGPSHerramientas.EjecutarComandoGPRS(6, HdnCveDipositivo.Value.ToEntero, UsuarioActual.CveUsuario, "")
|
||||
' ObjGPSHerramientas.Dispose()
|
||||
'End Sub
|
||||
|
||||
'Private Sub BtnEncenderMotor_Click(sender As Object, e As EventArgs) Handles BtnEncenderMotor.Click
|
||||
' 'Comando 7
|
||||
' Dim ObjGPSHerramientas As New ClsGPSHerramientas
|
||||
' ObjGPSHerramientas.EjecutarComandoGPRS(7, HdnCveDipositivo.Value.ToEntero, UsuarioActual.CveUsuario, "")
|
||||
' ObjGPSHerramientas.Dispose()
|
||||
'End Sub
|
||||
|
||||
'Private Sub BtnReinicio_Click(sender As Object, e As EventArgs) Handles BtnReinicio.Click
|
||||
' 'Comando 32
|
||||
' Dim ObjGPSHerramientas As New ClsGPSHerramientas
|
||||
' ObjGPSHerramientas.EjecutarComandoGPRS(32, HdnCveDipositivo.Value.ToEntero, UsuarioActual.CveUsuario, "")
|
||||
' ObjGPSHerramientas.Dispose()
|
||||
'End Sub
|
||||
|
||||
'Private Sub BtnTelefonoPanico_Click(sender As Object, e As EventArgs) Handles BtnTelefonoPanico.Click
|
||||
' 'Comando 36
|
||||
' Dim ObjGPSHerramientas As New ClsGPSHerramientas
|
||||
' ObjGPSHerramientas.EjecutarComandoGPRS(36, HdnCveDipositivo.Value.ToEntero, UsuarioActual.CveUsuario, TxtTelefonoPanico.Text.Trim)
|
||||
' ObjGPSHerramientas.Dispose()
|
||||
'End Sub
|
||||
|
||||
'Private Sub BtnProbarEncendido_Click(sender As Object, e As EventArgs) Handles BtnProbarEncendido.Click
|
||||
' 'Comando 8 'Abrir Compuerta
|
||||
' Dim ObjGPSHerramientas As New ClsGPSHerramientas
|
||||
' ObjGPSHerramientas.EjecutarComandoGPRS(8, HdnCveDipositivo.Value.ToEntero, UsuarioActual.CveUsuario, "")
|
||||
' ObjGPSHerramientas.Dispose()
|
||||
'End Sub
|
||||
|
||||
'Private Sub BtnInfoDispositivo_Click(sender As Object, e As EventArgs) Handles BtnInfoDispositivo.Click
|
||||
' 'Comando 9 'Cerrar Compuerta
|
||||
' Dim ObjGPSHerramientas As New ClsGPSHerramientas
|
||||
' ObjGPSHerramientas.EjecutarComandoGPRS(9, HdnCveDipositivo.Value.ToEntero, UsuarioActual.CveUsuario, "")
|
||||
' ObjGPSHerramientas.Dispose()
|
||||
'End Sub
|
||||
|
||||
'Private Sub BtnAhorroBateria_Click(sender As Object, e As EventArgs) Handles BtnAhorroBateria.Click
|
||||
' 'Comando 40
|
||||
' Dim ObjGPSHerramientas As New ClsGPSHerramientas
|
||||
' ObjGPSHerramientas.EjecutarComandoGPRS(40, HdnCveDipositivo.Value.ToEntero, UsuarioActual.CveUsuario, DdlTipoBateria.SelectedValue)
|
||||
' ObjGPSHerramientas.Dispose()
|
||||
'End Sub
|
||||
#End Region
|
||||
Public Function InfoWindowCombustible(Header As String, ExtraBody As String, CveDispositivo As Integer, row As DataRow, Optional PermisoComandos As Boolean = True) As String
|
||||
Dim SBuilder As New StringBuilder
|
||||
SBuilder.Clear()
|
||||
SBuilder.Append($"<div>")
|
||||
SBuilder.Append($"<div><h5><a target=\'_blank\' href=\'/GPS/Vehiculos.aspx?CveDispositivo={CveDispositivo}\'><b>{Header}</b></a></h5></div>")
|
||||
SBuilder.Append($"<div><table>")
|
||||
SBuilder.Append($"<tr><td>Fecha : {row("FechaTrama")} </td></tr>")
|
||||
SBuilder.Append($"<tr><td>Conductor : {row("Conductor").ToString}</td></tr>")
|
||||
SBuilder.Append($"<tr><td>Combustible : {IfNull(row("Combustible"), "NO DISPONIBLE", $"{row("Combustible").ToString.FormatoNumero} lts").ToString}</td></tr>")
|
||||
If row("SPD").ToString <> "-1" Then
|
||||
SBuilder.Append($"<tr><td>Velocidad : {row("SPD").ToString} KM/H </td></tr>")
|
||||
End If
|
||||
If ExtraBody <> "" AndAlso ExtraBody <> "-1" Then
|
||||
SBuilder.Append(ExtraBody)
|
||||
End If
|
||||
If PermisoComandos Then
|
||||
SBuilder.Append($"<tr><td><a href=""javascript:;"" onclick=""CargaComandos(\'{row("Vehiculo").ToString}\',{CveDispositivo});"">Comandos</a></td></tr>")
|
||||
End If
|
||||
SBuilder.AppendFormat("<tr><td><a target=\'_blank\' href=\'https://www.google.com/maps/search/{0},{1}/\'>Ver en google maps</a></td></tr>", row("Lat").ToString, row("Lng").ToString)
|
||||
SBuilder.Append($"</table></div><div></div></div>")
|
||||
Return SBuilder.ToString
|
||||
End Function
|
||||
End Class
|
||||
58
GPS/Notificaciones.aspx
Normal file
58
GPS/Notificaciones.aspx
Normal file
@@ -0,0 +1,58 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="Notificaciones.aspx.vb" Inherits="GPS_Notificaciones" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
||||
<style>
|
||||
.ADScroller .ADScroller-body {
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="C" Runat="Server">
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="margin-right: -15px;margin-left: -15px">
|
||||
<div class="col-md-12">
|
||||
<!-- BEGIN SAMPLE TABLE PORTLET-->
|
||||
<div class="portlet light ">
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size:25px">
|
||||
<i class="fa fa-bell font-green"></i>
|
||||
<span class="caption-subject font-green bold uppercase" style="font-size:18px" >Notificaciones</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveNotificacionBitacora" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="30%" HeaderText="Unidad" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Nombre" ItemStyle-Width="30%" HeaderText="Notificación" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:BoundField DataField="FechaEvento" ItemStyle-Width="25%" HeaderText="Fecha" ItemStyle-HorizontalAlign="center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="H" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
29
GPS/Notificaciones.aspx.vb
Normal file
29
GPS/Notificaciones.aspx.vb
Normal file
@@ -0,0 +1,29 @@
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class GPS_Notificaciones
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Sub GPS_Notificaciones_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
If Request("Tipo") IsNot Nothing AndAlso Request("Tipo").Length > 0 Then
|
||||
If Request("Tipo") = "EMG" Or Request("Tipo") = "ALT" Then
|
||||
Dim Tipo As Integer = -1
|
||||
Select Case Request("Tipo")
|
||||
Case "ALT"
|
||||
Tipo = 1
|
||||
Case "EMG"
|
||||
Tipo = 2
|
||||
End Select
|
||||
Dim ObjNotificaciones As New ClsSisNotificaciones
|
||||
ObjNotificaciones.GetNotificacionesCampanaDetalle(UsuarioActual.CveUsuario, Tipo)
|
||||
GvDatos.DataSource = ObjNotificaciones.DtResultados
|
||||
ObjNotificaciones.Dispose()
|
||||
GvDatos.DataBind()
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
764
GPS/PuntosDeInteres.aspx
Normal file
764
GPS/PuntosDeInteres.aspx
Normal file
@@ -0,0 +1,764 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="PuntosDeInteres.aspx.vb" Inherits="GPS_PuntosDeInteres" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<link href="../Metronic/assets/layouts/layout3/css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<style type="text/css">
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#map {
|
||||
position: fixed !important;
|
||||
width: 100%;
|
||||
height: calc(100% - 51px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.pac-container.pac-logo {
|
||||
z-index: 100000;
|
||||
}
|
||||
|
||||
.controls {
|
||||
margin-top: 10px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 2px 0 0 2px;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
height: 32px;
|
||||
outline: none;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
#pac-input {
|
||||
background-color: #fff;
|
||||
font-family: 'Open Sans Condensed', sans-serif;
|
||||
font-size: 13px;
|
||||
font-weight: 300;
|
||||
margin-left: 12px;
|
||||
padding: 0 11px 0 13px;
|
||||
text-overflow: ellipsis;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#pac-input:focus {
|
||||
border-color: #4d90fe;
|
||||
}
|
||||
|
||||
|
||||
#iw-container {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="H" ID="Content9" runat="server">
|
||||
<li>
|
||||
<asp:LinkButton ID="BtnCrear" OnClientClick="CargaDivs('Point');return false;" Text="<i class='fa fa-map-marker'></i><span>Crear punto(s) de Interés</span>" runat="server">
|
||||
</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="BtnCrearGrupo" OnClientClick="CargaDivs('PointGroup');return false;" Text="<i class='fa fa-users'></i><span>Crear un grupo de puntos</span>" runat="server">
|
||||
</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton OnClientClick="CargaDivs('Route');return false;" Text="<i class='fa fa-location-arrow'></i><span>Calcular ruta entre puntos</span>" runat="server">
|
||||
</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton OnClientClick="CargaDivs('GroupRoute');return false;" Text="<i class='fa fa-arrows-h'></i><span>Calcular ruta para grupo de puntos</span>" runat="server">
|
||||
</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="BtnEditar" OnClientClick="CargaDivs('Edit');return false;" Text="<i class='fa fa-pencil' aria-hidden='true'></i><span>Editar punto(s) de interés</span>" runat="server">
|
||||
</asp:LinkButton>
|
||||
</li>
|
||||
<%--<li>
|
||||
<asp:LinkButton Text="<i class='fa fa-calculator'></i><span>Calcular distancia entre puntos</span>" runat="server"></asp:LinkButton>
|
||||
</li>--%>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HdnTipo" runat="server" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="CommandArg" runat="server" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="Points" runat="server" ClientIDMode="Static" />
|
||||
<asp:HiddenField ID="HdnGrupo" runat="server" Value="-1" ClientIDMode="Static" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<input id="pac-input" class="controls" type="text" placeholder="Buscar Dirección">
|
||||
<div id="map"></div>
|
||||
<div id="dvEditar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpEditar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="H2" runat="server">Editar/Eliminar Puntos</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<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="TxtBuscar" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaEventos','{0}')", GvPuntos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaEventos','{0}')", GvPuntos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GVPuntosInteres" runat="server" GridLines="None" DataKeyNames="Punto,PuntoDeInteres,Descripcion,CvePuntoDeInteres,CvePuntoDeInteresGrupo, Estatus" 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>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkGR" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="30%" HeaderText="PuntoDeInteres" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Descripcion" ItemStyle-Width="30%" HeaderText="Descripcion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="10%" HeaderText="Eliminar" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" ItemStyle-Width="5%" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="LBMostrar" runat="server" Text="Mostrar en mapa" CssClass="btn btn-primary"></asp:LinkButton>
|
||||
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<div id="divAgregarTipo" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Agregar Punto(s) de interés</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyTipoEquipo" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div id="dvAdd">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtNombre" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVEstatusOS" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtNombre" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label id="lblPuntos" for="<%= TxtNombre.ClientID.ToString()%>">Nombre Punto(s) De Interés:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="width: 80%; margin-bottom: 20px;">
|
||||
<asp:TextBox ID="TxtDescripcion" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtDescripcion" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Descripcion''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtDescripcion.ClientID.ToString()%>">Descripción:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dvEstatus" style="display:none" runat="server" class="form-group form-md-line-input input-iconright">
|
||||
<label>Activo: </label>
|
||||
<br />
|
||||
<asp:Checkbox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px">
|
||||
</asp:Checkbox>
|
||||
</div>
|
||||
<div id="dvEventos" runat="server" style="display: none">
|
||||
<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="TxtGVGrupo" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtGVGrupo','{0}')", GvGrupos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtGVGrupo','{0}')", GvGrupos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvGrupos" runat="server" GridLines="None" DataKeyNames="CvePuntoDeInteresGrupo,PuntoDeInteresGrupo,Descripcion" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-height="150" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="PuntoDeInteresGrupo" ItemStyle-Width="45%" HeaderText="Agregar a Grupo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Descripcion" ItemStyle-Width="45%" HeaderText="Descripcion" ItemStyle-HorizontalAlign="Left" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpFooter" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarPunto" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button id="btnCancelarTE" class="btn btn-default" data-dismiss="modal" value="Cancelar">Cancelar </button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div id="divAgregarGeoreferencia" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpdatePanel1" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel2">Agregar Punto(s) De Interes</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtNomRuta" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtNomRuta" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddRuta"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtNomRuta.ClientID.ToString()%>">Nombre GeoReferencia:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTolerancia" runat="server" Style="width: 50%; display: inline-block" CssClass="form-control" CausesValidation="true"></asp:TextBox><asp:Literal runat="server" Text="mts"></asp:Literal>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtTolerancia" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTolerancia" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tolerancia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddRuta"></asp:RequiredFieldValidator>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBSerie" runat="server" TargetControlID="TxtTolerancia" FilterType="Numbers" />
|
||||
<label for="<%= TxtTolerancia.ClientID.ToString()%>" style="width: 50%">Tolerancia:</label>
|
||||
</div>
|
||||
<ul class="list-inline" style="font-size: 12px; margin-top: 15px; margin-left: 0px;">
|
||||
<li>Fecha I.:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpAddRuta"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
<li>Fecha F.:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpAddRuta"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="list-inline" style="font-size: 12px; margin-top: 15px; margin-left: 0px;">
|
||||
<li>Aplica Días:
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="L" ID="chkLunes" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="M" ID="chkMartes" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="M" ID="chkMiercoles" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="J" ID="chkJueves" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="V" ID="chkViernes" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="S" ID="chkSabado" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="D" ID="chkDomingo" />
|
||||
</li>
|
||||
</ul>
|
||||
<div class="row" style="margin-top: 10px; margin-bottom: 20px;">
|
||||
<div class="col-md-1">Hora Inicio:</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtHoraI" runat="server" CssClass="form-control input-sm hora" CausesValidation="true" MaxLength="18" Width="75px"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">Hora Fin:</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtHoraF" runat="server" CssClass="form-control input-sm hora" CausesValidation="true" MaxLength="18" Width="75px "></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="BtnAgregarRuta" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpAddRuta"> <i class='material-icons'>done_all</i> Agregar</asp:LinkButton>
|
||||
<button class="btn btn-default" data-dismiss="modal" value="Cancelar">Cancelar </button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>--%>
|
||||
<div id="dvConsulta" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UPConsulta" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="H1" runat="server">Calcular Ruta Óptima entre puntos</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<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="TxtBusquedaEventos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaEventos','{0}')", GvPuntos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaEventos','{0}')", GvPuntos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkGR" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="20%" HeaderText="PuntoDeInteres" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Descripcion" ItemStyle-Width="20%" HeaderText="Descripcion" ItemStyle-HorizontalAlign="Left" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="BtnCalcularR" runat="server" Text="Calcular Ruta" CssClass="btn btn-primary"></asp:LinkButton>
|
||||
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpHiddenBtns" runat="server">
|
||||
<ContentTemplate>
|
||||
<div style="display: none">
|
||||
<asp:Button runat="server" ID="BtnAlerta" />
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="../Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js"></script>
|
||||
<script>
|
||||
var directionsService;
|
||||
var directionsDisplay;
|
||||
var markers = [];
|
||||
var polylines = [];
|
||||
var indiceAnterior = 0;
|
||||
|
||||
|
||||
// var service;
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: { lat: 29.0730, lng: -110.9559 },
|
||||
zoom: 10
|
||||
});
|
||||
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(function (position) {
|
||||
var pos = {
|
||||
lat: position.coords.latitude,
|
||||
lng: position.coords.longitude
|
||||
};
|
||||
map.setCenter(pos);
|
||||
}, function () {
|
||||
handleLocationError(true, infoWindow, map.getCenter());
|
||||
});
|
||||
}
|
||||
|
||||
CargaPickers();
|
||||
|
||||
var input = document.getElementById('pac-input');
|
||||
var searchBox = new google.maps.places.SearchBox(input);
|
||||
map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
|
||||
map.addListener('bounds_changed', function () {
|
||||
searchBox.setBounds(map.getBounds());
|
||||
});
|
||||
|
||||
searchBox.addListener('places_changed', function () {
|
||||
var places = searchBox.getPlaces();
|
||||
|
||||
if (places.length == 0) {
|
||||
return;
|
||||
}
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
places.forEach(function (place) {
|
||||
if (place.geometry.viewport) {
|
||||
// Only geocodes have viewport.
|
||||
bounds.union(place.geometry.viewport);
|
||||
} else {
|
||||
bounds.extend(place.geometry.location);
|
||||
}
|
||||
});
|
||||
map.fitBounds(bounds);
|
||||
});
|
||||
|
||||
|
||||
directionsService = new google.maps.DirectionsService;
|
||||
directionsDisplay = new google.maps.DirectionsRenderer;
|
||||
directionsDisplay.setMap(map);
|
||||
|
||||
var upControlDiv = document.createElement('div');
|
||||
var upControl = new ControlUltimoPunto(upControlDiv, map);
|
||||
|
||||
upControlDiv.index = 1;
|
||||
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(upControlDiv);
|
||||
|
||||
var routeControlDiv = document.createElement('div');
|
||||
var routeControl = new ControlGuardarRuta(routeControlDiv, map);
|
||||
|
||||
routeControlDiv.index = 2;
|
||||
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(routeControlDiv);
|
||||
|
||||
//service = new google.maps.DistanceMatrixService;
|
||||
|
||||
|
||||
map.addListener('click', addLatLng);
|
||||
|
||||
}
|
||||
|
||||
function CargaPickers() {
|
||||
$('#C_TxtHoraI').datetimepicker({
|
||||
datepicker: false,
|
||||
lang: 'es',
|
||||
format: 'H:i',
|
||||
formatDate: 'H:i',
|
||||
step: 30
|
||||
});
|
||||
$('#C_TxtHoraF').datetimepicker({
|
||||
datepicker: false,
|
||||
lang: 'es',
|
||||
format: 'H:i',
|
||||
formatDate: 'H:i',
|
||||
step: 30
|
||||
});
|
||||
}
|
||||
|
||||
function addLatLng(event) {
|
||||
// var path = poly.getPath();
|
||||
// path.push(event.latLng);
|
||||
|
||||
var lat = event.latLng.lat();
|
||||
var lng = event.latLng.lng();
|
||||
|
||||
|
||||
|
||||
var info = new google.maps.InfoWindow({
|
||||
content: "(" + lat + " " + lng + ")"
|
||||
});
|
||||
|
||||
var marker = new google.maps.Marker({
|
||||
position: event.latLng,
|
||||
title: 'Punto',
|
||||
map: map
|
||||
|
||||
});
|
||||
markers.push(marker);
|
||||
$("#C_BtnCrear").attr("disabled", false)
|
||||
|
||||
marker.addListener('click', function () {
|
||||
info.open(map, marker);
|
||||
});
|
||||
|
||||
$("#CommandArg").val("(" + lng + " " + lat + ")")
|
||||
if (markers.length === 1) {
|
||||
var h = $('#Points').val() + "(" + lng + " " + lat + ")" + ",";
|
||||
$('#Points').val(h);
|
||||
} else if (markers.length > 1) {
|
||||
var j = $('#Points').val() + "(" + lng + " " + lat + ")" + ",";
|
||||
$('#Points').val(j);
|
||||
}
|
||||
|
||||
//marker.addListener(marker, "click", function (point) { id = this.__gm_id; delMarker(id) });
|
||||
|
||||
|
||||
}
|
||||
|
||||
var delMarker = function (id) {
|
||||
var mark = markers[id];
|
||||
mark.setMap(null);
|
||||
}
|
||||
|
||||
function Limpieza() {
|
||||
CargaPickers();
|
||||
DeleteMarkers();
|
||||
//$('#divAgregarGeoreferencia').modal('hide');
|
||||
}
|
||||
|
||||
function DeleteMarkers() {
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
markers = [];
|
||||
for (var i = 0; i < polylines.length; i++) {
|
||||
polylines[i].setMap(null);
|
||||
}
|
||||
polylines = [];
|
||||
markers = [];
|
||||
|
||||
$('#CommandArg').val("")
|
||||
$('#Points').val("")
|
||||
$("#C_BtnCrear").attr("disabled", true)
|
||||
directionsDisplay.setMap(null);
|
||||
$("#btnGuardarRuta").css("display", "none")
|
||||
}
|
||||
|
||||
function calculateAndDisplayRoute(origin, destination) {
|
||||
directionsService.route({
|
||||
origin: origin,
|
||||
destination: destination,
|
||||
travelMode: 'DRIVING'
|
||||
}, function (response, status) {
|
||||
if (status === 'OK') {
|
||||
directionsDisplay.setDirections(response);
|
||||
directionsDisplay.setMap(map);
|
||||
var s = "";
|
||||
var legs = response.routes[0].legs;
|
||||
for (i = 0; i < legs.length; i++) {
|
||||
var steps = legs[i].steps;
|
||||
for (j = 0; j < steps.length; j++) {
|
||||
var nextSegment = steps[j].path;
|
||||
for (k = 0; k < nextSegment.length; k++) {
|
||||
s = s + nextSegment[k] + '+'
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#CommandArg').val(s)
|
||||
} else {
|
||||
creaPolyline([(origin), (destination)]);
|
||||
$("#C_BtnAlerta").click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function CreaRuta(waypoints) {
|
||||
var start = waypoints[0];
|
||||
var end = waypoints[waypoints.length - 1];
|
||||
var waypts = [];
|
||||
|
||||
for (var i = 1; i < waypoints.length - 1; i++) {
|
||||
waypts.push({
|
||||
location: waypoints[i],
|
||||
stopover: true
|
||||
});
|
||||
}
|
||||
directionsService.route({
|
||||
origin: start,
|
||||
destination: end,
|
||||
travelMode: 'DRIVING',
|
||||
waypoints: waypts,
|
||||
optimizeWaypoints: true
|
||||
}, function (response, status) {
|
||||
if (status === 'OK') {
|
||||
directionsDisplay.setDirections(response);
|
||||
directionsDisplay.setMap(map);
|
||||
var s = "";
|
||||
var legs = response.routes[0].legs;
|
||||
for (i = 0; i < legs.length; i++) {
|
||||
var steps = legs[i].steps;
|
||||
for (j = 0; j < steps.length; j++) {
|
||||
var nextSegment = steps[j].path;
|
||||
for (k = 0; k < nextSegment.length; k++) {
|
||||
s = s + nextSegment[k] + '+'
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#CommandArg').val(s)
|
||||
$("#btnGuardarRuta").css("display", "")
|
||||
} else {
|
||||
//window.alert('Directions request failed due to ' + status);
|
||||
creaPolyline(waypoints);
|
||||
$("#C_BtnAlerta").click();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function creaPolyline(coords) {
|
||||
var polyline = new google.maps.Polyline({
|
||||
path: coords,
|
||||
strokeColor: "#0088FF",
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 2,
|
||||
fillOpacity: 0.35
|
||||
});
|
||||
for (var i = 0; i < coords.length; i++) {
|
||||
CreaMarcador(coords[i], i + ' ')
|
||||
}
|
||||
polyline.setMap(map);
|
||||
polylines.push(polyline);
|
||||
FitBounds();
|
||||
}
|
||||
|
||||
function CargaDatosSeleccionados(indice, valor) {
|
||||
var columnaSeleccionada = 2 + indice;
|
||||
$('#HdnGrupo').val(valor);
|
||||
$('#C_GvGrupos tr').filter(':nth-child(' + indiceAnterior + ')').css('background-color', 'initial');
|
||||
$('#C_GvGrupos tr').filter(':nth-child(' + columnaSeleccionada + ')').css('background-color', '#F5B27A');
|
||||
indiceAnterior = columnaSeleccionada;
|
||||
}
|
||||
|
||||
function FitBounds() {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].getVisible()) {
|
||||
bounds.extend(markers[i].getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
map.fitBounds(bounds);
|
||||
}
|
||||
|
||||
function CargaDivs(Tipo) {
|
||||
if (Tipo === "PointGroup") {
|
||||
$("#C_TxtNombre").val("")
|
||||
$("#C_TxtDescripcion").val("")
|
||||
$('#divAgregarTipo').modal();
|
||||
$('#myModalLabel').text("Agregar Grupo de Puntos");
|
||||
$("#HdnTipo").val(Tipo)
|
||||
$("#lblPuntos").text("Nombre Grupo de Puntos")
|
||||
$("#C_dvEventos").css("display", "none")
|
||||
$("#dvAdd").css("display", "")
|
||||
$("#C_dvEstatus").css("display", "none")
|
||||
}
|
||||
else if (Tipo === "Point") {
|
||||
if ($("#Points").val().length > 0) {
|
||||
$('#divAgregarTipo').modal();
|
||||
$("#C_TxtNombre").val("")
|
||||
$("#C_TxtDescripcion").val("")
|
||||
$("#HdnTipo").val(Tipo)
|
||||
$('#myModalLabel').text("Agregar Punto(s) de Interés");
|
||||
$("#lblPuntos").text("Nombre Punto(s) de Interés")
|
||||
$("#C_dvEventos").css("display", "")
|
||||
$("#dvAdd").css("display", "")
|
||||
$("#C_dvEstatus").css("display", "none")
|
||||
|
||||
} else { DeleteMarkers(); alert('Haga click en el mapa para dibujar puntos de interés') }
|
||||
}
|
||||
else if (Tipo === "GroupRoute") {
|
||||
DeleteMarkers();
|
||||
$("#C_TxtNombre").val("1")
|
||||
$("#C_TxtDescripcion").val("1")
|
||||
$('#divAgregarTipo').modal();
|
||||
$("#HdnTipo").val(Tipo)
|
||||
$('#myModalLabel').text("Consultar ruta óptima para grupo de puntos");
|
||||
$("#C_dvEventos").css("display", "")
|
||||
$("#dvAdd").css("display", "none")
|
||||
$("#C_dvEstatus").css("display", "none")
|
||||
|
||||
}
|
||||
else if (Tipo === "Route") {
|
||||
DeleteMarkers();
|
||||
$('#dvConsulta').modal();
|
||||
} else if (Tipo === "Edit") {
|
||||
DeleteMarkers();
|
||||
$('#dvEditar').modal();
|
||||
$("#dvEventos").css("display", "")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function ControlUltimoPunto(controlDiv, map) {
|
||||
|
||||
// Set CSS for the control border.
|
||||
var controlUI = document.createElement('div');
|
||||
controlUI.style.backgroundColor = '#fff';
|
||||
controlUI.style.borderRadius = '3px';
|
||||
controlUI.style.width = '165px'
|
||||
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 = '22px';
|
||||
controlUI.style.textAlign = 'center';
|
||||
controlUI.title = 'Click para borrar los puntos dibujados';
|
||||
controlDiv.appendChild(controlUI);
|
||||
|
||||
// Set CSS for the control interior.
|
||||
var controlText = document.createElement('div');
|
||||
controlText.style.color = 'rgb(25,25,25)';
|
||||
controlText.style.fontFamily = ' "Open Sans", sans-serif; ';
|
||||
controlText.style.fontSize = '14px';
|
||||
controlText.style.lineHeight = '38px';
|
||||
controlText.style.paddingLeft = '5px';
|
||||
controlText.style.paddingRight = '5px';
|
||||
controlText.innerHTML = 'Deshacer Puntos';
|
||||
controlUI.appendChild(controlText);
|
||||
|
||||
// Setup the click event listeners: simply set the map to Chicago.
|
||||
controlUI.addEventListener('click', function () {
|
||||
DeleteMarkers();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function ControlGuardarRuta(controlDiv, map) {
|
||||
|
||||
// Set CSS for the control border.
|
||||
var controlUI = document.createElement('div');
|
||||
controlUI.id = "btnGuardarRuta"
|
||||
controlUI.style.display = 'none';
|
||||
controlUI.style.backgroundColor = '#4B77BE';
|
||||
controlUI.style.color = "#fff";
|
||||
controlUI.style.borderRadius = '3px';
|
||||
controlUI.style.width = '165px'
|
||||
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 = '22px';
|
||||
controlUI.style.textAlign = 'center';
|
||||
controlUI.title = 'Guardar la ruta trazada como georeferencia';
|
||||
controlDiv.appendChild(controlUI);
|
||||
|
||||
// Set CSS for the control interior.
|
||||
var controlText = document.createElement('div');
|
||||
controlText.style.color = '#fff';
|
||||
controlText.style.fontFamily = ' "Open Sans", sans-serif; ';
|
||||
controlText.style.fontSize = '14px';
|
||||
controlText.style.lineHeight = '38px';
|
||||
controlText.style.paddingLeft = '5px';
|
||||
controlText.style.paddingRight = '5px';
|
||||
controlText.innerHTML = 'Guardar Ruta';
|
||||
controlUI.appendChild(controlText);
|
||||
|
||||
// Setup the click event listeners: simply set the map to Chicago.
|
||||
controlUI.addEventListener('click', function () {
|
||||
//$("#divAgregarGeoreferencia").modal()
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function CreaMarcador(coords, nomEquipo) {
|
||||
var marker = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: map
|
||||
});
|
||||
markers.push(marker);
|
||||
map.setCenter(coords);
|
||||
}
|
||||
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places&callback=initMap">
|
||||
</script>
|
||||
<%-- <script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAJnZ1CoEUX425C20aqzFw4dYxFL_LfThk&libraries=places&callback=initMap">
|
||||
</script>--%>
|
||||
</asp:Content>
|
||||
|
||||
265
GPS/PuntosDeInteres.aspx.vb
Normal file
265
GPS/PuntosDeInteres.aspx.vb
Normal file
@@ -0,0 +1,265 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class GPS_PuntosDeInteres
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region " PROPIEDADES "
|
||||
Private Property TrazarRuta As Integer
|
||||
Get
|
||||
Return ViewState("TrazarRuta").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("TrazarRuta") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property EsEditar As Integer
|
||||
Get
|
||||
Return ViewState("EsEditar").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("EsEditar") = value
|
||||
End Set
|
||||
|
||||
End Property
|
||||
Private Property CvePuntoDeInteres As Integer
|
||||
Get
|
||||
Return ViewState("CvePuntoDeInteres").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CvePuntoDeInteres") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDatos()
|
||||
EsEditar = 0
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim gps As New ClsGPS
|
||||
If gps.PuntoDeInteresGrupoGet(-1, 1) Then
|
||||
GvGrupos.DataSource = gps.DtResultados
|
||||
Else
|
||||
GvGrupos.DataSource = Nothing
|
||||
End If
|
||||
If gps.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, -1) Then
|
||||
GvPuntos.DataSource = gps.DtResultados
|
||||
GVPuntosInteres.DataSource = gps.DtResultados
|
||||
Else
|
||||
GvPuntos.DataSource = Nothing
|
||||
GVPuntosInteres.DataSource = Nothing
|
||||
End If
|
||||
gps.Dispose()
|
||||
GvGrupos.DataBind()
|
||||
GvPuntos.DataBind()
|
||||
GVPuntosInteres.DataBind()
|
||||
UpEditar.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvGrupos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvGrupos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.Attributes.Add("onClick", $"CargaDatosSeleccionados({e.Row.RowIndex}, '{e.Row.DBCampo("CvePuntoDeInteresGrupo").ToString}');")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnAgregarPunto_Click(sender As Object, e As EventArgs) Handles BtnAgregarPunto.Click
|
||||
Dim GPS As New ClsGPS
|
||||
GPS.IniciaTransacSQL()
|
||||
Dim GEOM As String
|
||||
Dim HuboError = False
|
||||
If EsEditar = 0 Then
|
||||
If HdnTipo.Value = "Point" Then
|
||||
If Points.Value <> "" Then
|
||||
GEOM = Points.Value
|
||||
Dim Var = 0
|
||||
Dim CoordsPuntos() As String = GEOM.Split(","c)
|
||||
For Each coordenada As String In CoordsPuntos
|
||||
Var += 1
|
||||
If coordenada Is CoordsPuntos.Last Then
|
||||
Exit For
|
||||
End If
|
||||
If Not GPS.PuntoDeInteresAdd($"{TxtNombre.Text} {Var}", UsuarioActual.CveCliente, $"POINT{coordenada}", True, TxtDescripcion.Text, HdnGrupo.Value.ToEntero) Then
|
||||
HuboError = True
|
||||
End If
|
||||
Next
|
||||
If Not HuboError Then
|
||||
Alert("Los puntos de interés se agregaron correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
Else
|
||||
GEOM = $"POINT{CommandArg.Value}"
|
||||
If GPS.PuntoDeInteresAdd(TxtNombre.Text, UsuarioActual.CveCliente, GEOM, True, TxtDescripcion.Text, HdnGrupo.Value.ToEntero) Then
|
||||
Alert("El punto de interés se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
HuboError = True
|
||||
End If
|
||||
End If
|
||||
RegistraScript("$('#divAgregarTipo').modal('hide');DeleteMarkers();", "1")
|
||||
CargaDatos()
|
||||
ElseIf HdnTipo.Value = "PointGroup" Then
|
||||
If GPS.PuntoDeInteresGrupoAdd(TxtNombre.Text, UsuarioActual.CveCliente, True, TxtDescripcion.Text) Then
|
||||
Alert("El grupo de puntos de guardó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
RegistraScript("$('#divAgregarTipo').modal('hide');DeleteMarkers();", "1")
|
||||
CargaDatos()
|
||||
ElseIf HdnTipo.Value = "GroupRoute" Then
|
||||
If HdnGrupo.Value = "-1" Then
|
||||
Alert("Es necesario seleccionar un grupo de puntos", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
If GPS.PuntoDeInteresGet(-1, -1, 1, HdnGrupo.Value.ToEntero) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
Dim ruta As String = ""
|
||||
For Each row As DataRow In GPS.DtResultados.Rows
|
||||
ruta += row("Punto").ToString.Replace("POINT (", "").Replace(")", ",")
|
||||
Next
|
||||
ruta = $"LINESTRING({ruta.Substring(0, ruta.Length - 1)})"
|
||||
ruta = SQLToGmaps(ruta, "LINESTRING")
|
||||
RegistraScript($"CreaRuta({ruta})")
|
||||
Else
|
||||
Alert("El grupo seleccionado está vacío", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
RegistraScript("$('#divAgregarTipo').modal('hide');", "1")
|
||||
End If
|
||||
Else
|
||||
If GPS.PuntoDeInteresUpdate(TxtNombre.Text, UsuarioActual.CveCliente, CvePuntoDeInteres, chkEstatus.Checked, TxtDescripcion.Text, HdnGrupo.Value.ToEntero) Then
|
||||
HuboError = False
|
||||
Alert("El punto de interés se actualizó correctamente")
|
||||
RegistraScript("$('#divAgregarTipo').modal('hide');", "1")
|
||||
dvEstatus.Style.Add("display", "none")
|
||||
Else
|
||||
HuboError = True
|
||||
End If
|
||||
End If
|
||||
TxtDescripcion.Text = ""
|
||||
TxtNombre.Text = ""
|
||||
UpBodyTipoEquipo.Update()
|
||||
If HuboError Then
|
||||
GPS.RollBack()
|
||||
Else
|
||||
GPS.Commit()
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function SQLToGmaps(CoordsSQL As String, Tipo As String) As String
|
||||
Dim CoordsPoligono As String = CoordsSQL.Replace($"{Tipo}", "").Replace(")", "").Replace("(", "")
|
||||
Dim CoordsPuntos() As String = CoordsPoligono.Split(","c)
|
||||
Dim Var As String = ""
|
||||
For Each coordenada As String In CoordsPuntos
|
||||
If coordenada Is CoordsPuntos.Last Then
|
||||
Dim latlng() As String = coordenada.Trim.Split(" ")
|
||||
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }}"
|
||||
Else
|
||||
Dim latlng() As String = coordenada.Trim.Split(" ")
|
||||
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }},"
|
||||
End If
|
||||
Next
|
||||
|
||||
If Tipo = "POLYGON" OrElse Tipo = "LINESTRING" Then
|
||||
Var = $"[{Var}]"
|
||||
End If
|
||||
Return Var
|
||||
End Function
|
||||
Protected Sub BtnCalcular_Click(sender As Object, e As EventArgs) Handles BtnCalcularR.Click
|
||||
Dim GPS As New ClsGPS
|
||||
Dim HuboError = False
|
||||
Dim ruta As String = ""
|
||||
|
||||
For Each row As GridViewRow In GvPuntos.Rows
|
||||
If row.FCCheckBox("chkGR").Checked Then
|
||||
ruta += row.DataKey("Punto").ToString.Replace("POINT (", "").Replace(")", ",")
|
||||
End If
|
||||
Next
|
||||
ruta = $"LINESTRING({ruta.Substring(0, ruta.Length - 1)})"
|
||||
ruta = SQLToGmaps(ruta, "LINESTRING")
|
||||
RegistraScript($"CreaRuta({ruta})", "1")
|
||||
RegistraScript("$('#dvConsulta').modal('hide');", "2")
|
||||
|
||||
End Sub
|
||||
'Protected Sub BtnAgregarRuta_Click(sender As Object, e As EventArgs) Handles BtnAgregarRuta.Click
|
||||
' Dim GPS As New ClsGPS
|
||||
' Dim GeoRefString As String = CommandArg.Value
|
||||
' Dim CoordsPuntos() As String = GeoRefString.Split("+"c)
|
||||
' GeoRefString = ""
|
||||
' For Each coordenada As String In CoordsPuntos
|
||||
' If coordenada Is CoordsPuntos.Last Then
|
||||
' Exit For
|
||||
' End If
|
||||
' coordenada = coordenada.Replace("(", "").Replace(")", "")
|
||||
' Dim LatLng() As String = coordenada.Split(","c)
|
||||
' GeoRefString = $"{GeoRefString} {LatLng(1).Trim} {LatLng(0).Trim},"
|
||||
' Next
|
||||
|
||||
' GeoRefString = GeoRefString.Substring(0, GeoRefString.Length - 1)
|
||||
' GeoRefString = $"LINESTRING({GeoRefString})"
|
||||
' If GPS.GeoReferenciaAdd(TxtNomRuta.Text, 7, GeoRefString, "Ruta", True, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, chkLunes.Checked, chkMartes.Checked, chkMiercoles.Checked, chkJueves.Checked, chkViernes.Checked, chkSabado.Checked, chkDomingo.Checked, DateTime.Today, DateTime.Today.AddDays(1), "#0088FF", TxtTolerancia.Text, UsuarioActual.CveCliente) Then
|
||||
' Alert("Se agregó correctamente la Ruta", TipoMensaje.MsgInformacion)
|
||||
' End If
|
||||
|
||||
' CommandArg.Value = ""
|
||||
' GeoRefString = ""
|
||||
' TxtNomRuta.Text = ""
|
||||
' TxtTolerancia.Text = ""
|
||||
' txtFechaI.Text = ""
|
||||
' txtFechaF.Text = ""
|
||||
' TxtHoraF.Text = ""
|
||||
' TxtHoraI.Text = ""
|
||||
' chkLunes.Checked = False
|
||||
' chkMartes.Checked = False
|
||||
' chkMiercoles.Checked = False
|
||||
' chkJueves.Checked = False
|
||||
' chkViernes.Checked = False
|
||||
' chkSabado.Checked = False
|
||||
' chkDomingo.Checked = False
|
||||
' UpdatePanel2.Update()
|
||||
' GPS.Dispose()
|
||||
' RegistraScript("Limpieza();")
|
||||
'End Sub
|
||||
Protected Sub BtnAlerta_Click(sender As Object, e As EventArgs) Handles BtnAlerta.Click
|
||||
Alert("Debido a la falta de caminos entre estos puntos, no es posible calcular la ruta. La siguiente es sólo una representación.", TipoMensaje.MsgAdvertencia)
|
||||
End Sub
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
EsEditar = 1
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
CvePuntoDeInteres = GvRow.DataKey("CvePuntoDeInteres").ToString.ToEntero
|
||||
TxtNombre.Text = GvRow.DataKey("PuntoDeInteres").ToString
|
||||
TxtDescripcion.Text = GvRow.DataKey("Descripcion").ToString
|
||||
dvEstatus.Style.Add("display", "")
|
||||
dvEstatus.Style.Add("display", "")
|
||||
chkEstatus.Checked = CBool(GvRow.DataKey("Estatus").ToString)
|
||||
RegistraScript($"$('#divAgregarTipo').modal();",1)
|
||||
For Each row As GridViewRow In GvGrupos.Rows
|
||||
If row.DataKey("CvePuntoDeInteresGrupo").ToString = GvRow.DataKey("CvePuntoDeInteresGrupo").ToString Then
|
||||
RegistraScript($"CargaDatosSeleccionados({row.RowIndex}, '{row.DataKey("CvePuntoDeInteresGrupo").ToString}');")
|
||||
End If
|
||||
Next
|
||||
UpBodyTipoEquipo.Update()
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GVPuntosInteres.RowDeleting
|
||||
Dim GPS As New ClsGPS
|
||||
Dim CvePuntodeInteres As Integer = GVPuntosInteres.Rows(e.RowIndex).DataKey("CvePuntoDeInteres").ToEntero
|
||||
If GPS.PuntoDeInteresDelete(CvePuntodeInteres, UsuarioActual.CveCliente) Then
|
||||
Alert("El punto de interés se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVPuntosInteres.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CvePuntoDeInteres").ToString
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub LBMostrar_Click(sender As Object, e As EventArgs) Handles LBMostrar.Click
|
||||
For Each row As GridViewRow In GVPuntosInteres.Rows
|
||||
If row.FCCheckBox("chkGR").Checked Then
|
||||
Dim coords = SQLToGmaps(row.DataKey("Punto"), "POINT")
|
||||
RegistraScript($"CreaMarcador({coords}, '{row.DataKey("PuntoDeInteres").ToString}')", row.RowIndex)
|
||||
End If
|
||||
Next
|
||||
RegistraScript("$('#dvEditar').modal('hide');FitBounds();")
|
||||
End Sub
|
||||
End Class
|
||||
3003
GPS/Rastreo.aspx
Normal file
3003
GPS/Rastreo.aspx
Normal file
File diff suppressed because it is too large
Load Diff
2126
GPS/Rastreo.aspx.vb
Normal file
2126
GPS/Rastreo.aspx.vb
Normal file
File diff suppressed because it is too large
Load Diff
3173
GPS/Rastreo2.aspx
Normal file
3173
GPS/Rastreo2.aspx
Normal file
File diff suppressed because it is too large
Load Diff
1933
GPS/Rastreo2.aspx.vb
Normal file
1933
GPS/Rastreo2.aspx.vb
Normal file
File diff suppressed because it is too large
Load Diff
693
GPS/RepCombustible.aspx
Normal file
693
GPS/RepCombustible.aspx
Normal file
@@ -0,0 +1,693 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCombustible.aspx.vb" Inherits="GPS_RepCombustible" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<link href="/Metronic/assets/layouts/layout3/css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||
<style>
|
||||
.amcharts-chart-div >svg {
|
||||
padding-top: 20px;
|
||||
}
|
||||
.amcharts-chart-div >div {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.circuloAmarillo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #c29d0b;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.amarillo {
|
||||
color: #c29d0b;
|
||||
}
|
||||
|
||||
.contenedor {
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
color: #989A8F;
|
||||
width: 450px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.amcharts-chart-div a {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.calificador {
|
||||
height: 270px;
|
||||
width: 75%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.toplistaAmarillo {
|
||||
background-color: #c29d0b;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
#chartdiv {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.tb > tbody > tr {
|
||||
height: 30px !important;
|
||||
}
|
||||
|
||||
#chartdiv > div > div > svg > g:nth-child(15) > g:nth-child(1) {
|
||||
visibility: hidden;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Combustibles
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LinkPDF" runat="server" OnClick="LinkPDF_Click"> <i class="fa fa-ad-pdf"></i> Imprimir</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkHistorial" runat="server" OnClick="LnkHistorial_Click"> <i class="fa fa-ad-excel"></i> Historial</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="Lnkreportegral" runat="server" OnClick="Lnkreportegral_Click"> <i class="fa fa-ad-excel"></i> Reporte</asp:LinkButton>
|
||||
</li>
|
||||
</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>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
Vehiculo:
|
||||
</div>
|
||||
<div class="col-md-3 ">
|
||||
<asp:DropDownList ID="DdlDispositivo" runat="server" DataTextField="NombreVehiculo" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Inicio:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVtxtFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpFechas"></asp:RequiredFieldValidator>
|
||||
|
||||
<%--<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999 00:00" MaskType="DateTime" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>--%>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RFVtxtFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<%-- <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div> <ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>--%>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Fin:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVtxtFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpFechas"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVtxtFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<%--<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999 00:00" MaskType="DateTime" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>--%>
|
||||
</div>
|
||||
<%--<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>--%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<asp:HiddenField ID="HdfVGrafica" ClientIDMode="Static" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel UpdateMode="Conditional" ID="UpReporte" runat="server">
|
||||
<ContentTemplate>
|
||||
<div runat="server" id="DvReporte" visible="false">
|
||||
<asp:UpdatePanel runat="server" ID="UpDash" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<div class="Row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light">
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px; width: 80%;">
|
||||
<span style="font-size: 24px; font-weight: bold; text-align: center">Reporte de combustible de unidad:
|
||||
<asp:Literal ID="LtlUnidad" runat="server"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="#" class="fullscreen" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 green" href="#">
|
||||
<div class="visual">
|
||||
<i class="fa fa-tachometer" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="549">
|
||||
<asp:Literal runat="server" ID="lblVelocidad"></asp:Literal></span> KM/H
|
||||
</div>
|
||||
<div class="desc">Velocidad Máxima</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 blue" href="#">
|
||||
<div class="visual">
|
||||
<i class="material-icons">local_gas_station</i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="1349">
|
||||
<asp:Literal runat="server" ID="lblRendBruto"></asp:Literal></span> KM/L
|
||||
</div>
|
||||
<div class="desc">Rendimiento</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 yellow" href="#">
|
||||
<div class="visual">
|
||||
<i class="fa fa-line-chart"></i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="549">
|
||||
<asp:Literal runat="server" ID="LtlDistanciaR"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="desc">KM Recorridos</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 red" href="#">
|
||||
<div class="visual">
|
||||
<i class="glyphicon glyphicon-tint" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="12.5">
|
||||
<asp:Literal runat="server" ID="LtlCombustibleConsumido"></asp:Literal></span> Lts
|
||||
</div>
|
||||
<div class="desc">Combustible Consumido</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:UpdatePanel ID="UPTabla" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<!-- BEGIN SAMPLE TABLE PORTLET-->
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="portlet light smmallpadding traspasorow bordered" style="margin-top: 48px">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-list"></i>Desglose
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-striped table-bordered table-advance table-hover tb">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Valor</th>
|
||||
<th>
|
||||
<i class="fa fa-flask"></i>Combustible (Lts) </th>
|
||||
<th>
|
||||
<i class="fa fa-usd"></i>Total (MXN)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="highlight">
|
||||
<div class="success"></div>
|
||||
<a style="pointer-events: none; font-weight: bold; color: black">Combustible Inicial</a>
|
||||
</td>
|
||||
<td></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCombustibleInicial" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCostoInicial" runat="server" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="highlight">
|
||||
<div class="info"></div>
|
||||
<asp:LinkButton Style="font-weight: bold" Text="Cargas" runat="server" ID="lbCargas"></asp:LinkButton>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlNoCargas" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="SumaCargas" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCostoCargas" runat="server" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="highlight">
|
||||
<div class="warning"></div>
|
||||
<asp:LinkButton Style="font-weight: bold" Text="Descargas" runat="server" ID="lbDescargas"></asp:LinkButton>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlNoDescargas" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="SumaDescargas" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCostoDescargas" runat="server" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="highlight">
|
||||
<div class="info"></div>
|
||||
<a style="pointer-events: none; font-weight: bold; color: black">Recorrido</a>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlDistancia" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="lCombustibleConsumido" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCostoConsumo" runat="server" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="highlight">
|
||||
<div class="success"></div>
|
||||
<a style="pointer-events: none; font-weight: bold; color: black">Combustible Final</a>
|
||||
</td>
|
||||
<td></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCombustibleFinal" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCostoCombustibleF" runat="server" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="portlet-title">
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered" style="margin-top: 48px">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-red">
|
||||
<i class="fa fa-clock-o font-red"></i>
|
||||
<span class="caption-subject bold uppercase">TIEMPOS OPERATIVOS</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div runat="server" id="bodyreportes" class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">Ralentí: </label>
|
||||
<br />
|
||||
<asp:Literal runat="server" ID="LtlRalenti"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">Tiempo Movimiento: </label>
|
||||
<br />
|
||||
<asp:Literal runat="server" ID="lblMovimiento"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">Tiempo Muerto: </label>
|
||||
<br />
|
||||
<asp:Literal runat="server" ID="lblMuerto"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END SAMPLE TABLE PORTLET-->
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet ">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-area-chart"></i>Historico
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||||
<a href="javascript:;" class="fullscreen " style="visibility: hidden;"></a>
|
||||
<a href="javascript:;" class="fullscreen " style="visibility: hidden;"></a>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div style="text-align: left;">
|
||||
<b>Mostrar(Encendido/Apagado)</b>
|
||||
<asp:CheckBox ID="ChkEncendido" ClientIDMode="Static" Checked="true" Text=" " CssClass="chksino ChkSinFuncion" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<asp:HiddenField ID="HdnChartBase64" runat="server" ClientIDMode="Static" Value="" />
|
||||
<div id="chartdiv"></div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="upDatosComb" runat ="server" UpdateMode="Conditional" Visible="false" >
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GVCombustibleResumen" runat="server" GridLines="None" CssClass ="table table-hover table-striped ScrollAD" AutoGenerateColumns="False"
|
||||
datakeynames="CveTrama,Fecha,Combustible,Encendido,SPD,Detenido,Latitud,Longitud,Suavizado,Grupo">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Fecha">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblfecha" runat="server" Text='<%# Eval("Fecha")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Encendido">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblencendido" runat="server" Text='<%#If(Eval("Encendido").ToString() = "1", "SI", "NO")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Velocidad">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblsPD" runat="server" Text='<%# Eval("SPD")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Detenido">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbldetenido" runat="server" Text='<%#If(Eval("Detenido").ToString() = "1", "SI", "NO")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Grupo" Visible="false">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblgrupo" runat="server" Text='<%# Eval("Grupo")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Combustible">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblcombustible" runat="server" Text='<%# Eval("Combustible")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Suavizado">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblsuavizado" runat="server" Text='<%# Eval("Suavizado")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Ubicación">
|
||||
<ItemTemplate><asp:Label runat="server" Text='<%#String.Format("http://maps.google.com/maps?q={0},{1}&ll={0},{1}&z=17", Eval("Latitud"), Eval("Longitud"))%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:HyperLinkField Visible=" false " HeaderText="Mapa" DataNavigateUrlFields="Latitud,Longitud" DataNavigateUrlFormatString="http://maps.google.com/maps?q={0},{1}&ll={0},{1}&z=17" Text='mapa' />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<!-- EMPIEZA MODAL CARGAS/DESCARGAS -->
|
||||
<div id="dvHistorico" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpHistorico" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="H2" runat="server"><i class="fa fa-bell-o"></i>
|
||||
<asp:Literal runat="server" ID="LtlTituloCD" /></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional" ID="UpdatePanel3">
|
||||
<ContentTemplate>
|
||||
<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="TxtBusquedaHist" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHistorico.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHistorico.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GVHistorico" runat="server" GridLines="None" DataKeyNames="CveEvento" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-heightfijo="300" data-height="300" data-sort="false" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Evento" ItemStyle-Width="20%" HeaderStyle-HorizontalAlign="center" HeaderText="Evento" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:BoundField DataField="FechaTrama" ItemStyle-Width="25%" HeaderStyle-HorizontalAlign="center" HeaderText="Fecha" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Volumen" DataFormatString="{0:###,###.00} Lts" HeaderStyle-HorizontalAlign="center" HeaderText="Volumen (Lts)" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Direccion" HeaderStyle-HorizontalAlign="center" HeaderText="Dirección" ItemStyle-Width="35%" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:HyperLinkField DataNavigateUrlFields="Lat,Lon" HeaderStyle-HorizontalAlign="center" Target="_blank" Text="Ver" HeaderText="Ver en mapa" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="center" DataNavigateUrlFormatString="https://www.google.com/maps/search/{0},{1}/" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="../Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
|
||||
<script>
|
||||
var geocoder;
|
||||
var directionsService;
|
||||
var directionsDisplay;
|
||||
function stringtodate(dateString) {
|
||||
return dateString;
|
||||
}
|
||||
function CargaHistorico() {
|
||||
var data = [];
|
||||
var Gcolor = $('#ChkEncendido').is(':checked') ? "lineColor" : null;
|
||||
eval($("#HdfVGrafica").val());
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"marginRight": 40,
|
||||
"marginLeft": 40,
|
||||
"autoMarginOffset": 20,
|
||||
"dataDateFormat": "YYYY-MM-DD HH:NN:SS",
|
||||
"valueAxes": [{
|
||||
"id": "v1",
|
||||
"axisAlpha": 0,
|
||||
"position": "left",
|
||||
"ignoreAxisWidth": true
|
||||
}],
|
||||
"balloon": {
|
||||
"borderThickness": 1,
|
||||
"shadowAlpha": 0
|
||||
},
|
||||
"graphs": [{
|
||||
"id": "g1",
|
||||
"balloon": {
|
||||
"drop": true,
|
||||
"adjustBorderColor": false,
|
||||
"color": "#ffffff",
|
||||
"type": "smoothedLine"
|
||||
},
|
||||
"fillAlphas": 0.2,
|
||||
"bullet": "round",
|
||||
"bulletBorderAlpha": 1,
|
||||
"bulletColor": "#FFFFFF",
|
||||
"bulletSize": 5,
|
||||
"hideBulletsCount": 50,
|
||||
"lineThickness": 2,
|
||||
"title": "red line",
|
||||
//"useLineColorForBulletBorder": true,
|
||||
"valueField": "value",
|
||||
"lineColorField": Gcolor,
|
||||
"fillColorsField": Gcolor,
|
||||
"balloonText": "<span style='font-size:18px;'>[[value]]</span><br/>T1:[[valuet1]]<br/>T2:[[valuet2]]"
|
||||
}],
|
||||
"chartScrollbar": {},
|
||||
"chartCursor": {
|
||||
"valueLineEnabled": true,
|
||||
"valueLineBalloonEnabled": true,
|
||||
"cursorAlpha": 0,
|
||||
"zoomable": false,
|
||||
"valueZoomable": true,
|
||||
"valueLineAlpha": 0.5
|
||||
},
|
||||
"categoryField": "date",
|
||||
"categoryAxis": {
|
||||
|
||||
"parseDates": false,
|
||||
"dashLength": 1,
|
||||
"minorGridEnabled": true,
|
||||
},
|
||||
"export": {
|
||||
"enabled": true,
|
||||
"menu": []
|
||||
},
|
||||
"dataProvider": data
|
||||
});
|
||||
exportChart(chart);
|
||||
}
|
||||
function exportChart(chart) {
|
||||
chart["export"].capture({}, function () {
|
||||
|
||||
// SAVE TO PNG
|
||||
this.toPNG({}, function (base64) {
|
||||
$("#HdnChartBase64").val(base64);
|
||||
});
|
||||
});
|
||||
}
|
||||
function GetDireccionesGV(posicion, indice, index) {
|
||||
setTimeout(function () {
|
||||
var tr = $(indice)
|
||||
var lat = posicion.lat;
|
||||
var lng = posicion.lng;
|
||||
if ($())
|
||||
var url = '<%= ClsPaginas.UrlDirecciones%>' + 'nominatim/reverse.php?format=jsonv2&lat=' + lat + '&lon=' + lng;
|
||||
$.getJSON(url, function (data) {
|
||||
if (typeof (data.error) === 'undefined') {
|
||||
tr.find("td").filter(':nth-child(4)').html(data.display_name);
|
||||
} else {
|
||||
tr.find("td").filter(':nth-child(4)').html("No se encontró la dirección");
|
||||
}
|
||||
});
|
||||
}, 250 * index);
|
||||
}
|
||||
|
||||
function CargaPickers() {
|
||||
$.datetimepicker.setLocale('es');
|
||||
$('input.ADDateTimePicker').each(function () {
|
||||
var TThis = $(this);
|
||||
TThis.datetimepicker({
|
||||
dayOfWeekStart: 1,
|
||||
lang: 'es',
|
||||
format: 'd/m/Y H:i',
|
||||
formatDate: 'd/m/Y H:i',
|
||||
step: 30
|
||||
});
|
||||
var Div = TThis.parent()
|
||||
var boton = document.createElement('span');
|
||||
boton.className = "input-group-btn"
|
||||
|
||||
var subboton = document.createElement('a')
|
||||
subboton.className = "btn default"
|
||||
subboton.innerHTML = "<i class='fa fa-calendar'></i>"
|
||||
subboton.addEventListener('click', function () {
|
||||
TThis.datetimepicker('show')
|
||||
});
|
||||
boton.appendChild(subboton)
|
||||
|
||||
var agregar = true;
|
||||
for (var i = 0; i < Div[0].children.length; i++) {
|
||||
if (Div[0].children[i].isEqualNode(boton)) {
|
||||
agregar = false;
|
||||
}
|
||||
}
|
||||
if (agregar) {
|
||||
Div[0].appendChild(boton);
|
||||
}
|
||||
//Div[0].appendChild(boton)
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
function loadchecked() {
|
||||
$(".ChkSinFuncion").change(function () {
|
||||
Metronic.blockUI({ animate: true });
|
||||
setTimeout(function () {
|
||||
try {
|
||||
|
||||
CargaHistorico();
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
Metronic.unblockUI();
|
||||
}, 1);
|
||||
});
|
||||
$(".ChkSinFuncion").removeClass('ChkSinFuncion')
|
||||
}
|
||||
|
||||
Sys.Application.add_load(function (s, e) {
|
||||
CargaPickers();
|
||||
loadchecked()
|
||||
});
|
||||
$(document).ready(function () {
|
||||
geocoder = new google.maps.Geocoder();
|
||||
CargaPickers();
|
||||
loadchecked()
|
||||
});
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places">
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
442
GPS/RepCombustible.aspx.vb
Normal file
442
GPS/RepCombustible.aspx.vb
Normal file
@@ -0,0 +1,442 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Net
|
||||
Imports Newtonsoft.Json.Linq
|
||||
Imports System.IO
|
||||
|
||||
Partial Class GPS_RepCombustible
|
||||
Inherits ClsPaginas
|
||||
#Region "P R O P I E D A D E S"
|
||||
Property DTDatos As DataTable
|
||||
Get
|
||||
If ViewState("DTDatos") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTDatos"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CveDispositivo As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveDispositivo"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveDispositivo") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property FechaI As DateTime
|
||||
Get
|
||||
Return CType(ViewState("FechaI"), DateTime)
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
ViewState("FechaI") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property FechaF As DateTime
|
||||
Get
|
||||
Return CType(ViewState("FechaF"), DateTime)
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
ViewState("FechaF") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DTCargas As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTCargas"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTCargas") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DTDescargas As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTDescargas"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDescargas") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDispositivos()
|
||||
txtFechaI.Text = $"{Now.FirstDayOfMonth.ToString("dd/MM/yyyy")} 00:00"
|
||||
txtFechaF.Text = $"{Now.LastDayOfMonth.ToString("dd/MM/yyyy")} 00:00"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "C O M B O S"
|
||||
Private Sub CargaDispositivos()
|
||||
DdlDispositivo.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("TieneCombustible = 1")
|
||||
'Dim GPS As New ClsGPS
|
||||
|
||||
'If GPS.DispositivosGet(-1, 1, UsuarioActual.CveCliente) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
' DdlDispositivo.DataSource = GPS.DtResultados.FiltraParametros("TieneCombustible = 1")
|
||||
'End If
|
||||
'GPS.Dispose()
|
||||
DdlDispositivo.DataBind()
|
||||
DdlDispositivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
LtlUnidad.Text = DdlDispositivo.SelectedItem.Text
|
||||
CveDispositivo = DdlDispositivo.SelectedValue.ToEntero()
|
||||
FechaI = txtFechaI.Text.ToDateTime
|
||||
FechaF = txtFechaF.Text.ToDateTime
|
||||
'UpReportes.Update()
|
||||
Dim GPS As New ClsGPS
|
||||
HdfVGrafica.Value = "data=[]"
|
||||
If GPS.RepCombustibleGet(DdlDispositivo.SelectedValue.ToEntero(), FechaI, FechaF) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
Dim Arow As DataRow = GPS.DtResultados.Rows(0)
|
||||
Dim TotalKilometros As Decimal = (Arow("Distancia").ToString().ToDecimal()) / 1000
|
||||
Dim CombustibleConsumido As Decimal = $"{(Arow("CombustibleInicial").ToString().ToDecimal() + Arow("SumaCargas").ToString().ToDecimal()) - Arow("CombustibleFinal").ToString().ToDecimal():N2}"
|
||||
Dim RendBruto As Decimal = If(CombustibleConsumido > 0, TotalKilometros / CombustibleConsumido, 0) '2.8
|
||||
Dim CostoCombustible As Decimal = GlobalDTDispositivos(-1).FiltroPrimeroValor("CostoCombustible", $"CveDispositivo = {DdlDispositivo.SelectedValue}").ToDecimal
|
||||
LtlDistancia.Text = TotalKilometros.ToString().FormatoNumero()
|
||||
lblVelocidad.Text = $"{GPS.DtResultados.Rows(0)("VelocidadMaxima").ToString().FormatoNumero()}"
|
||||
lblRendBruto.Text = $"{RendBruto.ToString().FormatoNumero()}"
|
||||
LtlCombustibleConsumido.Text = CombustibleConsumido.ToString().FormatoNumero()
|
||||
LtlCombustibleInicial.Text = $"{Arow("CombustibleInicial").ToString().ToDecimal():N2}"
|
||||
LtlCombustibleFinal.Text = GPS.DtResultados.Rows(0)("CombustibleFinal").ToString().FormatoNumero()
|
||||
LtlNoCargas.Text = $"{Arow("Cargas").ToString().ToDecimal():N2}"
|
||||
LtlNoDescargas.Text = $"{Arow("Descargas").ToString().ToDecimal():N2}"
|
||||
SumaCargas.Text = $"{Arow("SumaCargas").ToString().ToDecimal():N2}"
|
||||
LtlCostoCargas.Text = $"{Arow("SumaCargas").ToString().ToDecimal() * CostoCombustible:N2}"
|
||||
SumaDescargas.Text = $"{Arow("SumaDescargas").ToString().ToDecimal():N2}"
|
||||
LtlCostoDescargas.Text = $"{Arow("SumaDescargas").ToString().ToDecimal() * CostoCombustible:N2}"
|
||||
LtlDistanciaR.Text = TotalKilometros.ToString().FormatoNumero()
|
||||
lCombustibleConsumido.Text = $"{(CombustibleConsumido - Arow("SumaDescargas").ToString().ToDecimal()):N2}"
|
||||
LtlCostoConsumo.Text = $"${((CombustibleConsumido - Arow("SumaDescargas").ToString().ToDecimal()) * CostoCombustible).ToString().FormatoNumero()}"
|
||||
LtlCostoCombustibleF.Text = $"${(GPS.DtResultados.Rows(0)("CombustibleFinal").ToString().ToDecimal * CostoCombustible).ToString().FormatoNumero()}"
|
||||
LtlCostoInicial.Text = $"${(GPS.DtResultados.Rows(0)("CombustibleInicial").ToString().ToDecimal * CostoCombustible).ToString().FormatoNumero()}"
|
||||
lblMuerto.Text = $"{((DateDiff(DateInterval.Minute, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime).ToString() - GPS.DtResultados.Rows(0)("Horas").ToString().ToLong) / 60).ToString().FormatoNumero()} Hrs."
|
||||
lblMovimiento.Text = $"{(GPS.DtResultados.Rows(0)("Horas").ToString().ToDecimal / 60).ToString().FormatoNumero()} Hrs"
|
||||
LtlRalenti.Text = $"{GPS.DtResultados.Rows(0)("TiempoRalentiHoras").ToString().FormatoNumero()} Hrs. ({GPS.DtResultados.Rows(0)("TiempoRalentiMinutos").ToString()} Minutos)"
|
||||
CargaHistorico(GPS)
|
||||
DvReporte.Visible = True
|
||||
'lblRendEfectivo.Text = $"{(RendBruto + 1).ToString().FormatoNumero()} KM/L"
|
||||
End If
|
||||
GPS.Dispose()
|
||||
UpReporte.Update()
|
||||
UpDash.Update()
|
||||
UPTabla.Update()
|
||||
upDatosComb.Update()
|
||||
' bodyreportes.Visible = True
|
||||
' UpReportes.Update()
|
||||
End Sub
|
||||
Private Sub CargaHistorico(ByRef GPS As ClsGPS)
|
||||
|
||||
If GPS.GetCombustibleHistorico(DdlDispositivo.SelectedValue.ToEntero(), txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime) Then
|
||||
Dim json As New StringBuilder
|
||||
json.Append("data=[")
|
||||
Dim color As String = ""
|
||||
Dim encencido As Int16 = -1
|
||||
Dim encencidoC As Int16 = -1
|
||||
For Each gvrow As DataRow In GPS.DtResultados.Rows
|
||||
encencidoC = gvrow("Encendido").ToString().ToEntero()
|
||||
If encencido <> encencidoC Then
|
||||
If encencidoC = 1 Then
|
||||
color = ",lineColor:""#2498d2"""
|
||||
'color = ",lineColor:""#b7e021"""
|
||||
Else
|
||||
color = ",lineColor:""#F3565D"""
|
||||
'color = ",lineColor:""#2498d2"""
|
||||
End If
|
||||
Else
|
||||
color = ""
|
||||
End If
|
||||
encencido = encencidoC
|
||||
json.Append($",{{date: stringtodate(""{DirectCast(gvrow("FechaTrama"), DateTime).ToString("yyyy-MM-dd HH:mm:ss")}""), value: {gvrow("Valor").ToString().ToDecimal()}")
|
||||
json.Append($",valuet1: {gvrow("ValorT1").ToString().ToDecimal()}, valuet2: {gvrow("ValorT2").ToString().ToDecimal()} {color}}}")
|
||||
Next
|
||||
json.Append(" ]")
|
||||
json.Remove(6, 1)
|
||||
HdfVGrafica.Value = json.ToString()
|
||||
RegistraScript($"CargaHistorico()")
|
||||
End If
|
||||
End Sub
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Protected Sub lbCargas_Click(sender As Object, e As EventArgs) Handles lbCargas.Click
|
||||
LtlTituloCD.Text = $"Desglose de cargas de combustible: {LtlUnidad.Text}"
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.GetCargasDescargas(CveDispositivo, FechaI, FechaF, 69) Then
|
||||
GVHistorico.DataSource = GPS.DtResultados
|
||||
DTCargas = GPS.DtResultados
|
||||
Else
|
||||
GVHistorico.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GVHistorico.DataBind()
|
||||
UpdatePanel3.Update()
|
||||
UpHistorico.Update()
|
||||
RegistraScript("$('#dvHistorico').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub lbDesCargas_Click(sender As Object, e As EventArgs) Handles lbDescargas.Click
|
||||
LtlTituloCD.Text = $"Desglose de descargas de combustible: {LtlUnidad.Text}"
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.GetCargasDescargas(CveDispositivo, FechaI, FechaF, 74) Then
|
||||
GVHistorico.DataSource = GPS.DtResultados
|
||||
DTDescargas = GPS.DtResultados
|
||||
Else
|
||||
GVHistorico.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GVHistorico.DataBind()
|
||||
UpdatePanel3.Update()
|
||||
UpHistorico.Update()
|
||||
RegistraScript("$('#dvHistorico').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub GVHistorico_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVHistorico.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim RowID As String = $"row{e.Row.RowIndex}"
|
||||
e.Row.Attributes("id") = RowID
|
||||
RegistraScript($"GetDireccionesGV({{ lat: {e.Row.DBCampo("Lat").ToString()}, lng: {e.Row.DBCampo("Lon").ToString() }}}, '#{RowID}', {e.Row.RowIndex});", $"{RowID}")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub EnviarReporteProgramado()
|
||||
Dim DTHistorico As DataTable = Nothing
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.GetCargasDescargas(CveDispositivo, FechaI, FechaF, -1) Then
|
||||
DTHistorico = GPS.DtResultados.Copy()
|
||||
End If
|
||||
GPS.Dispose()
|
||||
|
||||
'DTHistorico.Columns.Add(New DataColumn("Direccion", GetType(String)))
|
||||
|
||||
If DTHistorico IsNot Nothing AndAlso DTHistorico.Rows.Count > 0 Then
|
||||
|
||||
Dim DireccionJSON As String = ""
|
||||
Dim request As WebRequest
|
||||
Dim js As JObject = Nothing
|
||||
|
||||
For Each Row As DataRow In DTHistorico.Rows
|
||||
Try
|
||||
request = WebRequest.Create(String.Format("{0}nominatim/reverse.php?format=jsonv2&lat={1}&lon={2}", ClsPaginas.UrlDirecciones, Row("Lat"), Row("Lon")))
|
||||
request.Method = "GET"
|
||||
Dim response As WebResponse = request.GetResponse()
|
||||
Dim inputstream1 As Stream = response.GetResponseStream()
|
||||
Dim reader As New StreamReader(inputstream1)
|
||||
DireccionJSON = reader.ReadToEnd
|
||||
inputstream1.Dispose()
|
||||
reader.Close()
|
||||
response.Close()
|
||||
request = Nothing
|
||||
js = JObject.Parse(DireccionJSON)
|
||||
If js IsNot Nothing Then
|
||||
Row("Direccion") = js("display_name").ToString()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
GuardaLog(ex.ToString)
|
||||
End Try
|
||||
Next
|
||||
|
||||
Dim retorno As Byte()
|
||||
Dim RutaReporte = "Empresas/Grales/ReportesProgramados/RPCombustible.rdlc"
|
||||
|
||||
Try
|
||||
Dim RptParametro As New List(Of ReportParameter)
|
||||
|
||||
RptParametro.Add(New ReportParameter("Equipo", LtlUnidad.Text))
|
||||
|
||||
RptParametro.Add(New ReportParameter("FechaInicio", FechaI.ToString("dd/MM/yyyy HH:mm")))
|
||||
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToString("dd/MM/yyyy HH:mm")))
|
||||
RptParametro.Add(New ReportParameter("ChartBase64", HdnChartBase64.Value, True))
|
||||
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||
RptParametro.Add(New ReportParameter("FechaImpresion", Now.ToString("dd/MM/yyyy")))
|
||||
|
||||
RptParametro.Add(New ReportParameter("ComInicialLTS", LtlCombustibleInicial.Text))
|
||||
RptParametro.Add(New ReportParameter("ComInicialTotal", LtlCostoInicial.Text))
|
||||
|
||||
RptParametro.Add(New ReportParameter("CargasValor", LtlNoCargas.Text))
|
||||
RptParametro.Add(New ReportParameter("CargasLTS", SumaCargas.Text))
|
||||
RptParametro.Add(New ReportParameter("CargasTotal", LtlCostoCargas.Text))
|
||||
|
||||
RptParametro.Add(New ReportParameter("DescargasValor", LtlNoCargas.Text))
|
||||
RptParametro.Add(New ReportParameter("DescargasLTS", SumaDescargas.Text))
|
||||
RptParametro.Add(New ReportParameter("DescargasTotal", LtlCostoCargas.Text))
|
||||
|
||||
RptParametro.Add(New ReportParameter("RecoValor", LtlDistancia.Text))
|
||||
RptParametro.Add(New ReportParameter("RecoLTS", lCombustibleConsumido.Text))
|
||||
RptParametro.Add(New ReportParameter("RecoTotal", LtlCostoConsumo.Text))
|
||||
|
||||
RptParametro.Add(New ReportParameter("ComFinalLTS", LtlCombustibleFinal.Text))
|
||||
RptParametro.Add(New ReportParameter("ComFinalTotal", LtlCostoCombustibleF.Text))
|
||||
|
||||
|
||||
RptParametro.Add(New ReportParameter("VMax", lblVelocidad.Text))
|
||||
RptParametro.Add(New ReportParameter("Rendimiento", lblRendBruto.Text))
|
||||
RptParametro.Add(New ReportParameter("KMRecorridos", LtlDistanciaR.Text))
|
||||
RptParametro.Add(New ReportParameter("ComConsumido", LtlCombustibleConsumido.Text))
|
||||
|
||||
retorno = StreamPDF(RutaReporte, DTHistorico, RptParametro, "ReporteProgramado", "PDF", MR:=Nothing, RDSName:="DsOC")
|
||||
|
||||
ImprimirbytesPDF(retorno, "ReporteCombustible")
|
||||
|
||||
Catch ex As Exception
|
||||
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||
End Try
|
||||
Else
|
||||
Alert("No se pudo imprimir el pdf, ya que no se ha hecho una consulta, o ésta no arrojó resultados.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Protected Sub LinkPDF_Click(sender As Object, e As EventArgs)
|
||||
EnviarReporteProgramado()
|
||||
End Sub
|
||||
Protected Sub LnkHistorial_Click(sender As Object, e As EventArgs)
|
||||
Dim GPS As New ClsGPS
|
||||
GPS.GetCombustibleResumen(DdlDispositivo.SelectedValue.ToEntero(), txtFechaI.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), txtFechaF.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"))
|
||||
GVCombustibleResumen.DataSource = GPS.DtResultados
|
||||
GVCombustibleResumen.DataBind()
|
||||
GPS.Dispose()
|
||||
GVCombustibleResumen.ExportToExcel2("Historial")
|
||||
End Sub
|
||||
Protected Sub Lnkreportegral_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim GloBalFileUrl As String = HttpContext.Current.Server.MapPath("~")
|
||||
Dim file As String = $"{GloBalFileUrl}Empresas\Grales\Formatos\CombustibleGeneral.xlsx"
|
||||
Try
|
||||
Dim wb As New ClosedXML.Excel.XLWorkbook(file)
|
||||
Dim libro = wb.Worksheets(0)
|
||||
Dim NombreCliente As String = ""
|
||||
Using ObjClientes As New ClsClientes()
|
||||
If ObjClientes.GetClientes(UsuarioActual.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, -1) Then
|
||||
NombreCliente = ObjClientes.DtResultados.Rows(0)("Nombre").ToString()
|
||||
End If
|
||||
End Using
|
||||
libro.Cell(1, 3).Value = NombreCliente
|
||||
libro.Cell(2, 3).Value = "Reporte de Combustible"
|
||||
libro.Cell(4, 12).Value = DateTime.Now.ToString("dd/MM/yyyy")
|
||||
libro.Cell(4, 4).Value = txtFechaI.Text
|
||||
libro.Cell(5, 4).Value = txtFechaF.Text
|
||||
Dim cRow As Integer = 9
|
||||
|
||||
Dim FechaI As String = txtFechaI.Text.ToDateTime
|
||||
Dim FechaF As String = txtFechaF.Text.ToDateTime
|
||||
Using GPS As New ClsGPS()
|
||||
For Each item In DdlDispositivo.Items
|
||||
CveDispositivo = item.value.ToString().ToEntero()
|
||||
If CveDispositivo > 0 Then
|
||||
|
||||
cRow = cRow + 1
|
||||
Dim vehiculo As String = item.Text
|
||||
Dim VelocidadMaxima As String = "VelocidadMaxima"
|
||||
Dim Rendimiento As String = "Rendimiento"
|
||||
Dim KMRecorridos As String = "KMRecorridos"
|
||||
Dim CombustibleConsumido As String = "CombustibleConsumido"
|
||||
Dim Ralenti As String = "Ralenti"
|
||||
Dim TiempoMovto As String = "TiempoMovto"
|
||||
Dim TiempoMuerto As String = "TiempoMuerto"
|
||||
Dim CILts As String = "CILts"
|
||||
Dim CITotal As String = "CITotal"
|
||||
Dim CFLts As String = "CFLts"
|
||||
Dim CFTotal As String = "CFTotal"
|
||||
Dim CargaValor As String = "CargaValor"
|
||||
Dim CargaLts As String = "CargaLts"
|
||||
Dim CargaTotal As String = "CargaTotal"
|
||||
Dim DesCargaValor As String = "DesCargaValor"
|
||||
Dim DesCargaLts As String = "DesCargaLts"
|
||||
Dim DesCargaTotal As String = "DesCargaTotal"
|
||||
Dim RecorridoValor As String = "RecorridoValor"
|
||||
Dim RecorridoLts As String = "RecorridoLts"
|
||||
Dim RecorridoTotal As String = "RecorridoTotal"
|
||||
|
||||
|
||||
If GPS.RepCombustibleGet(CveDispositivo, FechaI, FechaF) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
Dim Arow As DataRow = GPS.DtResultados.Rows(0)
|
||||
Dim TotalKilometros As Decimal = (Arow("Distancia").ToString().ToDecimal()) / 1000
|
||||
Dim CostoCombustible As Decimal = GlobalDTDispositivos(-1).FiltroPrimeroValor("CostoCombustible", $"CveDispositivo = {CveDispositivo}").ToDecimal
|
||||
Dim CombustibleConsumidoCC As Decimal = $"{(Arow("CombustibleInicial").ToString().ToDecimal() + Arow("SumaCargas").ToString().ToDecimal()) - Arow("CombustibleFinal").ToString().ToDecimal():N2}"
|
||||
VelocidadMaxima = $"{GPS.DtResultados.Rows(0)("VelocidadMaxima").ToString().FormatoNumero():N2}"
|
||||
Rendimiento = $"{If(CombustibleConsumidoCC > 0, TotalKilometros / CombustibleConsumidoCC, 0):N2}"
|
||||
KMRecorridos = $"{TotalKilometros:N2}"
|
||||
CombustibleConsumido = $"{(Arow("CombustibleInicial").ToString().ToDecimal() + Arow("SumaCargas").ToString().ToDecimal()) - Arow("CombustibleFinal").ToString().ToDecimal():N2}"
|
||||
Ralenti = $"{GPS.DtResultados.Rows(0)("TiempoRalentiHoras").ToString().FormatoNumero()} Hrs. ({GPS.DtResultados.Rows(0)("TiempoRalentiMinutos").ToString()} Minutos)"
|
||||
TiempoMovto = $"{(GPS.DtResultados.Rows(0)("Horas").ToString().ToDecimal / 60).ToString().FormatoNumero()} Hrs"
|
||||
TiempoMuerto = $"{((DateDiff(DateInterval.Minute, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime).ToString() - GPS.DtResultados.Rows(0)("Horas").ToString().ToLong) / 60).ToString().FormatoNumero()} Hrs."
|
||||
CILts = $"{Arow("CombustibleInicial").ToString().ToDecimal():N2}"
|
||||
CITotal = $"{(GPS.DtResultados.Rows(0)("CombustibleInicial").ToString().ToDecimal * CostoCombustible).ToString().FormatoNumero()}"
|
||||
CFLts = GPS.DtResultados.Rows(0)("CombustibleFinal").ToString().FormatoNumero()
|
||||
CFTotal = $"{(GPS.DtResultados.Rows(0)("CombustibleFinal").ToString().ToDecimal * CostoCombustible).ToString().FormatoNumero()}"
|
||||
CargaValor = $"{Arow("Cargas").ToString().ToDecimal():N2}"
|
||||
CargaLts = $"{Arow("SumaCargas").ToString().ToDecimal():N2}"
|
||||
CargaTotal = $"{Arow("SumaCargas").ToString().ToDecimal() * CostoCombustible:N2}"
|
||||
DesCargaValor = $"{Arow("Descargas").ToString().ToDecimal():N2}"
|
||||
DesCargaLts = $"{Arow("SumaDescargas").ToString().ToDecimal():N2}"
|
||||
DesCargaTotal = $"{Arow("SumaDescargas").ToString().ToDecimal() * CostoCombustible:N2}"
|
||||
RecorridoValor = TotalKilometros.ToString().FormatoNumero()
|
||||
RecorridoLts = $"{(CombustibleConsumido - Arow("SumaDescargas").ToString().ToDecimal()):N2}"
|
||||
RecorridoTotal = $"{((CombustibleConsumido - Arow("SumaDescargas").ToString().ToDecimal()) * CostoCombustible).ToString().FormatoNumero()}"
|
||||
End If
|
||||
|
||||
libro.Cell(cRow, 1).Value = vehiculo
|
||||
libro.Cell(cRow, 2).Value = VelocidadMaxima
|
||||
libro.Cell(cRow, 3).Value = Rendimiento
|
||||
libro.Cell(cRow, 4).Value = KMRecorridos
|
||||
libro.Cell(cRow, 5).Value = CombustibleConsumido
|
||||
libro.Cell(cRow, 6).Value = Ralenti
|
||||
libro.Cell(cRow, 7).Value = TiempoMovto
|
||||
libro.Cell(cRow, 8).Value = TiempoMuerto
|
||||
libro.Cell(cRow, 9).Value = CILts
|
||||
libro.Cell(cRow, 10).Value = CITotal
|
||||
libro.Cell(cRow, 10).Style.NumberFormat.Format = "$* #,##0.00"
|
||||
libro.Cell(cRow, 11).Value = CFLts
|
||||
libro.Cell(cRow, 12).Value = CFTotal
|
||||
libro.Cell(cRow, 12).Style.NumberFormat.Format = "$* #,##0.00"
|
||||
libro.Cell(cRow, 13).Value = CargaValor
|
||||
libro.Cell(cRow, 14).Value = CargaLts
|
||||
libro.Cell(cRow, 15).Value = CargaTotal
|
||||
libro.Cell(cRow, 15).Style.NumberFormat.Format = "$* #,##0.00"
|
||||
libro.Cell(cRow, 16).Value = DesCargaValor
|
||||
libro.Cell(cRow, 17).Value = DesCargaLts
|
||||
libro.Cell(cRow, 18).Value = DesCargaTotal
|
||||
libro.Cell(cRow, 18).Style.NumberFormat.Format = "$* #,##0.00"
|
||||
libro.Cell(cRow, 19).Value = RecorridoValor
|
||||
libro.Cell(cRow, 20).Value = RecorridoLts
|
||||
libro.Cell(cRow, 21).Value = RecorridoTotal
|
||||
libro.Cell(cRow, 21).Style.NumberFormat.Format = "$* #,##0.00"
|
||||
End If
|
||||
Next
|
||||
|
||||
End Using
|
||||
|
||||
|
||||
Dim fs As Stream = New MemoryStream()
|
||||
wb.SaveAs(fs)
|
||||
fs.Position = 0
|
||||
Dim memoryStream As New MemoryStream()
|
||||
Using input As Stream = fs
|
||||
input.CopyTo(memoryStream)
|
||||
End Using
|
||||
memoryStream.Position = 0
|
||||
|
||||
Response.Clear()
|
||||
Response.Buffer = True
|
||||
|
||||
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
Response.AddHeader("content-disposition", String.Format("attachment;filename={0}.xlsx", "Reporte de Historial de Movimientos"))
|
||||
Response.BinaryWrite(memoryStream.ToArray())
|
||||
Response.End()
|
||||
Catch ex As Exception
|
||||
Alert("Ocurrio un error al generar el reporte de combustible" & ex.ToString())
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
731
GPS/RepCombustible2.aspx
Normal file
731
GPS/RepCombustible2.aspx
Normal file
@@ -0,0 +1,731 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCombustible2.aspx.vb" Inherits="GPS_RepCombustible2" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||
<style>
|
||||
#balloon {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border: 1px solid #ccc;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
padding: 6px;
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
margin: 20px 0 0 20px;
|
||||
}
|
||||
.circuloAmarillo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #c29d0b;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.amarillo {
|
||||
color: #c29d0b;
|
||||
}
|
||||
|
||||
.contenedor {
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
color: #989A8F;
|
||||
width: 450px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.amcharts-chart-div a {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
svg:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.calificador {
|
||||
height: 270px;
|
||||
width: 75%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.toplistaAmarillo {
|
||||
background-color: #c29d0b;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
#chartdiv {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
.tb > tbody > tr {
|
||||
height: 30px !important;
|
||||
}
|
||||
|
||||
#chartdiv > div > div > svg > g:nth-child(15) > g:nth-child(1) {
|
||||
visibility: hidden;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Combustibles
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LinkPDF" runat="server"> <i class="fa fa-ad-pdf"></i> Imprimir</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Exportar Excel</asp:LinkButton>
|
||||
</li>
|
||||
</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>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<div class="col-md-1 truncate">
|
||||
Vehiculo:
|
||||
</div>
|
||||
<div class="col-md-3 ">
|
||||
<asp:DropDownList ID="DdlDispositivo" runat="server" DataTextField="NombreVehiculo" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Inicio:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Fin:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<asp:HiddenField ID="HdfGrafica" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel UpdateMode="Conditional" ID="UpReporte" runat="server">
|
||||
<ContentTemplate>
|
||||
<div runat="server" id="DvReporte" visible="false">
|
||||
<asp:UpdatePanel runat="server" ID="UpDash" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<div class="Row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light">
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px; width: 80%;">
|
||||
<span style="font-size: 24px; font-weight: bold; text-align: center">Reporte de combustible de unidad:
|
||||
<asp:Literal ID="LtlUnidad" runat="server"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="#" class="fullscreen" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 green" href="#">
|
||||
<div class="visual">
|
||||
<i class="fa fa-tachometer" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="549">
|
||||
<asp:Literal runat="server" ID="lblVelocidad"></asp:Literal></span> KM/H
|
||||
</div>
|
||||
<div class="desc">Velocidad Máxima</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 blue" href="#">
|
||||
<div class="visual">
|
||||
<i class="material-icons">local_gas_station</i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="1349">
|
||||
<asp:Literal runat="server" ID="lblRendBruto"></asp:Literal></span> KM/L
|
||||
</div>
|
||||
<div class="desc">Rendimiento</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 yellow" href="#">
|
||||
<div class="visual">
|
||||
<i class="fa fa-line-chart"></i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="549">
|
||||
<asp:Literal runat="server" ID="LtlDistanciaR"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="desc">KM Recorridos</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 red" href="#">
|
||||
<div class="visual">
|
||||
<i class="glyphicon glyphicon-tint" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="12.5">
|
||||
<asp:Literal runat="server" ID="LtlCombustibleConsumido"></asp:Literal></span> Lts
|
||||
</div>
|
||||
<div class="desc">Combustible Consumido</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel ID="UPTabla" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<!-- BEGIN SAMPLE TABLE PORTLET-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet" style="margin-top: 7px">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-list"></i>Desglose
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-striped table-bordered table-advance table-hover tb">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Valor</th>
|
||||
<th>
|
||||
<i class="fa fa-flask"></i>Combustible (Lts) </th>
|
||||
<th>
|
||||
<i class="fa fa-usd"></i>Total (MXN)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="highlight">
|
||||
<div class="success"></div>
|
||||
<a style="pointer-events: none; font-weight: bold; color: black">Combustible Inicial</a>
|
||||
</td>
|
||||
<td></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCombustibleInicial" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCostoInicial" runat="server" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="highlight">
|
||||
<div class="info"></div>
|
||||
<asp:LinkButton Style="font-weight: bold" Text="Cargas" runat="server" ID="lbCargas" OnClick="lbCargas_Click"></asp:LinkButton>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlNoCargas" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="SumaCargas" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCostoCargas" runat="server" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="highlight">
|
||||
<div class="warning"></div>
|
||||
<asp:LinkButton Style="font-weight: bold" Text="Descargas" runat="server" ID="lbDescargas" OnClick="lbDesCargas_Click"></asp:LinkButton>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlNoDescargas" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="SumaDescargas" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCostoDescargas" runat="server" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="highlight">
|
||||
<div class="info"></div>
|
||||
<a style="pointer-events: none; font-weight: bold; color: black">Recorrido</a>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlDistancia" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="lCombustibleConsumido" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCostoConsumo" runat="server" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="highlight">
|
||||
<div class="success"></div>
|
||||
<a style="pointer-events: none; font-weight: bold; color: black">Combustible Final</a>
|
||||
</td>
|
||||
<td></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCombustibleFinal" runat="server" /></td>
|
||||
<td style="text-align: right">
|
||||
<asp:Literal ID="LtlCostoCombustibleF" runat="server" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-red">
|
||||
<i class="fa fa-clock-o font-red"></i>
|
||||
<span class="caption-subject bold uppercase">TIEMPOS OPERATIVOS</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div runat="server" id="bodyreportes" class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">Ralentí: </label>
|
||||
<br />
|
||||
<asp:Literal runat="server" ID="LtlRalenti"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">Tiempo Movimiento: </label>
|
||||
<br />
|
||||
<asp:Literal runat="server" ID="lblMovimiento"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">Tiempo Muerto: </label>
|
||||
<br />
|
||||
<asp:Literal runat="server" ID="lblMuerto"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END SAMPLE TABLE PORTLET-->
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<div id="chartdiv">
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<!-- EMPIEZA MODAL CARGAS/DESCARGAS -->
|
||||
<div id="dvHistorico" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpHistorico" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="H2" runat="server"><i class="fa fa-bell-o"></i>
|
||||
<asp:Literal runat="server" ID="LtlTituloCD" /></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional" ID="UpdatePanel3">
|
||||
<ContentTemplate>
|
||||
<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="TxtBusquedaHist" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHistorico.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHistorico.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GVHistorico" runat="server" GridLines="None"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-heightfijo="300" data-height="300" data-sort="false" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="FechaInicio" ItemStyle-Width="25%" HeaderStyle-HorizontalAlign="center" HeaderText="Fecha Inicio" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="FechaFin" ItemStyle-Width="25%" HeaderStyle-HorizontalAlign="center" HeaderText="Fecha Fin" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Combustible" DataFormatString="{0:###,###.00} Lts" HeaderStyle-HorizontalAlign="center" HeaderText="Volumen (Lts)" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:HyperLinkField DataNavigateUrlFields="Lat,Lon" HeaderStyle-HorizontalAlign="center" Target="_blank" Text="Ver" HeaderText="Ver en mapa" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="center" DataNavigateUrlFormatString="https://www.google.com/maps/search/{0},{1}/" />
|
||||
<%-- <asp:BoundField DataField="Evento" ItemStyle-Width="20%" HeaderStyle-HorizontalAlign="center" HeaderText="Evento" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:BoundField DataField="FechaTrama" ItemStyle-Width="25%" HeaderStyle-HorizontalAlign="center" HeaderText="Fecha" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Volumen" DataFormatString="{0:###,###.00} Lts" HeaderStyle-HorizontalAlign="center" HeaderText="Volumen (Lts)" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Direccion" HeaderStyle-HorizontalAlign="center" HeaderText="Dirección" ItemStyle-Width="35%" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:HyperLinkField DataNavigateUrlFields="Lat,Lon" HeaderStyle-HorizontalAlign="center" Target="_blank" Text="Ver" HeaderText="Ver en mapa" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="center" DataNavigateUrlFormatString="https://www.google.com/maps/search/{0},{1}/" />
|
||||
--%></Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- <div class="row">
|
||||
<asp:UpdatePanel class="col-md-12" UpdateMode="Conditional" ID="UpReportes" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-red">
|
||||
<i class="fa fa-warning font-red"></i>
|
||||
<span class="caption-subject bold uppercase">Reporte de combustible de unidad:  <asp:Literal runat="server" ID="LtlUnidad"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div runat="server" id="bodyreportes" visible="false" class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight:bold;">Velocidad Máxima: </label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight:bold;">Tiempo Movimiento: </label>
|
||||
<asp:Literal runat="server" ID="lblMovimiento" ></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight:bold;">Tiempo Muerto: </label>
|
||||
<asp:Literal runat="server" ID="lblMuerto"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight:bold;">Tiempo en Ralentí:
|
||||
</label>
|
||||
<asp:Literal runat="server" ID="lblRalenti"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight:bold;">Rendimiento Bruto:
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight:bold;">Rendimiento Efectivo:
|
||||
</label>
|
||||
<asp:Literal runat="server" ID="lblRendEfectivo"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>--%>
|
||||
<%-- <asp:UpdatePanel class="col-md-6" UpdateMode="Conditional" ID="UpdatePanel1" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-red">
|
||||
<i class="fa fa-warning font-red"></i>
|
||||
<span class="caption-subject bold uppercase">Reporte de Cargas y Descargas</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div runat="server" id="Div1" visible="false" class="portlet-body rowpadding" style="height: 299px;">
|
||||
<asp:GridView ID="GvDescargas" runat="server" DataKeyNames="CveEvento, Posicion, Imagen" Style="table-layout: fixed" AutoGenerateColumns="False" ShowHeader="True" data-heightfijo="240" data-height="240" EmptyDataText="No se Encontró Activo Fijo Registrado" GridLines="none" ToolTip="Listado de Activos Fijos" data-sort="false" CssClass="table table-striped table-hover Widthall ScrollAD">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Vehículo" DataField="Evento" ItemStyle-HorizontalAlign="center" ItemStyle-Width="50%" />
|
||||
<asp:BoundField HeaderText="Tanque" DataField="Control" ItemStyle-HorizontalAlign="center" ItemStyle-Width="50%" />
|
||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0}" ItemStyle-HorizontalAlign="right" ItemStyle-Width="50%" />
|
||||
<asp:BoundField HeaderText="Litros" DataField="Volumen" DataFormatString="{0}" ItemStyle-HorizontalAlign="right" ItemStyle-Width="50%" />
|
||||
<asp:BoundField HeaderText="Costo" DataField="Costo" DataFormatString="{0}" ItemStyle-HorizontalAlign="right" ItemStyle-Width="50%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>--%>
|
||||
<%-- </div>--%>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
|
||||
<script>
|
||||
var geocoder;
|
||||
var directionsService;
|
||||
var directionsDisplay;
|
||||
function CargaHistorico(data) {
|
||||
/*
|
||||
$('#chartdiv').highcharts({
|
||||
|
||||
title: {
|
||||
text: 'Historico Combustible'
|
||||
},
|
||||
|
||||
subtitle: {
|
||||
text: 'Subititulo'
|
||||
},
|
||||
|
||||
yAxis: {
|
||||
title: {
|
||||
text: 'Litros'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
layout: 'vertical',
|
||||
align: 'right',
|
||||
verticalAlign: 'middle'
|
||||
},
|
||||
|
||||
plotOptions: {
|
||||
series: {
|
||||
label: {
|
||||
connectorAllowed: false
|
||||
},
|
||||
pointStart: 2010
|
||||
}
|
||||
},
|
||||
|
||||
series: [{
|
||||
name: 'Nivel GPS',
|
||||
data: data
|
||||
} ],
|
||||
|
||||
responsive: {
|
||||
rules: [{
|
||||
condition: {
|
||||
maxWidth: 500
|
||||
},
|
||||
chartOptions: {
|
||||
legend: {
|
||||
layout: 'horizontal',
|
||||
align: 'center',
|
||||
verticalAlign: 'bottom'
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
}); */
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"marginRight": 40,
|
||||
"marginLeft": 40,
|
||||
"autoMarginOffset": 20,
|
||||
"dataDateFormat": "YYYY-MM-DD HH:NN:SS",
|
||||
"valueAxes": [{
|
||||
"id": "v1",
|
||||
"axisAlpha": 0,
|
||||
"position": "left",
|
||||
"ignoreAxisWidth": true
|
||||
}],
|
||||
"balloon": {
|
||||
"borderThickness": 1,
|
||||
"shadowAlpha": 0, "fadeOutDuration":5
|
||||
},
|
||||
"legend": {
|
||||
"enabled": true
|
||||
},
|
||||
"chartScrollbar": {},
|
||||
"graphs": [{
|
||||
"id": "g1",/*
|
||||
"balloon": {
|
||||
"drop": true,
|
||||
"adjustBorderColor": false,
|
||||
"color": "#ffffff",
|
||||
"type": "smoothedLine"
|
||||
},*/
|
||||
"fillAlphas": 0.2,
|
||||
"bullet": "round",
|
||||
"bulletBorderAlpha": 1,
|
||||
"bulletColor": "#FFFFFF",
|
||||
"bulletSize": 5,
|
||||
"hideBulletsCount": 50,
|
||||
"lineThickness": 2,
|
||||
"title": "Datos",
|
||||
"useLineColorForBulletBorder": true,
|
||||
"valueField": "value",
|
||||
"balloonText": "<span style='font-size:18px;'>[[value]]:[[cvetrama]]</span>"
|
||||
}, {
|
||||
"id": "g2",/*
|
||||
"balloon": {
|
||||
"drop": true,
|
||||
"adjustBorderColor": false,
|
||||
"color": "#ffffff",
|
||||
"type": "smoothedLine"
|
||||
},*/
|
||||
"fillAlphas": 0.2,
|
||||
"bullet": "round",
|
||||
"bulletBorderAlpha": 1,
|
||||
"bulletColor": "#FFFFFF",
|
||||
"bulletSize": 5,
|
||||
"hideBulletsCount": 50,
|
||||
"lineThickness": 2,
|
||||
"title": "Procesada",
|
||||
"useLineColorForBulletBorder": true,
|
||||
"valueField": "value2",
|
||||
"balloonText": "<span style='font-size:18px;'>[[value2]]:[[cvetrama]]</span>"
|
||||
}, {
|
||||
"id": "g3",/*
|
||||
"balloon": {
|
||||
"drop": true,
|
||||
"adjustBorderColor": false,
|
||||
"color": "#ffffff",
|
||||
"type": "smoothedLine"
|
||||
},*/
|
||||
"fillAlphas": 0.2,
|
||||
"bullet": "round",
|
||||
"bulletBorderAlpha": 1,
|
||||
"bulletColor": "#FFFFFF",
|
||||
"bulletSize": 5,
|
||||
"hideBulletsCount": 50,
|
||||
"lineThickness": 2,
|
||||
"title": "Tanque2",
|
||||
"useLineColorForBulletBorder": true,
|
||||
"valueField": "Tanque2",
|
||||
"balloonText": "<span style='font-size:18px;'>[[Tanque2]]:[[cvetrama]]</span>"
|
||||
}, {
|
||||
"id": "g4",/*
|
||||
"balloon": {
|
||||
"drop": true,
|
||||
"adjustBorderColor": false,
|
||||
"color": "#ffffff",
|
||||
"type": "smoothedLine"
|
||||
},*/
|
||||
"fillAlphas": 0.2,
|
||||
"bullet": "round",
|
||||
"bulletBorderAlpha": 1,
|
||||
"bulletColor": "#FFFFFF",
|
||||
"bulletSize": 5,
|
||||
"hideBulletsCount": 50,
|
||||
"lineThickness": 2,
|
||||
"title": "Tanque1",
|
||||
"useLineColorForBulletBorder": true,
|
||||
"valueField": "Tanque1",
|
||||
"balloonText": "<span style='font-size:18px;'>[[Tanque1]]:[[cvetrama]]</span>"
|
||||
}],
|
||||
"chartCursor": {
|
||||
"valueLineEnabled": true,
|
||||
"valueLineBalloonEnabled": true,
|
||||
"cursorAlpha": 0,
|
||||
"zoomable": false,
|
||||
"valueZoomable": true,
|
||||
"valueLineAlpha": 0.5
|
||||
},
|
||||
"categoryField": "date",
|
||||
"categoryAxis": {
|
||||
"parseDates": false,
|
||||
"dashLength": 1,
|
||||
"minorGridEnabled": true
|
||||
},
|
||||
"export": {
|
||||
"enabled": false
|
||||
},
|
||||
"dataProvider": data
|
||||
});/*
|
||||
chart.addListener("rollOverGraphItem", function (event) {
|
||||
var b = document.getElementById("balloon");
|
||||
b.innerHTML = event.item.category + ": <b>" + event.item.values.value +":"+ event.item.values.cvetrama + "</b>";
|
||||
b.style.display = "block";
|
||||
});*/
|
||||
}
|
||||
function GetDireccionesGV(posicion, indice, index) {
|
||||
setTimeout(function () {
|
||||
var tr = $(indice)
|
||||
geocoder.geocode({ 'location': posicion }, function (results, status) {
|
||||
if (status === 'OK') {
|
||||
if (results[0]) {
|
||||
tr.find("td").filter(':nth-child(4)').html(results[0].formatted_address);
|
||||
} else {
|
||||
tr.find("td").filter(':nth-child(4)').html("Direccion no encontrada");
|
||||
}
|
||||
} else {
|
||||
window.alert('Geocoder failed due to: ' + status);
|
||||
}
|
||||
});
|
||||
}, 250 * index);
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
geocoder = new google.maps.Geocoder();
|
||||
});
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places">
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
246
GPS/RepCombustible2.aspx.vb
Normal file
246
GPS/RepCombustible2.aspx.vb
Normal file
@@ -0,0 +1,246 @@
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class GPS_RepCombustible2
|
||||
Inherits Page
|
||||
|
||||
ReadOnly Property UsuarioActual() As Usuario
|
||||
Get
|
||||
Try
|
||||
'UsuarioActual = DirectCast(Session("UsuarioSIG"), Usuario)
|
||||
UsuarioActual = CType(Context.Session("UsuarioSIG"), Usuario)
|
||||
Catch ex As Exception
|
||||
UsuarioActual = Nothing
|
||||
FormsAuthentication.SignOut()
|
||||
Session("UsuarioSIG") = Nothing
|
||||
HttpContext.Current.Response.Redirect(String.Format("/LogIn.aspx?ReturnUrl={0}", HttpContext.Current.Request.Url))
|
||||
End Try
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub RegistraScript(Script As String, Optional valuetick As String = "")
|
||||
Dim Rdm As Random = New Random()
|
||||
ScriptManager.RegisterStartupScript(Page, Me.GetType(), String.Format("{0}{1}{2}", (DateTime.Now.Ticks + 1), Rdm.Next(), valuetick), String.Format("<script type='text/javascript' language='javascript'>{0}</script>", Script), False)
|
||||
End Sub
|
||||
Property DTCargasDescargas As DataTable
|
||||
Get
|
||||
If ViewState("DTCargasDescargas") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTCargasDescargas"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTCargasDescargas") = value
|
||||
End Set
|
||||
End Property
|
||||
Property DTDatos As DataTable
|
||||
Get
|
||||
If ViewState("DTDatos") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTDatos"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveDispositivo As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveDispositivo"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveDispositivo") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property FechaI As DateTime
|
||||
Get
|
||||
Return CType(ViewState("FechaI"), DateTime)
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
ViewState("FechaI") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property FechaF As DateTime
|
||||
Get
|
||||
Return CType(ViewState("FechaF"), DateTime)
|
||||
End Get
|
||||
Set(value As DateTime)
|
||||
ViewState("FechaF") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDispositivos()
|
||||
txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
|
||||
txtFechaF.Text = Now.LastDayOfMonth.ToShortDateString
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'Private Sub CargaDatos()
|
||||
' Dim ObjAF As New ClsAF
|
||||
' Dim Finicial As String = ""
|
||||
' Dim FFinal As String = ""
|
||||
' Try
|
||||
' Finicial = txtFechaI.Text.ToDate.ToString("yyyy/MM/dd")
|
||||
' FFinal = txtFechaF.Text.ToDate.ToString("yyyy/MM/dd")
|
||||
' Catch ex As Exception
|
||||
' Alert("Ocurrio un error con las fechas")
|
||||
' End Try
|
||||
|
||||
' If ObjAF.GetIncidentesRep(-1, -1, -1, Finicial, FFinal, DdlDispositivo.SelectedValue.ToEntero, UsuarioActual.CveCliente) Then
|
||||
' DTDatos = ObjAF.DtResultados
|
||||
' Else
|
||||
' DTDatos = Nothing
|
||||
' End If
|
||||
' ObjAF.Dispose()
|
||||
'End Sub
|
||||
|
||||
#Region "C O M B O S"
|
||||
Private Sub CargaDispositivos()
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If GPS.DispositivosGet(-1, -1, UsuarioActual.CveCliente) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
DdlDispositivo.DataSource = GPS.DtResultados.FiltraParametros("TieneCombustible = 1")
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DdlDispositivo.DataBind()
|
||||
DdlDispositivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
LtlUnidad.Text = DdlDispositivo.SelectedItem.Text
|
||||
CveDispositivo = DdlDispositivo.SelectedValue.ToEntero
|
||||
FechaI = txtFechaI.Text.ToDateTime
|
||||
FechaF = txtFechaF.Text.ToDateTime
|
||||
'UpReportes.Update()
|
||||
Dim GPS As New ClsGPS
|
||||
CargaHistorico(GPS)
|
||||
If GPS.RepCombustibleGet2(DdlDispositivo.SelectedValue.ToEntero, FechaI, FechaF) AndAlso GPS.DtSetResultados.Tables.Count > 1 Then
|
||||
Dim DTDatos As DataTable = GPS.DtSetResultados.Tables(1) '$("{DTDatos.Rows(0)("")}")
|
||||
DTCargasDescargas = GPS.DtSetResultados.Tables(0)
|
||||
If DTDatos.Rows.Count > 0 Then
|
||||
LtlDistancia.Text = $"{DTDatos.Rows(0)("KmRecorridos")}"
|
||||
lblVelocidad.Text = $"{DTDatos.Rows(0)("SPD")}"
|
||||
lblRendBruto.Text = $"{DTDatos.Rows(0)("KmRecorridos") / DTDatos.Rows(0)("CombustibleConsumido"):N2}"
|
||||
LtlCombustibleInicial.Text = $"{DTDatos.Rows(0)("CombustibleInicial")}"
|
||||
LtlCombustibleFinal.Text = $"{DTDatos.Rows(0)("CombustibleFinal")}"
|
||||
LtlNoCargas.Text = $"{DTDatos.Rows(0)("CCargas")}"
|
||||
LtlNoDescargas.Text = $"{DTDatos.Rows(0)("CDescargas")}"
|
||||
SumaCargas.Text = $"{DTDatos.Rows(0)("Cargas")}"
|
||||
LtlCostoCargas.Text = ""
|
||||
SumaDescargas.Text = $"{DTDatos.Rows(0)("Descargas")}"
|
||||
LtlCostoDescargas.Text = ""
|
||||
LtlDistanciaR.Text = $"{DTDatos.Rows(0)("KmRecorridos")}"
|
||||
LtlCombustibleConsumido.Text = $"{DTDatos.Rows(0)("CombustibleConsumido")}"
|
||||
LtlCostoConsumo.Text = ""
|
||||
LtlCostoCombustibleF.Text = ""
|
||||
LtlCostoInicial.Text = ""
|
||||
lCombustibleConsumido.Text = $"{DTDatos.Rows(0)("Recorrido")}"
|
||||
End If
|
||||
|
||||
End If
|
||||
If GPS.RepCombustibleGet(DdlDispositivo.SelectedValue.ToEntero, FechaI, FechaF) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
' Dim TotalKilometros As Decimal = (GPS.DtResultados.Rows(0)("Distancia").ToString.ToDecimal) / 1000
|
||||
' Dim CombustibleConsumido As Decimal = (GPS.DtResultados.Rows(0)("CombustibleInicial").ToString.ToDecimal + GPS.DtResultados.Rows(0)("SumaCargas").ToString.ToDecimal) - (GPS.DtResultados.Rows(0)("CombustibleFinal").ToString.ToDecimal + GPS.DtResultados.Rows(0)("SumaDescargas").ToString.ToDecimal)
|
||||
' Dim RendBruto As Decimal = TotalKilometros / CombustibleConsumido
|
||||
' Dim CostoCombustible As Decimal = GlobalDTDispositivos(-1).FiltroPrimeroValor("CostoCombustible", $"CveDispositivo = {DdlDispositivo.SelectedValue}").ToDecimal
|
||||
' LtlDistancia.Text = TotalKilometros.ToString.FormatoNumero
|
||||
' lblVelocidad.Text = $"{GPS.DtResultados.Rows(0)("VelocidadMaxima").ToString.FormatoNumero}"
|
||||
' lblRendBruto.Text = $"{RendBruto.ToString.FormatoNumero}"
|
||||
' LtlCombustibleInicial.Text = GPS.DtResultados.Rows(0)("CombustibleInicial").ToString.FormatoNumero
|
||||
' LtlCombustibleFinal.Text = GPS.DtResultados.Rows(0)("CombustibleFinal").ToString.FormatoNumero
|
||||
' LtlNoCargas.Text = GPS.DtResultados.Rows(0)("Cargas").ToString
|
||||
' LtlNoDescargas.Text = GPS.DtResultados.Rows(0)("Descargas").ToString
|
||||
' SumaCargas.Text = GPS.DtResultados.Rows(0)("SumaCargas").ToString.FormatoNumero
|
||||
' LtlCostoCargas.Text = $"${(GPS.DtResultados.Rows(0)("SumaCargas").ToString.ToDecimal * CostoCombustible).ToString.FormatoNumero}"
|
||||
' SumaDescargas.Text = GPS.DtResultados.Rows(0)("SumaDescargas").ToString.FormatoNumero
|
||||
' LtlCostoDescargas.Text = $"${(GPS.DtResultados.Rows(0)("SumaDescargas").ToString.ToDecimal * CostoCombustible).ToString.FormatoNumero}"
|
||||
' LtlDistanciaR.Text = TotalKilometros.ToString.FormatoNumero
|
||||
' LtlCombustibleConsumido.Text = CombustibleConsumido.ToString.FormatoNumero
|
||||
' LtlCostoConsumo.Text = $"${(CombustibleConsumido * CostoCombustible).ToString.FormatoNumero}"
|
||||
' LtlCostoCombustibleF.Text = $"${(GPS.DtResultados.Rows(0)("CombustibleFinal").ToString.ToDecimal * CostoCombustible).ToString.FormatoNumero}"
|
||||
' LtlCostoInicial.Text = $"${(GPS.DtResultados.Rows(0)("CombustibleInicial").ToString.ToDecimal * CostoCombustible).ToString.FormatoNumero}"
|
||||
' lCombustibleConsumido.Text = CombustibleConsumido.ToString.FormatoNumero
|
||||
lblMuerto.Text = $"{((DateDiff(DateInterval.Minute, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime).ToString - GPS.DtResultados.Rows(0)("Horas").ToString.ToLong) / 60).ToString.FormatoNumero} Hrs."
|
||||
lblMovimiento.Text = $"{(GPS.DtResultados.Rows(0)("Horas").ToString.ToDecimal / 60).ToString.FormatoNumero} Hrs"
|
||||
LtlRalenti.Text = $"{GPS.DtResultados.Rows(0)("TiempoRalentiHoras").ToString.FormatoNumero} Hrs. ({GPS.DtResultados.Rows(0)("TiempoRalentiMinutos").ToString} Minutos)"
|
||||
|
||||
' 'lblRendEfectivo.Text = $"{(RendBruto + 1).ToString.FormatoNumero} KM/L"
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DvReporte.Visible = True
|
||||
UpReporte.Update()
|
||||
UpDash.Update()
|
||||
UPTabla.Update()
|
||||
' bodyreportes.Visible = True
|
||||
' UpReportes.Update()
|
||||
End Sub
|
||||
Private Sub CargaHistorico(ByRef GPS As ClsGPS)
|
||||
If GPS.GetCombustibleHistorico(DdlDispositivo.SelectedValue.ToEntero, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime) Then
|
||||
Dim query = From s In GPS.DtResultados
|
||||
Select New With {.date = s.Field(Of DateTime)("FechaTrama").ToString("yyyy-MM-dd HH:mm:ss"), .value = s("Valor").ToString().ToDecimal(), .value2 = s("Valor2").ToString().ToDecimal(), .Tanque1 = s("Tanque1").ToString().ToDecimal(), .Tanque2 = s("Tanque2").ToString().ToDecimal(), .cvetrama = s("CveTrama")} ',,
|
||||
Dim json = Newtonsoft.Json.JsonConvert.SerializeObject(query)
|
||||
|
||||
HdfGrafica.Value = json
|
||||
RegistraScript($"CargaHistorico(JSON.parse($(""#{HdfGrafica.ClientID}"").val()))")
|
||||
End If
|
||||
End Sub
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Protected Sub lbCargas_Click(sender As Object, e As EventArgs)
|
||||
LtlTituloCD.Text = $"Desglose de cargas de combustible: {LtlUnidad.Text}"
|
||||
Dim GPS As New ClsGPS
|
||||
GVHistorico.DataSource = DTCargasDescargas.FiltraParametros("TipoEvento=2")
|
||||
'If GPS.GetCargasDescargas(CveDispositivo, FechaI, FechaF, 48) Then
|
||||
' GVHistorico.DataSource = GPS.DtResultados
|
||||
'Else
|
||||
' GVHistorico.DataSource = Nothing
|
||||
'End If
|
||||
GPS.Dispose()
|
||||
GVHistorico.DataBind()
|
||||
UpdatePanel3.Update()
|
||||
UpHistorico.Update()
|
||||
RegistraScript("$('#dvHistorico').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub lbDesCargas_Click(sender As Object, e As EventArgs) Handles lbDescargas.Click
|
||||
LtlTituloCD.Text = $"Desglose de descargas de combustible: {LtlUnidad.Text}"
|
||||
Dim GPS As New ClsGPS
|
||||
GVHistorico.DataSource = DTCargasDescargas.FiltraParametros("TipoEvento=1")
|
||||
'If GPS.GetCargasDescargas(CveDispositivo, FechaI, FechaF, 43) Then
|
||||
' GVHistorico.DataSource = GPS.DtResultados
|
||||
'Else
|
||||
' GVHistorico.DataSource = Nothing
|
||||
'End If
|
||||
GPS.Dispose()
|
||||
GVHistorico.DataBind()
|
||||
UpdatePanel3.Update()
|
||||
UpHistorico.Update()
|
||||
RegistraScript("$('#dvHistorico').modal()")
|
||||
End Sub
|
||||
|
||||
Protected Sub GVHistorico_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVHistorico.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
Dim RowID As String = $"row{e.Row.RowIndex}"
|
||||
e.Row.Attributes("id") = RowID
|
||||
RegistraScript($"GetDireccionesGV({{ lat: {e.Row.DBCampo("Lat").ToString}, lng: {e.Row.DBCampo("Lon").ToString }}}, '#{RowID}', {e.Row.RowIndex});", $"{RowID}")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
217
GPS/RepEventos.aspx
Normal file
217
GPS/RepEventos.aspx
Normal file
@@ -0,0 +1,217 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEventos.aspx.vb" Inherits="GPS_RepEventos" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Eventos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:HyperLink ID="LnkGrafica" runat="server" NavigateUrl="javascript:CargaGraficaEventos(false);$('#DivModalGraficaEventos').modal({ backdrop: 'static', keyboard: false });"><i class="fa fa-file-pdf-o"></i> Ver Grafica</asp:HyperLink>
|
||||
</li>
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkPDF" OnClientClick="ImprimeGrafica(); return false;" OnClick="LnkPDF_Click" runat="server"><i class="fa fa-file-pdf-o"></i> Imprimir PDF</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkPDF" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</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>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" ValidationGroup="GrpGuardar" Text="Consultar" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption" style="margin-top: -8px;">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Grupo:
|
||||
<asp:DropDownList AppendDataBoundItems="true" ID="DdlGrupo" runat="server" Width="200px" DataTextField="Nombre" DataValueField="CveDispositivosGrupos" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Value="-2" Text="Seleccione"></asp:ListItem>
|
||||
<asp:ListItem Value="-1" Text="Todos"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlGrupo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Conductor''</b> es necesario, por favor seleccione uno." InitialValue="-2" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDispositivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDispositivo" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</li>
|
||||
<li>Fecha Inicio:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
<li>Fecha Fin:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Eventos</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 rowpadding">
|
||||
<asp:GridView ID="GvEventos" runat="server" Style="overflow-x: auto;" GridLines="None" OnRowDataBound="GvEventos_RowDataBound" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-rows ="2" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Numero de Vueltas Realizadas">
|
||||
<Columns>
|
||||
<asp:HyperLinkField Target="_blank" DataTextField="Vehiculo" DataNavigateUrlFormatString='/GPS/Conductores.aspx?CveDispositivo={0}' DataNavigateUrlFields="CveDispositivo" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Conductor" ItemStyle-Width="12.5%" HeaderText="Conductor" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="NoExcesosVelocidad" ItemStyle-Width="12.5%" HeaderText="Excesos de Velocidad" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="NoAceleraciones" ItemStyle-Width="12.5%" HeaderText="Aceleraciones" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="NoAceleraciones" ItemStyle-Width="12.5%" HeaderText="Aceleraciones" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="NoFrenados" ItemStyle-Width="12.5%" HeaderText="Frenados" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="NoRalentis" ItemStyle-Width="12.5%" HeaderText="Ralentí" ItemStyle-HorizontalAlign="Center" />
|
||||
<%--
|
||||
<asp:BoundField DataField="Ponderacion" ItemStyle-Width="12.5%" HeaderText="Ponderación" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Riesgo" ItemStyle-Width="12.5%" HeaderText="Riesgo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Desgaste" ItemStyle-Width="12.5%" HeaderText="Desgaste" ItemStyle-HorizontalAlign="Center" />--%>
|
||||
<asp:BoundField DataField="TotalEventos" ItemStyle-Width="12.5%" HeaderText="Total Eventos" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivModalGraficaEventos" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpGraficaEventos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<asp:HiddenField ID="HdnImagen" ClientIDMode="Static" Value="[]" runat="server" />
|
||||
<asp:HiddenField ID="HdnGraficaEventos" ClientIDMode="Static" Value="[]" runat="server" />
|
||||
<div id="DvGraficaEventos" style="min-width: 900px; height: 500px; margin: 0 auto"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="modal-btn">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
function CargaGraficaEventos(print) {
|
||||
var datosKM = JSON.parse($('#HdnGraficaEventos').val());
|
||||
var datosgrupo = $("#C_DdlGrupo").select2('data');
|
||||
var titulo = "";
|
||||
if (typeof (datosgrupo) !== 'undefined') {
|
||||
titulo = "TOTAL DE EVENTOS OCURRIDOS DEL GRUPO:<b>" + datosgrupo[0].text + "</b>";
|
||||
}
|
||||
$("#DvGraficaEventos").highcharts({
|
||||
chart: {
|
||||
type: 'column'
|
||||
},
|
||||
title: {
|
||||
text: titulo
|
||||
},
|
||||
subtitle: {
|
||||
text: ''
|
||||
},
|
||||
xAxis: {
|
||||
categories: datosKM.categories,
|
||||
crosshair: true
|
||||
},
|
||||
yAxis: {
|
||||
min: 0,
|
||||
title: {
|
||||
text: ''
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
|
||||
pointFormat: '<tr><td style="color:{series.color};padding:0">Total de {series.name}: </td>' +
|
||||
'<td style="padding:0"><b>{point.y:.1f}</b></td></tr>',
|
||||
footerFormat: '</table>',
|
||||
shared: true,
|
||||
useHTML: true
|
||||
},
|
||||
plotOptions: {
|
||||
column: {
|
||||
pointPadding: 0.2,
|
||||
borderWidth: 0
|
||||
}
|
||||
},
|
||||
series: datosKM.series
|
||||
});
|
||||
save_chart($('#DvGraficaEventos').highcharts(), 'chart',print);
|
||||
|
||||
}
|
||||
EXPORT_WIDTH = 1000;
|
||||
function save_chart(chart, filename,print) {
|
||||
var render_width = EXPORT_WIDTH;
|
||||
var render_height = render_width * chart.chartHeight / chart.chartWidth
|
||||
|
||||
var svg = chart.getSVG({
|
||||
exporting: {
|
||||
sourceWidth: chart.chartWidth,
|
||||
sourceHeight: chart.chartHeight
|
||||
}
|
||||
});
|
||||
var canvas = document.createElement('canvas');
|
||||
canvas.height = render_height;
|
||||
canvas.width = render_width;
|
||||
|
||||
var image = new Image;
|
||||
image.onload = function () {
|
||||
canvas.getContext('2d').drawImage(this, 0, 0, render_width, render_height);
|
||||
var data = canvas.toDataURL("image/png");
|
||||
|
||||
$("#HdnImagen").val(data);
|
||||
if (print) {
|
||||
javascript: __doPostBack('ctl00$H$LnkPDF', '')
|
||||
}
|
||||
};
|
||||
//image.src = 'data:image/svg+xml;base64,' + window.btoa(svg);
|
||||
image.src = 'data:image/svg+xml;base64,' + utoa(svg);
|
||||
}
|
||||
function utoa(str) {
|
||||
return window.btoa(unescape(encodeURIComponent(str)));
|
||||
}
|
||||
function ImprimeGrafica() {
|
||||
CargaGraficaEventos(true);
|
||||
}
|
||||
//function download(data, filename) {
|
||||
// var a = document.createElement('a');
|
||||
// a.download = filename;
|
||||
// a.href = data
|
||||
// document.body.appendChild(a);
|
||||
// a.click();
|
||||
// a.remove();
|
||||
//}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
163
GPS/RepEventos.aspx.vb
Normal file
163
GPS/RepEventos.aspx.vb
Normal file
@@ -0,0 +1,163 @@
|
||||
Option Explicit On
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports System.Data
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
Partial Class GPS_RepEventos
|
||||
Inherits ClsPaginas
|
||||
Property DTDatos As DataTable
|
||||
Get
|
||||
If ViewState("DTDatos") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTDatos"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
txtFechaI.Text = $"01/{DateTime.Now.ToString("MM")}/{DateTime.Now.Year} 00:00"
|
||||
txtFechaF.Text = $"{DateTime.Now.ToString("dd/MM/yyyy")} 23:59"
|
||||
CargaGrupos()
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Private Sub CargaGrupos()
|
||||
Dim ObjGPS As ClsGPS = New ClsGPS()
|
||||
|
||||
If ObjGPS.GruposGet(-1, UsuarioActual.CveCliente) Then
|
||||
DdlGrupo.DataSource = ObjGPS.DtResultados
|
||||
End If
|
||||
|
||||
ObjGPS.Dispose()
|
||||
DdlGrupo.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
Using ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetRepEventosDispositivosCliente(DdlGrupo.SelectedValue.ToEntero(), txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, UsuarioActual.CveCliente) Then
|
||||
GvEventos.DataSource = ObjGPS.DtResultados
|
||||
DTDatos = ObjGPS.DtResultados
|
||||
Else
|
||||
GvEventos.DataSource = Nothing
|
||||
End If
|
||||
End Using
|
||||
GvEventos.DataBind()
|
||||
CargaGraficaEventos(DTDatos.FiltraParametros("CveDispositivo > 0"))
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
Private Sub CargaGraficaEventos(DtEventos As DataTable)
|
||||
'Dim DtEventos = ObjGPS.DtResultados.FiltraParametros("CveEvento IS NOT NULL")
|
||||
Dim datosVelocidad = New JArray()
|
||||
Dim datosAceleraciones = New JArray()
|
||||
Dim datosFrenados = New JArray()
|
||||
Dim datosColisiones = New JArray()
|
||||
Dim datosRalenti = New JArray()
|
||||
|
||||
Dim categories = New JArray()
|
||||
|
||||
For Each Row As DataRow In DtEventos.Rows
|
||||
categories.Add(Row("Vehiculo").ToString())
|
||||
|
||||
datosVelocidad.Add(Row("NoExcesosVelocidad").ToString().ToEntero())
|
||||
datosAceleraciones.Add(Row("NoAceleraciones").ToString().ToEntero())
|
||||
datosFrenados.Add(Row("NoFrenados").ToString().ToEntero())
|
||||
datosColisiones.Add(Row("NoColisiones").ToString().ToEntero())
|
||||
datosRalenti.Add(Row("NoRalentis").ToString().ToEntero())
|
||||
Next
|
||||
|
||||
Dim series = New JArray() From {
|
||||
New JObject() From {
|
||||
New JProperty("name", "Excesos de Velocidad"),
|
||||
New JProperty("data", datosVelocidad),
|
||||
New JProperty("color", "#4B77BE")
|
||||
},
|
||||
New JObject() From {
|
||||
New JProperty("name", "Aceleraciones"),
|
||||
New JProperty("data", datosAceleraciones),
|
||||
New JProperty("color", "#26C281")
|
||||
},
|
||||
New JObject() From {
|
||||
New JProperty("name", "Frenados"),
|
||||
New JProperty("data", datosFrenados),
|
||||
New JProperty("color", "#ACB5C3")
|
||||
},
|
||||
New JObject() From {
|
||||
New JProperty("name", "Colisiones"),
|
||||
New JProperty("data", datosColisiones),
|
||||
New JProperty("color", "#D91E18")
|
||||
},
|
||||
New JObject() From {
|
||||
New JProperty("name", "Ralenti"),
|
||||
New JProperty("data", datosRalenti),
|
||||
New JProperty("color", "#8E44AD")
|
||||
}
|
||||
}
|
||||
Dim jsonGrafica = New JObject() From {
|
||||
New JProperty("categories", categories),
|
||||
New JProperty("series", series)
|
||||
}
|
||||
HdnGraficaEventos.Value = jsonGrafica.ToString()
|
||||
UpGraficaEventos.Update()
|
||||
End Sub
|
||||
Public Sub EnviarReporteProgramado(DtDatos As DataTable)
|
||||
If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then
|
||||
|
||||
Dim retorno As Byte()
|
||||
Dim RutaReporte = "Empresas/Grales/ReportesProgramados/RPEventos.rdlc"
|
||||
|
||||
Dim Excesos = DtDatos.SUM("NoExcesosVelocidad")
|
||||
|
||||
Dim Aceleraciones = DtDatos.SUM("NoAceleraciones")
|
||||
|
||||
Dim NoColisiones = DtDatos.SUM("NoColisiones")
|
||||
|
||||
Dim TotalEventos = DtDatos.SUM("TotalEventos")
|
||||
|
||||
Dim Ralenti = DtDatos.SUM("NoRalentis")
|
||||
|
||||
Try
|
||||
Dim RptParametro As New List(Of ReportParameter)
|
||||
|
||||
|
||||
RptParametro.Add(New ReportParameter("FechaInicio", txtFechaI.Text.ToDateTime().ToString("dd/MM/yyyy HH:mm")))
|
||||
RptParametro.Add(New ReportParameter("FechaFin", txtFechaF.Text.ToDateTime().ToString("dd/MM/yyyy HH:mm")))
|
||||
RptParametro.Add(New ReportParameter("ChartBase64", HdnImagen.Value, True))
|
||||
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||
RptParametro.Add(New ReportParameter("FechaImpresion", Now.ToString("dd/MM/yyyy")))
|
||||
RptParametro.Add(New ReportParameter("NoExcesosVelocidad", Excesos.ToString))
|
||||
RptParametro.Add(New ReportParameter("NoAceleraciones", Aceleraciones.ToString))
|
||||
RptParametro.Add(New ReportParameter("NoColisiones", NoColisiones.ToString))
|
||||
RptParametro.Add(New ReportParameter("Ralenti", Ralenti.ToString))
|
||||
RptParametro.Add(New ReportParameter("TotalEventos", TotalEventos.ToString))
|
||||
retorno = StreamPDF(RutaReporte, DtDatos, RptParametro, "ReporteEventos", "PDF", MR:=Nothing, RDSName:="DsOC")
|
||||
|
||||
ImprimirbytesPDF(retorno, "ReporteEventos")
|
||||
|
||||
Catch ex As Exception
|
||||
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||
End Try
|
||||
Else
|
||||
Alert("No se pudo imprimir el pdf, ya que no se ha hecho una consulta, o ésta no arrojó resultados.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub LnkPDF_Click(sender As Object, e As EventArgs)
|
||||
EnviarReporteProgramado(DTDatos)
|
||||
End Sub
|
||||
Protected Sub GvEventos_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("CveDispositivo").ToEntero <= 0 Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
633
GPS/RepGeoReferencias.aspx
Normal file
633
GPS/RepGeoReferencias.aspx
Normal file
@@ -0,0 +1,633 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="RepGeoReferencias.aspx.vb" Inherits="GPS_RepGeoReferencias" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style type="text/css">
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#map {
|
||||
width: 100%;
|
||||
height: calc(100% - 51px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#map {
|
||||
position: fixed !important;
|
||||
}
|
||||
|
||||
|
||||
.pac-container.pac-logo {
|
||||
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;
|
||||
}
|
||||
|
||||
.v-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ContentPlaceHolderID="H" ID="Content9" runat="server">
|
||||
<li>
|
||||
<a id="BtnDir" onclick="$('#dvConsulta').modal({ backdrop: 'static', keyboard: false });CargaPickers();NuevaConsulta();">
|
||||
<i class='fa fa-exchange'></i><span>Volver a Consultar</span>
|
||||
</a>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
|
||||
<div id="map"></div>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UPModalBusqueda">
|
||||
<ContentTemplate>
|
||||
<div id="dvConsulta" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UPConsulta" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel2" runat="server">Consulta de GeoReferencias</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpModalBody" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-8 v-center">
|
||||
<lable>Estatus: </lable>
|
||||
<asp:CheckBox runat="server" ID="ChkEstatusGeocerca" AutoPostBack="true" CssClass="chksino" Checked="true" Text=" " OnCheckedChanged="ChkEstatusGeocerca_CheckedChanged" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<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="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVGeoreferencias.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVGeoreferencias.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GVGeoreferencias" runat="server" GridLines="None" data-height="200" DataKeyNames="Coordenadas,CveGeoReferencia,GeoReferencia, CveDispositivo,Tipo,Color,Estatus,FechaInicio,FechaFin,AplicaLunes,AplicaMartes,AplicaMiercoles,AplicaJueves,AplicaViernes,AplicaSabado,AplicaDomingo, HoraInicio, HoraFin, Tolerancia" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkGR" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Tipo" ItemStyle-Width="20%" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="GeoReferencia" ItemStyle-Width="20%" HeaderText="GeoReferencia" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Color" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgColor" HeaderText="Color" runat="server" Style="height: 20px;" Enabled="false" CausesValidation="False" CssClass="btn btn-circle btn-sm green" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20%" HeaderText="Estatus">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text='<%# Eval("Estatus") %>'>></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" HeaderText="Eliminar" runat="server" AlternateText="Editar" OnClick="imgE_Click" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:UpdatePanel runat="server" ID="UpUp" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright v-center">
|
||||
<label>Ver Posición Dispositivos: </label>
|
||||
<asp:CheckBox ID="chkUp" onchange="DisplayGV();" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox>
|
||||
</div>
|
||||
<div id="dvDispositivos" style="display: none">
|
||||
<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="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDispositivos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDispositivos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<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-height="120.8" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkDis" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="25%" HeaderText="Número Económico" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="ModeloVehiculo" ItemStyle-Width="25%" HeaderText="Modelo Vehículo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="AñoVehiculo" ItemStyle-Width="15%" HeaderText="Año Vehículo" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="PlacasVehiculo" ItemStyle-Width="25%" HeaderText="Placas Vehículo" ItemStyle-HorizontalAlign="center" />
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="BtnConsultar" runat="server" Text="Consultar" CssClass="btn btn-primary"></asp:LinkButton>
|
||||
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="dvEditar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpAgregar" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="myModalLabel">Editar Georeferencia</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel ID="UpBodyGeoReferencia" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtNombre" runat="server" CssClass="form-control" CausesValidation="true"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVEstatusOS" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtNombre" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Nombre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtNombre.ClientID.ToString()%>">Nombre Geocerca:</label>
|
||||
</div>
|
||||
<%--<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlEquipo" Width="230px" runat="server" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlEquipo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlEquipo.ClientID.ToString()%>">Equipo:</label>
|
||||
</div>--%>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTolerancia" runat="server" Style="width: 50%; display: inline-block" CssClass="form-control" CausesValidation="true"></asp:TextBox><asp:Literal runat="server" Text="mts"></asp:Literal>
|
||||
<asp:RequiredFieldValidator ID="RFVTxtTolerancia" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTolerancia" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tolerancia''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
|
||||
<ajax:FilteredTextBoxExtender ID="FTBSerie" runat="server" TargetControlID="TxtTolerancia" FilterType="Numbers" />
|
||||
<label for="<%= TxtTolerancia.ClientID.ToString()%>" style="width: 50%">Tolerancia:</label>
|
||||
</div>
|
||||
<ul class="list-inline" style="font-size: 12px; margin-top: 15px; margin-left: 0px;">
|
||||
<li>Fecha I.:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
<li>Fecha F.:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="list-inline" style="font-size: 12px; margin-top: 15px; margin-left: 0px;">
|
||||
<li>Aplica Días:
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="L" ID="chkLunes" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="M" ID="chkMartes" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="M" ID="chkMiercoles" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="J" ID="chkJueves" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="V" ID="chkViernes" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="S" ID="chkSabado" />
|
||||
</li>
|
||||
<li>
|
||||
<asp:CheckBox runat="server" Text="D" ID="chkDomingo" />
|
||||
</li>
|
||||
</ul>
|
||||
<div class="row" style="margin-top: 10px; margin-bottom: 20px;">
|
||||
<div class="col-md-1">Hora Inicio:</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtHoraI" runat="server" CssClass="form-control input-sm hora" CausesValidation="true" MaxLength="18" Width="75px"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1">Hora Fin:</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtHoraF" runat="server" CssClass="form-control input-sm hora" CausesValidation="true" MaxLength="18" Width="75px "></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<label>Activo: </label>
|
||||
<br />
|
||||
<asp:CheckBox ID="chkEstatus" Text=" " runat="server" CssClass="chksino" Width="250px"></asp:CheckBox>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlGrupo" Width="230px" runat="server" DataTextField="Nombre" DataValueField="CveDispositivosGrupos" CssClass="form-control select2me">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlGrupo" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregarGrupo"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlGrupo.ClientID.ToString()%>">Grupo:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="margin-top: 12px; text-align: right;">
|
||||
<asp:LinkButton ID="LnkAgregarGrupo" runat="server" CssClass="btn btn-sm btn-success" OnClick="LnkAgregarGrupo_Click" ValidationGroup="GrpAgregarGrupo"><i class='fa fa-plus' aria-hidden='true'></i></asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlEquipoD" Width="230px" runat="server" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control select2me">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVEquipoD" runat="server" CssClass="help-block errorimput" InitialValue="-1" ControlToValidate="DdlEquipoD" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Equipo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAgregarVehiculo"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlEquipoD.ClientID.ToString()%>">Equipo:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="margin-top: 12px; text-align: right;">
|
||||
<asp:LinkButton ID="LnkAgregarDisp" runat="server" CssClass="btn btn-sm btn-success" OnClick="LnkAgregarDisp_Click" ValidationGroup="GrpAgregarVehiculo"><i class='fa fa-plus' aria-hidden='true'></i></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvEquiposDetalle" runat="server" GridLines="None" data-height="200" DataKeyNames="CveDispositivo, NoEconomico,CveDispositivoGeoreferenciaDetalle" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" OnRowDeleting="GvEquiposDetalle_RowDeleting" EmptyDataText="Seleccione el vehiculo y presione agregar.">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="20%" HeaderText="NoEconomico" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Acciones" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="BtnBorrarDispositivo" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar este dispositivo?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="BtnActualizarGeoreferencia" OnClick="BtnActualizarGeoreferencia_Click" runat="server" CssClass="btn btn-primary" ValidationGroup="GrpObligatorio">Actualizar</asp:LinkButton>
|
||||
<button id="btnCancelarTE" class="btn btn-default" data-dismiss="modal" value="Cancelar">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade bottom in" style="bottom: unset" 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>
|
||||
<asp:GridView ID="GvBarra" runat="server" GridLines="None" data-height="200" DataKeyNames="Nombre, Posicion" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Nombre" ItemStyle-Width="100%" HeaderText="GeoReferencia" ItemStyle-HorizontalAlign="Left" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="../Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js"></script>
|
||||
<script>
|
||||
var map;
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: { lat: 29.0730, lng: -110.9559 },
|
||||
zoom: 7
|
||||
});
|
||||
|
||||
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);
|
||||
|
||||
google.maps.Polygon.prototype.my_getBounds = function () {
|
||||
var bounds = new google.maps.LatLngBounds()
|
||||
this.getPath().forEach(function (element, index) { bounds.extend(element) })
|
||||
return bounds
|
||||
}
|
||||
|
||||
}
|
||||
var polylines = [];
|
||||
var polygons = [];
|
||||
var polybounds = [];
|
||||
var markers = [];
|
||||
var lastOpenedInfoWindow;
|
||||
|
||||
$(document).ready(function () {
|
||||
initMap();
|
||||
$("#SideNav").removeClass("nav-is-visible");
|
||||
$("#dvConsulta").modal({ backdrop: 'static', keyboard: false });
|
||||
});
|
||||
|
||||
function creaPoligono(coords, color, Geocerca) {
|
||||
var polygon = new google.maps.Polygon({
|
||||
paths: coords,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 2,
|
||||
fillColor: color,
|
||||
fillOpacity: 0.35
|
||||
});
|
||||
polygon.setMap(map);
|
||||
polygons.push(polygon);
|
||||
CreaMarcadorPoligono(coords, Geocerca)
|
||||
}
|
||||
|
||||
function CreaMarcadorPoligono(coords, GeoCerca) {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (i = 0; i < coords.length; i++) {
|
||||
bounds.extend(coords[i]);
|
||||
}
|
||||
|
||||
var marker = new google.maps.Marker({
|
||||
position: bounds.getCenter(),
|
||||
title: GeoCerca,
|
||||
map: map
|
||||
});
|
||||
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: '<h4><b>' + GeoCerca + '</b></h4>'
|
||||
});
|
||||
|
||||
marker.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
infowindow.open(map, marker);
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
});
|
||||
|
||||
markers.push(marker);
|
||||
}
|
||||
|
||||
function CenterPoligono(coords) {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (i = 0; i < coords.length; i++) {
|
||||
bounds.extend(coords[i]);
|
||||
}
|
||||
map.fitBounds(bounds)
|
||||
}
|
||||
|
||||
function closeLastOpenedInfoWindow() {
|
||||
if (lastOpenedInfoWindow) {
|
||||
lastOpenedInfoWindow.close();
|
||||
}
|
||||
}
|
||||
|
||||
function FitBounds() {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
var paths = polygons[i].getPaths();
|
||||
paths.forEach(function (path) {
|
||||
var ar = path.getArray();
|
||||
for (var i = 0, l = ar.length; i < l; i++) {
|
||||
bounds.extend(ar[i]);
|
||||
}
|
||||
})
|
||||
}
|
||||
for (var i = 0; i < polybounds.length; i++) {
|
||||
bounds.extend(polybounds[i]);
|
||||
}
|
||||
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].getVisible()) {
|
||||
bounds.extend(markers[i].getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
map.fitBounds(bounds)
|
||||
}
|
||||
|
||||
function CreaMarcador(coords, nomEquipo, ContentString, imagen) {
|
||||
if (typeof imagen === 'undefined') { imagen = image; }
|
||||
var marker = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: map,
|
||||
icon: imagen
|
||||
});
|
||||
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: ContentString
|
||||
});
|
||||
marker.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
infowindow.open(map, marker);
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
});
|
||||
markers.push(marker);
|
||||
}
|
||||
|
||||
function creaPolyline(coords, color, GeoCerca) {
|
||||
var polyline = new google.maps.Polyline({
|
||||
path: coords,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 2,
|
||||
fillOpacity: 0.35
|
||||
});
|
||||
polyline.setMap(map);
|
||||
polylines.push(polyline);
|
||||
polybounds.push(coords[0]);
|
||||
polybounds.push(coords[coords.length - 1]);
|
||||
CreaMarcadorPoligono(coords, GeoCerca);
|
||||
}
|
||||
|
||||
function NuevaConsulta() {
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
polygons[i].setMap(null);
|
||||
}
|
||||
polygons = [];
|
||||
for (var i = 0; i < polylines.length; i++) {
|
||||
polylines[i].setMap(null);
|
||||
}
|
||||
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
polylines = [];
|
||||
polybounds = [];
|
||||
markers = [];
|
||||
$("#dvConsulta").modal({ backdrop: 'static', keyboard: false })
|
||||
}
|
||||
|
||||
function fitBoundsToVisibleMarkers() {
|
||||
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
bounds.extend(polygons[i].my_getBounds().getCenter())
|
||||
|
||||
}
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].getVisible()) {
|
||||
bounds.extend(markers[i].getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
map.fitBounds(bounds);
|
||||
|
||||
}
|
||||
|
||||
function CargaPickers() {
|
||||
$.datetimepicker.setLocale('es');
|
||||
$('input.ADDateTimePicker').each(function () {
|
||||
var TThis = $(this);
|
||||
TThis.datetimepicker({
|
||||
dayOfWeekStart: 1,
|
||||
lang: 'es',
|
||||
format: 'd/m/Y H:i',
|
||||
formatDate: 'd/m/Y H:i',
|
||||
step: 30
|
||||
});
|
||||
var Div = TThis.parent()
|
||||
var boton = document.createElement('span');
|
||||
boton.className = "input-group-btn"
|
||||
|
||||
var subboton = document.createElement('a')
|
||||
subboton.className = "btn default"
|
||||
subboton.innerHTML = "<i class='fa fa-calendar'></i>"
|
||||
subboton.addEventListener('click', function () {
|
||||
TThis.datetimepicker('show')
|
||||
});
|
||||
boton.appendChild(subboton)
|
||||
|
||||
Div[0].appendChild(boton)
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
function DisplayGV() {
|
||||
if ($("#C_chkUp").prop('checked')) {
|
||||
($("#dvDispositivos").css('display', ''))
|
||||
} else {
|
||||
($("#dvDispositivos").css('display', 'none'))
|
||||
}
|
||||
}
|
||||
|
||||
function CargaModal() {
|
||||
$('#C_TxtHoraI').datetimepicker({
|
||||
datepicker: false,
|
||||
lang: 'es',
|
||||
format: 'H:i',
|
||||
formatDate: 'H:i',
|
||||
step: 30
|
||||
});
|
||||
$('#C_TxtHoraF').datetimepicker({
|
||||
datepicker: false,
|
||||
lang: 'es',
|
||||
format: 'H:i',
|
||||
formatDate: 'H:i',
|
||||
step: 30
|
||||
});
|
||||
$('#dvEditar').modal()
|
||||
}
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
var open = false;
|
||||
function FNShowDiv() {
|
||||
if (open === false) {
|
||||
$("#h").modal()
|
||||
$("#ShowDiv3").css("line-height", "34px")
|
||||
open = true
|
||||
$("#ShowDiv3").html('<i class="fa fa-angle-down" aria-hidden="true"></i>')
|
||||
} else {
|
||||
$("#h").modal('hide')
|
||||
$("#ShowDiv3").css("line-height", "20px")
|
||||
open = false
|
||||
$("#ShowDiv3").html('<i class="fa fa-angle-up" aria-hidden="true"></i>')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places">
|
||||
</script>
|
||||
<%--<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAJnZ1CoEUX425C20aqzFw4dYxFL_LfThk&libraries=places">
|
||||
</script>--%>
|
||||
</asp:Content>
|
||||
|
||||
419
GPS/RepGeoReferencias.aspx.vb
Normal file
419
GPS/RepGeoReferencias.aspx.vb
Normal file
@@ -0,0 +1,419 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class GPS_RepGeoReferencias
|
||||
Inherits ClsPaginas
|
||||
|
||||
Public Property CveGeoReferencia As Integer
|
||||
Get
|
||||
Return ViewState("CveGeoReferencia").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveGeoReferencia") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtPosiciones As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtPosiciones"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtPosiciones") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property DtDetalle() As Data.DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtDetalle"), DataTable)
|
||||
End Get
|
||||
Set(ByVal value As Data.DataTable)
|
||||
ViewState("DtDetalle") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property DtDetalleEliminar() As Data.DataTable
|
||||
Get
|
||||
Return DirectCast(ViewState("DtDetalleEliminar"), DataTable)
|
||||
End Get
|
||||
Set(ByVal value As Data.DataTable)
|
||||
ViewState("DtDetalleEliminar") = value
|
||||
End Set
|
||||
End Property
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaGeoReferencias()
|
||||
CargaDispositivos()
|
||||
CreaTmpDTDetalle()
|
||||
CargaGrupos()
|
||||
' RegistraScript("$('#dvConsulta').modal()")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGeoReferencias()
|
||||
Dim Estatus = If(ChkEstatusGeocerca.Checked, 1, 0)
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.GeoReferenciaGet(-1, Estatus, "-1", UsuarioActual.CveCliente) Then
|
||||
GVGeoreferencias.DataSource = GPS.DtResultados
|
||||
Else
|
||||
GVGeoreferencias.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GVGeoreferencias.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaDispositivos()
|
||||
DdlEquipoD.DataSource = GlobalDTDispositivos(UsuarioActual.CveCliente)
|
||||
DdlEquipoD.DataBind()
|
||||
DdlEquipoD.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
GvDispositivos.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("Estatus = 1")
|
||||
GvDispositivos.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaGrupos()
|
||||
Using ObjGPS As New ClsGPS
|
||||
If ObjGPS.GruposGet(-1, UsuarioActual.CveCliente) Then
|
||||
DdlGrupo.DataSource = ObjGPS.DtResultados
|
||||
DdlGrupo.DataBind()
|
||||
End If
|
||||
End Using
|
||||
DdlGrupo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
Protected Sub CreaTmpDTDetalle()
|
||||
DtDetalle = New DataTable
|
||||
Dim pk = DtDetalle.Columns.Add("CveDispositivo", GetType(Integer))
|
||||
DtDetalle.Columns.Add("NoEconomico", GetType(String))
|
||||
DtDetalle.Columns.Add("CveDispositivoGeoReferenciaDetalle", GetType(Integer))
|
||||
DtDetalle.PrimaryKey = New DataColumn() {pk}
|
||||
|
||||
GvEquiposDetalle.DataSource = DtDetalle
|
||||
GvEquiposDetalle.DataBind()
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
Protected Sub CreaTmpDTDetalleEliminar()
|
||||
|
||||
DtDetalleEliminar = New DataTable
|
||||
Dim pk2 = DtDetalleEliminar.Columns.Add("CveDispositivo", GetType(Integer))
|
||||
DtDetalleEliminar.Columns.Add("NoEconomico", GetType(String))
|
||||
Dim pk3 = DtDetalleEliminar.Columns.Add("CveDispositivoGeoReferenciaDetalle", GetType(Integer))
|
||||
DtDetalleEliminar.PrimaryKey = New DataColumn() {pk2, pk3}
|
||||
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvGeoreferencias_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVGeoreferencias.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCLinkButton("imgColor").Style.Add("background-color", e.Row.DBCampo("Color").ToString)
|
||||
e.Row.FCLinkButton("imgE").CommandArgument = e.Row.DBCampo("CveGeoReferencia").ToString
|
||||
If e.Row.DBCampo("Estatus").ToString = "True" Then
|
||||
e.Row.FCLabel("LblEstatus").Text = "Activo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
|
||||
|
||||
Else
|
||||
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
|
||||
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
Dim Coord As String = ""
|
||||
Dim count = 0
|
||||
CreaDTPosiciones()
|
||||
For Each row As GridViewRow In GVGeoreferencias.Rows
|
||||
If row.FCCheckBox("chkGR").Checked Then
|
||||
If row.DataKey("Tipo") = "Geocerca" Then
|
||||
Coord = SQLToGmaps(row.DataKey("Coordenadas").ToString, "POLYGON")
|
||||
RegistraScript($"creaPoligono({Coord}, '{row.DataKey("Color").ToString}', '{row.DataKey("GeoReferencia")}')", count.ToString())
|
||||
AddRowPosiciones(row.DataKey("GeoReferencia").ToString, Coord)
|
||||
ElseIf row.DataKey("Tipo") = "Ruta" Then
|
||||
Coord = SQLToGmaps(row.DataKey("Coordenadas").ToString, "LINESTRING")
|
||||
RegistraScript($"creaPolyline({Coord}, '{row.DataKey("Color").ToString}', '{row.DataKey("GeoReferencia")}')", count.ToString())
|
||||
AddRowPosiciones(row.DataKey("GeoReferencia").ToString, Coord)
|
||||
End If
|
||||
End If
|
||||
count += 1
|
||||
Next
|
||||
|
||||
If chkUp.Checked Then
|
||||
Dim gps As New ClsGPS
|
||||
Dim Fecha, Vehiculo, Icono, CoordDis, Info As String
|
||||
For Each GVRow As GridViewRow In GvDispositivos.Rows
|
||||
If GVRow.FCCheckBox("chkDis").Checked Then
|
||||
If gps.UltimaPosicionEquipoGet(GVRow.DataKey("CveDispositivo").ToEntero, MinFecha, MaxFecha) Then
|
||||
If gps.DtResultados.Rows.Count > 0 Then
|
||||
CoordDis = gps.DtResultados.Rows(0)("Posicion").ToString.SQLToGmaps("POINT")
|
||||
Fecha = gps.DtResultados.Rows(0)("FechaTrama").ToString
|
||||
Vehiculo = gps.DtResultados.Rows(0)("Vehiculo").ToString
|
||||
Info = InfoWindow($"Vehículo:{Vehiculo}", "-1", GVRow.DataKey("CveDispositivo").ToString.ToEntero, gps.DtResultados.Rows(0))
|
||||
If gps.DtResultados.Rows(0)("SPD").ToString.ToDouble > 1 Then
|
||||
Icono = $"/Imagenes/{GlobalDTDispositivos(UsuarioActual.CveCliente).FiltroPrimeroValor("Icono", $"CveDispositivo = {GVRow.DataKey("CveDispositivo").ToString}")}green.png"
|
||||
Else
|
||||
Icono = $"/Imagenes/{GlobalDTDispositivos(UsuarioActual.CveCliente).FiltroPrimeroValor("Icono", $"CveDispositivo = {GVRow.DataKey("CveDispositivo").ToString}")}.png"
|
||||
End If
|
||||
RegistraScript($"CreaMarcador({CoordDis},'{GVRow.DataKey("NombreVehiculo")}', '{Info}', '{Icono}');", $"{GVRow.DataKey("CveDispositivo").ToString}D")
|
||||
Else
|
||||
Alert($"No se encontraron resultados del vehículo con serie: {GVRow.DataKey("SerieVehiculo").ToString}", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
gps.Dispose()
|
||||
End If
|
||||
chkUp.Checked = False
|
||||
UpUp.Update()
|
||||
UPModalBusqueda.Update()
|
||||
GvBarra.DataSource = DtPosiciones
|
||||
GvBarra.DataBind()
|
||||
UPGV.Update()
|
||||
RegistraScript($"FitBounds();", "XBounds")
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub imgE_Click(sender As Object, e As EventArgs)
|
||||
Dim Boton = CType(sender, LinkButton)
|
||||
CveGeoReferencia = Boton.CommandArgument.ToEntero
|
||||
DtDetalle = Nothing
|
||||
DtDetalleEliminar = Nothing
|
||||
Try
|
||||
Dim GvRow As GridViewRow = DirectCast(Boton.NamingContainer, GridViewRow)
|
||||
TxtNombre.Text = GvRow.DataKey("GeoReferencia").ToString
|
||||
TxtTolerancia.Text = GvRow.DataKey("Tolerancia").ToString
|
||||
'DdlEquipo.SelectedValueExist(GvRow.DataKey("CveDispositivo").ToString)
|
||||
txtFechaI.Text = GvRow.DataKey("FechaInicio").ToString.ToDate.ToString("dd/MM/yyyy")
|
||||
txtFechaF.Text = GvRow.DataKey("FechaFin").ToString.ToDate.ToString("dd/MM/yyyy")
|
||||
chkLunes.Checked = CBool(GvRow.DataKey("AplicaLunes").ToString)
|
||||
chkMartes.Checked = CBool(GvRow.DataKey("AplicaMartes").ToString)
|
||||
chkMiercoles.Checked = CBool(GvRow.DataKey("AplicaMiercoles").ToString)
|
||||
chkJueves.Checked = CBool(GvRow.DataKey("AplicaJueves").ToString)
|
||||
chkViernes.Checked = CBool(GvRow.DataKey("AplicaViernes").ToString)
|
||||
chkSabado.Checked = CBool(GvRow.DataKey("AplicaSabado").ToString)
|
||||
chkDomingo.Checked = CBool(GvRow.DataKey("AplicaDomingo").ToString)
|
||||
chkEstatus.Checked = CBool(GvRow.DataKey("Estatus").ToString)
|
||||
TxtHoraI.Text = GvRow.DataKey("HoraInicio").ToString.ToDateTime.ToString("HH:mm")
|
||||
TxtHoraF.Text = GvRow.DataKey("HoraFin").ToString.ToDateTime.ToString("HH:mm")
|
||||
|
||||
Using ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetReferenciaDetalle(-1, CveGeoReferencia, -1, UsuarioActual.CveCliente) Then
|
||||
If ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
DtDetalle = ObjGPS.DtResultados
|
||||
GvEquiposDetalle.DataSource = DtDetalle
|
||||
Else
|
||||
DtDetalle = Nothing
|
||||
DtDetalleEliminar = Nothing
|
||||
GvEquiposDetalle.DataSource = Nothing
|
||||
End If
|
||||
|
||||
End If
|
||||
End Using
|
||||
GvEquiposDetalle.DataBind()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al cargar la GeoReferencia.", ex)
|
||||
End Try
|
||||
RegistraScript("CargaModal();")
|
||||
UpBodyGeoReferencia.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function SQLToGmaps(CoordsSQL As String, Tipo As String) As String
|
||||
Dim CoordsPoligono As String = CoordsSQL.Replace($"{Tipo}", "").Replace(")", "").Replace("(", "")
|
||||
Dim CoordsPuntos() As String = CoordsPoligono.Split(","c)
|
||||
Dim Var As String = If(Tipo = "POINT", "", "[")
|
||||
For Each coordenada As String In CoordsPuntos
|
||||
If coordenada Is CoordsPuntos.Last Then
|
||||
Dim latlng() As String = coordenada.Trim.Split(" "c)
|
||||
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }}"
|
||||
Else
|
||||
Dim latlng() As String = coordenada.Trim.Split(" "c)
|
||||
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }},"
|
||||
End If
|
||||
Next
|
||||
Var = If(Tipo = "POINT", Var, $"{Var}]")
|
||||
Return Var
|
||||
End Function
|
||||
|
||||
Protected Sub BtnActualizarGeoreferencia_Click(sender As Object, e As EventArgs)
|
||||
|
||||
If DtDetalle IsNot Nothing AndAlso DtDetalle.Rows.Count > 0 Then
|
||||
Dim ObjGPS As New ClsGPS
|
||||
ObjGPS.IniciaTransacSQL()
|
||||
Dim TieneError As Boolean = False
|
||||
Try
|
||||
Dim HoraI As Date = ($"{Date.Now.ToString("dd/MM/yyyy")} {TxtHoraI.Text}").ToDate
|
||||
Dim HoraF As Date = ($"{Date.Now.ToString("dd/MM/yyyy")} {TxtHoraF.Text}").ToDate
|
||||
|
||||
If ObjGPS.GeoReferenciaUpdate(CveGeoReferencia, TxtNombre.Text, -1, chkEstatus.Checked, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, chkLunes.Checked, chkMartes.Checked, chkMiercoles.Checked, chkJueves.Checked, chkViernes.Checked,
|
||||
chkSabado.Checked, chkDomingo.Checked, HoraI, HoraF, TxtTolerancia.Text.ToEntero, UsuarioActual.CveCliente) Then
|
||||
|
||||
For Each Dr As DataRow In DtDetalle.Rows
|
||||
Dim CveGeoReferenciaDetalle = Dr("CveDispositivoGeoreferenciaDetalle").ToString.ToEntero
|
||||
If CveGeoReferenciaDetalle > 0 Then
|
||||
If Not ObjGPS.UpdateReferenciaDetalle(CveGeoReferenciaDetalle, CveGeoReferencia, Dr("CveDispositivo").ToString.ToEntero) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
If Not ObjGPS.AddGeoReferenciaDetalle(CveGeoReferencia, Dr("CveDispositivo").ToString.ToEntero) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If Not TieneError Then
|
||||
For Each DrE As DataRow In DtDetalleEliminar.Rows
|
||||
TieneError = Not ObjGPS.RemoveferenciaDetalle(DrE("CveDispositivoGeoreferenciaDetalle").ToString.ToEntero)
|
||||
Next
|
||||
End If
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
GuardaLog(ex.ToString())
|
||||
Finally
|
||||
If TieneError Then
|
||||
ObjGPS.RollBack()
|
||||
Alert("Ocurrió un error al guardar la georeferencia.", TipoMensaje.MsgError)
|
||||
Else
|
||||
ObjGPS.Commit()
|
||||
Alert("La georeferencia se actualizó correctamente.", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
|
||||
ObjGPS.Dispose()
|
||||
End Try
|
||||
|
||||
Else
|
||||
Alert("No hay vehiculos asignados a esta georeferencia", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
Protected Sub gvMarcas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GVGeoreferencias.RowDeleting
|
||||
Dim GPS As New ClsGPS
|
||||
Dim CveGeoReferencia As Integer = GVGeoreferencias.Rows(e.RowIndex).DataKey("CveGeoReferencia").ToEntero
|
||||
If GPS.GeoReferenciaDelete(CveGeoReferencia, UsuarioActual.CveCliente) Then
|
||||
Alert("La GeoReferencia se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaGeoReferencias()
|
||||
RegistraScript("$('#divAgregarTipo').modal('hide')")
|
||||
End Sub
|
||||
|
||||
#Region "DATA TABLES"
|
||||
Private Sub CreaDTPosiciones()
|
||||
ViewState("DtPosiciones") = Nothing
|
||||
Dim dt As New DataTable
|
||||
dt.Columns.Add("Nombre", Type.GetType("System.String"))
|
||||
dt.Columns.Add("Posicion", Type.GetType("System.String"))
|
||||
ViewState("DtPosiciones") = dt
|
||||
End Sub
|
||||
|
||||
Private Sub AddRowPosiciones(Nombres As String, Posicion As String)
|
||||
Dim dr As DataRow = DtPosiciones.NewRow()
|
||||
dr("Nombre") = Nombres
|
||||
dr("Posicion") = Posicion
|
||||
DtPosiciones.Rows.Add(dr)
|
||||
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
|
||||
e.Row.Attributes.Add("onClick", $" CenterPoligono({e.Row.DBCampo("Posicion")});")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
'Protected Sub LnkAgregarDisp_Click(sender As Object, e As EventArgs)
|
||||
|
||||
'End Sub
|
||||
'Protected Sub LnkAgregarGrupo_Click(sender As Object, e As EventArgs)
|
||||
|
||||
'End Sub
|
||||
'Protected Sub GvEquiposDetalle_RowDeleting(sender As Object, e As GridViewDeleteEventArgs)
|
||||
|
||||
'End Sub
|
||||
Protected Sub GvEquiposDetalle_RowDeleting(sender As Object, e As GridViewDeleteEventArgs)
|
||||
If DtDetalleEliminar Is Nothing Then
|
||||
CreaTmpDTDetalleEliminar()
|
||||
End If
|
||||
|
||||
If DtDetalle.Rows.Count > 0 Then
|
||||
Dim Dr As DataRow = DtDetalle.Rows(e.RowIndex)
|
||||
Dim CveGeoReferenciaDetalle = Dr("CveDispositivoGeoreferenciaDetalle").ToString.ToEntero
|
||||
If CveGeoReferenciaDetalle > 0 Then
|
||||
|
||||
Dim DrEliminar = DtDetalleEliminar.NewRow
|
||||
DrEliminar("CveDispositivoGeoreferenciaDetalle") = CveGeoReferenciaDetalle
|
||||
DrEliminar("CveDispositivo") = Dr("CveDispositivo").ToString.ToEntero
|
||||
DrEliminar("NoEconomico") = Dr("NoEconomico").ToString
|
||||
DtDetalleEliminar.Rows.Add(DrEliminar)
|
||||
DtDetalleEliminar.AcceptChanges()
|
||||
|
||||
End If
|
||||
DtDetalle.Rows.RemoveAt(e.RowIndex)
|
||||
|
||||
GvEquiposDetalle.DataSource = DtDetalle
|
||||
GvEquiposDetalle.DataBind()
|
||||
End If
|
||||
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
Protected Sub LnkAgregarDisp_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim CveDispositivo As Integer = DdlEquipoD.SelectedValue.ToEntero
|
||||
If CveDispositivo > 0 Then
|
||||
Dim NoEconomico As String = DdlEquipoD.SelectedItem.Text
|
||||
|
||||
If DtDetalle IsNot Nothing Then
|
||||
If Not DtDetalle.Select($"CveDispositivo={CveDispositivo}").Any() Then
|
||||
Dim Dr As DataRow = DtDetalle.NewRow
|
||||
Dr("CveDispositivo") = CveDispositivo
|
||||
Dr("NoEconomico") = NoEconomico
|
||||
Dr("CveDispositivoGeoReferenciaDetalle") = -1
|
||||
|
||||
DtDetalle.Rows.Add(Dr)
|
||||
DtDetalle.AcceptChanges()
|
||||
Else
|
||||
Alert($"El dispositivo '{NoEconomico} ya existe en la tabla.'", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Else
|
||||
CreaTmpDTDetalle()
|
||||
CreaTmpDTDetalleEliminar()
|
||||
Dim Dr As DataRow = DtDetalle.NewRow
|
||||
Dr("CveDispositivo") = CveDispositivo
|
||||
Dr("NoEconomico") = NoEconomico
|
||||
Dr("CveDispositivoGeoReferenciaDetalle") = -1
|
||||
|
||||
DtDetalle.Rows.Add(Dr)
|
||||
DtDetalle.AcceptChanges()
|
||||
End If
|
||||
|
||||
GvEquiposDetalle.DataSource = DtDetalle
|
||||
GvEquiposDetalle.DataBind()
|
||||
End If
|
||||
UpAgregar.Update()
|
||||
CargaGeoReferencias()
|
||||
RegistraScript("CargaPickersHora();", "1")
|
||||
|
||||
End Sub
|
||||
Protected Sub LnkAgregarGrupo_Click(sender As Object, e As EventArgs)
|
||||
Dim CveGrupo As Integer = DdlGrupo.SelectedValue.ToEntero
|
||||
|
||||
Using ObjGPS As New ClsGPS
|
||||
|
||||
If ObjGPS.GruposDetallesGet(CveGrupo) Then
|
||||
Dim Query = From dr In ObjGPS.DtResultados
|
||||
Select CveDispositivo = dr("CveDispositivo").ToString.ToEntero, NoEconomico = dr("NoEconomico").ToString, CveDispositivoGeoReferenciaDetalle = -1
|
||||
|
||||
Dim dt As DataTable = Query.QueryToDataTable(True)
|
||||
dt.PrimaryKey = New DataColumn() {dt.Columns(0)}
|
||||
DtDetalle.Merge(dt, True, MissingSchemaAction.Ignore)
|
||||
|
||||
End If
|
||||
|
||||
End Using
|
||||
GvEquiposDetalle.DataSource = DtDetalle
|
||||
GvEquiposDetalle.DataBind()
|
||||
UpAgregar.Update()
|
||||
RegistraScript("CargaPickersHora();", "1")
|
||||
End Sub
|
||||
|
||||
Protected Sub ChkEstatusGeocerca_CheckedChanged(sender As Object, e As EventArgs)
|
||||
CargaGeoReferencias()
|
||||
End Sub
|
||||
End Class
|
||||
126
GPS/RepIgnicion.aspx
Normal file
126
GPS/RepIgnicion.aspx
Normal file
@@ -0,0 +1,126 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepIgnicion.aspx.cs" Inherits="GPS_RepIgnicion" %>
|
||||
|
||||
<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 de Ignición
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkImprimirPDF" Visible="false" OnClick="LnkImprimirPDF_Click" runat="server"><i class="fa fa-file-pdf-o"></i> Imprimir PDF</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkImprimirPDF" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</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>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" ValidationGroup="GrpGuardar" Text="Consultar" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption" style="margin-top: -8px;">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Vehículo:
|
||||
<asp:DropDownList AppendDataBoundItems="true" ID="DdlDispositivo" runat="server" Width="200px" DataTextField="Display" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Value="-1" Text="Seleccione"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlDispositivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Conductor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDispositivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDispositivo" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
<li>Fecha Inicio:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
<li>Fecha Fin:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Igniciones</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 rowpadding">
|
||||
<asp:GridView ID="GvIgnicion" runat="server" GridLines="None" OnRowDataBound="GvIgnicion_RowDataBound" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-rows ="1" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Numero de Vueltas Realizadas">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Vehiculo" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaEncendido" ItemStyle-Width="12.5%" HeaderText="Fecha Encendido" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaApagado" ItemStyle-Width="12.5%" HeaderText="Fecha Apagado" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="VMedia" DataFormatString="{0:N2} Km/hr." ItemStyle-Width="12.5%" HeaderText="Velocidad Media" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="VMax" DataFormatString="{0:N2} Km/hr." ItemStyle-Width="12.5%" HeaderText="Velocidad Máxima" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Kilometraje" DataFormatString="{0:N2} Km." ItemStyle-Width="12.5%" HeaderText="Kilometraje" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Duracion" ItemStyle-Width="12.5%" HeaderText="Duración" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Dirección Inicial" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDireccionInicial" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Dirección Final" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDireccionFinal" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivModalGrafica" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpGraficaEventos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<asp:HiddenField ID="HdnImagen" ClientIDMode="Static" Value="[]" runat="server" />
|
||||
<asp:HiddenField ID="HdnGrafica" ClientIDMode="Static" Value="[]" runat="server" />
|
||||
<div id="DvGrafica" style="min-width: 900px; height: 500px; margin: 0 auto"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="modal-btn">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
141
GPS/RepIgnicion.aspx.cs
Normal file
141
GPS/RepIgnicion.aspx.cs
Normal file
@@ -0,0 +1,141 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
using System.Data;
|
||||
using System.Net;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.IO;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
|
||||
public partial class GPS_RepIgnicion : ClsPaginas
|
||||
{
|
||||
#region "P R O P I E D A D E S"
|
||||
private DataTable DtIgniciones
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((DataTable)(ViewState["DtIgniciones"]));
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["DtIgniciones"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaFecha();
|
||||
CargaDispositivos();
|
||||
UPFiltros.Update();
|
||||
}
|
||||
}
|
||||
private void CargaFecha()
|
||||
{
|
||||
txtFechaI.Text = $"{DateTime.Now.AddDays(-7).ToString("dd/MM/yyyy")} 00:00";
|
||||
txtFechaF.Text = $"{DateTime.Now.ToString("dd/MM/yyyy")} 23:59";
|
||||
}
|
||||
private void CargaDispositivos()
|
||||
{
|
||||
DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario);
|
||||
DdlDispositivo.DataBind();
|
||||
}
|
||||
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var ObjGPS = new ClsGPS())
|
||||
{
|
||||
int CveDispositivo = DdlDispositivo.SelectedValue.ToEntero();
|
||||
DateTime FechaI = txtFechaI.Text.ToDateTime(), FechaF = txtFechaF.Text.ToDateTime();
|
||||
|
||||
if (ObjGPS.GetRepIgnicion(CveDispositivo, FechaI, FechaF, UsuarioActual.CveCliente))
|
||||
{
|
||||
DtIgniciones = ObjGPS.DtResultados;
|
||||
GvIgnicion.DataSource = DtIgniciones;
|
||||
GvIgnicion.DataBind();
|
||||
LnkImprimirPDF.Visible = true;
|
||||
}
|
||||
}
|
||||
UpDatos.Update();
|
||||
}
|
||||
|
||||
protected void GvIgnicion_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
CargaDireccion(e.Row.DBCampo("LatitudInicial"), e.Row.DBCampo("LongitudInicial"), "DireccionInical", "LtlDireccionInicial", e.Row);
|
||||
CargaDireccion(e.Row.DBCampo("LatitudFinal"), e.Row.DBCampo("LongitudFinal"), "DireccionFinal", "LtlDireccionFinal", e.Row);
|
||||
}
|
||||
}
|
||||
private void CargaDireccion(string lat, string lng, string campo, string control, GridViewRow row)
|
||||
{
|
||||
try
|
||||
{
|
||||
string DireccionJSON = "";
|
||||
WebRequest request;
|
||||
JObject js = null;
|
||||
request = WebRequest.Create(String.Format("{0}nominatim/reverse.php?format=jsonv2&lat={1}&lon={2}", ClsPaginas.UrlDirecciones, lat, lng));
|
||||
request.Method = "GET";
|
||||
WebResponse response = request.GetResponse();
|
||||
Stream inputstream1 = response.GetResponseStream();
|
||||
StreamReader reader = new StreamReader(inputstream1);
|
||||
DireccionJSON = reader.ReadToEnd();
|
||||
inputstream1.Dispose();
|
||||
reader.Close();
|
||||
response.Close();
|
||||
request = null;
|
||||
js = JObject.Parse(DireccionJSON);
|
||||
if (js != null)
|
||||
{
|
||||
DtIgniciones.Rows[row.RowIndex][campo] = js["display_name"].ToString();
|
||||
row.FCLiteral(control).Text = js["display_name"].ToString();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.GuardaLog(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkImprimirPDF_Click(object sender, EventArgs e)
|
||||
{
|
||||
EnviarReporteProgramado();
|
||||
}
|
||||
public void EnviarReporteProgramado()
|
||||
{
|
||||
if (DtIgniciones != null)
|
||||
{
|
||||
byte[] retorno;
|
||||
string RutaReporte = "Empresas/Grales/ReportesProgramados/RPIgnicion.rdlc";
|
||||
|
||||
try
|
||||
{
|
||||
List<ReportParameter> RptParametro = new List<ReportParameter>();
|
||||
RptParametro.Add(new ReportParameter("FechaInicio", txtFechaI.Text.ToDateTime().ToString("dd/MM/yyyy HH:mm")));
|
||||
RptParametro.Add(new ReportParameter("FechaFin", txtFechaF.Text.ToDateTime().ToString("dd/MM/yyyy HH:mm")));
|
||||
RptParametro.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Usuario));
|
||||
RptParametro.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy HH:mm tt")));
|
||||
|
||||
retorno = StreamPDF(RutaReporte, DtIgniciones, RptParametro, "ReporteEventos", "PDF", "DsOC");
|
||||
// TODO: Labeled Arguments not supported. Argument: 6 := 'MR'
|
||||
// TODO: Labeled Arguments not supported. Argument: 7 := 'RDSName'
|
||||
ImprimirbytesPDF(retorno, "ReporteEventos");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.GuardaLog(string.Format("Ocurrio un error al generar el reporte RLDC {0}", ex));
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("No se pudo imprimir el pdf, ya que no se ha hecho una consulta, o esta no arrojo resultados.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
226
GPS/RepParadas.aspx
Normal file
226
GPS/RepParadas.aspx
Normal file
@@ -0,0 +1,226 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepParadas.aspx.cs" Inherits="GPS_RepParardas" %>
|
||||
|
||||
<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 de Rutas
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LinkPDF" runat="server" OnClick="LinkPDF_Click" Visible="false"> <i class="fa fa-ad-pdf"></i> Imprimir</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LinkPDF" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server" OnClick="LnkExportar_Click" Visible="false"><i class="fa fa-ad-excel"></i> Exportar Excel</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkExportar" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="HpGrafica" Visible="false" OnClientClick="CargaChart(); return false;" data-toggle="modal" data-target="#DivModalGrafca" runat="server"><i class="fa fa-bar-chart"></i> Ver Porcentajes</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</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>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" ValidationGroup="GrpGuardar" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption" style="margin-top: -8px;">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Grupo:
|
||||
<asp:DropDownList AppendDataBoundItems="true" ID="DdlGrupo" runat="server" Width="200px" DataTextField="Nombre" DataValueField="CveDispositivosGrupos" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Value="-2" Text="Seleccione"></asp:ListItem>
|
||||
<asp:ListItem Value="-1" Text="Todos"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlGrupo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Conductor''</b> es necesario, por favor seleccione uno." InitialValue="-2" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDispositivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDispositivo" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
<li>Fecha Inicio:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
<li>Fecha Fin:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel runat="server" ID="UpDash" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" id="DivIndicadores" runat="server" visible="false">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet light">
|
||||
<div class="portlet-title">
|
||||
<div class="caption" style="font-size: 17px; width: 80%;">
|
||||
<span style="font-size: 24px; font-weight: bold; text-align: center">Reporte de rutas del grupo:
|
||||
<asp:Literal ID="LtlGrupo" runat="server"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="#" class="fullscreen" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="col-md-4">
|
||||
<a class="dashboard-stat dashboard-stat-v2 green" href="#">
|
||||
<div class="visual">
|
||||
<i class="material-icons">attach_money</i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="549">
|
||||
<asp:Literal runat="server" ID="LtlTotal"></asp:Literal></span>MXN
|
||||
</div>
|
||||
<div class="desc">Total General</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<a class="dashboard-stat dashboard-stat-v2 yellow" href="#">
|
||||
<div class="visual">
|
||||
<i class="material-icons">warning</i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="1349">
|
||||
<asp:Literal runat="server" ID="LtlNumEventos"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="desc">Número de Eventos</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<a class="dashboard-stat dashboard-stat-v2 blue" href="#">
|
||||
<div class="visual">
|
||||
<i class="material-icons">account_circle</i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="1349">
|
||||
<asp:Literal runat="server" ID="LtlMejorC"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="desc">Mejor conductor</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="margin-left: 0px; margin-top: 15px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GvDatos" runat="server" OnRowDataBound="GvDatos_RowDataBound" GridLines="None" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Compuestos Activos">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Conductor" ItemStyle-Width="12.5%" HeaderText="Conductor" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="GeoReferencia" ItemStyle-Width="12.5%" HeaderText="Parada" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="NumVueltas" ItemStyle-Width="12.5%" HeaderText="Número de Vueltas" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Clasificacion" ItemStyle-Width="12.5%" HeaderText="Clasificación" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="TotalEventos" ItemStyle-Width="12.5%" HeaderText="Número Eventos" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="Importe" ItemStyle-Width="12.5%" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="Fecha" ItemStyle-Width="12.5%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivModalGrafca" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalGrafica" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">Porcentaje de Importes por Vehículos.</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:HiddenField ID="HdnJsonChart" Value="[]" runat="server" ClientIDMode="Static" />
|
||||
<div id="dvGrafica"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="modal-btn">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
function CargaChart() {
|
||||
var datos = JSON.parse($('#HdnJsonChart').val());
|
||||
$("#dvGrafica").highcharts({
|
||||
chart: {
|
||||
plotBackgroundColor: null,
|
||||
plotBorderWidth: null,
|
||||
plotShadow: false,
|
||||
type: 'pie'
|
||||
},
|
||||
title: {
|
||||
text: ''
|
||||
},
|
||||
tooltip: {
|
||||
pointFormat: '{series.name}: <b>{point.Importe:,.2f}$</b>'
|
||||
},
|
||||
plotOptions: {
|
||||
pie: {
|
||||
allowPointSelect: true,
|
||||
cursor: 'pointer',
|
||||
dataLabels: {
|
||||
enabled: true,
|
||||
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
|
||||
style: {
|
||||
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: 'Importe',
|
||||
colorByPoint: true,
|
||||
data: datos
|
||||
}]
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
202
GPS/RepParadas.aspx.cs
Normal file
202
GPS/RepParadas.aspx.cs
Normal file
@@ -0,0 +1,202 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
public partial class GPS_RepParardas : ClsPaginas
|
||||
{
|
||||
#region "P R O P I E D A D E S"
|
||||
private DataTable DtParadas
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((DataTable)(ViewState["DtParadas"]));
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["DtParadas"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaFecha();
|
||||
CargaGrupos();
|
||||
}
|
||||
}
|
||||
private void CargaGrupos()
|
||||
{
|
||||
ClsGPS ObjGPS = new ClsGPS();
|
||||
if (ObjGPS.GruposGet(-1,UsuarioActual.CveCliente))
|
||||
{
|
||||
DdlGrupo.DataSource = ObjGPS.DtResultados;
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
DdlGrupo.DataBind();
|
||||
UPFiltros.Update();
|
||||
}
|
||||
private void CargaFecha()
|
||||
{
|
||||
txtFechaI.Text = DateTime.Now.ToString("dd/MM/yyyy") + " 00:00";
|
||||
txtFechaF.Text = DateTime.Now.ToString("dd/MM/yyyy") + " 23:59";
|
||||
}
|
||||
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
int CveGrupo = DdlGrupo.SelectedValue.ToEntero();
|
||||
if (CveGrupo > -2)
|
||||
{
|
||||
DateTime FechaI = txtFechaI.Text.ToDateTime();
|
||||
DateTime FechaF = txtFechaF.Text.ToDateTime();
|
||||
|
||||
ClsGPS ObjGPS = new ClsGPS();
|
||||
if (ObjGPS.GetRepParadas(CveGrupo, FechaI, FechaF, UsuarioActual.CveCliente))
|
||||
{
|
||||
DtParadas = ObjGPS.DtResultados.Copy();
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
if (DtParadas != null)
|
||||
{
|
||||
CargaDashboard(DtParadas);
|
||||
CargaGrafica(DtParadas);
|
||||
GvDatos.DataSource = DtParadas;
|
||||
GvDatos.DataBind();
|
||||
}
|
||||
UpDash.Update();
|
||||
UpDatos.Update();
|
||||
UpModalGrafica.Update();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("Debe seleccionar un grupo", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
private void CargaDashboard(DataTable Dt)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Dt != null)
|
||||
{
|
||||
DataRow Dr = Dt.FiltroPrimero("TipoColumna=1");
|
||||
if (Dr != null)
|
||||
{
|
||||
var Total = Dr["Importe"].ToString().FormatoNumero();
|
||||
var NumEventos = Dr["TotalEventos"].ToString();
|
||||
var MejorConductor = Dt.FiltroPrimeroValor("Conductor", "CveConductor IS NOT NULL AND TotalEventos IS NOT NULL", "TotalEventos ASC");
|
||||
|
||||
LtlGrupo.Text = DdlGrupo.SelectedItem.Text;
|
||||
LtlTotal.Text = Total;
|
||||
LtlNumEventos.Text = NumEventos;
|
||||
LtlMejorC.Text = MejorConductor;
|
||||
|
||||
DivIndicadores.Visible = true;
|
||||
|
||||
LinkPDF.Visible = true;
|
||||
LnkExportar.Visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ModExtensiones.OnError(this, "Ocurrió un error al cargar los indicadores", ex);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
private void CargaGrafica(DataTable Dt)
|
||||
{
|
||||
try
|
||||
{
|
||||
var DtTop = Dt.FiltraParametros("CveConductor IS NOT NULL AND TotalEventos IS NOT NULL", "TotalEventos ASC").AsEnumerable().Take<DataRow>(10);
|
||||
decimal Total = DtTop.Sum(dr => dr["Importe"].ToString().ToDecimal());
|
||||
decimal PorcentajeTotal = 100m;
|
||||
|
||||
var JsonArray = new JArray()
|
||||
{
|
||||
from d in DtTop
|
||||
select new JObject()
|
||||
{
|
||||
new JProperty("name",d["NoEconomico"].ToString()),
|
||||
new JProperty("Importe",d["Importe"].ToString().ToDecimal()),
|
||||
new JProperty("y", (d["Importe"].ToString().ToDecimal()/Total) * PorcentajeTotal)
|
||||
}
|
||||
};
|
||||
|
||||
HpGrafica.Visible = true;
|
||||
HdnJsonChart.Value = JsonArray.ToString();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
protected void GvDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
switch (e.Row.DBCampo("TipoColumna"))
|
||||
{
|
||||
case "1":
|
||||
e.Row.CssClass = "Totales";
|
||||
break;
|
||||
case "2":
|
||||
e.Row.CssClass = "SubTotales";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
private void ImprimirPDFParadas(string TipoDoc = "PDF")
|
||||
{
|
||||
if (DtParadas != null)
|
||||
{
|
||||
byte[] retorno;
|
||||
string RutaReporte = "Empresas/Grales/ReportesProgramados/RPTParadas.rdlc";
|
||||
string NombreReporte = "ReporteRutas";
|
||||
try
|
||||
{
|
||||
var TotalGeneral = LtlTotal.Text;
|
||||
var Grupo = LtlGrupo.Text;
|
||||
var NumEventos = LtlNumEventos.Text;
|
||||
var MejorC = LtlMejorC.Text;
|
||||
List<ReportParameter> RptParametro = new List<ReportParameter>();
|
||||
RptParametro.Add(new ReportParameter("FechaInicio", txtFechaI.Text.ToString()));
|
||||
RptParametro.Add(new ReportParameter("FechaFin", txtFechaF.Text.ToString()));
|
||||
RptParametro.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Usuario));
|
||||
RptParametro.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString()));
|
||||
RptParametro.Add(new ReportParameter("Grupo", Grupo));
|
||||
RptParametro.Add(new ReportParameter("TotalGeneral", TotalGeneral));
|
||||
RptParametro.Add(new ReportParameter("NumEventos", NumEventos));
|
||||
RptParametro.Add(new ReportParameter("MejorConductor", MejorC));
|
||||
retorno = StreamPDF(RutaReporte, DtParadas, RptParametro, string.Format("{0}{1}", NombreReporte, DateTime.Now.ToShortDateString()), TipoDoc, "DsOC");
|
||||
ImprimirbytesPDF(retorno, string.Format("{0}{1}", NombreReporte, DateTime.Now.ToShortDateString()));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ModExtensiones.GuardaLog(string.Format("Ocurrio un error al generar el reporte RLDC {0}", ex));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void LinkPDF_Click(object sender, EventArgs e)
|
||||
{
|
||||
ImprimirPDFParadas();
|
||||
}
|
||||
|
||||
protected void LnkExportar_Click(object sender, EventArgs e)
|
||||
{
|
||||
//var table = new System.Web.UI.HtmlControls.HtmlTable();
|
||||
// table.InnerHtml = DivIndicadores.InnerHtml;
|
||||
GvDatos.ExportToExcelx("ReporteRutas");
|
||||
}
|
||||
}
|
||||
520
GPS/RepPasajero.aspx
Normal file
520
GPS/RepPasajero.aspx
Normal file
@@ -0,0 +1,520 @@
|
||||
<%@ Page Title="" Language="C#" ViewStateMode="Enabled" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepPasajero.aspx.cs" Inherits="GPS_RepPasajero" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
td a {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.ADScroller-body {
|
||||
max-height: 400px;
|
||||
}
|
||||
|
||||
.dataTables_scrollHeadInner > table {
|
||||
background: lightgray;
|
||||
}
|
||||
|
||||
table.dataTable th.focus, table.dataTable td.focus {
|
||||
outline: 3px solid #3366ff00;
|
||||
outline-offset: -1px;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Pasajeros
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="HpGrafica" Visible="false" OnClientClick="CargaChart(); return false;" data-toggle="modal" data-target="#DivModalGrafca" data-backdrop="static" data-keyboard="false" runat="server"><i class="fa fa-bar-chart"></i> Ver Grafica</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton ID="LnkExportaExcel" Visible="false" OnClientClick="ImprimeGrafica(); return false;" OnClick="LnkExportaExcel_Click" runat="server"><i class="fa fa-file-excel-o"></i> Exportar a Excel</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkExportaExcel" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</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>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" ValidationGroup="GrpGuardar" Text="Consultar" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption" style="margin-top: -8px;">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Grupo:
|
||||
<asp:DropDownList AppendDataBoundItems="true" ID="DdlGrupo" runat="server" Width="200px" DataTextField="Nombre" DataValueField="CveDispositivosGrupos" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Value="-2" Text="Seleccione"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlGrupo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Conductor''</b> es necesario, por favor seleccione uno." InitialValue="-2" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDispositivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDispositivo" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</li>
|
||||
<li>Fecha Inicio:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
<li>Fecha Fin:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="divContenido" runat="server" visible="false">
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Numero de Vueltas</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 rowpadding">
|
||||
<asp:GridView ID="GvVueltas" runat="server" Style="overflow-x: auto;" GridLines="None" OnRowDataBound="GvVueltas_RowDataBound" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-rows ="3" data-sortindex="1" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Numero de Vueltas Realizadas">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="material-icons font-green" style="font-size: 24px;">attach_money</i>
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Costo de Vueltas (MXN)</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 rowpadding">
|
||||
<asp:GridView ID="GvCostos" runat="server" OnRowCreated="GvCostos_RowCreated" GridLines="None" DataKeyNames="CveDispositivo" OnRowDataBound="GvCostos_RowDataBound" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-rows ="2" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Costos por Vuelta">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="material-icons font-green" style="font-size: 24px;">local_shipping</i>
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Kilometros Recorridos</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:CargaGraficaKilometros();$('#DivModalGraficaKilometros').modal({ backdrop: 'static', keyboard: false });"><i class="icon-graph" style="font-size: 30px; color: #c1ccd1 !important;"></i></a>
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<asp:GridView ID="GvKilometros" runat="server" GridLines="None" OnRowDataBound="GvKilometros_RowDataBound" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-rows ="2" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Kilometros Recorridos">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="material-icons font-green" style="font-size: 24px;">attach_money</i>
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Costo de Kilometros Recorridos (MXN)</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 rowpadding" id="DvKilometrosCostoHeader" runat="server">
|
||||
<asp:HiddenField ID="HdnHeaderKMCosto" runat="server" />
|
||||
<asp:GridView ID="GvKilometrosCosto" runat="server" GridLines="None" OnRowDataBound="GvKilometrosCosto_RowDataBound" OnRowCreated="GvKilometrosCosto_RowCreated" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-rows ="3" data-sortindex="1" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Kilometros Recorridos">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="material-icons font-green" style="font-size: 24px;">local_shipping</i>
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Driving (Eventos Ocurridos)</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:CargaGraficaEventos();$('#DivModalGraficaEventos').modal({ backdrop: 'static', keyboard: false });"><i class="icon-graph" style="font-size: 30px; color: #c1ccd1 !important;"></i></a>
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<asp:GridView ID="GvDriving" runat="server" GridLines="None" OnRowDataBound="GvDriving_RowDataBound" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-rows ="2" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Kilometros Recorridos">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<asp:HiddenField ID="HdnCostosValores" ClientIDMode="Static" Value="[]" runat="server" />
|
||||
<asp:HiddenField ID="HdnCostosKilometros" ClientIDMode="Static" Value="[]" runat="server" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivModalGraficaKilometros" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalGraficaKilometros" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<asp:HiddenField ID="HdnGraficaKilometros" ClientIDMode="Static" Value="[]" runat="server" />
|
||||
<asp:HiddenField ID="HdnGraficaKilometros64" ClientIDMode="Static" Value="[]" runat="server" />
|
||||
<div id="dvGraficaKilometros" style="min-width: 900px; height: 500px; margin: 0 auto"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="modal-btn">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div id="DivModalGraficaEventos" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpGraficaEventos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<asp:HiddenField ID="HdnGraficaEventos" ClientIDMode="Static" Value="[]" runat="server" />
|
||||
<asp:HiddenField ID="HdnGraficaEventos64" ClientIDMode="Static" Value="[]" runat="server" />
|
||||
<div id="DvGraficaEventos" style="min-width: 900px; height: 500px; margin: 0 auto"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="modal-btn">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div id="DivModalVueltas" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalEditar" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 id="ModalTitulo" class="modal-title"></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:HiddenField ID="HdnFechaValue" runat="server" ClientIDMode="Static" />
|
||||
<asp:GridView ID="GvModalEditar" runat="server" GridLines="None" DataKeyNames="CveDispositivo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="50%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField ItemStyle-Width="50%" HeaderText="Pago" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtImporte" runat="server" Text="" CssClass="form-control input-sm calcular"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FTEImporte" runat="server" TargetControlID="TxtImporte" FilterType="Custom,Numbers" ValidChars="." />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="modal-btn">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
|
||||
<asp:Button ID="BtnGuardarCostos" runat="server" Text="Guardar" CssClass="btn btn-primary" OnClick="BtnGuardarCostos_Click1" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div id="DivModalKilometros" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalKilometros" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 id="ModalTituloKilometros" class="modal-title"></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:HiddenField ID="HdnFechaKilometrosValue" runat="server" ClientIDMode="Static" />
|
||||
<asp:GridView ID="GvModalKilometros" runat="server" GridLines="None" DataKeyNames="CveDispositivo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="50%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField ItemStyle-Width="50%" HeaderText="Pago" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtImporte" runat="server" Text="" CssClass="form-control input-sm calcular"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender ID="FTEImporte" runat="server" TargetControlID="TxtImporte" FilterType="Custom,Numbers" ValidChars="." />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="modal-btn">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
|
||||
<asp:Button ID="BtnGuardarCostosKilometros" runat="server" Text="Guardar" CssClass="btn btn-primary" OnClick="BtnGuardarCostosKilometros_Click" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div id="DvEventos" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpGvEventos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 id="ModalTituloEventos" runat="server" class="modal-title"></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:HiddenField ID="HiddenField1" runat="server" ClientIDMode="Static" />
|
||||
<asp:GridView ID="GvEventosDetalle" OnRowDataBound="GvEventosDetalle_RowDataBound" runat="server" GridLines="None" DataKeyNames="CveDispositivo" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="30%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Evento" ItemStyle-Width="40%" HeaderText="Evento" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Total" ItemStyle-Width="30%" HeaderText="Total" DataFormatString="{0:N}" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="modal-btn">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpEventos" runat="server" ClientIDMode="Static" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HdnDispositivo" ClientIDMode="Static" Value="-1" runat="server" />
|
||||
<asp:HiddenField ID="HdnOpcion" ClientIDMode="Static" Value="-1" runat="server" />
|
||||
<asp:HiddenField ID="HdnFechaDetalle" ClientIDMode="Static" Value="" runat="server" />
|
||||
<asp:LinkButton ID="LnkEventosDetalle" Text="ED" Style="display: none;" runat="server" OnClick="LnkEventosDetalle_Click"></asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
function CargaGraficaKilometros(print) {
|
||||
var datosKM = JSON.parse($('#HdnGraficaKilometros').val());
|
||||
var datosgrupo = $("#C_DdlGrupo").select2('data');
|
||||
var titulo = "";
|
||||
if (typeof (datosgrupo) !== 'undefined') {
|
||||
titulo = "TOTAL DE KILOMETROS RECORRIDOS DEL GRUPO:<b>" + datosgrupo[0].text + "</b>";
|
||||
}
|
||||
$("#dvGraficaKilometros").highcharts({
|
||||
chart: {
|
||||
type: 'column'
|
||||
},
|
||||
title: {
|
||||
text: titulo
|
||||
},
|
||||
subtitle: {
|
||||
text: ''
|
||||
},
|
||||
xAxis: {
|
||||
categories: datosKM.categories,
|
||||
crosshair: true
|
||||
},
|
||||
yAxis: {
|
||||
min: 0,
|
||||
title: {
|
||||
text: ''
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
|
||||
pointFormat: '<tr><td style="color:{series.color};padding:0">Total de {series.name}: </td>' +
|
||||
'<td style="padding:0"><b>{point.y:.1f}</b></td></tr>',
|
||||
footerFormat: '</table>',
|
||||
shared: true,
|
||||
useHTML: true
|
||||
},
|
||||
plotOptions: {
|
||||
column: {
|
||||
pointPadding: 0.2,
|
||||
borderWidth: 0
|
||||
}
|
||||
},
|
||||
series: datosKM.series
|
||||
});
|
||||
save_chart($('#dvGraficaKilometros').highcharts(), print, 'HdnGraficaKilometros64');
|
||||
}
|
||||
|
||||
function CargaGraficaEventos(print) {
|
||||
var datosKM = JSON.parse($('#HdnGraficaEventos').val());
|
||||
var datosgrupo = $("#C_DdlGrupo").select2('data');
|
||||
var titulo = "";
|
||||
if (typeof (datosgrupo) !== 'undefined') {
|
||||
titulo = "TOTAL DE EVENTOS OCURRIDOS DEL GRUPO:<b>" + datosgrupo[0].text + "</b>";
|
||||
}
|
||||
$("#DvGraficaEventos").highcharts({
|
||||
chart: {
|
||||
type: 'column'
|
||||
},
|
||||
title: {
|
||||
text: titulo
|
||||
},
|
||||
subtitle: {
|
||||
text: ''
|
||||
},
|
||||
xAxis: {
|
||||
categories: datosKM.categories,
|
||||
crosshair: true
|
||||
},
|
||||
yAxis: {
|
||||
min: 0,
|
||||
title: {
|
||||
text: ''
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
|
||||
pointFormat: '<tr><td style="color:{series.color};padding:0">Total de {series.name}: </td>' +
|
||||
'<td style="padding:0"><b>{point.y:.1f}</b></td></tr>',
|
||||
footerFormat: '</table>',
|
||||
shared: true,
|
||||
useHTML: true
|
||||
},
|
||||
plotOptions: {
|
||||
column: {
|
||||
pointPadding: 0.2,
|
||||
borderWidth: 0
|
||||
}
|
||||
},
|
||||
series: datosKM.series
|
||||
});
|
||||
save_chart($('#DvGraficaEventos').highcharts(), print, 'HdnGraficaEventos64');
|
||||
}
|
||||
|
||||
function CargaModal(Fecha) {
|
||||
$(".calcular").each(function (key, value) {
|
||||
this.value = "";
|
||||
});
|
||||
HdnFechaValue.value = Fecha;
|
||||
ModalTitulo.innerText = 'Costos de vueltas del día: ' + Fecha;
|
||||
$("#DivModalVueltas").modal({ backdrop: 'static', keyboard: false });
|
||||
}
|
||||
function CargaModalKilometros(Fecha) {
|
||||
$(".calcularKilometros").each(function (key, value) {
|
||||
this.value = "";
|
||||
});
|
||||
HdnFechaKilometrosValue.value = Fecha;
|
||||
ModalTituloKilometros.innerText = 'Costos de kilometraje del día: ' + Fecha;
|
||||
$("#DivModalKilometros").modal({ backdrop: 'static', keyboard: false });
|
||||
}
|
||||
|
||||
function CargaDetalleEventos(CveDispositivo, Fecha, Opcion) {
|
||||
$("#HdnDispositivo").val(CveDispositivo);
|
||||
$("#HdnFechaDetalle").val(Fecha);
|
||||
$("#HdnOpcion").val(Opcion);
|
||||
__doPostBack('ctl00$C$LnkEventosDetalle', '');
|
||||
}
|
||||
|
||||
EXPORT_WIDTH = 1000;
|
||||
function save_chart(chart, print, imagen) {
|
||||
var render_width = EXPORT_WIDTH;
|
||||
var render_height = render_width * chart.chartHeight / chart.chartWidth
|
||||
|
||||
var svg = chart.getSVG({
|
||||
exporting: {
|
||||
sourceWidth: chart.chartWidth,
|
||||
sourceHeight: chart.chartHeight
|
||||
}
|
||||
});
|
||||
|
||||
var canvas = document.createElement('canvas');
|
||||
canvas.height = render_height;
|
||||
canvas.width = render_width;
|
||||
|
||||
var image = new Image;
|
||||
image.onload = function () {
|
||||
canvas.getContext('2d').drawImage(this, 0, 0, render_width, render_height);
|
||||
var data = canvas.toDataURL("image/png");
|
||||
|
||||
$("#" + imagen).val(data);
|
||||
if (print) {
|
||||
__doPostBack('ctl00$H$LnkExportaExcel', '')
|
||||
}
|
||||
};
|
||||
image.src = 'data:image/svg+xml;base64,' + utoa(svg);
|
||||
}
|
||||
function utoa(str) {
|
||||
return window.btoa(unescape(encodeURIComponent(str)));
|
||||
}
|
||||
function ImprimeGrafica() {
|
||||
CargaGraficaKilometros(false);
|
||||
setTimeout(function () {
|
||||
CargaGraficaEventos(true);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
1060
GPS/RepPasajero.aspx.cs
Normal file
1060
GPS/RepPasajero.aspx.cs
Normal file
File diff suppressed because it is too large
Load Diff
406
GPS/RepPasajeros.aspx
Normal file
406
GPS/RepPasajeros.aspx
Normal file
@@ -0,0 +1,406 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPasajeros.aspx.vb" Inherits="GPS_RepPasajeros" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<link href="/Metronic/assets/layouts/layout3/css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
<style>
|
||||
.dataTables_scrollHead {
|
||||
background-color: #95A5A6;
|
||||
color: white;
|
||||
}
|
||||
|
||||
@import url(https://fonts.googleapis.com/css?family=Droid+Sans:400,700|Droid+Serif:400,700);
|
||||
|
||||
#chartPasajeros {
|
||||
height: 800px;
|
||||
width: 1200px;
|
||||
}
|
||||
|
||||
.amcharts-chart-div a {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.contenedor {
|
||||
margin: 0 auto;
|
||||
text-align: left;
|
||||
color: #989A8F;
|
||||
width: 450px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.calificador {
|
||||
height: 270px;
|
||||
width: 75%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.toplistaVerde {
|
||||
background-color: #1BA39C;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaAmarillo {
|
||||
background-color: #c29d0b;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaRojo {
|
||||
background-color: #E43A45;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.toplistaAzul {
|
||||
background-color: #337ab7;
|
||||
height: 33%;
|
||||
width: 300px;
|
||||
padding-top: 17%;
|
||||
}
|
||||
|
||||
.bottomlista {
|
||||
margin-top: 25%;
|
||||
}
|
||||
|
||||
|
||||
.circuloVerde {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #1BA39C;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.verde {
|
||||
color: #1BA39C;
|
||||
}
|
||||
|
||||
.circuloAmarillo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #c29d0b;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.amarillo {
|
||||
color: #c29d0b;
|
||||
}
|
||||
|
||||
.circuloRojo {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #E43A45;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.rojo {
|
||||
color: #E43A45;
|
||||
}
|
||||
|
||||
.circuloAzul {
|
||||
width: 40%;
|
||||
height: 400%;
|
||||
border: 4px solid;
|
||||
border-radius: 50% !important;
|
||||
border-color: #337ab7;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
line-height: 405%;
|
||||
text-align: center;
|
||||
background-color: #FFFFFF;
|
||||
margin-left: 30%;
|
||||
margin-top: -10%;
|
||||
}
|
||||
|
||||
.azul {
|
||||
color: #337ab7;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Ascensos y Descensos
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkPdf" runat="server"><i class="fa fa-ad-pdf"></i> Genera PDF</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:HyperLink ID="HpGrafica" data-toggle="modal" data-target="#DivModalGrafca" runat="server"><i class="fa fa-bar-chart"></i> Ver Grafica</asp:HyperLink>
|
||||
</li>
|
||||
</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>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" ValidationGroup="GrpGuardar" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Vehiculo:
|
||||
<asp:DropDownList ID="DdlDispositivo" Width="110px" runat="server" AppendDataBoundItems="true" DataTextField="NoEconomico" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlDispositivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Dispositivo''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDispositivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDispositivo" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
<li>Fecha Inicio:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
<li>Fecha Fin:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
<li>Ver por:
|
||||
<asp:DropDownList ID="DdlGrupo" Width="110px" runat="server" AppendDataBoundItems="true" DataTextField="NoEconomico" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="15 min" Value="15"></asp:ListItem>
|
||||
<asp:ListItem Text="30 min" Value="30"></asp:ListItem>
|
||||
<asp:ListItem Text="1Hr" Value="60"></asp:ListItem>
|
||||
<asp:ListItem Text="12 Hr" Value="12H"></asp:ListItem>
|
||||
<asp:ListItem Text="1 día" Value="24H"></asp:ListItem>
|
||||
<asp:ListItem Text="7 días" Value="7D"></asp:ListItem>
|
||||
<asp:ListItem Text="15 días" Value="15D"></asp:ListItem>
|
||||
<asp:ListItem Text="1 mes" Value="1M"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel UpdateMode="Conditional" ID="UpIndicadores" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="Row" runat="server" id="RowIndicadores" visible="false" style="height: 130px;">
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 yellow" href="#">
|
||||
<div class="visual">
|
||||
<i class="fa fa-arrow-circle-o-up"></i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="1349">
|
||||
<asp:Literal runat="server" ID="lblAscensos"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="desc">Total Ascensos</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 blue" href="#">
|
||||
<div class="visual">
|
||||
<i class="fa fa-arrow-circle-o-down"></i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="549">
|
||||
<asp:Literal runat="server" ID="lblDescensos"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="desc">Total Descensos</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="margin-left: 0px; margin-top: 15px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="NoEconomico" CssClass="table table-striped table-advance table-hover Widthall" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Compuestos Activos">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="20%" HeaderText="Dispositivo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Fecha" ItemStyle-Width="20%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="AcumuladoAnterior" NullDisplayText="0" ItemStyle-Width="20%" HeaderText="Acumulado Anterior" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="Ascensos" ItemStyle-Width="10%" HeaderText="Ascensos" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="Descensos" ItemStyle-Width="10%" HeaderText="Descensos" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="Acumulado" ItemStyle-Width="10%" NullDisplayText="0" HeaderText="Acumulado" ItemStyle-HorizontalAlign="right" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivModalGrafca" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalGrafica" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<h4 class="modal-title">Pasajeros </h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:HiddenField ID="HdnJsonGrupo" Value="[]" runat="server" ClientIDMode="Static" />
|
||||
<div id="chartPasajeros"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="modal-btn">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="../Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/pie.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/gauge.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/plugins/animate/animate.min.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||
<script>
|
||||
function CargaPickers() {
|
||||
$.datetimepicker.setLocale('es');
|
||||
$('input.ADDateTimePicker').each(function () {
|
||||
var TThis = $(this);
|
||||
TThis.datetimepicker({
|
||||
dayOfWeekStart: 1,
|
||||
lang: 'es',
|
||||
format: 'd/m/Y H:i',
|
||||
formatDate: 'd/m/Y H:i',
|
||||
step: 30
|
||||
});
|
||||
var Div = TThis.parent()
|
||||
var boton = document.createElement('span');
|
||||
boton.className = "input-group-btn"
|
||||
|
||||
var subboton = document.createElement('a')
|
||||
subboton.className = "btn default"
|
||||
subboton.innerHTML = "<i class='fa fa-calendar'></i>"
|
||||
subboton.addEventListener('click', function () {
|
||||
TThis.datetimepicker('show')
|
||||
});
|
||||
boton.appendChild(subboton)
|
||||
|
||||
Div[0].appendChild(boton)
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
function CargaChart(data) {
|
||||
var chart = AmCharts.makeChart("chartPasajeros", {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"legend": {
|
||||
"useGraphSettings": true
|
||||
},
|
||||
"dataProvider": data,
|
||||
"synchronizeGrid": true,
|
||||
"valueAxes": [{
|
||||
"id": "v1",
|
||||
"axisColor": "#FF6600",
|
||||
"axisThickness": 2,
|
||||
"axisAlpha": 1,
|
||||
"position": "left"
|
||||
}],
|
||||
"graphs": [{
|
||||
"valueAxis": "v1",
|
||||
"lineColor": "#DD5F2E",
|
||||
"bullet": "round",
|
||||
"bulletBorderThickness": 1,
|
||||
"hideBulletsCount": 30,
|
||||
"fillAlphas": 0,
|
||||
"title": "Ascensos",
|
||||
"valueField": "Ascensos"
|
||||
}, {
|
||||
"valueAxis": "v1",
|
||||
"lineColor": "#26C281",
|
||||
"bullet": "round",
|
||||
"bulletBorderThickness": 1,
|
||||
"hideBulletsCount": 30,
|
||||
"fillAlphas": 0,
|
||||
"title": "Descensos",
|
||||
"valueField": "Descensos"
|
||||
}, {
|
||||
"valueAxis": "v1",
|
||||
"lineColor": "#E43A45",
|
||||
"bullet": "round",
|
||||
"bulletBorderThickness": 1,
|
||||
"hideBulletsCount": 30,
|
||||
"fillAlphas": 0,
|
||||
"title": "Acumulado",
|
||||
"valueField": "Acumulado"
|
||||
}],
|
||||
"chartScrollbar": {},
|
||||
"chartCursor": {
|
||||
"cursorPosition": "mouse"
|
||||
},
|
||||
"categoryField": "Fecha",
|
||||
"categoryAxis": {
|
||||
"axisColor": "#DADADA",
|
||||
"minorGridEnabled": true
|
||||
},
|
||||
"export": {
|
||||
"enabled": false
|
||||
}
|
||||
});
|
||||
|
||||
chart.addListener("dataUpdated", zoomChart);
|
||||
zoomChart();
|
||||
|
||||
function zoomChart() {
|
||||
chart.zoomToIndexes(chart.dataProvider.length - 20, chart.dataProvider.length - 1);
|
||||
}
|
||||
}
|
||||
function ADSReady() {
|
||||
CargaPickers();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
|
||||
219
GPS/RepPasajeros.aspx.vb
Normal file
219
GPS/RepPasajeros.aspx.vb
Normal file
@@ -0,0 +1,219 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports Newtonsoft.Json
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
Partial Class GPS_RepPasajeros
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
Private Sub CargaDispositivos()
|
||||
DdlDispositivo.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("CveModelo = 17")
|
||||
DdlDispositivo.DataBind()
|
||||
UPFiltros.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub GPS_RepTemperaturas_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaDispositivos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
Dim GPS As New ClsGPS
|
||||
Dim GrupoMinutos, GrupoHoras, GrupoDias As Integer
|
||||
|
||||
Select Case DdlGrupo.SelectedValue
|
||||
Case "15"
|
||||
GrupoMinutos = 15
|
||||
GrupoHoras = 1
|
||||
GrupoDias = 1
|
||||
Case "30"
|
||||
GrupoMinutos = 30
|
||||
GrupoHoras = 1
|
||||
GrupoDias = 1
|
||||
Case "60"
|
||||
GrupoMinutos = 60
|
||||
GrupoHoras = 1
|
||||
GrupoDias = 1
|
||||
Case "12H"
|
||||
GrupoMinutos = 60
|
||||
GrupoHoras = 12
|
||||
GrupoDias = 1
|
||||
Case "24H"
|
||||
GrupoMinutos = 60
|
||||
GrupoHoras = 24
|
||||
GrupoDias = 1
|
||||
Case "7D"
|
||||
GrupoMinutos = 60
|
||||
GrupoHoras = 24
|
||||
GrupoDias = 7
|
||||
Case "15D"
|
||||
GrupoMinutos = 60
|
||||
GrupoHoras = 24
|
||||
GrupoDias = 15
|
||||
Case "1M"
|
||||
GrupoMinutos = 60
|
||||
GrupoHoras = 24
|
||||
GrupoDias = 31
|
||||
End Select
|
||||
|
||||
|
||||
If GPS.GetHistorialPasajeros(DdlDispositivo.SelectedValue.ToEntero, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, GrupoMinutos, GrupoHoras, GrupoDias) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
GvDatos.DataSource = GPS.DtResultados
|
||||
lblAscensos.Text = GPS.DtResultados.FiltroPrimeroValor("Ascensos", "Fecha IS NULL")
|
||||
lblDescensos.Text = GPS.DtResultados.FiltroPrimeroValor("Descensos", "Fecha IS NULL")
|
||||
RowIndicadores.Visible = True
|
||||
CargaGraficas(GPS.DtResultados.FiltraParametros("Fecha IS NOT NULL"))
|
||||
Else
|
||||
GvDatos.DataSource = Nothing
|
||||
Alert("La consulta no arrojó resultados")
|
||||
End If
|
||||
|
||||
'lblMinima.Text = $"{GPS.DtResultados.MIN("Temperatura")} {GPS.DtResultados.FiltroPrimeroValor("UnidadMedida")}"
|
||||
'lblPromedio.Text = $"{GPS.DtResultados.AVG("Temperatura").ToString("#0.##")} {GPS.DtResultados.FiltroPrimeroValor("UnidadMedida")}"
|
||||
' lblMaxima.Text = $"{GPS.DtResultados.MAX("Temperatura")} {GPS.DtResultados.FiltroPrimeroValor("UnidadMedida")}"
|
||||
' lblTmpActual.Text = $"{GPS.DtResultados.FiltroPrimeroValor("Temperatura", "1 = 1", "FechaTrama DESC")} {GPS.DtResultados.FiltroPrimeroValor("UnidadMedida")}"
|
||||
GPS.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
UpIndicadores.Update()
|
||||
UpModalGrafica.Update()
|
||||
RegistraScript($"CargaChart({HdnJsonGrupo.Value});", "2")
|
||||
End Sub
|
||||
|
||||
Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
If e.Row.DBCampo("Fecha").ToString = "" Then
|
||||
e.Row.CssClass = "Totales"
|
||||
e.Row.Cells(0).Text = "Total"
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnFiltrarFechaGV_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click
|
||||
|
||||
Dim retorno As Byte()
|
||||
Dim RutaReporte As String = ""
|
||||
Dim NombreReporte As String = ""
|
||||
Dim GrupoMinutos, GrupoHoras, GrupoDias As Integer
|
||||
|
||||
Select Case DdlGrupo.SelectedValue
|
||||
Case "15"
|
||||
GrupoMinutos = 15
|
||||
GrupoHoras = 1
|
||||
GrupoDias = 1
|
||||
Case "30"
|
||||
GrupoMinutos = 30
|
||||
GrupoHoras = 1
|
||||
GrupoDias = 1
|
||||
Case "60"
|
||||
GrupoMinutos = 60
|
||||
GrupoHoras = 1
|
||||
GrupoDias = 1
|
||||
Case "12H"
|
||||
GrupoMinutos = 60
|
||||
GrupoHoras = 12
|
||||
GrupoDias = 1
|
||||
Case "24H"
|
||||
GrupoMinutos = 60
|
||||
GrupoHoras = 24
|
||||
GrupoDias = 1
|
||||
Case "7D"
|
||||
GrupoMinutos = 60
|
||||
GrupoHoras = 24
|
||||
GrupoDias = 7
|
||||
Case "15D"
|
||||
GrupoMinutos = 60
|
||||
GrupoHoras = 24
|
||||
GrupoDias = 15
|
||||
Case "1M"
|
||||
GrupoMinutos = 60
|
||||
GrupoHoras = 24
|
||||
GrupoDias = 31
|
||||
End Select
|
||||
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetHistorialPasajeros(DdlDispositivo.SelectedValue.ToEntero, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, GrupoMinutos, GrupoHoras, GrupoDias) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
Try
|
||||
RutaReporte = "Empresas/Grales/ReportesProgramados/RPTPasajeros.rdlc"
|
||||
NombreReporte = "ReportePasajeros"
|
||||
|
||||
Dim RptParametro As New List(Of ReportParameter)
|
||||
RptParametro.Add(New ReportParameter("FechaInicio", txtFechaI.Text.ToString))
|
||||
RptParametro.Add(New ReportParameter("FechaFin", txtFechaF.Text.ToString))
|
||||
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
|
||||
RptParametro.Add(New ReportParameter("TotalAscensos", ObjGPS.DtResultados.FiltroPrimeroValor("Ascensos", "Fecha IS NULL")))
|
||||
RptParametro.Add(New ReportParameter("TotalDescensos", ObjGPS.DtResultados.FiltroPrimeroValor("Descensos", "Fecha IS NULL")))
|
||||
|
||||
retorno = StreamPDF(RutaReporte, ObjGPS.DtResultados, RptParametro, $"{NombreReporte}{Date.Now.ToShortDateString}", "PDF", MR:=Nothing, RDSName:="DsOC")
|
||||
|
||||
ImprimirbytesPDF(retorno, $"{NombreReporte}{Date.Now.ToShortDateString}")
|
||||
|
||||
Catch ex As Exception
|
||||
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||
End Try
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
UpModalGrafica.Update()
|
||||
RegistraScript($"CargaChart({HdnJsonGrupo.Value});", "2")
|
||||
End Sub
|
||||
Private Sub CargaGraficas(DtDatos As DataTable)
|
||||
|
||||
Dim jsonData = New JArray()
|
||||
Dim FechaI = txtFechaI.Text.ToDateTime
|
||||
Dim FechaF = txtFechaF.Text.ToDateTime
|
||||
Dim Dias = (FechaF - FechaI).TotalDays
|
||||
|
||||
For Each dr As DataRow In DtDatos.Rows
|
||||
Dim StrFecha As String = ""
|
||||
Dim Fecha = dr("Fecha").ToString.ToDate
|
||||
Dim cultureInfo = System.Globalization.CultureInfo.GetCultureInfo("es-MX")
|
||||
Dim textInfo = cultureInfo.TextInfo
|
||||
Select Case DdlGrupo.SelectedValue
|
||||
Case "15"
|
||||
If Dias < 1 Then
|
||||
StrFecha = textInfo.ToTitleCase(Fecha.ToString("hh:mm tt", cultureInfo))
|
||||
Else
|
||||
StrFecha = textInfo.ToTitleCase(Fecha.ToString("dd MMM hh:mm tt", cultureInfo))
|
||||
End If
|
||||
Case "30"
|
||||
If Dias < 1 Then
|
||||
StrFecha = textInfo.ToTitleCase(Fecha.ToString("hh:mm tt", cultureInfo))
|
||||
Else
|
||||
StrFecha = textInfo.ToTitleCase(Fecha.ToString("dd MMM hh:mm tt", cultureInfo))
|
||||
End If
|
||||
Case "60"
|
||||
If Dias < 1 Then
|
||||
StrFecha = textInfo.ToTitleCase(Fecha.ToString("hh tt", cultureInfo))
|
||||
Else
|
||||
StrFecha = textInfo.ToTitleCase(Fecha.ToString("dd MMM hh tt", cultureInfo))
|
||||
End If
|
||||
Case "12H"
|
||||
StrFecha = textInfo.ToTitleCase(Fecha.ToString("dd MMM H tt", cultureInfo))
|
||||
Case "24H"
|
||||
StrFecha = textInfo.ToTitleCase(Fecha.ToString("dd MMM", cultureInfo))
|
||||
Case "7D"
|
||||
StrFecha = textInfo.ToTitleCase(Fecha.ToString("dd MMM", cultureInfo))
|
||||
Case "15D"
|
||||
StrFecha = textInfo.ToTitleCase(Fecha.ToString("dd MMMM", cultureInfo))
|
||||
Case "1M"
|
||||
StrFecha = textInfo.ToTitleCase(Fecha.ToString("MMMM yyyy", cultureInfo))
|
||||
End Select
|
||||
|
||||
Dim Obj = New JObject(
|
||||
New JProperty("Ascensos", dr("Ascensos").ToString().ToEntero()),
|
||||
New JProperty("Descensos", dr("Descensos").ToString().ToEntero()),
|
||||
New JProperty("Acumulado", dr("Acumulado").ToString().ToEntero()),
|
||||
New JProperty("Fecha", StrFecha)
|
||||
)
|
||||
jsonData.Add(Obj)
|
||||
Next
|
||||
HdnJsonGrupo.Value = jsonData.ToString
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
366
GPS/RepPuntosDeInteres.aspx
Normal file
366
GPS/RepPuntosDeInteres.aspx
Normal file
@@ -0,0 +1,366 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="RepPuntosDeInteres.aspx.vb" Inherits="GPS_RepPuntosDeInteres" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#map {
|
||||
width: 100%;
|
||||
height: calc(100% - 51px);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
#map {
|
||||
position: fixed !important;
|
||||
}
|
||||
|
||||
.pac-container.pac-logo {
|
||||
z-index: 100000;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
|
||||
<div id="map"></div>
|
||||
<div id="dvConsulta" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UPConsulta" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="H1" runat="server">Consultar Reporte de Puntos</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<ul class="list-inline" style="font-size: 12px; margin-top: 15px; margin-left: 0px; margin-bottom: 20px;">
|
||||
<li>Fecha Inicio:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpFechas"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
<li>Fecha Fin:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpFechas"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<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="TxtBusquedaEventos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaEventos','{0}')", GvPuntos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaEventos','{0}')", GvPuntos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkGR" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="PuntoDeInteres" ItemStyle-Width="45%" HeaderText="Punto De Interés" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Descripcion" ItemStyle-Width="45%" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<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="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDispositivos.ClientID) %>" data-height="150" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDispositivos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkDis" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="NoEconomico" ItemStyle-Width="25%" HeaderText="Número Económico" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="ModeloVehiculo" ItemStyle-Width="25%" HeaderText="Modelo Vehículo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="AñoVehiculo" ItemStyle-Width="25%" HeaderText="Año Vehículo" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="PlacasVehiculo" ItemStyle-Width="25%" HeaderText="Placas Vehículo" ItemStyle-HorizontalAlign="center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="BtnConsultar" runat="server" Text="Consultar Reporte" ValidationGroup="GrpFechas" CssClass="btn btn-primary"></asp:LinkButton>
|
||||
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="UpdatePanel1">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField runat="server" ID="HdnPunto" ClientIDMode="static" Value="0" />
|
||||
<asp:HiddenField runat="server" ID="HdnDispositivo" ClientIDMode="static" Value="0" />
|
||||
<div id="dvHistorico" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<asp:UpdatePanel ID="UpHistorico" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="H2" runat="server"><i class="fa fa-bell-o"></i>Historial Visitas: </h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional" ID="UpdatePanel3">
|
||||
<ContentTemplate>
|
||||
<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="TxtBusquedaHist" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHistorico.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVHistorico.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GVHistorico" runat="server" GridLines="None" DataKeyNames="CveDispositivoEvento" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-heightfijo="100" data-height="100" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Conductor" ItemStyle-Width="35%" HeaderStyle-HorizontalAlign="center" HeaderText="Conductor" ItemStyle-HorizontalAlign="left" />
|
||||
<asp:BoundField DataField="FechaEntrada" ItemStyle-Width="35%" HeaderStyle-HorizontalAlign="center" HeaderText="Fecha Visita" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Duracion" DataFormatString="{0} Minutos" HeaderStyle-HorizontalAlign="center" HeaderText="Duración" ItemStyle-Width="30%" ItemStyle-HorizontalAlign="center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server" ID="uphidden">
|
||||
<ContentTemplate>
|
||||
<asp:Button Style="display: none" ID="BtnCargarGV" runat="server" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="BtnRep" OnClientClick="CargaDivs('Rep');return false;" Text="<i class='fa fa-location-arrow'></i><span>Reporte de puntos</span>" runat="server">
|
||||
</asp:LinkButton>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
|
||||
var markers = [];
|
||||
var lastOpenedInfoWindow;
|
||||
var geocoder;
|
||||
var map;
|
||||
var circles = [];
|
||||
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: { lat: 19.4326, lng: -99.13329 },
|
||||
zoom: 8
|
||||
});
|
||||
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(function (position) {
|
||||
var pos = {
|
||||
lat: position.coords.latitude,
|
||||
lng: position.coords.longitude
|
||||
};
|
||||
map.setCenter(pos);
|
||||
}, function () {
|
||||
handleLocationError(true, infoWindow, map.getCenter());
|
||||
});
|
||||
}
|
||||
//CargaPickers();
|
||||
////directionsService = new google.maps.DirectionsService;
|
||||
////directionsDisplay = new google.maps.DirectionsRenderer;
|
||||
////directionsDisplay.setMap(map);
|
||||
|
||||
//var upControlDiv = document.createElement('div');
|
||||
//var upControl = new ControlUltimoPunto(upControlDiv, map);
|
||||
|
||||
//upControlDiv.index = 1;
|
||||
//map.controls[google.maps.ControlPosition.TOP_RIGHT].push(upControlDiv);
|
||||
|
||||
//var routeControlDiv = document.createElement('div');
|
||||
//var routeControl = new ControlGuardarRuta(routeControlDiv, map);
|
||||
|
||||
//routeControlDiv.index = 2;
|
||||
//map.controls[google.maps.ControlPosition.TOP_RIGHT].push(routeControlDiv);
|
||||
|
||||
//service = new google.maps.DistanceMatrixService;
|
||||
// map.addListener('click', addLatLng);
|
||||
}
|
||||
function CargaDivs(Tipo) {
|
||||
if (Tipo === "PointGroup") {
|
||||
$("#C_TxtNombre").val("")
|
||||
$("#C_TxtDescripcion").val("")
|
||||
$('#divAgregarTipo').modal();
|
||||
$("#HdnTipo").val(Tipo)
|
||||
$("#lblPuntos").text("Nombre Grupo de Puntos")
|
||||
$("#dvEventos").css("display", "none")
|
||||
$("#dvAdd").css("display", "")
|
||||
}
|
||||
else if (Tipo === "Point") {
|
||||
if (markers.length > 0) {
|
||||
$('#divAgregarTipo').modal();
|
||||
$("#C_TxtNombre").val("")
|
||||
$("#C_TxtDescripcion").val("")
|
||||
$("#HdnTipo").val(Tipo)
|
||||
$("#lblPuntos").text("Nombre Punto(s) de Interés")
|
||||
$("#dvEventos").css("display", "")
|
||||
$("#dvAdd").css("display", "")
|
||||
} else { DeleteMarkers(); alert('Haga click en el mapa para dibujar puntos de interés') }
|
||||
}
|
||||
else if (Tipo === "GroupRoute") {
|
||||
DeleteMarkers();
|
||||
$("#C_TxtNombre").val("1")
|
||||
$("#C_TxtDescripcion").val("1")
|
||||
$('#divAgregarTipo').modal();
|
||||
$("#HdnTipo").val(Tipo)
|
||||
$("#dvEventos").css("display", "")
|
||||
$("#dvAdd").css("display", "none")
|
||||
}
|
||||
else if (Tipo === "Route") {
|
||||
DeleteMarkers();
|
||||
$('#dvConsulta').modal({ backdrop: 'static', keyboard: false });
|
||||
} else if (Tipo === "Rep") {
|
||||
$('#dvConsulta').modal({ backdrop: 'static', keyboard: false });
|
||||
CargaPickers();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
function CreaCirculo(coords, color) {
|
||||
//var Circle = new google.maps.Circle({
|
||||
// strokeColor: color,
|
||||
// strokeOpacity: 0.8,
|
||||
// strokeWeight: 2,
|
||||
// fillColor: color,
|
||||
// fillOpacity: 0.35,
|
||||
// map: map,
|
||||
// center: coords,
|
||||
// radius: 15
|
||||
//});
|
||||
var Circle = new google.maps.Marker({
|
||||
position: coords,
|
||||
icon: {
|
||||
path: google.maps.SymbolPath.CIRCLE,
|
||||
scale: 10,
|
||||
fillColor: color,
|
||||
fillOpacity: 0.35,
|
||||
strokeWeight: 2,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.8
|
||||
},
|
||||
map: map
|
||||
});
|
||||
circles.push(Circle);
|
||||
}
|
||||
function DeleteMarkers() {
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
markers = [];
|
||||
for (var i = 0; i < circles.length; i++) {
|
||||
circles[i].setMap(null);
|
||||
}
|
||||
circles = [];
|
||||
markers = [];
|
||||
}
|
||||
function CreaMarcador(coords, nomPunto, ContentString) {
|
||||
var marker = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomPunto,
|
||||
map: map
|
||||
});
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: ContentString
|
||||
});
|
||||
marker.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
infowindow.open(map, marker);
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
});
|
||||
markers.push(marker);
|
||||
if (markers.length > 1) {
|
||||
fitBoundsToVisibleMarkers()
|
||||
} else if (markers.length === 1) {
|
||||
map.setZoom(15);
|
||||
map.setCenter(coords);
|
||||
}
|
||||
}
|
||||
function closeLastOpenedInfoWindow() {
|
||||
if (lastOpenedInfoWindow) {
|
||||
lastOpenedInfoWindow.close();
|
||||
}
|
||||
}
|
||||
|
||||
function fitBoundsToVisibleMarkers() {
|
||||
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].getVisible()) {
|
||||
bounds.extend(markers[i].getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
map.fitBounds(bounds);
|
||||
|
||||
}
|
||||
|
||||
function CargaPickers() {
|
||||
$.datetimepicker.setLocale('es');
|
||||
$('input.ADDateTimePicker').each(function () {
|
||||
var TThis = $(this);
|
||||
if (Tthis.siblings().length <= 2) {
|
||||
TThis.datetimepicker({
|
||||
dayOfWeekStart: 1,
|
||||
lang: 'es',
|
||||
format: 'd/m/Y H:i',
|
||||
formatDate: 'd/m/Y H:i',
|
||||
step: 30
|
||||
});
|
||||
var Div = TThis.parent()
|
||||
var boton = document.createElement('span');
|
||||
boton.className = "input-group-btn"
|
||||
|
||||
var subboton = document.createElement('a')
|
||||
subboton.className = "btn default"
|
||||
subboton.innerHTML = "<i class='fa fa-calendar'></i>"
|
||||
subboton.addEventListener('click', function () {
|
||||
TThis.datetimepicker('show')
|
||||
});
|
||||
boton.appendChild(subboton)
|
||||
|
||||
Div[0].appendChild(boton)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function CargaGV(CveDispositivo, CvePunto) {
|
||||
$("#HdnPunto").val(CvePunto + '')
|
||||
$("#HdnDispositivo").val(CveDispositivo + '')
|
||||
$("#C_BtnCargarGV").click()
|
||||
}
|
||||
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places&callback=initMap">
|
||||
</script>
|
||||
<%-- <script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAJnZ1CoEUX425C20aqzFw4dYxFL_LfThk&libraries=places&callback=initMap">
|
||||
</script>--%>
|
||||
</asp:Content>
|
||||
|
||||
156
GPS/RepPuntosDeInteres.aspx.vb
Normal file
156
GPS/RepPuntosDeInteres.aspx.vb
Normal file
@@ -0,0 +1,156 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
Partial Class GPS_RepPuntosDeInteres
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "P R O P I E D A D E S "
|
||||
Private Property DispositivosLista As List(Of String)
|
||||
Get
|
||||
Return If(IsNothing(ViewState("DispositivosLista")), Nothing, CType(ViewState("DispositivosLista"), List(Of String)))
|
||||
End Get
|
||||
Set(value As List(Of String))
|
||||
ViewState("DispositivosLista") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
CargaDispositivos()
|
||||
Dim gps As New ClsGPS
|
||||
'If gps.PuntoDeInteresGrupoGet(-1, 1) Then
|
||||
' GvGrupos.DataSource = gps.DtResultados
|
||||
'Else
|
||||
' GvGrupos.DataSource = Nothing
|
||||
'End If
|
||||
If gps.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, -1) Then
|
||||
GvPuntos.DataSource = gps.DtResultados
|
||||
Else
|
||||
GvPuntos.DataSource = Nothing
|
||||
End If
|
||||
gps.Dispose()
|
||||
'GvGrupos.DataBind()
|
||||
GvPuntos.DataBind()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDispositivos()
|
||||
GvDispositivos.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("Estatus = 1 ")
|
||||
GvDispositivos.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
Dim sb As New StringBuilder
|
||||
DispositivosLista = New List(Of String)
|
||||
RegistraScript("DeleteMarkers();", "0")
|
||||
For Each row As GridViewRow In GvDispositivos.Rows
|
||||
If row.FCCheckBox("chkDis").Checked Then
|
||||
sb.Append($"{row.DataKey("CveDispositivo").ToString},")
|
||||
DispositivosLista.Add(row.DataKey("CveDispositivo").ToString)
|
||||
End If
|
||||
Next
|
||||
ReportePuntos(sb.ToString)
|
||||
RegistraScript("$('#dvConsulta').modal('hide');", "00")
|
||||
End Sub
|
||||
|
||||
Private Sub ReportePuntos(Dispositivos As String)
|
||||
Dim GPS As New ClsGPS
|
||||
Dim FechaI, FechaF As Date
|
||||
Dim SBBody As New StringBuilder
|
||||
Dim CoordsPoligono = ""
|
||||
Dim Coords = ""
|
||||
Dim Titulo = ""
|
||||
Dim Info = ""
|
||||
Dim COUNT = 0
|
||||
Dim GeoCercas = ""
|
||||
Dim Color = ""
|
||||
FechaI = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.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
|
||||
Color = "#26C281"
|
||||
SBBody.Append($"<div><table>")
|
||||
For Each Cve As String In DispositivosLista
|
||||
If GPS.DtResultados.FiltraParametros($"CveDispositivo = {Cve} ").Rows.Count > 0 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>")
|
||||
SBBody.Append($"<tr><td>Última Visita: {GPS.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
|
||||
Next
|
||||
GPS.Dispose()
|
||||
End Sub
|
||||
|
||||
'If GPS.GeoReferenciasEntradasSalidas(GVRow.DataKey("CveDispositivo").ToString.ToEntero, row.DataKey("CveGeoReferencia").ToString.ToEntero, FechaI, FechaF) Then
|
||||
' SBBody.Append($"<div><table>")
|
||||
' SBBody.Append($"<tr><td>Fecha : {rr("FechaTrama").ToString}</td></tr>")
|
||||
' SBBody.Append($"<tr><td>Conductor : {rr("Conductor").ToString}</td></tr>")
|
||||
' SBBody.Append($"<tr><td>Serie Vehículo: {GVRow.DataKey("SerieVehiculo").ToString}</td></tr>")
|
||||
' If GPS.DtResultados.Rows.Count > 0 Then
|
||||
' CoordsPoligono = SQLToGmaps(row.DataKey("Coordenadas").ToString, "POLYGON")
|
||||
' For Each rr As DataRow In GPS.DtResultados.Rows
|
||||
' Coords = SQLToGmaps(rr("Posicion").ToString, "POINT")
|
||||
' SBBody.Clear()
|
||||
' SBBody.Append($"<div>")
|
||||
' SBBody.Append($"<div><h4><b>{rr("Evento")}</b></h4></div>")
|
||||
' SBBody.Append($"</table></div><div></div></div>")
|
||||
' Info = SBBody.ToString
|
||||
' RegistraScript($"CreaMarcador({Coords},'{GVRow.DataKey("SerieVehiculo").ToString}', '{Info}');", $"{rr("CveDispositivoEvento").ToString}{COUNT.ToString}")
|
||||
' COUNT += 1
|
||||
' Next
|
||||
' RegistraScript($"creaPoligono([{CoordsPoligono}], '{row.DataKey("Color").ToString}')", $"{row.DataKey("CveGeoReferencia").ToString.ToEntero}{COUNT.ToString}")
|
||||
' Else
|
||||
' GeoCercas = $"{GeoCercas} {row.DataKey("GeoReferencia").ToString},"
|
||||
' End If
|
||||
' End If
|
||||
|
||||
Private Function SQLToGmaps(CoordsSQL As String, Tipo As String) As String
|
||||
Dim CoordsPoligono As String = CoordsSQL.Replace($"{Tipo}", "").Replace(")", "").Replace("(", "")
|
||||
Dim CoordsPuntos() As String = CoordsPoligono.Split(","c)
|
||||
Dim Var As String = ""
|
||||
For Each coordenada As String In CoordsPuntos
|
||||
If coordenada Is CoordsPuntos.Last Then
|
||||
Dim latlng() As String = coordenada.Trim.Split(" "c)
|
||||
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }}"
|
||||
Else
|
||||
Dim latlng() As String = coordenada.Trim.Split(" "c)
|
||||
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }},"
|
||||
End If
|
||||
Next
|
||||
Return Var
|
||||
End Function
|
||||
|
||||
|
||||
Protected Sub BtnCargarGV_Click(sender As Object, e As EventArgs) Handles BtnCargarGV.Click
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.RepPuntosDetalleGet(HdnPunto.Value.ToEntero, HdnDispositivo.Value.ToEntero, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, UsuarioActual.CveCliente) Then
|
||||
GVHistorico.DataSource = GPS.DtResultados.FiltraParametros("CveEvento = 106")
|
||||
Else
|
||||
GVHistorico.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GVHistorico.DataBind()
|
||||
UpdatePanel3.Update()
|
||||
RegistraScript("$('#dvHistorico').modal()")
|
||||
End Sub
|
||||
End Class
|
||||
265
GPS/RepTemperaturas.aspx
Normal file
265
GPS/RepTemperaturas.aspx
Normal file
@@ -0,0 +1,265 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepTemperaturas.aspx.vb" Inherits="GPS_RepTemperaturas" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" Runat="Server">
|
||||
<link href="/Metronic/assets/layouts/layout3/css/jquery.datetimepicker.css" rel="stylesheet" />
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
|
||||
Reporte de Temperaturas
|
||||
</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>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT smalltitle " style="">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" ValidationGroup="GrpGuardar" Text="Consultar" class="btn btn-primary" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Vehiculo:
|
||||
<asp:DropDownList ID="DdlDispositivo" AutoPostBack="true" runat="server" Width="100px" AppendDataBoundItems="true" DataTextField="NoEconomico" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlDispositivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Dispositivo''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDispositivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDispositivo" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
<li>Control/Sensor:
|
||||
<asp:DropDownList ID="DdlSensores" runat="server" DataTextField="Control" AppendDataBoundItems="false" DataValueField="Sensor" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
<li>Fecha Inicio:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpFechas"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
<li>Fecha Fin:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpFechas"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<%--<div class="row">
|
||||
<div class="col-md-1 truncate" style="width:65px">
|
||||
Vehiculo:
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlDispositivo" AutoPostBack="true" runat="server" AppendDataBoundItems="true" DataTextField="NoEconomico" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlDispositivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Dispositivo''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEDispositivo" runat="server" HighlightCssClass="vco" TargetControlID="RFVDispositivo" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Control/Sensor:
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<asp:DropDownList ID="DdlSensores" runat="server" DataTextField="Control" DataValueField="Sensor" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<div class="col-md-1 truncate" style="width:60px">
|
||||
Fecha I.:
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Inicio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpFechas"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator4" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1 truncate" style="width:60px">
|
||||
Fecha F.:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpFechas"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator5" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="col-md-1 truncate">
|
||||
Fecha Inicio:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaI" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<div class="col-md-1 truncate">
|
||||
Fecha Fin:
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px;">
|
||||
<asp:TextBox Width="80px" ID="txtFechaF" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>--%>
|
||||
<%--</div>--%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel UpdateMode="Conditional" ID="UpIndicadores" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel runat="server" ID="UpDash" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<div class="Row" style="height:130px;">
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 green" href="#">
|
||||
<div class="visual">
|
||||
<i class="fa fa-truck" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="549">
|
||||
<asp:Literal runat="server" ID="lblTmpActual"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="desc">Última Temperatura</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 yellow" href="#">
|
||||
<div class="visual">
|
||||
<i class="fa fa-clock-o"></i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="1349">
|
||||
<asp:Literal runat="server" ID="lblPromedio"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="desc">Temperatura Promedio</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 blue" href="#">
|
||||
<div class="visual">
|
||||
<i class="fa fa-thermometer-empty"></i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="549">
|
||||
<asp:Literal runat="server" ID="lblMinima"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="desc">Temperatura Mínima</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="dashboard-stat dashboard-stat-v2 red" href="#">
|
||||
<div class="visual">
|
||||
<i class="fa fa-thermometer-full" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="details">
|
||||
<div class="number">
|
||||
<span data-counter="counterup" data-value="12.5">
|
||||
<asp:Literal runat="server" ID="lblMaxima"></asp:Literal></span>
|
||||
</div>
|
||||
<div class="desc">Temperatura Máxima</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="margin-left: 0px; margin-top: 15px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GvDatos" runat="server" GridLines="None" DataKeyNames="CveControl" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Compuestos Activos">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Control" ItemStyle-Width="35%" HeaderText="Control" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Sensor" ItemStyle-Width="25%" HeaderText="Sensor" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaTrama" ItemStyle-Width="20%" HeaderText="Fecha" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:BoundField DataField="Temperatura" ItemStyle-Width="15%" HeaderText="Temperatura" ItemStyle-HorizontalAlign="right" />
|
||||
<asp:BoundField DataField="UnidadMedida" ItemStyle-Width="5%" HeaderText="Unidad de Medida" ItemStyle-HorizontalAlign="Left" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
<script src="https://use.fontawesome.com/c5bb48e43a.js"></script>
|
||||
<script src="../Metronic/assets/layouts/layout3/scripts/jquery.datetimepicker.full.js"></script>
|
||||
|
||||
<script>
|
||||
function CargaPickers() {
|
||||
$.datetimepicker.setLocale('es');
|
||||
$('input.ADDateTimePicker').each(function () {
|
||||
var TThis = $(this);
|
||||
TThis.datetimepicker({
|
||||
dayOfWeekStart: 1,
|
||||
lang: 'es',
|
||||
format: 'd/m/Y H:i',
|
||||
formatDate: 'd/m/Y H:i',
|
||||
step: 30
|
||||
});
|
||||
var Div = TThis.parent()
|
||||
var boton = document.createElement('span');
|
||||
boton.className = "input-group-btn"
|
||||
|
||||
var subboton = document.createElement('a')
|
||||
subboton.className = "btn default"
|
||||
subboton.innerHTML = "<i class='fa fa-calendar'></i>"
|
||||
subboton.addEventListener('click', function () {
|
||||
TThis.datetimepicker('show')
|
||||
});
|
||||
boton.appendChild(subboton)
|
||||
|
||||
Div[0].appendChild(boton)
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function ADSReady() {
|
||||
CargaPickers();
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
70
GPS/RepTemperaturas.aspx.vb
Normal file
70
GPS/RepTemperaturas.aspx.vb
Normal file
@@ -0,0 +1,70 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
|
||||
|
||||
Partial Class GPS_RepTemperaturas
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
Private Sub CargaDispositivos()
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If GPS.DispositivosSensoresGet(-1, -1, UsuarioActual.CveCliente) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
DdlDispositivo.DataSource = GPS.DtResultados.FiltraParametros("CveTipoControl = 2", "CveDispositivo ASC", {"CveDispositivo", "NoEconomico"})
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DdlDispositivo.DataBind()
|
||||
UPFiltros.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSensores()
|
||||
DdlSensores.Items.Clear()
|
||||
If DdlDispositivo.SelectedValue = "-1" Then
|
||||
DdlSensores.DataSource = Nothing
|
||||
DdlSensores.DataBind()
|
||||
DdlSensores.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
Else
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.DispositivosSensoresGet(DdlDispositivo.SelectedValue.ToEntero, 1, UsuarioActual.CveCliente) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
DdlSensores.DataSource = GPS.DtResultados.FiltraParametros("CveTipoControl = 2", "CveDispositivo ASC")
|
||||
Else
|
||||
DdlSensores.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DdlSensores.DataBind()
|
||||
DdlSensores.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
UPFiltros.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub DdlDispositivo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlDispositivo.SelectedIndexChanged
|
||||
CargaSensores()
|
||||
End Sub
|
||||
|
||||
Private Sub GPS_RepTemperaturas_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaDispositivos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.GetReporteTemperatura(DdlDispositivo.SelectedValue.ToEntero, DdlSensores.SelectedValue, -1, MinFecha, MaxFecha) Then
|
||||
GvDatos.DataSource = GPS.DtResultados
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
lblMinima.Text = $"{GPS.DtResultados.MIN("Temperatura")} {GPS.DtResultados.FiltroPrimeroValor("UnidadMedida")}"
|
||||
lblPromedio.Text = $"{GPS.DtResultados.AVG("Temperatura").ToString("#0.##")} {GPS.DtResultados.FiltroPrimeroValor("UnidadMedida")}"
|
||||
lblMaxima.Text = $"{GPS.DtResultados.MAX("Temperatura")} {GPS.DtResultados.FiltroPrimeroValor("UnidadMedida")}"
|
||||
lblTmpActual.Text = $"{GPS.DtResultados.FiltroPrimeroValor("Temperatura", "1 = 1", "FechaTrama DESC")} {GPS.DtResultados.FiltroPrimeroValor("UnidadMedida")}"
|
||||
End If
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
UpIndicadores.Update()
|
||||
End Sub
|
||||
End Class
|
||||
174
GPS/SIGFOX/SigfoxParse.js
Normal file
174
GPS/SIGFOX/SigfoxParse.js
Normal file
@@ -0,0 +1,174 @@
|
||||
|
||||
(function bin_dec() {
|
||||
var x = WScript.arguments(0);
|
||||
var valor = x.toString();
|
||||
var result = parseSigFox(valor);
|
||||
|
||||
WScript.echo(result);
|
||||
})();
|
||||
|
||||
//In an attempt to make the code clearer, I will not be using ArrayBuffer
|
||||
function hex2Bytes(val) {
|
||||
|
||||
if (!val) {
|
||||
return [];
|
||||
}
|
||||
|
||||
var numBytes = val.length / 2;
|
||||
var bytes = [];
|
||||
|
||||
for (var i = 0; i < numBytes; i++) {
|
||||
bytes.push(parseInt(val.substring(i*2, (i*2) + 2), 16));
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
function parseLittleEndianInt32(buffer, offset) {
|
||||
return (buffer[offset + 3] << 24) +
|
||||
(buffer[offset + 2] << 16) +
|
||||
(buffer[offset + 1] << 8) +
|
||||
(buffer[offset]);
|
||||
}
|
||||
|
||||
function parseLittleEndianInt16(buffer, offset) {
|
||||
return (buffer[offset + 1] << 8) +
|
||||
(buffer[offset]);
|
||||
}
|
||||
|
||||
function parseLittleEndianInt16Bits(buffer, offset, bitOffset, bitLength) {
|
||||
var temp = parseLittleEndianInt16(buffer, offset);
|
||||
temp = temp >> bitOffset;
|
||||
var mask = 0xffff >> (16 - bitLength);
|
||||
return temp & mask;
|
||||
}
|
||||
|
||||
function parseSigFox(data) {
|
||||
var buffer = hex2Bytes(data);
|
||||
|
||||
if (!buffer) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var recordType = buffer[0] & 0x0f;
|
||||
|
||||
switch (recordType) {
|
||||
case 0: //positional data
|
||||
return parsePositionalData(buffer);
|
||||
|
||||
case 1: //downlink ACK
|
||||
return parseDownlinkAck(buffer);
|
||||
|
||||
case 2: //device data
|
||||
return parseDeviceStats(buffer);
|
||||
|
||||
case 3: //extended positional data
|
||||
return parseExtendedData(buffer);
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function parsePositionalData(buffer) {
|
||||
var flags = buffer[0] & 0xF0;
|
||||
var inTrip = (flags & 0x10) > 0;
|
||||
var lastFixFailed = (flags & 0x20) > 0;
|
||||
|
||||
var latitudeRaw = parseLittleEndianInt32(buffer, 1);
|
||||
var longitudeRaw = parseLittleEndianInt32(buffer, 5);
|
||||
var headingRaw = buffer[9];
|
||||
var speedRaw = buffer[10];
|
||||
var batteryRaw = buffer[11];
|
||||
|
||||
var retorno = {
|
||||
MessageType: 0,
|
||||
InTrip: inTrip,
|
||||
LastFixFailed: lastFixFailed,
|
||||
Latitude: latitudeRaw * 1e-7,
|
||||
Longitude: longitudeRaw * 1e-7,
|
||||
Heading: headingRaw * 2,
|
||||
SpeedKmH: speedRaw,
|
||||
BatteryVoltage: (batteryRaw * 25) / 1000.0
|
||||
};
|
||||
return "{MessageType: " + retorno.MessageType + ", InTrip: " + retorno.InTrip + ", LastFixFailed: " + retorno.LastFixFailed + ", Latitude: " + retorno.Latitude + ", Longitude: " + retorno.Longitude + ", SpeedKmH: " + retorno.SpeedKmH + ", BatteryVoltage: " + retorno.BatteryVoltage + ", Heading: " + retorno.Heading + "}";
|
||||
}
|
||||
|
||||
function parseDownlinkAck(buffer) {
|
||||
var flags = buffer[0] & 0xF0;
|
||||
var downlinkAccepted = (flags & 0x10) > 0;
|
||||
|
||||
var firmwareMajor = buffer[2];
|
||||
var firmwareMinor = buffer[3];
|
||||
|
||||
var data = [];
|
||||
for (var i = 0; i < 8; i++) {
|
||||
data.push(i + 4);
|
||||
}
|
||||
|
||||
var retorno = {
|
||||
MessageType: 1,
|
||||
DownlinkAccepted: downlinkAccepted,
|
||||
FirmwareVersion: firmwareMajor + '.' + firmwareMinor,
|
||||
DownlinkData: data
|
||||
};
|
||||
return "{MessageType: " + retorno.MessageType + ", DownlinkAccepted: " + retorno.DownlinkAccepted + ", FirmwareVersion: " + retorno.FirmwareVersion + ", DownlinkData: " + retorno.DownlinkData + "}";
|
||||
}
|
||||
|
||||
function parseDeviceStats(buffer) {
|
||||
var uptimeWeeks = parseLittleEndianInt16Bits(buffer, 0, 4, 9/*bits*/);
|
||||
var txCountRaw = parseLittleEndianInt16Bits(buffer, 1, 5, 11 /*bits*/);
|
||||
var rxCountRaw = buffer[3];
|
||||
var tripCountRaw = parseLittleEndianInt16Bits(buffer, 4, 0, 13 /*bits*/);
|
||||
var gpsSuccessRaw = parseLittleEndianInt16Bits(buffer, 5, 5, 10 /*bits*/);
|
||||
var gpsFailuresRaw = parseLittleEndianInt16Bits(buffer, 6, 7, 8 /*bits*/);
|
||||
var averageFixTime = parseLittleEndianInt16Bits(buffer, 7, 7, 9/*bits*/);
|
||||
var averageFailTime = parseLittleEndianInt16Bits(buffer, 9, 0, 9/*bits*/);
|
||||
var averageFreshenTime = parseLittleEndianInt16Bits(buffer, 10, 1, 8/*bits*/);
|
||||
var wakeupsPerTrip = buffer[11] >> 1;
|
||||
|
||||
|
||||
var retorno = {
|
||||
MessageType: 2,
|
||||
UptimeWeeks: uptimeWeeks,
|
||||
TxCount: txCountRaw * 32,
|
||||
RxCount: rxCountRaw * 32,
|
||||
TripCount: tripCountRaw,
|
||||
GpsSuccessCount: gpsSuccessRaw * 32,
|
||||
GpsFailureCount: gpsFailuresRaw * 32,
|
||||
AverageFixTimeSeconds: averageFixTime,
|
||||
AverageFailTimeSeconds: averageFailTime,
|
||||
AverageFreshenTimeSeconds: averageFreshenTime,
|
||||
WakeUpsPerTrip: wakeupsPerTrip
|
||||
};
|
||||
|
||||
return "{MessageType: " + retorno.MessageType + ", UptimeWeeks: " + retorno.UptimeWeeks + ", TxCount: " + retorno.TxCount + ", RxCount: " + retorno.RxCount + "}";
|
||||
}
|
||||
|
||||
function parseExtendedData(buffer) {
|
||||
var headingRaw = buffer[0] >> 4;
|
||||
var latitudeRaw = buffer[1] + buffer[2] * 256 + buffer[3] * 65536;
|
||||
if (latitudeRaw >= 0x800000) // 2^23
|
||||
latitudeRaw -= 0x1000000; // 2^24
|
||||
var longitudeRaw = buffer[4] + buffer[5] * 256 + buffer[6] * 65536;
|
||||
if (longitudeRaw >= 0x800000) // 2^23
|
||||
longitudeRaw -= 0x1000000; // 2^24
|
||||
var posAccRaw = buffer[7];
|
||||
var batteryRaw = buffer[8];
|
||||
var speedRaw = buffer[9] & 0x3F;
|
||||
var inTrip = (buffer[9] & 0x40) > 0;
|
||||
var lastFixFailed = (buffer[9] & 0x80) > 0;
|
||||
|
||||
var retorno = {
|
||||
MessageType: 3,
|
||||
Heading: headingRaw * 22.5,
|
||||
Latitude: (latitudeRaw * 256) / 1e7,
|
||||
Longitude: (longitudeRaw * 256) / 1e7,
|
||||
PosAccM: posAccRaw * 1,
|
||||
BatteryVoltage: (batteryRaw * 25) / 1000.0,
|
||||
SpeedKmH: speedRaw * 2.5,
|
||||
InTrip: inTrip,
|
||||
LastFixFailed: lastFixFailed
|
||||
};
|
||||
return "{MessageType: " + retorno.MessageType + ", InTrip: " + retorno.InTrip + ", LastFixFailed: " + retorno.LastFixFailed + ", Latitude: " + retorno.Latitude + ", Longitude: " + retorno.Longitude + ", PosAccM: " + retorno.PosAccM + ", SpeedKmH: " + retorno.SpeedKmH + ", BatteryVoltage: " + retorno.BatteryVoltage + ", Heading: " + retorno.Heading + "}";
|
||||
}
|
||||
690
GPS/Shipments.aspx
Normal file
690
GPS/Shipments.aspx
Normal file
@@ -0,0 +1,690 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Shipments.aspx.cs" EnableEventValidation="false" Inherits="GPS_Shipments" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
.v-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Catálogo de Shipments
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" ID="LnkAgregar" OnClick="LnkAgregar_Click"><i class="fa fa-plus"></i>Crear Shipment</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Shipments</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 rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<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="TxtBusquedaEva" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaEva','{0}')", GvShipments.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvShipments.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GvShipments" runat="server" OnRowDeleting="GvShipments_RowDeleting" OnRowDataBound="GvShipments_RowDataBound" GridLines="None" DataKeyNames="CveShipment,ShipmentID" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" data-heighterror="800" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="ShipmentID" HeaderText="ShipmentID" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="NoEconomico" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="CustomerText" HeaderText="Customer" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="AssetID" HeaderText="AssetID" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="RouteID" HeaderText="RouteID" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="TrailerID" HeaderText="TrailerID" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:TemplateField HeaderText="Transmitiendo" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkTransmitir" runat="server" AutoPostBack="true" CssClass="chksino" Text=" " OnCheckedChanged="ChkTransmitir_CheckedChanged" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="FechaIng" HeaderText="Fecha Ingreso" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkAddEvent" runat="server" Text="Crear Evento" OnClick="LnkAddEvent_Click" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar el shipment?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="DivShipment" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 900px; margin: auto;">
|
||||
<asp:UpdatePanel ID="UpShipment" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">Crear Shipment</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Datos de Shipment</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 rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtShipment" CssClass="form-control " runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVShipment" runat="server" ControlToValidate="TxtShipment" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Shipment ID''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtShipment.ClientID.ToString()%>">Shipment ID (Numero de viaje):</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlCustomer" runat="server" Width="100%" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="General Motors" Value="GMHQ"></asp:ListItem>
|
||||
<asp:ListItem Text="Ford Motor Company" Value="FORD"></asp:ListItem>
|
||||
<asp:ListItem Text="Ford Customer Service Division" Value="FCSD"></asp:ListItem>
|
||||
<asp:ListItem Text="Goodyear Tire & Rubber Company" Value="FV0219415A"></asp:ListItem>
|
||||
<asp:ListItem Text="FCA" Value="FCA"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVCustomer" runat="server" ControlToValidate="DdlCustomer" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Customer/Shipper''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlCustomer.ClientID.ToString()%>">Customer/Shipper:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlDispositivo" runat="server" AppendDataBoundItems="true" AutoPostBack="true" OnSelectedIndexChanged="DdlDispositivo_SelectedIndexChanged" Width="100%" CssClass="form-control input-sm select2me" DataValueField="CveDispositivo" DataTextField="NoEconomico">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDispositivo" runat="server" ControlToValidate="DdlDispositivo" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Vehículo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlDispositivo.ClientID.ToString()%>">Vehículo:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAsset" CssClass="form-control " runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVAsset" runat="server" ControlToValidate="TxtAsset" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Asset ID''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtAsset.ClientID.ToString()%>">Asset ID (ID DEL GPS):</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtRoute" CssClass="form-control " runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVRoute" runat="server" ControlToValidate="TxtRoute" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Route ID''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtRoute.ClientID.ToString()%>">Route ID (Numero de ruta):</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTrailer" CssClass="form-control " runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVTrailer" runat="server" ControlToValidate="TxtTrailer" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Trailer ID''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtTrailer.ClientID.ToString()%>">Trailer ID (Numero de caja):</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<table border="0" width="100%">
|
||||
<tr align="left">
|
||||
<div class="row v-center">
|
||||
<label class="col-md-12" style="color: gray">Observaciones Generales:</label>
|
||||
</div>
|
||||
</tr>
|
||||
<tr align="left">
|
||||
<td>
|
||||
<div class="row v-center">
|
||||
<asp:TextBox ID="TxtObs" runat="server" Rows="6" TextMode="MultiLine" Width="95%" MaxLength="200" CssClass="col-md-12 form-control input-sm"></asp:TextBox>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Stops (Paradas)</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
</div>
|
||||
<div class="tools">
|
||||
<div class="btn-group">
|
||||
<asp:LinkButton ID="LnkAddNewStop" runat="server" OnClick="LnkAddNewStop_Click" Text="<i class='fa fa-plus' style=' color: white;'></i> Agregar" class="btn btn-sm btn-primary"></asp:LinkButton>
|
||||
</div>
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<asp:UpdatePanel ID="UpStops" runat="server" ClientIDMode="Static">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvStops" runat="server" GridLines="None" DataKeyNames="StopSequence" OnRowDeleting="GvStops_RowDeleting" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" data-heighterror="800" EmptyDataText="No se encontraron registros">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="StopSequence" HeaderText="Stop Sequence" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="LocationID" HeaderText="LocationID" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="StopType" HeaderText="Stop Type" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="StopRole" HeaderText="Stop Role" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="EarlyArrivalTime" HeaderText="Early Arrival Time" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="LateArrivalTime" HeaderText="Late Arrival Time" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Desea eliminar el stop?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="BtnAgregarShipment" runat="server" OnClick="BtnAgregarShipment_Click" Text="Guardar" CssClass="btn btn-primary" ValidationGroup="GrpGuardar"></asp:LinkButton>
|
||||
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<div id="DivStop" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 900px; margin: auto;">
|
||||
<asp:UpdatePanel ID="UpStop" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">Agregar Stop(Parada)</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Stops (Paradas)</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 rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLocName" CssClass="form-control " runat="server" Text=""></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVName" runat="server" ControlToValidate="TxtLocName" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Name''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLocName.ClientID.ToString()%>">Name:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLocID" CssClass="form-control " runat="server"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtLocID" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Location''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLocID.ClientID.ToString()%>">Location ID:</label>
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Dirección</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 rowpadding">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtAddress" CssClass="form-control " runat="server" Text=""></asp:TextBox>
|
||||
<label for="<%= TxtAddress.ClientID.ToString()%>">Address:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCity" CssClass="form-control " runat="server" Text=""></asp:TextBox>
|
||||
<label for="<%= TxtCity.ClientID.ToString()%>">City:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtState" CssClass="form-control " runat="server" Text=""></asp:TextBox>
|
||||
<label for="<%= TxtState.ClientID.ToString()%>">State:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPostalCode" CssClass="form-control " runat="server" Text=""></asp:TextBox>
|
||||
<label for="<%= TxtPostalCode.ClientID.ToString()%>">Postal Code:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtContry" CssClass="form-control " runat="server" Text=""></asp:TextBox>
|
||||
<label for="<%= TxtContry.ClientID.ToString()%>">Contry:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLatLong" CssClass="form-control " runat="server" Text="" Enabled="false"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVLatLon" runat="server" ControlToValidate="TxtLatLong" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Latitude/Longitude''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLatLong.ClientID.ToString()%>">Latitude/Longitude:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row v-center">
|
||||
<label class="col-md-12" style="color: gray">Early Arrival Time:</label>
|
||||
</div>
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtFechaStopI" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaIStop" runat="server" ControlToValidate="TxtFechaStopI" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Early Arrival Time''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEI" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaIStop" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row v-center">
|
||||
<label class="col-md-12" style="color: gray">Late Arrival Time:</label>
|
||||
</div>
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy hh:mm" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtFechaStopF" runat="server" CssClass="form-control input-sm ADDateTimePicker" CausesValidation="true" MaxLength="18" Width="132px "></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVFechaFStop" runat="server" ControlToValidate="TxtFechaStopF" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Late Arrival Time''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEF" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaFStop" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlStopType" runat="server" Width="100%" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Load" Value="load"></asp:ListItem>
|
||||
<asp:ListItem Text="Unload" Value="unload"></asp:ListItem>
|
||||
<asp:ListItem Text="Drop" Value="drop"></asp:ListItem>
|
||||
<asp:ListItem Text="Hook" Value="hook"></asp:ListItem>
|
||||
<asp:ListItem Text="Relay" Value="relay"></asp:ListItem>
|
||||
<asp:ListItem Text="Other" Value="other"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVStopType" runat="server" ControlToValidate="DdlStopType" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Stop Type''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlStopType.ClientID.ToString()%>">StopType:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlStopRole" runat="server" Width="100%" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Ship From" Value="ship_from"></asp:ListItem>
|
||||
<asp:ListItem Text="Ship To" Value="ship_to"></asp:ListItem>
|
||||
<asp:ListItem Text="Border" Value="border"></asp:ListItem>
|
||||
<asp:ListItem Text="Terminal" Value="terminal"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVStopRole" runat="server" ControlToValidate="DdlStopRole" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Stop Role''</b> es necesario, por favor ingréselo." ValidationGroup="GrpStop"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlStopRole.ClientID.ToString()%>">Stop Role:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLoc" CssClass="form-control " runat="server"></asp:TextBox>
|
||||
<label for="<%= TxtLoc.ClientID.ToString()%>">Search Location:</label>
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Position</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 rowpadding">
|
||||
<div id="map" class="gmaps" style="position: relative; overflow: hidden;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="LnkAddStop" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpStop" OnClick="LnkAddStop_Click"></asp:LinkButton>
|
||||
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
<div id="DivEvent" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 900px; margin: auto;">
|
||||
<asp:UpdatePanel ID="UpEvent" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">Crear Evento</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Evento</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 rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlStops" runat="server" Width="100%" CssClass="form-control input-sm select2me" OnSelectedIndexChanged="DdlStops_SelectedIndexChanged" AutoPostBack="true" DataTextField="Name" DataValueField="CveStop">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVStops" runat="server" ControlToValidate="DdlStops" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Stop''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEvent"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlStops.ClientID.ToString()%>">Stops:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlEvent" runat="server" Width="100%" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Assign Asset for tracking" Value="XB"></asp:ListItem>
|
||||
<asp:ListItem Text="Unassign Asset" Value="XX"></asp:ListItem>
|
||||
<asp:ListItem Text="Location Update" Value="LO"></asp:ListItem>
|
||||
<asp:ListItem Text="Pick up: Arrival" Value="X3"></asp:ListItem>
|
||||
<asp:ListItem Text="Pick up: Complete loading or hook" Value="CP"></asp:ListItem>
|
||||
<asp:ListItem Text="Pick up: Departure" Value="AF"></asp:ListItem>
|
||||
<asp:ListItem Text="Drop off: Arrival" Value="X1"></asp:ListItem>
|
||||
<asp:ListItem Text="Drop off: Complete unloading or unhook" Value="D1"></asp:ListItem>
|
||||
<asp:ListItem Text="Drop off: Departure" Value="CD"></asp:ListItem>
|
||||
<asp:ListItem Text="Terminal: Arrival" Value="X4"></asp:ListItem>
|
||||
<asp:ListItem Text="Terminal: Departed" Value="P1"></asp:ListItem>
|
||||
<asp:ListItem Text="Estimated delivery" Value="AG"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="DdlEvent" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Event''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEvent"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlCustomer.ClientID.ToString()%>">Event:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlReason" runat="server" Width="100%" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Normal Status" Value="NS"></asp:ListItem>
|
||||
<asp:ListItem Text="Accident" Value="AF"></asp:ListItem>
|
||||
<asp:ListItem Text="Shipper Related" Value="AM"></asp:ListItem>
|
||||
<asp:ListItem Text="Previous Stop" Value="AL"></asp:ListItem>
|
||||
<asp:ListItem Text="Consignee Related" Value="AG"></asp:ListItem>
|
||||
<asp:ListItem Text="Driver Related" Value="AH"></asp:ListItem>
|
||||
<asp:ListItem Text="Mechanical Breakdown" Value="AI"></asp:ListItem>
|
||||
<asp:ListItem Text="Other Carrier Related" Value="AJ"></asp:ListItem>
|
||||
<asp:ListItem Text="Weather or Natural Disaster Related" Value="AO"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="DdlReason" InitialValue="-1" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Reason''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEvent"></asp:RequiredFieldValidator>
|
||||
<label for="<%= DdlCustomer.ClientID.ToString()%>">Reason:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLatLongEvent" CssClass="form-control " runat="server" Text="" Enabled="false"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RFVLLEvent" runat="server" ControlToValidate="TxtLatLongEvent" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Latitude/Longitude''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEvent"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtLatLong.ClientID.ToString()%>">Latitude/Longitude:</label>
|
||||
</div>
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtStopSec" CssClass="form-control " runat="server" Text="" Enabled="false"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtStopSec" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Stop Sequence''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEvent"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtStopSec.ClientID.ToString()%>">Stop Sequence:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtLoc2" CssClass="form-control " runat="server"></asp:TextBox>
|
||||
<label for="<%= TxtLoc2.ClientID.ToString()%>">Search Location:</label>
|
||||
</div>
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<span class="caption-subject bold uppercase" style="line-height: 2;">Position</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 rowpadding">
|
||||
<div id="mapEvent" class="gmaps" style="position: relative; overflow: hidden;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:LinkButton ID="LnkAddNewEvent" runat="server" Text="Agregar" CssClass="btn btn-primary" ValidationGroup="GrpEvent" OnClick="LnkAddNewEvent_Click"></asp:LinkButton>
|
||||
<button data-dismiss="modal" class="btn btn-default">Cancelar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
var map;
|
||||
var directionsService;
|
||||
var directionsDisplay;
|
||||
var markers = [];
|
||||
var marker;
|
||||
|
||||
var mapEvent;
|
||||
var directionsServiceEvent;
|
||||
var directionsDisplayEvent;
|
||||
var markersEvent = [];
|
||||
var markerEvent;
|
||||
|
||||
$(document).ready(function () {
|
||||
initMap();
|
||||
Sys.Application.add_load(function (s, e) {
|
||||
initMap();
|
||||
});
|
||||
});
|
||||
|
||||
function initMap() {
|
||||
|
||||
var uluru = { lat: 29.0730, lng: -110.9559 }
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: uluru,
|
||||
zoom: 10
|
||||
});
|
||||
|
||||
mapEvent = new google.maps.Map(document.getElementById('mapEvent'), {
|
||||
center: uluru,
|
||||
zoom: 10
|
||||
});
|
||||
|
||||
directionsService = new google.maps.DirectionsService;
|
||||
directionsDisplay = new google.maps.DirectionsRenderer;
|
||||
directionsDisplay.setOptions({ suppressMarkers: true });
|
||||
directionsDisplay.setMap(map);
|
||||
|
||||
directionsServiceEvent = new google.maps.DirectionsService;
|
||||
directionsDisplayEvent = new google.maps.DirectionsRenderer;
|
||||
directionsDisplayEvent.setOptions({ suppressMarkers: true });
|
||||
directionsDisplayEvent.setMap(mapEvent);
|
||||
|
||||
var searchBox = new google.maps.places.SearchBox(document.getElementById("<%= TxtLoc.ClientID%>"));
|
||||
var searchBoxEvent = new google.maps.places.SearchBox(document.getElementById("<%= TxtLoc2.ClientID%>"));
|
||||
|
||||
searchBox.addListener('places_changed', function () {
|
||||
var places = searchBox.getPlaces();
|
||||
if (places.length == 0) {
|
||||
return;
|
||||
}
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
places.forEach(function (place) {
|
||||
if (!place.geometry) {
|
||||
console.log("Returned place contains no geometry");
|
||||
return;
|
||||
}
|
||||
var lat = place.geometry.location.lat();
|
||||
var lng = place.geometry.location.lng();
|
||||
|
||||
$("#<%= TxtLatLong.ClientID%>").val(lat + ',' + lng);
|
||||
|
||||
getDirecciones(lat, lng);
|
||||
|
||||
var icon = {
|
||||
url: 'http://maps.google.com/mapfiles/ms/micons/truck.png',
|
||||
size: new google.maps.Size(71, 71),
|
||||
origin: new google.maps.Point(0, 0),
|
||||
anchor: new google.maps.Point(17, 34),
|
||||
scaledSize: new google.maps.Size(25, 25)
|
||||
};
|
||||
|
||||
marker = new google.maps.Marker({
|
||||
map: map,
|
||||
icon: icon,
|
||||
title: place.name,
|
||||
position: place.geometry.location,
|
||||
draggable: true,
|
||||
animation: google.maps.Animation.DROP
|
||||
});
|
||||
|
||||
google.maps.event.addListener(marker, 'dragend', function () {
|
||||
var pos = marker.getPosition();
|
||||
getDirecciones(pos.lat(), pos.lng());
|
||||
});
|
||||
// Create a marker for each place.
|
||||
deleteMarkers(markers);
|
||||
markers.push(marker);
|
||||
|
||||
if (place.geometry.viewport) {
|
||||
// Only geocodes have viewport.
|
||||
bounds.union(place.geometry.viewport);
|
||||
} else {
|
||||
bounds.extend(place.geometry.location);
|
||||
}
|
||||
|
||||
map.fitBounds(bounds);
|
||||
map.setCenter(bounds.getCenter());
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
searchBoxEvent.addListener('places_changed', function () {
|
||||
var places = searchBoxEvent.getPlaces();
|
||||
if (places.length == 0) {
|
||||
return;
|
||||
}
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
places.forEach(function (place) {
|
||||
if (!place.geometry) {
|
||||
console.log("Returned place contains no geometry");
|
||||
return;
|
||||
}
|
||||
var lat = place.geometry.location.lat();
|
||||
var lng = place.geometry.location.lng();
|
||||
|
||||
SetMapPinEvent(lat, lng);
|
||||
});
|
||||
});
|
||||
|
||||
map.addListener('bounds_changed', function () {
|
||||
searchBox.setBounds(map.getBounds());
|
||||
});
|
||||
|
||||
mapEvent.addListener('bounds_changed', function () {
|
||||
searchBoxEvent.setBounds(mapEvent.getBounds());
|
||||
});
|
||||
|
||||
}
|
||||
function cargapin(lat, lng) {
|
||||
setTimeout(function () { SetMapPinEvent(lat, lng) }, 1000);
|
||||
}
|
||||
|
||||
function SetMapPinEvent(lat, lng) {
|
||||
$("#<%= TxtLatLongEvent.ClientID%>").val(lat + ',' + lng);
|
||||
|
||||
var icon = {
|
||||
url: 'http://maps.google.com/mapfiles/ms/micons/truck.png',
|
||||
size: new google.maps.Size(71, 71),
|
||||
origin: new google.maps.Point(0, 0),
|
||||
anchor: new google.maps.Point(17, 34),
|
||||
scaledSize: new google.maps.Size(25, 25)
|
||||
};
|
||||
|
||||
markerEvent = new google.maps.Marker({
|
||||
map: mapEvent,
|
||||
icon: icon,
|
||||
position: new google.maps.LatLng(lat, lng),
|
||||
draggable: true,
|
||||
animation: google.maps.Animation.DROP
|
||||
});
|
||||
|
||||
google.maps.event.addListener(markerEvent, 'dragend', function () {
|
||||
var pos = markerEvent.getPosition();
|
||||
$("#<%= TxtLatLongEvent.ClientID%>").val(pos.lat() + ',' + pos.lng());
|
||||
var centerMaker = new google.maps.LatLng(pos.lat(), pos.lng());
|
||||
mapEvent.panTo(centerMaker);
|
||||
|
||||
});
|
||||
|
||||
deleteMarkers(markersEvent);
|
||||
// Create a marker for each place.
|
||||
markersEvent.push(markerEvent);
|
||||
|
||||
var center = new google.maps.LatLng(lat, lng);
|
||||
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
bounds.extend(center);
|
||||
|
||||
mapEvent.fitBounds(bounds);
|
||||
mapEvent.setCenter(bounds.getCenter());
|
||||
|
||||
}
|
||||
function deleteMarkers(markers) {
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
markers = [];
|
||||
}
|
||||
function getDirecciones(lat, lng) {
|
||||
var url = '<%= ClsPaginas.UrlDirecciones%>' + 'nominatim/reverse.php?format=jsonv2&zoom=18&addressdetails=1&lat=' + lat + '&lon=' + lng;
|
||||
$.getJSON(url, function (data) {
|
||||
if (typeof (data.error) === 'undefined') {
|
||||
$("#<%= TxtLatLong.ClientID%>").val(lat + ',' + lng);
|
||||
$("#<%= TxtAddress.ClientID%>").val(data.display_name);
|
||||
$("#<%= TxtCity.ClientID%>").val(data.address.city);
|
||||
$("#<%= TxtState.ClientID%>").val(data.address.state);
|
||||
$("#<%= TxtContry.ClientID%>").val(data.address.country);
|
||||
$("#<%= TxtPostalCode.ClientID%>").val(data.address.postcode);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places">
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
915
GPS/Shipments.aspx.cs
Normal file
915
GPS/Shipments.aspx.cs
Normal file
@@ -0,0 +1,915 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Fluent;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Data;
|
||||
using Extensiones;
|
||||
using static Extensiones.ModExtensiones;
|
||||
public partial class GPS_Shipments : ClsPaginas
|
||||
{
|
||||
#region "P R O P I E D A D E S"
|
||||
public int CveShipment
|
||||
{
|
||||
get { return IfNull(ViewState["CveShipment"], -1).ToString().ToEntero(); }
|
||||
set { ViewState["CveShipment"] = value; }
|
||||
}
|
||||
public string UsuarioFV
|
||||
{
|
||||
get { return IfNull(ViewState["UsuarioFV"], "").ToString(); }
|
||||
set { ViewState["UsuarioFV"] = value; }
|
||||
}
|
||||
public string ContraseniaFV
|
||||
{
|
||||
get { return IfNull(ViewState["ContraseniaFV"], "").ToString(); }
|
||||
set { ViewState["ContraseniaFV"] = value; }
|
||||
}
|
||||
public string FVTHIRDPARTYID
|
||||
{
|
||||
get { return IfNull(ViewState["fvThirdPartyId"], "").ToString(); }
|
||||
set { ViewState["fvThirdPartyId"] = value; }
|
||||
}
|
||||
public string SCAC
|
||||
{
|
||||
get { return IfNull(ViewState["SCAC"], "").ToString(); }
|
||||
set { ViewState["SCAC"] = value; }
|
||||
}
|
||||
|
||||
public string FVCARRIERID
|
||||
{
|
||||
get { return IfNull(ViewState["FVCARRIERID"], "").ToString(); }
|
||||
set { ViewState["FVCARRIERID"] = value; }
|
||||
}
|
||||
private DataTable DtStops
|
||||
{
|
||||
get { return (DataTable)ViewState["DtStops"]; }
|
||||
set { ViewState["DtStops"] = value; }
|
||||
}
|
||||
|
||||
private string Token => Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(string.Format("{0}:{1}", Decripta(UsuarioFV), Decripta(ContraseniaFV))));
|
||||
|
||||
#endregion
|
||||
|
||||
#region "D A T O S"
|
||||
private void IniciaDTStops()
|
||||
{
|
||||
if (this.DtStops != null)
|
||||
{
|
||||
this.DtStops.Dispose();
|
||||
this.DtStops = null;
|
||||
}
|
||||
|
||||
this.DtStops = new DataTable();
|
||||
this.DtStops.Columns.Add(new DataColumn("StopSequence", typeof(int)));
|
||||
this.DtStops.Columns.Add(new DataColumn("Name", typeof(string)));
|
||||
this.DtStops.Columns.Add(new DataColumn("LocationID", typeof(string)));
|
||||
this.DtStops.Columns.Add(new DataColumn("StopType", typeof(string)));
|
||||
this.DtStops.Columns.Add(new DataColumn("StopRole", typeof(string)));
|
||||
this.DtStops.Columns.Add(new DataColumn("EarlyArrivalTime", typeof(DateTime)));
|
||||
this.DtStops.Columns.Add(new DataColumn("LateArrivalTime", typeof(DateTime)));
|
||||
|
||||
this.DtStops.Columns.Add(new DataColumn("Address", typeof(string)));
|
||||
this.DtStops.Columns.Add(new DataColumn("City", typeof(string)));
|
||||
this.DtStops.Columns.Add(new DataColumn("State", typeof(string)));
|
||||
this.DtStops.Columns.Add(new DataColumn("PostalCode", typeof(string)));
|
||||
this.DtStops.Columns.Add(new DataColumn("Country", typeof(string)));
|
||||
this.DtStops.Columns.Add(new DataColumn("Lat", typeof(string)));
|
||||
this.DtStops.Columns.Add(new DataColumn("Lon", typeof(string)));
|
||||
}
|
||||
#endregion
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
CargaConfiguracion();
|
||||
CargaDatos();
|
||||
|
||||
}
|
||||
}
|
||||
protected void CargaConfiguracion()
|
||||
{
|
||||
var ObjGPS = new ClsGPS();
|
||||
try
|
||||
{
|
||||
if (ObjGPS.GetFVConfiguracion(UsuarioActual.CveCliente, -1))
|
||||
{
|
||||
if (ObjGPS.DtResultados.Rows.Count == 1)
|
||||
{
|
||||
var row = ObjGPS.DtResultados.Rows[0];
|
||||
this.FVCARRIERID = row["fvCarrierId"].ToString().Trim();
|
||||
this.FVTHIRDPARTYID = row["fvThirdPartyId"].ToString().Trim();
|
||||
this.SCAC = row["scac"].ToString().Trim();
|
||||
this.UsuarioFV = Encripta(row["Usuario"].ToString()).Trim();
|
||||
this.ContraseniaFV = Encripta(row["Contrasenia"].ToString()).Trim();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("No esta configurado para utilizar este modulo", TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario).FiltraParametros("Estatus = 1");
|
||||
DdlDispositivo.DataBind();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.OnError("Ocurrió un error al obtener la configuración", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ObjGPS.Dispose();
|
||||
}
|
||||
}
|
||||
protected void CargaDatos()
|
||||
{
|
||||
var ObjGPS = new ClsGPS();
|
||||
if (ObjGPS.GetShipments(UsuarioActual.CveCliente, -1))
|
||||
{
|
||||
GvShipments.DataSource = ObjGPS.DtResultados;
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
|
||||
GvShipments.DataBind();
|
||||
|
||||
IniciaDTStops();
|
||||
|
||||
LimpiarModal();
|
||||
LimpiarModalStop();
|
||||
}
|
||||
protected void LnkAgregar_Click(object sender, EventArgs e)
|
||||
{
|
||||
IniciaDTStops();
|
||||
LimpiarModal();
|
||||
this.RegistraScript("$('#DivShipment').modal({backdrop: 'static', keyboard: false});");
|
||||
}
|
||||
protected void LnkAddNewStop_Click(object sender, EventArgs e)
|
||||
{
|
||||
LimpiarModalStop();
|
||||
this.RegistraScript("$('#DivStop').modal({backdrop: 'static', keyboard: false});");
|
||||
}
|
||||
protected void LnkAddStop_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (DtStops != null)
|
||||
{
|
||||
var Row = DtStops.NewRow();
|
||||
Row["StopSequence"] = DtStops.Rows.Count + 1;
|
||||
Row["Name"] = TxtLocName.Text.Trim();
|
||||
Row["LocationID"] = TxtLocID.Text.Trim();
|
||||
Row["StopType"] = DdlStopType.SelectedValue;
|
||||
Row["StopRole"] = DdlStopRole.SelectedValue;
|
||||
Row["EarlyArrivalTime"] = TxtFechaStopI.Text.ToDateTime();
|
||||
Row["LateArrivalTime"] = TxtFechaStopF.Text.ToDateTime();
|
||||
|
||||
Row["Address"] = TxtAddress.Text.Trim();
|
||||
Row["City"] = TxtCity.Text.Trim();
|
||||
Row["State"] = TxtState.Text.Trim();
|
||||
Row["PostalCode"] = TxtPostalCode.Text.Trim();
|
||||
Row["Country"] = TxtContry.Text.Trim();
|
||||
|
||||
var latlon = TxtLatLong.Text.Trim().Split(',');
|
||||
|
||||
Row["Lat"] = latlon[0];
|
||||
Row["Lon"] = latlon[1];
|
||||
|
||||
DtStops.Rows.Add(Row);
|
||||
}
|
||||
GvStops.DataSource = DtStops;
|
||||
GvStops.DataBind();
|
||||
|
||||
UpShipment.Update();
|
||||
|
||||
this.RegistraScript("$('#DivStop').modal('hide');");
|
||||
}
|
||||
protected void LimpiarModal()
|
||||
{
|
||||
TxtShipment.Text = "";
|
||||
TxtAsset.Text = "";
|
||||
TxtRoute.Text = "";
|
||||
TxtTrailer.Text = "";
|
||||
TxtObs.Text = "";
|
||||
UpShipment.Update();
|
||||
}
|
||||
protected void LimpiarModalStop()
|
||||
{
|
||||
TxtLocName.Text = "";
|
||||
TxtLocID.Text = "";
|
||||
TxtLoc.Text = "";
|
||||
TxtFechaStopI.Text = "";
|
||||
TxtFechaStopF.Text = "";
|
||||
|
||||
TxtAddress.Text = "";
|
||||
TxtCity.Text = "";
|
||||
TxtState.Text = "";
|
||||
TxtPostalCode.Text = "";
|
||||
TxtContry.Text = "";
|
||||
TxtLatLong.Text = "";
|
||||
|
||||
UpStop.Update();
|
||||
}
|
||||
#region "C R E A R E Q U E S T"
|
||||
|
||||
protected JObject GeneraRequestShipment()
|
||||
{
|
||||
var stops = GeneraStops();
|
||||
|
||||
return new JObject()
|
||||
{
|
||||
new JProperty("carrier", new JObject()
|
||||
{
|
||||
new JProperty("fvCarrierId", FVCARRIERID),
|
||||
new JProperty("scac", SCAC)
|
||||
}),
|
||||
new JProperty("customer",new JObject()
|
||||
{
|
||||
new JProperty("fvCustomerId", DdlCustomer.SelectedValue.Trim())
|
||||
}),
|
||||
new JProperty("thirdParty",new JObject()
|
||||
{
|
||||
new JProperty("fvThirdPartyId", FVTHIRDPARTYID)
|
||||
}),
|
||||
new JProperty("shipmentIdentification",new JObject()
|
||||
{
|
||||
new JProperty("shipmentId", TxtShipment.Text.Trim())
|
||||
}),
|
||||
new JProperty("telematics",new JObject()
|
||||
{
|
||||
new JProperty("provider", "Direct"),
|
||||
new JProperty("trackingAssetId", TxtAsset.Text.Trim())
|
||||
}),
|
||||
new JProperty("shipmentDetails",new JObject()),
|
||||
new JProperty("stops",stops),
|
||||
new JProperty("shipmentReferences",new JArray() {
|
||||
new JObject()
|
||||
{
|
||||
new JProperty("qualifier", "route_id"),
|
||||
new JProperty("description", ""),
|
||||
new JProperty("value",TxtRoute.Text.Trim())
|
||||
},
|
||||
new JObject()
|
||||
{
|
||||
new JProperty("qualifier", "trailer_number"),
|
||||
new JProperty("description", ""),
|
||||
new JProperty("value",TxtTrailer.Text.Trim())
|
||||
}
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
protected JArray GeneraStops()
|
||||
{
|
||||
return new JArray(from row in DtStops.AsEnumerable()
|
||||
select new JObject(
|
||||
new JProperty("stopType", row["StopType"]),
|
||||
new JProperty("stopRole", row["StopRole"]),
|
||||
new JProperty("stopSequence", row["StopSequence"].ToString().ToEntero()),
|
||||
new JProperty("earlyArrival", string.Format("{0}{1}", row["EarlyArrivalTime"].ToString().ToDateTime().ToString("yyyy-MM-ddThh:mm:ss"), "-0500")),
|
||||
new JProperty("lateArrival", string.Format("{0}{1}", row["LateArrivalTime"].ToString().ToDateTime().ToString("yyyy-MM-ddThh:mm:ss"), "-0500")),
|
||||
new JProperty("location", new JObject()
|
||||
{
|
||||
new JProperty("locationId", new JObject()
|
||||
{
|
||||
new JProperty("qualifier", "customer"),
|
||||
new JProperty("value", row["LocationID"])
|
||||
}),
|
||||
new JProperty("name", row["Name"]),
|
||||
new JProperty("address1",row["Address"]),
|
||||
new JProperty("city",row["City"]),
|
||||
new JProperty("state",row["State"]),
|
||||
new JProperty("postalCode",row["PostalCode"]),
|
||||
new JProperty("country",row["Country"]),
|
||||
new JProperty("latitude",row["Lat"].ToString().ToDouble()),
|
||||
new JProperty("longitude",row["Lon"].ToString().ToDouble())
|
||||
})
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
protected JObject GeneraRequestEvent(int CveShipment)
|
||||
{
|
||||
var route_id = "";
|
||||
var trailer_number = "";
|
||||
var trackingAssetId = "";
|
||||
|
||||
var ObjGPS = new ClsGPS();
|
||||
if (ObjGPS.GetShipments(UsuarioActual.CveCliente, CveShipment))
|
||||
{
|
||||
if (ObjGPS.DtResultados.Rows.Count == 1)
|
||||
{
|
||||
var row = ObjGPS.DtResultados.Rows[0];
|
||||
route_id = row["RouteID"].ToString();
|
||||
trailer_number = row["TrailerID"].ToString();
|
||||
trackingAssetId = row["AssetID"].ToString();
|
||||
}
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
var latlon = TxtLatLongEvent.Text.Trim().Split(',');
|
||||
var json = new JObject()
|
||||
{
|
||||
new JProperty("carrier", new JObject()
|
||||
{
|
||||
new JProperty("fvCarrierId", FVCARRIERID),
|
||||
new JProperty("scac", SCAC)
|
||||
}),
|
||||
new JProperty("location",new JObject()
|
||||
{
|
||||
new JProperty("latitude", latlon[0].ToDouble()),
|
||||
new JProperty("longitude", latlon[1].ToDouble())
|
||||
}),
|
||||
new JProperty("telematics",new JObject()
|
||||
{
|
||||
new JProperty("provider", "Direct"),
|
||||
new JProperty("trackingAssetId", trackingAssetId)
|
||||
}),
|
||||
new JProperty("eventDetail",new JObject()
|
||||
{
|
||||
new JProperty("event", DdlEvent.SelectedValue),
|
||||
new JProperty("reason",DdlReason.SelectedValue),
|
||||
new JProperty("eventDate",string.Format("{0}{1}",UsuarioActual.FechaActualCliente.ToString("yyyy-MM-ddThh:mm:ss"),"-0500"))
|
||||
}),
|
||||
new JProperty("eventReferences",new JArray() {
|
||||
new JObject()
|
||||
{
|
||||
new JProperty("qualifier", "route_id"),
|
||||
new JProperty("description", ""),
|
||||
new JProperty("value",route_id)
|
||||
},
|
||||
new JObject()
|
||||
{
|
||||
new JProperty("qualifier", "trailer_number"),
|
||||
new JProperty("description", ""),
|
||||
new JProperty("value",trailer_number)
|
||||
}
|
||||
})
|
||||
};
|
||||
if (DdlEvent.SelectedValue != "LO")
|
||||
{
|
||||
json.Add(new JProperty("stopSequence", 1));
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
protected JObject GeneraRequestLO(int CveShipment)
|
||||
{
|
||||
var route_id = "";
|
||||
var trailer_number = "";
|
||||
var trackingAssetId = "";
|
||||
double lat = 0;
|
||||
double lon = 0;
|
||||
var ObjGPS = new ClsGPS();
|
||||
if (ObjGPS.GetShipmentDetail(CveShipment))
|
||||
{
|
||||
if (ObjGPS.DtResultados.Rows.Count == 1)
|
||||
{
|
||||
var row = ObjGPS.DtResultados.Rows[0];
|
||||
lat = row["Lat"].ToString().ToDouble();
|
||||
lon = row["Lon"].ToString().ToDouble();
|
||||
route_id = row["RouteID"].ToString();
|
||||
trailer_number = row["TrailerID"].ToString();
|
||||
trackingAssetId = row["AssetID"].ToString();
|
||||
}
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
|
||||
var json = new JObject()
|
||||
{
|
||||
new JProperty("carrier", new JObject()
|
||||
{
|
||||
new JProperty("fvCarrierId", FVCARRIERID),
|
||||
new JProperty("scac", SCAC)
|
||||
}),
|
||||
new JProperty("location",new JObject()
|
||||
{
|
||||
new JProperty("latitude", lat),
|
||||
new JProperty("longitude", lon)
|
||||
}),
|
||||
new JProperty("telematics",new JObject()
|
||||
{
|
||||
new JProperty("provider", "Direct"),
|
||||
new JProperty("trackingAssetId", trackingAssetId)
|
||||
}),
|
||||
new JProperty("eventDetail",new JObject()
|
||||
{
|
||||
new JProperty("event","LO"),
|
||||
new JProperty("reason","NS"),
|
||||
new JProperty("eventDate",string.Format("{0}{1}",UsuarioActual.FechaActualCliente.ToString("yyyy-MM-ddThh:mm:ss"),"-0500"))
|
||||
}),
|
||||
new JProperty("eventReferences",new JArray() {
|
||||
new JObject()
|
||||
{
|
||||
new JProperty("qualifier", "route_id"),
|
||||
new JProperty("description", ""),
|
||||
new JProperty("value",route_id)
|
||||
},
|
||||
new JObject()
|
||||
{
|
||||
new JProperty("qualifier", "trailer_number"),
|
||||
new JProperty("description", ""),
|
||||
new JProperty("value",trailer_number)
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region "A P I"
|
||||
private bool EnviarShipmentAPI(string Datos)
|
||||
{
|
||||
bool Retorno = false;
|
||||
string correlationId = GuidGenerator.GenerateTimeBasedGuid(UsuarioActual.FechaActualCliente).ToString();
|
||||
|
||||
HttpClient wc = new HttpClient();
|
||||
try
|
||||
{
|
||||
var Url = new Uri("https://api.freightverify.com/ws/rest/v2/tl/shipment");
|
||||
var content = new StringContent(Datos, Encoding.UTF8, "application/json");
|
||||
wc.DefaultRequestHeaders.Add("Authorization", $"Basic {Token}");
|
||||
wc.DefaultRequestHeaders.Add("WSS-correlationId", correlationId);
|
||||
var response = wc.PostAsync(Url, content).Result;
|
||||
var result = response.Content.ReadAsStringAsync().Result;
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.OK || response.StatusCode == System.Net.HttpStatusCode.Created)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
{
|
||||
Retorno = true;
|
||||
}
|
||||
}
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.BadRequest)
|
||||
{
|
||||
Retorno = false;
|
||||
var jerror = JObject.Parse(result);
|
||||
Alert(jerror["errors"].ToString(), TipoMensaje.MsgError);
|
||||
}
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized)
|
||||
{
|
||||
Retorno = false;
|
||||
Alert("No esta autorizado para realizar esta petición.", TipoMensaje.MsgError);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
}
|
||||
wc.Dispose();
|
||||
|
||||
return Retorno;
|
||||
}
|
||||
|
||||
private bool EnviarEventoAPI(int CveShipment, string Datos)
|
||||
{
|
||||
var ShipmentID = "";
|
||||
var Customer = "";
|
||||
|
||||
var ObjGPS = new ClsGPS();
|
||||
if (ObjGPS.GetShipments(UsuarioActual.CveCliente, CveShipment))
|
||||
{
|
||||
if (ObjGPS.DtResultados.Rows.Count == 1)
|
||||
{
|
||||
var row = ObjGPS.DtResultados.Rows[0];
|
||||
ShipmentID = row["ShipmentID"].ToString();
|
||||
Customer = row["Customer"].ToString();
|
||||
}
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
|
||||
string correlationId = GuidGenerator.GenerateTimeBasedGuid(UsuarioActual.FechaActualCliente).ToString();
|
||||
bool Retorno = false;
|
||||
HttpClient wc = new HttpClient();
|
||||
try
|
||||
{
|
||||
var fvShipmentId = $"{this.FVCARRIERID}|{Customer}|{ShipmentID}";
|
||||
|
||||
var Url = new Uri("https://api.freightverify.com/ws/rest/v2/tl/shipment/event");
|
||||
var content = new StringContent(Datos, Encoding.UTF8, "application/json");
|
||||
wc.DefaultRequestHeaders.Add("Authorization", $"Basic {Token}");
|
||||
wc.DefaultRequestHeaders.Add("WSS-correlationId", correlationId);
|
||||
wc.DefaultRequestHeaders.Add("X-WSS-fvShipmentId", fvShipmentId);
|
||||
var response = wc.PostAsync(Url, content).Result;
|
||||
var result = response.Content.ReadAsStringAsync().Result;
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.OK || response.StatusCode == System.Net.HttpStatusCode.Created)
|
||||
{
|
||||
Retorno = true;
|
||||
}
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.BadRequest)
|
||||
{
|
||||
Retorno = false;
|
||||
var jerror = JObject.Parse(result);
|
||||
Alert(jerror["errors"].ToString(), TipoMensaje.MsgError);
|
||||
}
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized)
|
||||
{
|
||||
Retorno = false;
|
||||
Alert("No esta autorizado para realizar esta petición.", TipoMensaje.MsgError);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
}
|
||||
wc.Dispose();
|
||||
|
||||
return Retorno;
|
||||
}
|
||||
|
||||
private bool EliminarShipmentAPI(int CveShipment)
|
||||
{
|
||||
var ShipmentID = "";
|
||||
var Customer = "";
|
||||
|
||||
var ObjGPS = new ClsGPS();
|
||||
if (ObjGPS.GetShipments(UsuarioActual.CveCliente, CveShipment))
|
||||
{
|
||||
if (ObjGPS.DtResultados.Rows.Count == 1)
|
||||
{
|
||||
var row = ObjGPS.DtResultados.Rows[0];
|
||||
ShipmentID = row["ShipmentID"].ToString();
|
||||
Customer = row["Customer"].ToString();
|
||||
}
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
|
||||
string correlationId = GuidGenerator.GenerateTimeBasedGuid(UsuarioActual.FechaActualCliente).ToString();
|
||||
bool Retorno = false;
|
||||
HttpClient wc = new HttpClient();
|
||||
try
|
||||
{
|
||||
var fvShipmentId = $"{this.FVCARRIERID}|{Customer}|{ShipmentID}";
|
||||
|
||||
var Url = new Uri("https://api.freightverify.com/ws/rest/v2/tl/shipment");
|
||||
|
||||
wc.DefaultRequestHeaders.Add("Authorization", $"Basic {Token}");
|
||||
wc.DefaultRequestHeaders.Add("WSS-correlationId", correlationId);
|
||||
wc.DefaultRequestHeaders.Add("X-WSS-fvShipmentId", fvShipmentId);
|
||||
var response = wc.DeleteAsync(Url).Result;
|
||||
var result = response.Content.ReadAsStringAsync().Result;
|
||||
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.OK || response.StatusCode == System.Net.HttpStatusCode.Created)
|
||||
{
|
||||
Retorno = true;
|
||||
}
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.BadRequest)
|
||||
{
|
||||
Retorno = false;
|
||||
var jerror = JObject.Parse(result);
|
||||
Alert(jerror["errors"].ToString(), TipoMensaje.MsgError);
|
||||
}
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized)
|
||||
{
|
||||
Retorno = false;
|
||||
Alert("No esta autorizado para realizar esta petición.", TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
}
|
||||
wc.Dispose();
|
||||
|
||||
return Retorno;
|
||||
}
|
||||
#endregion
|
||||
protected void BtnAgregarShipment_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (DtStops.Rows.Count < 2)
|
||||
{
|
||||
Alert("Se requieren al menos 2 stops.", TipoMensaje.MsgAdvertencia);
|
||||
return;
|
||||
}
|
||||
var request = GeneraRequestShipment();
|
||||
bool envio = EnviarShipmentAPI(request.ToString());
|
||||
if (envio)
|
||||
{
|
||||
bool TieneError = false;
|
||||
var ObjGPS = new ClsGPS();
|
||||
ObjGPS.IniciaTransacSQL();
|
||||
try
|
||||
{
|
||||
var CveShipment = ObjGPS.AddShipment(DdlDispositivo.SelectedValue.ToEntero(), true, DdlCustomer.SelectedValue, TxtShipment.Text, TxtAsset.Text, TxtRoute.Text, TxtTrailer.Text.Trim(), TxtObs.Text.Trim(), UsuarioActual.CveCliente);
|
||||
foreach (DataRow row in DtStops.Rows)
|
||||
{
|
||||
|
||||
if (!ObjGPS.AddStop(CveShipment, row["StopSequence"].ToString().ToEntero(), row["Name"].ToString(), row["LocationID"].ToString(), row["StopType"].ToString(),
|
||||
row["StopRole"].ToString(), row["EarlyArrivalTime"].ToString().ToDateTime(), row["LateArrivalTime"].ToString().ToDateTime(),
|
||||
row["Address"].ToString(), row["City"].ToString(), row["State"].ToString(), row["PostalCode"].ToString(), row["Country"].ToString(),
|
||||
row["Lat"].ToString(), row["Lon"].ToString()))
|
||||
{
|
||||
TieneError = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
TieneError = true;
|
||||
this.OnError("Ocurrió un error al agregar el shipment", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (TieneError)
|
||||
{
|
||||
ObjGPS.RollBack();
|
||||
this.Alert("No se pudo guardar el shipment.", TipoMensaje.MsgError);
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjGPS.Commit();
|
||||
this.Alert("El shipment se envió correctamente a FreightVerify.", TipoMensaje.MsgInformacion);
|
||||
this.RegistraScript("$('#DivShipment').modal('hide');");
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert("No se pudo enviar el shipment a FreightVerify.", TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkAddEvent_Click(object sender, EventArgs e)
|
||||
{
|
||||
var GvRow = ((sender as LinkButton).NamingContainer as GridViewRow);
|
||||
CveShipment = GvRow.DataKey("CveShipment").ToEntero();
|
||||
|
||||
CargaStops(CveShipment);
|
||||
|
||||
this.RegistraScript("$('#DivEvent').modal({backdrop: 'static', keyboard: false});", "1");
|
||||
CargaPosicionStop(DdlStops.SelectedValue.ToEntero());
|
||||
UpEvent.Update();
|
||||
}
|
||||
private void CargaPosicionStop(int CveStop)
|
||||
{
|
||||
var row = DtStops.FiltroPrimero($"CveStop = {CveStop}");
|
||||
TxtStopSec.Text = row["StopSequence"].ToString();
|
||||
|
||||
TxtLatLongEvent.Text = string.Format("{0},{1}", row["Lat"].ToString(), row["Lon"].ToString());
|
||||
TxtLatLongEvent.Text = string.Format("{0},{1}", row["Lat"].ToString(), row["Lon"].ToString());
|
||||
|
||||
this.RegistraScript($"cargapin('{row["Lat"].ToString()}','{row["Lon"].ToString()}');", "2"); ;
|
||||
}
|
||||
private void CargaStops(int CveShipment)
|
||||
{
|
||||
var ObjGPS = new ClsGPS();
|
||||
if (ObjGPS.GetStops(CveShipment))
|
||||
{
|
||||
DtStops = ObjGPS.DtResultados.Copy();
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
|
||||
DdlStops.DataSource = DtStops;
|
||||
DdlStops.DataBind();
|
||||
}
|
||||
|
||||
protected void GvShipments_RowDeleting(object sender, GridViewDeleteEventArgs e)
|
||||
{
|
||||
CveShipment = GvShipments.Rows[e.RowIndex].DataKey("CveShipment").ToEntero();
|
||||
|
||||
bool elimino = EliminarShipmentAPI(CveShipment);
|
||||
if (elimino)
|
||||
{
|
||||
var ObjGPS = new ClsGPS();
|
||||
if (ObjGPS.RemoveShipment(CveShipment))
|
||||
{
|
||||
Alert("El shipment se eliminó correctamente");
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert("No se pudo eliminar el shipment.", TipoMensaje.MsgError);
|
||||
}
|
||||
CargaDatos();
|
||||
UpDatos.Update();
|
||||
}
|
||||
|
||||
protected void GvStops_RowDeleting(object sender, GridViewDeleteEventArgs e)
|
||||
{
|
||||
DtStops.Rows.RemoveAt(e.RowIndex);
|
||||
for (int i = 0; i < DtStops.Rows.Count; i++)
|
||||
{
|
||||
DtStops.Rows[i]["StopSequence"] = i + 1;
|
||||
}
|
||||
GvStops.DataSource = DtStops;
|
||||
GvStops.DataBind();
|
||||
|
||||
UpShipment.Update();
|
||||
}
|
||||
|
||||
protected void DdlStops_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
CargaPosicionStop(DdlStops.SelectedValue.ToEntero());
|
||||
UpEvent.Update();
|
||||
}
|
||||
|
||||
protected void LnkAddNewEvent_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (CveShipment > 0)
|
||||
{
|
||||
var Request = GeneraRequestEvent(CveShipment).ToString();
|
||||
bool envio = EnviarEventoAPI(CveShipment, Request);
|
||||
if (envio)
|
||||
{
|
||||
Alert("Se envio el evento correctamente.");
|
||||
this.RegistraScript("$('#DivEvent').modal('hide');");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert("No se pudo eliminar el shipment.", TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Alert("No se pudo eliminar el shipment.", TipoMensaje.MsgError);
|
||||
}
|
||||
}
|
||||
|
||||
protected void DdlDispositivo_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (DdlDispositivo.SelectedValue.ToEntero() > 0)
|
||||
{
|
||||
TxtAsset.Text = DdlDispositivo.SelectedItem.Text.Trim();
|
||||
}
|
||||
else
|
||||
{
|
||||
TxtAsset.Text = "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void GvShipments_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
e.Row.FCCheckBox("ChkTransmitir").Checked = e.Row.DBCampo("TransmitirTexto") == "Si";
|
||||
}
|
||||
}
|
||||
|
||||
protected void ChkTransmitir_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
var check = sender as CheckBox;
|
||||
var GvRow = check.NamingContainer as GridViewRow;
|
||||
CveShipment = GvRow.DataKey("CveShipment").ToEntero();
|
||||
if (CveShipment > 0)
|
||||
{
|
||||
var ObjGPS = new ClsGPS();
|
||||
if (ObjGPS.UpdateShipmentTransmision(CveShipment, check.Checked))
|
||||
{
|
||||
Alert("El estatus de transmisión de datos se actualizó correctamente.");
|
||||
}
|
||||
ObjGPS.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace Fluent
|
||||
{
|
||||
public enum GuidVersion
|
||||
{
|
||||
TimeBased = 0x01,
|
||||
Reserved = 0x02,
|
||||
NameBased = 0x03,
|
||||
Random = 0x04
|
||||
}
|
||||
public static partial class GuidGenerator
|
||||
{
|
||||
// number of bytes in guid
|
||||
public const int ByteArraySize = 16;
|
||||
|
||||
// multiplex variant info
|
||||
public const int VariantByte = 8;
|
||||
public const int VariantByteMask = 0x3f;
|
||||
public const int VariantByteShift = 0x80;
|
||||
|
||||
// multiplex version info
|
||||
public const int VersionByte = 7;
|
||||
public const int VersionByteMask = 0x0f;
|
||||
public const int VersionByteShift = 4;
|
||||
|
||||
// indexes within the uuid array for certain boundaries
|
||||
private const byte TimestampByte = 0;
|
||||
private const byte GuidClockSequenceByte = 8;
|
||||
private const byte NodeByte = 10;
|
||||
|
||||
// offset to move from 1/1/0001, which is 0-time for .NET, to gregorian 0-time of 10/15/1582
|
||||
private static readonly DateTimeOffset GregorianCalendarStart = new DateTimeOffset(1582, 10, 15, 0, 0, 0, TimeSpan.Zero);
|
||||
|
||||
// random clock sequence and node
|
||||
public static byte[] DefaultClockSequence { get; set; }
|
||||
public static byte[] DefaultNode { get; set; }
|
||||
|
||||
static GuidGenerator()
|
||||
{
|
||||
DefaultClockSequence = new byte[2];
|
||||
DefaultNode = new byte[6];
|
||||
|
||||
var random = new Random();
|
||||
random.NextBytes(DefaultClockSequence);
|
||||
random.NextBytes(DefaultNode);
|
||||
}
|
||||
|
||||
public static GuidVersion GetVersion(this Guid guid)
|
||||
{
|
||||
byte[] bytes = guid.ToByteArray();
|
||||
return (GuidVersion)((bytes[VersionByte] & 0xFF) >> VersionByteShift);
|
||||
}
|
||||
|
||||
public static DateTimeOffset GetDateTimeOffset(Guid guid)
|
||||
{
|
||||
byte[] bytes = guid.ToByteArray();
|
||||
|
||||
// reverse the version
|
||||
bytes[VersionByte] &= (byte)VersionByteMask;
|
||||
bytes[VersionByte] |= (byte)((byte)GuidVersion.TimeBased >> VersionByteShift);
|
||||
|
||||
byte[] timestampBytes = new byte[8];
|
||||
Array.Copy(bytes, TimestampByte, timestampBytes, 0, 8);
|
||||
|
||||
long timestamp = BitConverter.ToInt64(timestampBytes, 0);
|
||||
long ticks = timestamp + GregorianCalendarStart.Ticks;
|
||||
|
||||
return new DateTimeOffset(ticks, TimeSpan.Zero);
|
||||
}
|
||||
|
||||
public static DateTime GetDateTime(Guid guid)
|
||||
{
|
||||
return GetDateTimeOffset(guid).DateTime;
|
||||
}
|
||||
|
||||
public static DateTime GetLocalDateTime(Guid guid)
|
||||
{
|
||||
return GetDateTimeOffset(guid).LocalDateTime;
|
||||
}
|
||||
|
||||
public static DateTime GetUtcDateTime(Guid guid)
|
||||
{
|
||||
return GetDateTimeOffset(guid).UtcDateTime;
|
||||
}
|
||||
|
||||
public static Guid GenerateTimeBasedGuid()
|
||||
{
|
||||
return GenerateTimeBasedGuid(DateTimeOffset.UtcNow, DefaultClockSequence, DefaultNode);
|
||||
}
|
||||
|
||||
public static Guid GenerateTimeBasedGuid(DateTime dateTime)
|
||||
{
|
||||
return GenerateTimeBasedGuid(dateTime, DefaultClockSequence, DefaultNode);
|
||||
}
|
||||
|
||||
public static Guid GenerateTimeBasedGuid(DateTimeOffset dateTime)
|
||||
{
|
||||
return GenerateTimeBasedGuid(dateTime, DefaultClockSequence, DefaultNode);
|
||||
}
|
||||
|
||||
public static Guid GenerateTimeBasedGuid(DateTime dateTime, byte[] clockSequence, byte[] node)
|
||||
{
|
||||
return GenerateTimeBasedGuid(new DateTimeOffset(dateTime), clockSequence, node);
|
||||
}
|
||||
|
||||
public static Guid GenerateTimeBasedGuid(DateTimeOffset dateTime, byte[] clockSequence, byte[] node)
|
||||
{
|
||||
if (clockSequence == null)
|
||||
throw new ArgumentNullException("clockSequence");
|
||||
|
||||
if (node == null)
|
||||
throw new ArgumentNullException("node");
|
||||
|
||||
if (clockSequence.Length != 2)
|
||||
throw new ArgumentOutOfRangeException("clockSequence", "The clockSequence must be 2 bytes.");
|
||||
|
||||
if (node.Length != 6)
|
||||
throw new ArgumentOutOfRangeException("node", "The node must be 6 bytes.");
|
||||
|
||||
long ticks = (dateTime - GregorianCalendarStart).Ticks;
|
||||
byte[] guid = new byte[ByteArraySize];
|
||||
byte[] timestamp = BitConverter.GetBytes(ticks);
|
||||
|
||||
// copy node
|
||||
Array.Copy(node, 0, guid, NodeByte, Math.Min(6, node.Length));
|
||||
|
||||
// copy clock sequence
|
||||
Array.Copy(clockSequence, 0, guid, GuidClockSequenceByte, Math.Min(2, clockSequence.Length));
|
||||
|
||||
// copy timestamp
|
||||
Array.Copy(timestamp, 0, guid, TimestampByte, Math.Min(8, timestamp.Length));
|
||||
|
||||
// set the variant
|
||||
guid[VariantByte] &= (byte)VariantByteMask;
|
||||
guid[VariantByte] |= (byte)VariantByteShift;
|
||||
|
||||
// set the version
|
||||
guid[VersionByte] &= (byte)VersionByteMask;
|
||||
guid[VersionByte] |= (byte)((byte)GuidVersion.TimeBased << VersionByteShift);
|
||||
|
||||
return new Guid(guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
726
GPS/Soporte.aspx
Normal file
726
GPS/Soporte.aspx
Normal file
@@ -0,0 +1,726 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Soporte.aspx.vb" Inherits="GPS_Soporte" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style type="text/css">
|
||||
#map { height: 344px; }
|
||||
|
||||
.portlet.light.smmallpadding > .portlet-title > .caption {
|
||||
font-size:12px;
|
||||
width:80%
|
||||
}
|
||||
.portlet.light.smmallpadding > .portlet-title {
|
||||
min-height: 20px;
|
||||
}
|
||||
.progress {
|
||||
display:none;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
SIG SOPORTE
|
||||
</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">
|
||||
|
||||
<ajax:TabContainer ID="Tab" runat="server" Width="100%">
|
||||
|
||||
<ajax:TabPanel ID="TabConsulta" runat="server" HeaderText="Consulta">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel runat="server" ID="upDispositivo" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle magindate">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnCargaDispositivo" ClientIDMode="Static" runat="server" ValidationGroup="GrpGuardar" Text="Consultar" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Unidad/Dispositivo GPS:
|
||||
<asp:DropDownList ID="DdlDispositivo" runat="server" DataTextField="Serie" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me" Style="width: 230px;" ValidationGroup="GrpGuardar"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDdlDispositivo" runat="server" ControlToValidate="DdlDispositivo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Dispositivo''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
</li>
|
||||
<li>Tipo Consulta:
|
||||
<asp:DropDownList ID="DdlTipoConsulta" AutoPostBack="true" Width="150px" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Value="Last" Text="Última Posición"></asp:ListItem>
|
||||
<asp:ListItem Value="Last10" Text="Últimos 10"></asp:ListItem>
|
||||
<asp:ListItem Value="Today" Text="Hoy"></asp:ListItem>
|
||||
<asp:ListItem Value="Yesterday" Text="Ayer"></asp:ListItem>
|
||||
<asp:ListItem Value="Week" Text="Semana"></asp:ListItem>
|
||||
<asp:ListItem Value="All" Text="Personalizada"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
|
||||
<li id="liFechai" visible="false" runat="server">Fecha I.:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaI" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendario" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="txtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="txtFechaI" PopupButtonID="ImgCalendario" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="txtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
<li id="liFechaF" runat="server" visible="false">Fecha F.:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="txtFechaF" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="txtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="txtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="txtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpInfo" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12 ">
|
||||
<div class="portlet light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="fa fa-car font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Datos de la unidad: <asp:literal ID="ltlSerieConsulta" runat="server"></asp:literal></span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bodydatos" runat="server" visible="false" class="portlet-body form">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtIp" Text="192.158.0.2" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtIp.ClientID.ToString()%>">Ip </label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtPuerto" Text="2403" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtPuerto.ClientID.ToString()%>">Puerto.</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtAPN" Text="192.158.0.2" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtIp.ClientID.ToString()%>">APN </label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtPlanDatos" Text="TELCEL 100MB" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtPlanDatos.ClientID.ToString()%>">Plan de datos:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtSim" Text="895202001222417228" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtSim.ClientID.ToString()%>">SIM.</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtNoLinea" Text="192.158.0.2" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtNoLinea.ClientID.ToString()%>">Número de línea </label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtMarca" Text="2403" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtMarca.ClientID.ToString()%>">Marca de equipo.</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtModelo" Text="192.158.0.2" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtModelo.ClientID.ToString()%>">Modelo de equipo </label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtImei" Text="TELCEL 100MB" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtImei.ClientID.ToString()%>">IMEI:</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtSerie" Text="895202001222417228" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtSerie.ClientID.ToString()%>">Número de serie.</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtUnidad" Text="192.158.0.2" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtUnidad.ClientID.ToString()%>">Unidad de negocio</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtCliente" Text="2403" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtCliente.ClientID.ToString()%>">Cliente</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtEstatus" Text="192.158.0.2" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtEstatus.ClientID.ToString()%>">Estado Administrativo</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtFechaInstalacion" Text="TELCEL 100MB" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtFechaInstalacion.ClientID.ToString()%>">Fecha de Instalacion</label>
|
||||
</div>
|
||||
</div>
|
||||
<%--<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input">
|
||||
<asp:TextBox ID="TxtFechaReinstalacion" Text="895202001222417228" Enabled="false" runat="server" CssClass="form-control" ></asp:TextBox>
|
||||
<label for="<%= TxtFechaReinstalacion.ClientID.ToString()%>">Fecha de reinstalación</label>
|
||||
</div>
|
||||
</div>--%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div class="row">
|
||||
<asp:UpdatePanel UpdateMode="Conditional" ID="UpReportes" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="col-md-5" style="width:48%">
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">REPORTES</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div runat="server" id="bodyreportes" visible="false" class="portlet-body rowpadding" style="height:286px;">
|
||||
<div style="max-height: 260px; overflow-y: scroll">
|
||||
<asp:GridView ID="GvReportes" runat="server" DataKeyNames="CveTrama" Style="table-layout: fixed" AutoGenerateColumns="False" ShowHeader="True" EmptyDataText="No se Encontró Activo Fijo Registrado" GridLines="none" ToolTip="Listado de Activos Fijos" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Fecha" DataField="FechaIng" ItemStyle-HorizontalAlign="center" ItemStyle-Width="70%" />
|
||||
<asp:BoundField HeaderText="Valor" DataField="Valor" DataFormatString="{0} KM/H" ItemStyle-HorizontalAlign="right" ItemStyle-Width="30%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<div id="map" class="col-md-6" >
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<ajax:TabContainer ID="SubTab" CssClass="tab-wizard" runat="server" Width="100%">
|
||||
<ajax:TabPanel ID="TabHistorico" CssClass="tab-wizard" runat="server" HeaderText="Histórico">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="upHistorico" runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet smmallpadding light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand" class=" collapse" data-original-title="" title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative; text-align:left"><i class="fa fa-info-circle"></i>Histórico</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<asp:GridView ID="gvH1" runat="server" DataKeyNames="CveTrama" Style="table-layout: fixed" AutoGenerateColumns="False" ShowHeader="false" EmptyDataText="No se encontraron tramas" GridLines="none" ToolTip="Listado de Activos Fijos" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Trama" ItemStyle-Font-Bold="true" DataField="Evento" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100%" />
|
||||
<asp:BoundField HeaderText="Trama" DataField="Valor" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:GridView ID="gvH2" runat="server" DataKeyNames="CveTrama" Style="table-layout: fixed" AutoGenerateColumns="False" ShowHeader="false" EmptyDataText="No se encontraron tramas" GridLines="none" ToolTip="Listado de Activos Fijos" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Trama" ItemStyle-Font-Bold="true" DataField="Evento" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100%" />
|
||||
<asp:BoundField HeaderText="Trama" DataField="Valor" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:GridView ID="gvH3" runat="server" DataKeyNames="CveTrama" Style="table-layout: fixed" AutoGenerateColumns="False" ShowHeader="false" EmptyDataText="No se encontraron tramas" GridLines="none" ToolTip="Listado de Activos Fijos" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Trama" ItemStyle-Font-Bold="true" DataField="Evento" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100%" />
|
||||
<asp:BoundField HeaderText="Trama" DataField="Valor" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel ID="TabDiagnostico" CssClass="tab-wizard" runat="server" HeaderText="Diagnóstico">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="portlet smmallpadding light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand2" class=" collapse" data-original-title="" title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand2" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<asp:Literal runat="server" ID="LtlReportes" Text="Reportes: "></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Literal runat="server" ID="LtlBytes" Text="0 kB"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Literal runat="server" ID="LtlPorcReportes" Text="0%"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="portlet smmallpadding light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand3" class=" collapse" data-original-title="" title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand3" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<asp:Literal runat="server" ID="LtlGPS" Text="GPS"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Literal runat="server" ID="LtlEstatusGPS" Text="Estatus: OK"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="portlet smmallpadding light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand4" class=" collapse" data-original-title="" title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand4" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<asp:Literal runat="server" ID="LtlGPRS" Text="Estado GPRS"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Literal runat="server" ID="LtlEstatusGPRS" Text="Estatus: OK"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Literal runat="server" ID="LtlPorcGPRS" Text="0%"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="portlet smmallpadding light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand5" class=" collapse" data-original-title="" title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand5" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative;">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<asp:Literal runat="server" ID="LtlActividad" Text="Actividad"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Literal runat="server" ID="LtlReportesAct" Text="Reportes: "></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Literal runat="server" ID="LtlPorcAct" Text="0%"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel ID="TabVLog" runat="server" HeaderText="Ver Log">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UPVlog" runat="server" updatemode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet smmallpadding light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="tools">
|
||||
<a href="javascript;" data-idchekbox="C_chkexpand7" class=" collapse" data-original-title="" title=""></a><span class="hidden">
|
||||
<input id="C_chkexpand7" type="checkbox" name="ctl00$C$chkexpand" checked="checked"></span>
|
||||
</div>
|
||||
<div class="caption uppercase" style="position: relative; text-align:left"><i class="fa fa-info-circle"></i>Log del vehículo</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div style="max-height: 392px; overflow-y: scroll">
|
||||
<asp:GridView ID="GvVLog" runat="server" DataKeyNames="CveTrama" Style="table-layout: fixed" AutoGenerateColumns="False" ShowHeader="false" EmptyDataText="No se Encontró Activo Fijo Registrado" GridLines="none" ToolTip="Listado de Activos Fijos" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Trama" DataField="Trama" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
</ajax:TabContainer>
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
<ajax:TabPanel ID="TabLog" runat="server" HeaderText="Ver Log">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel runat="server" ID="UpDispositivoLog" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle magindate">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnCargaLog" ClientIDMode="Static" runat="server" ValidationGroup="GrpLog" Text="Consultar" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Unidad/Dispositivo GPS:
|
||||
<asp:DropDownList ID="DdlDispositivosLog" runat="server" DataTextField="Serie" DataValueField="CveDispositivo" CssClass="form-control input-sm select2me" Style="width: 230px;" ValidationGroup="GrpLog"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVDispositivosLog" runat="server" ControlToValidate="DdlDispositivosLog" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Dispositivo''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpLog"></asp:RequiredFieldValidator>
|
||||
</li>
|
||||
<li>Tipo Consulta:
|
||||
<asp:DropDownList ID="DdlTipoConsultaLog" AutoPostBack="true" Width="150px" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Value="Last" Text="Última Posición"></asp:ListItem>
|
||||
<asp:ListItem Value="Last10" Text="Últimos 10"></asp:ListItem>
|
||||
<asp:ListItem Value="Today" Text="Hoy"></asp:ListItem>
|
||||
<asp:ListItem Value="Yesterday" Text="Ayer"></asp:ListItem>
|
||||
<asp:ListItem Value="Week" Text="Semana"></asp:ListItem>
|
||||
<asp:ListItem Value="All" Text="Personalizada"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
|
||||
<li id="liFechaLogI" visible="false" runat="server">Fecha I.:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtFechaLogI" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LinkButton1" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFechaLogI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaLogI" PopupButtonID="LinkButton1" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtFechaLogI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
<li id="liFechaLogF" runat="server" visible="false">Fecha F.:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtFechaLogF" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LinkButton2" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="TxtFechaLogF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="TxtFechaLogF" PopupButtonID="LinkButton2" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="TxtFechaLogF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator2" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpGVLog" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12 ">
|
||||
<div class="portlet light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="fa fa-car font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Log de la unidad:
|
||||
<asp:Literal ID="ltlSerieLog" runat="server"></asp:Literal></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 form">
|
||||
<div style="max-height: 392px; overflow-y: scroll">
|
||||
<asp:GridView ID="GVLog" runat="server" DataKeyNames="CveTrama" Style="table-layout: fixed" AutoGenerateColumns="False" ShowHeader="false" EmptyDataText="No se Encontró Activo Fijo Registrado" GridLines="none" ToolTip="Listado de Activos Fijos" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Trama" DataField="Trama" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="27%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
<ajax:TabPanel ID="TabTR" runat="server" HeaderText="Enviar Comando">
|
||||
<ContentTemplate>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
<ajax:TabPanel ID="TabE" runat="server" HeaderText="Consulta Multiple">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel runat="server" ID="UpCM" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet solid grey-cascade portlet-filter">
|
||||
<div class="portlet-title portlet-filterT smalltitle magindate">
|
||||
<div class="tools">
|
||||
<asp:Button ID="btnAgregar" runat="server" Text="Buscar" class="btn btn-primary" />
|
||||
</div>
|
||||
<div class="titlefiltros caption ">
|
||||
<ul class="list-inline" style="font-size: 12px;">
|
||||
<li>Buscar por cliente:
|
||||
<asp:DropDownList ID="DdlClientes" DataTextField="NombreComercial" DataValueField="CveCliente" Width="250px" runat="server" CssClass="form-control input-sm select2me">
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpConsultaM" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Seleccione los Dispositivos a consultar</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 rowpadding">
|
||||
<div class="row" style="margin-right: 10px; margin-top: -18px;" align="right">
|
||||
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvConsultaM.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvConsultaM.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GvConsultaM" runat="server" DataKeyNames="CveCliente, CveDispositivo" Style="table-layout: fixed" AutoGenerateColumns="False" ShowHeader="true" EmptyDataText="No se encontraron tramas" GridLines="none" ToolTip="Listado de Activos Fijos" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkEv" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Id Unidad" DataField="devID" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%" />
|
||||
<asp:BoundField HeaderText="Nombre" DataField="NombreVehiculo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%" />
|
||||
<asp:BoundField HeaderText="Cliente" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6" runat="server" id="DvConsultar" visible="false">
|
||||
<div class="portlet light smmallpadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">CONSULTA MULTIPLE</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 rowpadding">
|
||||
<div class="row">
|
||||
<label class="col-md-3" style="max-width: 120px;">Tipo Consulta:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:DropDownList ID="DdlTConsultaM" AutoPostBack="true" Width="150px" runat="server" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Value="Last" Text="Última Posición"></asp:ListItem>
|
||||
<asp:ListItem Value="Last10" Text="Últimos 10"></asp:ListItem>
|
||||
<asp:ListItem Value="Yesterday" Text="Ayer"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="text-align:center">
|
||||
<asp:LinkButton ID="btnConsultaMultiple" runat="server" CssClass="btn btn-primary" Text="Consultar"></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvReporteMultiple" runat="server" DataKeyNames="CveDispositivo" Style="table-layout: fixed" AutoGenerateColumns="False" ShowHeader="true" EmptyDataText="No se encontraron tramas" GridLines="none" ToolTip="Listado de Activos Fijos" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkEv" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Id Unidad" DataField="devID" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Nombre" DataField="NombreVehiculo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Cliente" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
|
||||
<asp:BoundField HeaderText="Reportes" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="Reportes Unicos" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="Reportes Repeditos" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="GPS" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="GPS NOT FIXED" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="Promedio Satelites" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="GPRS" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="Tiempo Movimiento" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="Tiempo Detenido" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="Eventos" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="Rep. Temperatura" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="Horas Refrigeradas" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="Rep. Combustible" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
<asp:BoundField HeaderText="Tanques Reportando" DataField="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
</ajax:TabContainer>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
var map;
|
||||
var image = 'http://maps.google.com/mapfiles/kml/shapes/truck.png';
|
||||
|
||||
function initMap() {
|
||||
var uluru = { lat: 29.0730, lng: -110.9559 }
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: uluru,
|
||||
zoom: 15
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
var markers = [];
|
||||
|
||||
function CreaMarcador(coords, nomEquipo, imagen) {
|
||||
if (typeof imagen === 'undefined') { imagen = image; }
|
||||
var marker = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: map,
|
||||
icon: imagen
|
||||
});
|
||||
markers.push(marker);
|
||||
map.setCenter(coords)
|
||||
}
|
||||
|
||||
function DeleteMarkers() {
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
markers = [];
|
||||
}
|
||||
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=drawing&callback=initMap">
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
395
GPS/Soporte.aspx.vb
Normal file
395
GPS/Soporte.aspx.vb
Normal file
@@ -0,0 +1,395 @@
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class GPS_Soporte
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
#Region "PROPIEDADES"
|
||||
Private Property TmpDT As DataTable
|
||||
Get
|
||||
Return CType(ViewState("TmpDT"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("TmpDT") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargaDispositivos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaDispositivos()
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If GPS.DispositivosGet(-1, -1, -1, UsuarioActual.CveEmpresa) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
DdlDispositivo.DataSource = GPS.DtResultados
|
||||
DdlDispositivosLog.DataSource = GPS.DtResultados
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DdlDispositivo.DataBind()
|
||||
DdlDispositivosLog.DataBind()
|
||||
DdlDispositivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlDispositivosLog.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
|
||||
DdlClientes.DataBind()
|
||||
DdlClientes.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If GPS.DispositivosGet(DdlDispositivo.SelectedValue, -1, -1) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
TxtIp.Text = GPS.DtResultados.Rows(0)("IP").ToString
|
||||
TxtPuerto.Text = "80"
|
||||
TxtAPN.Text = GPS.DtResultados.Rows(0)("APN").ToString
|
||||
TxtPlanDatos.Text = GPS.DtResultados.Rows(0)("PlanDato").ToString
|
||||
TxtSim.Text = GPS.DtResultados.Rows(0)("SSID").ToString
|
||||
TxtNoLinea.Text = GPS.DtResultados.Rows(0)("NumeroTelefono").ToString
|
||||
TxtMarca.Text = GPS.DtResultados.Rows(0)("Marca").ToString
|
||||
TxtModelo.Text = GPS.DtResultados.Rows(0)("Modelo").ToString
|
||||
TxtImei.Text = GPS.DtResultados.Rows(0)("IMEI").ToString
|
||||
TxtSerie.Text = GPS.DtResultados.Rows(0)("Serie").ToString
|
||||
TxtUnidad.Text = "SIG"
|
||||
TxtCliente.Text = GPS.DtResultados.Rows(0)("Cliente").ToString
|
||||
TxtEstatus.Text = If(GPS.DtResultados.Rows(0)("Estatus").ToString = "1", "Activo", "Inactivo")
|
||||
TxtFechaInstalacion.Text = GPS.DtResultados.Rows(0)("FechaInstalacion").ToString
|
||||
'TxtFechaReinstalacion.Text = GPS.DtResultados.Rows(0)("FechaReinstalacion").ToString
|
||||
bodydatos.Visible = True
|
||||
ltlSerieConsulta.Text = GPS.DtResultados.Rows(0)("Serie").ToString
|
||||
Else
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaReportes()
|
||||
UpInfo.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnCargaDispositivo_Click(sender As Object, e As EventArgs) Handles BtnCargaDispositivo.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaReportes()
|
||||
Dim GPS As New ClsGPS
|
||||
RegistraScript("DeleteMarkers();")
|
||||
|
||||
|
||||
If DdlTipoConsulta.SelectedValue = "Last" Then
|
||||
If GPS.GetRepDispositivo(DdlDispositivo.SelectedValue.ToEntero, MinFecha, MaxFecha, "Top 1") Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
Dim Coord As String = SQLToGmaps(GPS.DtResultados.Rows(0)("Punto"), "POINT")
|
||||
RegistraScript($"CreaMarcador({Coord},'{DdlDispositivo.SelectedItem.Text}');")
|
||||
GvReportes.DataSource = GPS.DtResultados
|
||||
GvVLog.DataSource = GPS.DtResultados
|
||||
bodyreportes.Visible = True
|
||||
Else
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ElseIf DdlTipoConsulta.SelectedValue = "Last10" Then
|
||||
If GPS.GetRepDispositivo(DdlDispositivo.SelectedValue.ToEntero, MinFecha, MaxFecha, "TOP 10") Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
For Each row As DataRow In GPS.DtResultados.Rows
|
||||
Dim Coord As String = SQLToGmaps(row("Punto"), "POINT")
|
||||
RegistraScript($"CreaMarcador({Coord},'{DdlDispositivo.SelectedItem.Text}: {row("FechaIng").ToString}');")
|
||||
Next
|
||||
GvReportes.DataSource = GPS.DtResultados
|
||||
GvVLog.DataSource = GPS.DtResultados
|
||||
bodyreportes.Visible = True
|
||||
Else
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ElseIf DdlTipoConsulta.SelectedValue = "Today" Then
|
||||
If GPS.GetRepDispositivo(DdlDispositivo.SelectedValue.ToEntero, DateTime.Today.AddHours(-1), DateTime.Today.AddDays(1)) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
For Each row As DataRow In GPS.DtResultados.Rows
|
||||
Dim Coord As String = SQLToGmaps(row("Punto"), "POINT")
|
||||
RegistraScript($"CreaMarcador({Coord},'{DdlDispositivo.SelectedItem.Text}: {row("FechaIng")}');")
|
||||
Next
|
||||
GvReportes.DataSource = GPS.DtResultados
|
||||
GvVLog.DataSource = GPS.DtResultados
|
||||
bodyreportes.Visible = True
|
||||
Else
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ElseIf DdlTipoConsulta.SelectedValue = "Yesterday" Then
|
||||
If GPS.GetRepDispositivo(DdlDispositivo.SelectedValue.ToEntero, DateTime.Today.AddDays(-1).AddHours(-1), DateTime.Today) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
For Each row As DataRow In GPS.DtResultados.Rows
|
||||
Dim Coord As String = SQLToGmaps(row("Punto"), "POINT")
|
||||
RegistraScript($"CreaMarcador({Coord},'{DdlDispositivo.SelectedItem.Text}: {row("FechaIng")}');")
|
||||
Next
|
||||
GvReportes.DataSource = GPS.DtResultados
|
||||
GvVLog.DataSource = GPS.DtResultados
|
||||
bodyreportes.Visible = True
|
||||
Else
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ElseIf DdlTipoConsulta.SelectedValue = "Week" Then
|
||||
If GPS.GetRepDispositivo(DdlDispositivo.SelectedValue.ToEntero, DateTime.Today.AddDays(-7).AddHours(-1), DateTime.Today.AddDays(1)) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
Dim dr As DataRow = TmpDT.NewRow
|
||||
For Each row As DataRow In GPS.DtResultados.Rows
|
||||
Dim Coord As String = SQLToGmaps(row("Punto"), "POINT")
|
||||
RegistraScript($"CreaMarcador({Coord},'{DdlDispositivo.SelectedItem.Text}: {row("FechaIng")}');")
|
||||
Next
|
||||
GvReportes.DataSource = GPS.DtResultados
|
||||
GvVLog.DataSource = GPS.DtResultados
|
||||
bodyreportes.Visible = True
|
||||
Else
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ElseIf DdlTipoConsulta.SelectedValue = "All" Then
|
||||
Dim FechaI = If(txtFechaI.Text.Trim = "", MinFecha, txtFechaI.Text.Trim.ToDateTime.AddHours(-1))
|
||||
Dim FechaF = If(txtFechaF.Text.Trim = "", MaxFecha, txtFechaF.Text.Trim.ToDateTime.AddDays(1))
|
||||
If GPS.GetRepDispositivo(DdlDispositivo.SelectedValue.ToEntero, FechaI.AddHours(-1), FechaF.AddDays(1)) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
Dim dr As DataRow = TmpDT.NewRow
|
||||
For Each row As DataRow In GPS.DtResultados.Rows
|
||||
Dim Coord As String = SQLToGmaps(row("Punto"), "POINT")
|
||||
RegistraScript($"CreaMarcador({Coord},'{DdlDispositivo.SelectedItem.Text}: {row("FechaIng")}');")
|
||||
Next
|
||||
GvReportes.DataSource = GPS.DtResultados
|
||||
GvVLog.DataSource = GPS.DtResultados
|
||||
bodyreportes.Visible = True
|
||||
Else
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
Dim CveTrama = GPS.DtResultados.Rows(0)("CveTrama").ToString.ToEntero
|
||||
If GPS.RepEventosDispositivosGet(CveTrama) Then
|
||||
Dim nRows As Double = (GPS.DtResultados.Rows.Count / 3)
|
||||
If nRows > 0 Then
|
||||
If Math.Abs(nRows Mod 1) < Double.Epsilon Then
|
||||
gvH1.DataSource = GPS.DtResultados().FiltraParametros($"RowNumber <= {nRows}")
|
||||
gvH2.DataSource = GPS.DtResultados().FiltraParametros($"RowNumber > {nRows} AND RowNumber <= {nRows * 2} ")
|
||||
gvH3.DataSource = GPS.DtResultados().FiltraParametros($"RowNumber > {nRows * 2} AND RowNumber <= {nRows * 3} ")
|
||||
Else
|
||||
nRows = Math.Ceiling(nRows)
|
||||
gvH1.DataSource = GPS.DtResultados().FiltraParametros($"RowNumber <= {nRows}")
|
||||
gvH2.DataSource = GPS.DtResultados().FiltraParametros($"RowNumber > {nRows} AND RowNumber <= {nRows * 2} ")
|
||||
gvH3.DataSource = GPS.DtResultados().FiltraParametros($"RowNumber > {nRows * 2} AND RowNumber <= {GPS.DtResultados.Rows.Count} ")
|
||||
End If
|
||||
Else
|
||||
gvH1.DataSource = Nothing
|
||||
gvH2.DataSource = Nothing
|
||||
gvH3.DataSource = Nothing
|
||||
gvH2.Visible = False
|
||||
gvH3.Visible = False
|
||||
End If
|
||||
Else
|
||||
gvH1.DataSource = Nothing
|
||||
gvH2.DataSource = Nothing
|
||||
gvH3.DataSource = Nothing
|
||||
gvH2.Visible = False
|
||||
gvH3.Visible = False
|
||||
End If
|
||||
End If
|
||||
|
||||
GPS.Dispose()
|
||||
gvH1.DataBind()
|
||||
gvH2.DataBind()
|
||||
gvH3.DataBind()
|
||||
GvReportes.DataBind()
|
||||
GvVLog.DataBind()
|
||||
UpReportes.Update()
|
||||
UPVlog.Update()
|
||||
upHistorico.Update()
|
||||
|
||||
|
||||
End Sub
|
||||
Private Function SQLToGmaps(CoordsSQL As String, Tipo As String) As String
|
||||
Dim CoordsPoligono As String = CoordsSQL.Replace($"{Tipo}", "").Replace(")", "").Replace("(", "")
|
||||
Dim CoordsPuntos() As String = CoordsPoligono.Split(","c)
|
||||
Dim Var As String = ""
|
||||
For Each coordenada As String In CoordsPuntos
|
||||
If coordenada Is CoordsPuntos.Last Then
|
||||
Dim latlng() As String = coordenada.Trim.Split(" ")
|
||||
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }}"
|
||||
Else
|
||||
Dim latlng() As String = coordenada.Trim.Split(" ")
|
||||
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }},"
|
||||
End If
|
||||
Next
|
||||
Return Var
|
||||
End Function
|
||||
|
||||
Private Sub CreaTmpDT(Opcion As String)
|
||||
TmpDT = New DataTable
|
||||
If Opcion = 1 Then
|
||||
TmpDT.Columns.Add("Fecha", GetType(String))
|
||||
TmpDT.Columns.Add("Valor", GetType(String))
|
||||
TmpDT.Columns.Add("CveTrama", GetType(Integer))
|
||||
ElseIf Opcion = 2 Then
|
||||
TmpDT.Columns.Add("Trama", GetType(String))
|
||||
TmpDT.Columns.Add("CveTrama", GetType(Integer))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlTipoConsulta_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoConsulta.SelectedIndexChanged
|
||||
If DdlTipoConsulta.SelectedValue = "All" Then
|
||||
liFechai.Visible = True
|
||||
liFechaF.Visible = True
|
||||
Else
|
||||
liFechai.Visible = False
|
||||
liFechaF.Visible = False
|
||||
End If
|
||||
upDispositivo.Update()
|
||||
End Sub
|
||||
Protected Sub BtnCargaLog_Click(sender As Object, e As EventArgs) Handles BtnCargaLog.Click
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If GPS.DispositivosGet(DdlDispositivo.SelectedValue, -1, -1) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
ltlSerieLog.Text = GPS.DtResultados.Rows(0)("Serie").ToString
|
||||
Else
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
GPS.Dispose()
|
||||
CargaLog()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlTipoConsultaLog_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoConsultaLog.SelectedIndexChanged
|
||||
If DdlTipoConsultaLog.SelectedValue = "All" Then
|
||||
liFechaLogI.Visible = True
|
||||
liFechaLogF.Visible = True
|
||||
Else
|
||||
liFechaLogI.Visible = False
|
||||
liFechaLogF.Visible = False
|
||||
End If
|
||||
UpDispositivoLog.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaLog()
|
||||
Dim GPS As New ClsGPS
|
||||
CreaTmpDT(2)
|
||||
RegistraScript("DeleteMarkers();")
|
||||
|
||||
|
||||
If DdlTipoConsultaLog.SelectedValue = "Last" Then
|
||||
If GPS.GetRepDispositivo(DdlDispositivosLog.SelectedValue.ToEntero, MinFecha, MaxFecha) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
Dim dr As DataRow = TmpDT.NewRow
|
||||
dr("Trama") = GPS.DtResultados(0)("Trama").ToString
|
||||
dr("CveTrama") = GPS.DtResultados(0)("CveTrama").ToString
|
||||
TmpDT.Rows.Add(dr)
|
||||
GVLog.DataSource = TmpDT
|
||||
bodyreportes.Visible = True
|
||||
Else
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ElseIf DdlTipoConsultaLog.SelectedValue = "Last10" Then
|
||||
If GPS.GetRepDispositivo(DdlDispositivosLog.SelectedValue.ToEntero, MinFecha, MaxFecha) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
Dim dr As DataRow = TmpDT.NewRow
|
||||
For rowindex = 0 To 9 Step 1
|
||||
dr = TmpDT.NewRow
|
||||
dr("Trama") = GPS.DtResultados(rowindex)("Trama").ToString
|
||||
dr("CveTrama") = GPS.DtResultados(rowindex)("CveTrama").ToString
|
||||
TmpDT.Rows.Add(dr)
|
||||
Next
|
||||
GVLog.DataSource = TmpDT
|
||||
Else
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ElseIf DdlTipoConsultaLog.SelectedValue = "Today" Then
|
||||
If GPS.GetRepDispositivo(DdlDispositivosLog.SelectedValue.ToEntero, DateTime.Today.AddHours(-1), DateTime.Today.AddDays(1)) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
Dim dr As DataRow = TmpDT.NewRow
|
||||
For Each row As DataRow In GPS.DtResultados.Rows
|
||||
dr = TmpDT.NewRow
|
||||
dr("Trama") = row("Trama").ToString
|
||||
dr("CveTrama") = row("CveTrama").ToString
|
||||
TmpDT.Rows.Add(dr)
|
||||
Next
|
||||
GVLog.DataSource = TmpDT
|
||||
Else
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ElseIf DdlTipoConsultaLog.SelectedValue = "Yesterday" Then
|
||||
If GPS.GetRepDispositivo(DdlDispositivosLog.SelectedValue.ToEntero, DateTime.Today.AddDays(-1).AddHours(-1), DateTime.Today) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
Dim dr As DataRow = TmpDT.NewRow
|
||||
For Each row As DataRow In GPS.DtResultados.Rows
|
||||
Dim Coord As String = SQLToGmaps(row("Punto"), "POINT")
|
||||
dr = TmpDT.NewRow
|
||||
dr("Trama") = row("Trama").ToString
|
||||
dr("CveTrama") = row("CveTrama").ToString
|
||||
TmpDT.Rows.Add(dr)
|
||||
Next
|
||||
GVLog.DataSource = TmpDT
|
||||
Else
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ElseIf DdlTipoConsultaLog.SelectedValue = "Week" Then
|
||||
If GPS.GetRepDispositivo(DdlDispositivosLog.SelectedValue.ToEntero, DateTime.Today.AddDays(-7).AddHours(-1), DateTime.Today.AddDays(1)) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
Dim dr As DataRow = TmpDT.NewRow
|
||||
For Each row As DataRow In GPS.DtResultados.Rows
|
||||
dr = TmpDT.NewRow
|
||||
dr("Trama") = row("Trama").ToString
|
||||
dr("CveTrama") = row("CveTrama").ToString
|
||||
TmpDT.Rows.Add(dr)
|
||||
Next
|
||||
GVLog.DataSource = TmpDT
|
||||
Else
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
ElseIf DdlTipoConsultaLog.SelectedValue = "All" Then
|
||||
Dim FechaI = If(TxtFechaLogI.Text.Trim = "", MinFecha, TxtFechaLogI.Text.Trim.ToDateTime.AddHours(-1))
|
||||
Dim FechaF = If(TxtFechaLogF.Text.Trim = "", MaxFecha, TxtFechaLogF.Text.Trim.ToDateTime.AddDays(1))
|
||||
If GPS.GetRepDispositivo(DdlDispositivosLog.SelectedValue.ToEntero, FechaI, FechaF) Then
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
Dim dr As DataRow = TmpDT.NewRow
|
||||
For Each row As DataRow In GPS.DtResultados.Rows
|
||||
dr = TmpDT.NewRow
|
||||
dr("Trama") = row("Trama").ToString
|
||||
dr("CveTrama") = row("CveTrama").ToString
|
||||
TmpDT.Rows.Add(dr)
|
||||
Next
|
||||
GVLog.DataSource = TmpDT
|
||||
Else
|
||||
GVLog.DataSource = Nothing
|
||||
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
GPS.Dispose()
|
||||
GVLog.DataBind()
|
||||
UpGVLog.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub btnAgregar_Click(sender As Object, e As EventArgs) Handles btnAgregar.Click
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.DispositivosGet(-1, -1, DdlClientes.SelectedValue, UsuarioActual.CveEmpresa) Then
|
||||
GvConsultaM.DataSource = GPS.DtResultados
|
||||
Else
|
||||
GvConsultaM.DataSource = GPS.DtResultados
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvConsultaM.DataBind()
|
||||
DvConsultar.Visible = True
|
||||
End Sub
|
||||
End Class
|
||||
616
GPS/TrayectoDetalle.aspx
Normal file
616
GPS/TrayectoDetalle.aspx
Normal file
@@ -0,0 +1,616 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="TrayectoDetalle.aspx.vb" Inherits="GPS_TrayectoDetalle" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style type="text/css">
|
||||
/*html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}*/
|
||||
|
||||
/*#map {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: fixed !important;
|
||||
}*/
|
||||
|
||||
.pac-container.pac-logo {
|
||||
z-index: 100000;
|
||||
}
|
||||
|
||||
.v-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
<asp:Literal ID="LblTitulo" runat="server" Text="Trayecto"></asp:Literal>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:UpdatePanel runat="server" UpdateMode="conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" ID="BtnTerminarTrayeto" OnClick="BtnTerminarTrayeto_Click"><i class="fa fa-map-marker"></i>Terminar Trayecto</asp:LinkButton>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</li>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<ajax:TabContainer runat="server" Width="100%">
|
||||
<ajax:TabPanel runat="server" HeaderText="Recorrido">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12 ">
|
||||
<div class="portlet light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="fa fa-map-o"></i>
|
||||
<span class="caption-subject bold uppercase">Recorrido de la unidad:</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 form">
|
||||
<div id="map" style="height: 600px; padding: 0;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel runat="server" HeaderText="Estatus">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpEventos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6 ">
|
||||
<div class="portlet light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="fa fa-map-signs font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Datos del Trayecto:</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 form" style="padding: 5px;">
|
||||
<div class="row v-center">
|
||||
<div class="col-md-2 v-center">
|
||||
<b>
|
||||
<asp:Literal runat="server" Text="Estatus Actual:"></asp:Literal></b>
|
||||
</div>
|
||||
<div class="col-md-4 v-center">
|
||||
<asp:Literal ID="LtlEstatusActual" runat="server"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-2 v-center">
|
||||
<b>
|
||||
<asp:Literal runat="server" Text="Vehículo:"></asp:Literal></b>
|
||||
</div>
|
||||
<div class="col-md-4 v-center">
|
||||
<asp:Literal ID="LtlDispositivo" runat="server"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row v-center">
|
||||
<div class="col-md-2 v-center">
|
||||
<b>
|
||||
<asp:Literal runat="server" Text="Fecha Inicio:"></asp:Literal></b>
|
||||
</div>
|
||||
<div class="col-md-4 v-center">
|
||||
<asp:Literal ID="LtlFechaI" runat="server"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-2 v-center">
|
||||
<b>
|
||||
<asp:Literal runat="server" Text="Fecha Fin:"></asp:Literal></b>
|
||||
</div>
|
||||
<div class="col-md-4 v-center">
|
||||
<asp:Literal ID="LtlFechaF" runat="server"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row v-center">
|
||||
<div class="col-md-2 v-center">
|
||||
<b>
|
||||
<asp:Literal runat="server" Text="Combustible Inicial:"></asp:Literal></b>
|
||||
</div>
|
||||
<div class="col-md-4 v-center">
|
||||
<asp:Literal ID="LtlCombustibleI" runat="server"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-2 v-center">
|
||||
<b>
|
||||
<asp:Literal runat="server" Text="Combustible Final:"></asp:Literal></b>
|
||||
</div>
|
||||
<div class="col-md-4 v-center">
|
||||
<asp:Literal ID="LtlCombustibleF" runat="server"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row v-center">
|
||||
<div class="col-md-2 v-center">
|
||||
<b>
|
||||
<asp:Literal runat="server" Text="Velocidad Media:"></asp:Literal></b>
|
||||
</div>
|
||||
<div class="col-md-4 v-center">
|
||||
<asp:Literal ID="LtlVMedia" runat="server"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-2 v-center">
|
||||
<b>
|
||||
<asp:Literal runat="server" Text="Velocidad Máxima:"></asp:Literal></b>
|
||||
</div>
|
||||
<div class="col-md-4 v-center">
|
||||
<asp:Literal ID="LtlVMax" runat="server"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row v-center">
|
||||
<div class="col-md-2 v-center">
|
||||
<b>
|
||||
<asp:Literal runat="server" Text="Tiempo Operativo:"></asp:Literal></b>
|
||||
</div>
|
||||
<div class="col-md-4 v-center">
|
||||
<asp:Literal ID="LtlTiempo" runat="server"></asp:Literal>
|
||||
</div>
|
||||
<div class="col-md-2 v-center">
|
||||
<b>
|
||||
<asp:Literal runat="server" Text="Kilometros Recorridos:"></asp:Literal></b>
|
||||
</div>
|
||||
<div class="col-md-4 v-center">
|
||||
<asp:Literal ID="LtlKM" runat="server"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row v-center">
|
||||
<div class="col-md-2 v-center">
|
||||
<b>
|
||||
<asp:Literal runat="server" Text="No. Excesos de Velocidad:"></asp:Literal></b>
|
||||
</div>
|
||||
<div class="col-md-4 v-center">
|
||||
<asp:Literal ID="LtlExcesosVelo" runat="server"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 ">
|
||||
<div class="portlet light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="fa fa-car font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Historial de Estatus:</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 form">
|
||||
<div style="max-height: 392px; overflow-y: scroll">
|
||||
<asp:GridView ID="GvEstatus" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Eventos" GridLines="none" ToolTip="Listado de Eventos" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Estatus" ItemStyle-Width="15%" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="ES" ItemStyle-Width="15%" HeaderText="Evento" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Fecha" ItemStyle-Width="15%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Combustible" ItemStyle-Width="15%" HeaderText="Combustible" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Direccion" ItemStyle-Width="40%" HeaderText="Dirección" ItemStyle-HorizontalAlign="Left" />
|
||||
<%-- <asp:BoundField DataField="Combustible" ItemStyle-Width="20%" HeaderText="Combustible" ItemStyle-HorizontalAlign="Center" />--%>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel runat="server" HeaderText="Driving">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpDriving" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6 ">
|
||||
<div class="portlet light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="fa
|
||||
fa-car font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Eventos de la unidad:</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 form">
|
||||
<div style="max-height: 392px; overflow-y: scroll">
|
||||
<asp:GridView ID="GvEventos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Eventos" GridLines="none" ToolTip="Listado de Eventos" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Evento" ItemStyle-Width="20%" HeaderText="Evento" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaTrama" ItemStyle-Width="20%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Direccion" ItemStyle-Width="60%" HeaderText="Dirección" ItemStyle-HorizontalAlign="Left" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="portlet light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="fa fa-car font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Ralentí:</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 form">
|
||||
<div style="max-height: 392px; overflow-y: scroll">
|
||||
<asp:GridView ID="GvRalenti" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Eventos" GridLines="none" ToolTip="Listado de Eventos" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Evento" ItemStyle-Width="25%" HeaderText="Estatus" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="TiempoDetenido" ItemStyle-Width="25%" HeaderText="Evento" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaTrama" ItemStyle-Width="25%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="portlet light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="fa fa-car font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Excesos de Velocidad:</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 form">
|
||||
<div style="max-height: 392px; overflow-y: scroll">
|
||||
<asp:GridView ID="GvExcesos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Eventos" GridLines="none" ToolTip="Listado de Eventos" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="VelocidadMaxima" ItemStyle-Width="25%" HeaderText="Velocidad Máxima" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="TiempoDetenido" ItemStyle-Width="25%" HeaderText="Tiempo Detenido" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaTrama" ItemStyle-Width="25%" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
<ajax:TabPanel runat="server" HeaderText="Igniciones">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel runat="server" ID="UpIgniciones">
|
||||
<ContentTemplate>
|
||||
<div class="portlet light bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="fa fa-car font-green"></i>
|
||||
<span class="caption-subject bold uppercase">Igniciones</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 form">
|
||||
<div style="max-height: 392px; overflow-y: scroll">
|
||||
<asp:GridView ID="GvIgnicion" runat="server" GridLines="None" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" data-rows="1" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Numero de Vueltas Realizadas">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Vehiculo" ItemStyle-Width="12.5%" HeaderText="Vehículo" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaEncendido" ItemStyle-Width="12.5%" HeaderText="Fecha Encendido" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaApagado" ItemStyle-Width="12.5%" HeaderText="Fecha Apagado" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="VMedia" DataFormatString="{0:N2} Km/hr." ItemStyle-Width="12.5%" HeaderText="Velocidad Media" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="VMax" DataFormatString="{0:N2} Km/hr." ItemStyle-Width="12.5%" HeaderText="Velocidad Máxima" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Kilometraje" DataFormatString="{0:N2} Km." ItemStyle-Width="12.5%" HeaderText="Kilometraje" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Duracion" ItemStyle-Width="12.5%" HeaderText="Duración" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Dirección Inicial" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDireccionInicial" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="12.5%" HeaderText="Dirección Final" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlDireccionFinal" runat="server"></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
</ajax:TabContainer>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script type="text/javascript">
|
||||
var map;
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: { lat: 29.0730, lng: -110.9559 },
|
||||
zoom: 7
|
||||
});
|
||||
}
|
||||
var polylines = [];
|
||||
var polygons = [];
|
||||
var polybounds = [];
|
||||
var markers = [];
|
||||
var GeoReferencias = []
|
||||
var lastOpenedInfoWindow;
|
||||
var directionsDisplay;
|
||||
|
||||
//$(document).ready(function () {
|
||||
// initMap();
|
||||
// DeleteMarkers();
|
||||
//});
|
||||
function DeleteMarkers() {
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
polygons[i].setMap(null);
|
||||
}
|
||||
markers = [];
|
||||
polygons = [];
|
||||
if (typeof directionsDisplay !== 'undefined') {
|
||||
directionsDisplay.setMap(null);
|
||||
}
|
||||
}
|
||||
function doScaledCLick(boton) {
|
||||
setTimeout(function () {
|
||||
$(boton).click();
|
||||
}, 250);
|
||||
}
|
||||
|
||||
function creaPoligono(coords, color, Geocerca, Estatus, InicioFin, CveEstatus, CveEstatusAnterior) {
|
||||
var polygon = new google.maps.Polygon({
|
||||
paths: coords,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 2,
|
||||
fillColor: color,
|
||||
fillOpacity: 0.35
|
||||
});
|
||||
polygon.setMap(map);
|
||||
polygons.push(polygon);
|
||||
|
||||
CreaMarcadorPoligono(coords, Geocerca, Estatus, InicioFin, CveEstatus, CveEstatusAnterior)
|
||||
}
|
||||
var posInicio, posFin;
|
||||
|
||||
function CreaMarcadorPoligono(coords, GeoCerca, Estatus, InicioFin, CveEstatus, CveEstatusAnterior) {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (i = 0; i < coords.length; i++) {
|
||||
bounds.extend(coords[i]);
|
||||
}
|
||||
if (InicioFin == 0) {
|
||||
var data = {
|
||||
CveEstatus: CveEstatus,
|
||||
CveEstatusAnterior: CveEstatusAnterior,
|
||||
coords: bounds.getCenter(),
|
||||
};
|
||||
GeoReferencias.push(data);
|
||||
} else if (InicioFin == 1) {
|
||||
posInicio = bounds.getCenter();
|
||||
} else if (InicioFin == 2) {
|
||||
posFin = bounds.getCenter();
|
||||
|
||||
var directionsService = new google.maps.DirectionsService;
|
||||
directionsDisplay = new google.maps.DirectionsRenderer({
|
||||
map: map,
|
||||
suppressMarkers: true
|
||||
});
|
||||
|
||||
calculateAndDisplayRoute(directionsService, directionsDisplay, posInicio, posFin);
|
||||
}
|
||||
var marker = new google.maps.Marker({
|
||||
position: bounds.getCenter(),
|
||||
title: GeoCerca,
|
||||
map: map
|
||||
});
|
||||
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: '<h4><b> GeoReferencia: ' + GeoCerca + '</b></h4><h4><b> Estatus: ' + Estatus + '</b></h4>'
|
||||
});
|
||||
|
||||
marker.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
infowindow.open(map, marker);
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
});
|
||||
|
||||
markers.push(marker);
|
||||
}
|
||||
function calculateAndDisplayRoute(directionsService, directionsDisplay, pointA, pointB) {
|
||||
var waypts = [];
|
||||
var orden = GeoReferencias.sort((a, b) => parseInt(a.CveEstatusAnterior) - parseInt(b.CveEstatusAnterior));
|
||||
for (var i = 0; i < orden.length; i++) {
|
||||
waypts.push({
|
||||
location: orden[i].coords,
|
||||
stopover: true
|
||||
});
|
||||
}
|
||||
directionsService.route({
|
||||
origin: pointA,
|
||||
destination: pointB,
|
||||
waypoints: waypts,
|
||||
travelMode: google.maps.TravelMode.DRIVING
|
||||
}, function (response, status) {
|
||||
if (status == google.maps.DirectionsStatus.OK) {
|
||||
directionsDisplay.setDirections(response);
|
||||
} else {
|
||||
window.alert('Directions request failed due to ' + status);
|
||||
}
|
||||
});
|
||||
}
|
||||
function CenterPoligono(coords) {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (i = 0; i < coords.length; i++) {
|
||||
bounds.extend(coords[i]);
|
||||
}
|
||||
map.fitBounds(bounds)
|
||||
}
|
||||
|
||||
function closeLastOpenedInfoWindow() {
|
||||
if (lastOpenedInfoWindow) {
|
||||
lastOpenedInfoWindow.close();
|
||||
}
|
||||
}
|
||||
|
||||
function FitBounds() {
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
var paths = polygons[i].getPaths();
|
||||
paths.forEach(function (path) {
|
||||
var ar = path.getArray();
|
||||
for (var i = 0, l = ar.length; i < l; i++) {
|
||||
bounds.extend(ar[i]);
|
||||
}
|
||||
})
|
||||
}
|
||||
for (var i = 0; i < polybounds.length; i++) {
|
||||
bounds.extend(polybounds[i]);
|
||||
}
|
||||
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].getVisible()) {
|
||||
bounds.extend(markers[i].getPosition());
|
||||
}
|
||||
}
|
||||
|
||||
map.fitBounds(bounds)
|
||||
}
|
||||
|
||||
function CreaMarcador(coords, nomEquipo, ContentString, imagen) {
|
||||
//setTimeout(function () {
|
||||
|
||||
//}, 500);
|
||||
|
||||
if (typeof imagen === 'undefined') { imagen = image; }
|
||||
var marker = new google.maps.Marker({
|
||||
position: coords,
|
||||
title: nomEquipo,
|
||||
map: map,
|
||||
icon: imagen
|
||||
});
|
||||
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
content: ContentString
|
||||
});
|
||||
marker.addListener('click', function () {
|
||||
closeLastOpenedInfoWindow();
|
||||
infowindow.open(map, marker);
|
||||
lastOpenedInfoWindow = infowindow;
|
||||
});
|
||||
markers.push(marker);
|
||||
|
||||
}
|
||||
|
||||
function creaPolyline(coords, color, GeoCerca) {
|
||||
var polyline = new google.maps.Polyline({
|
||||
path: coords,
|
||||
strokeColor: color,
|
||||
strokeOpacity: 0.8,
|
||||
strokeWeight: 2,
|
||||
fillOpacity: 0.35
|
||||
});
|
||||
polyline.setMap(map);
|
||||
polylines.push(polyline);
|
||||
polybounds.push(coords[0]);
|
||||
polybounds.push(coords[coords.length - 1]);
|
||||
CreaMarcadorPoligono(coords, GeoCerca);
|
||||
}
|
||||
|
||||
function NuevaConsulta() {
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
polygons[i].setMap(null);
|
||||
}
|
||||
polygons = [];
|
||||
for (var i = 0; i < polylines.length; i++) {
|
||||
polylines[i].setMap(null);
|
||||
}
|
||||
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
polylines = [];
|
||||
polybounds = [];
|
||||
markers = [];
|
||||
$("#dvConsulta").modal({ backdrop: 'static', keyboard: false })
|
||||
}
|
||||
|
||||
function fitBoundsToVisibleMarkers() {
|
||||
|
||||
var bounds = new google.maps.LatLngBounds();
|
||||
|
||||
for (var i = 0; i < polygons.length; i++) {
|
||||
bounds.extend(polygons[i].my_getBounds().getCenter())
|
||||
|
||||
}
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
if (markers[i].getVisible()) {
|
||||
bounds.extend(markers[i].getPosition());
|
||||
}
|
||||
}
|
||||
map.fitBounds(bounds);
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<script
|
||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places">
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
206
GPS/TrayectoDetalle.aspx.vb
Normal file
206
GPS/TrayectoDetalle.aspx.vb
Normal file
@@ -0,0 +1,206 @@
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports System.Net
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports Newtonsoft.Json.Linq
|
||||
Imports System.Linq
|
||||
Imports System.Net.Http
|
||||
|
||||
Partial Class GPS_TrayectoDetalle
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "P R O P I E D A D E S"
|
||||
Private Property DtGeocercas As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtGeocercas"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtGeocercas") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtPosiciones As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtPosiciones"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtPosiciones") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Private Property CveTrayecto As Integer
|
||||
Get
|
||||
Return CType(ViewState("CveTrayecto"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveTrayecto") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
|
||||
CveTrayecto = Request("CveTrayecto").ToString().ToEntero()
|
||||
If CveTrayecto > 0 Then
|
||||
CargaTrayectoHistorial(CveTrayecto)
|
||||
CargaReporte()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaTrayectoHistorial(CveTrayecto As Integer)
|
||||
Dim ObjGPS As New ClsGPS
|
||||
Try
|
||||
If CveTrayecto > 0 Then
|
||||
RegistraScript("initMap();")
|
||||
If ObjGPS.GetTrayectosEstatusHistorial(CveTrayecto) Then
|
||||
Dim Direcciones = ConsultarDirecciones(ObjGPS.DtResultados)
|
||||
For Each Dir As JObject In Direcciones
|
||||
ObjGPS.DtResultados.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
|
||||
Next
|
||||
GvEstatus.DataSource = ObjGPS.DtResultados
|
||||
GvEstatus.DataBind()
|
||||
End If
|
||||
If ObjGPS.GetTrayectosDatos(CveTrayecto) Then
|
||||
Dim DtDatos = ObjGPS.DtSetResultados.Tables(0)
|
||||
If DtDatos.Rows.Count > 0 Then
|
||||
Dim RowEstatus As DataRow = DtDatos.Rows(0)
|
||||
LblTitulo.Text = $"Trayecto: {RowEstatus("Trayecto")}"
|
||||
LtlEstatusActual.Text = RowEstatus("Estatus").ToString()
|
||||
LtlDispositivo.Text = RowEstatus("Vehiculo").ToString()
|
||||
LtlFechaI.Text = If(String.IsNullOrEmpty(RowEstatus("FechaInicio").ToString()), "No ha ingresado a la geocerca de inicio", String.Format("{0:dd/MM/yyyy HH:mm tt}", RowEstatus("FechaInicio").ToString().ToDateTime()))
|
||||
LtlFechaF.Text = If(String.IsNullOrEmpty(RowEstatus("FechaFin").ToString()), "No ha Terminado", String.Format("{0:dd/MM/yyyy HH:mm tt}", RowEstatus("FechaFin").ToString().ToDateTime()))
|
||||
LtlVMedia.Text = String.Format("{0:N2}", RowEstatus("VMedia"))
|
||||
LtlVMax.Text = String.Format("{0:N2}", RowEstatus("VMax"))
|
||||
LtlTiempo.Text = String.Format("{0}", RowEstatus("TiempoOperativo"))
|
||||
LtlKM.Text = String.Format("{0:N2}", RowEstatus("Dist"))
|
||||
LtlExcesosVelo.Text = String.Format("{0}", RowEstatus("ExcesosVelocidad"))
|
||||
|
||||
LtlCombustibleI.Text = If(String.IsNullOrEmpty(RowEstatus("CombustibleInicial").ToString()), "No Disponible", String.Format("{0:N2}", RowEstatus("CombustibleInicial")))
|
||||
LtlCombustibleF.Text = If(String.IsNullOrEmpty(RowEstatus("CombustibleFinal").ToString()), "No Disponible", String.Format("{0:N2}", RowEstatus("CombustibleFinal")))
|
||||
|
||||
GvIgnicion.DataSource = ObjGPS.DtSetResultados.Tables(1)
|
||||
GvIgnicion.DataBind()
|
||||
|
||||
GvExcesos.DataSource = ObjGPS.DtSetResultados.Tables(2)
|
||||
GvExcesos.DataBind()
|
||||
|
||||
GvRalenti.DataSource = ObjGPS.DtSetResultados.Tables(3)
|
||||
GvRalenti.DataBind()
|
||||
End If
|
||||
End If
|
||||
Dim count = 0
|
||||
If ObjGPS.GetTrayectosGeoReferencias(CveTrayecto) Then
|
||||
DtGeocercas = ObjGPS.DtResultados
|
||||
If DtGeocercas IsNot Nothing Then
|
||||
Dim Coord As String = ""
|
||||
Dim CoordAnterior As String = ""
|
||||
Dim CveEstatus As Integer = -1
|
||||
Dim CveEstatusAnterior As Integer = -1
|
||||
'GEOCERCAS
|
||||
For Each Row As DataRow In DtGeocercas.Rows
|
||||
count += 1
|
||||
Coord = SQLToGmaps(Row("Geom").ToString, "POLYGON")
|
||||
CveEstatus = Row("CveEstatusTrayecto").ToString.ToEntero
|
||||
CveEstatusAnterior = Row("CveEstatusAnterior").ToString.ToEntero
|
||||
Dim EsInicio As Boolean = CBool(IfNull(Row("EsInicio"), 0))
|
||||
Dim EsFin As Boolean = CBool(IfNull(Row("EsFin"), 0))
|
||||
Dim InicioFin As Integer = If(EsInicio, 1, If(EsFin, 2, 0))
|
||||
RegistraScript($"creaPoligono({Coord}, '{Row("Color").ToString}', '{Row("GeoReferencia")}', '{Row("EstatusTrayecto")}',{InicioFin},{CveEstatus},{CveEstatusAnterior})", count.ToString())
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
If ObjGPS.GetTrayectosHistorial(CveTrayecto, UsuarioActual.CveCliente) Then
|
||||
DtPosiciones = ObjGPS.DtResultados
|
||||
If DtPosiciones IsNot Nothing Then
|
||||
Dim Fecha, Vehiculo, Icono, CoordDis, Info As String
|
||||
For Each Row As DataRow In DtPosiciones.Rows
|
||||
CoordDis = Row("PosicionVehiculo").ToString.SQLToGmaps("POINT")
|
||||
Fecha = Row("FechaTrama").ToString
|
||||
Vehiculo = Row("Vehiculo").ToString
|
||||
Info = InfoWindow($"{Row("EventoTexto")}", "-1", Row("CveDispositivo").ToString.ToEntero, Row, PermisoComandos:=False)
|
||||
If Row("Velocidad").ToString.ToDouble > 1 Then
|
||||
Icono = $"/Imagenes/{Row("Icono")}green.png"
|
||||
Else
|
||||
Icono = $"/Imagenes/{Row("Icono")}.png"
|
||||
End If
|
||||
RegistraScript($"CreaMarcador({CoordDis},'{Row("Vehiculo")}', '{Info}', '{Icono}');", count.ToString())
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al consultar el trayecto.", ex)
|
||||
End Try
|
||||
ObjGPS.Dispose()
|
||||
|
||||
'UpIgniciones.Update()
|
||||
'UpEventos.Update()
|
||||
End Sub
|
||||
Public Sub CargaReporte()
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetTrayectosDetalle(CveTrayecto) Then
|
||||
Dim Direcciones = ConsultarDirecciones(ObjGPS.DtResultados)
|
||||
|
||||
If Direcciones IsNot Nothing Then
|
||||
For Each Dir As JObject In Direcciones
|
||||
ObjGPS.DtResultados.Rows(Dir("Indice").ToEntero())("Direccion") = Dir("Direccion").ToString()
|
||||
Next
|
||||
End If
|
||||
|
||||
GvEventos.DataSource = ObjGPS.DtResultados
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
GvEventos.DataBind()
|
||||
UpEventos.Update()
|
||||
'RegistraScript("$('#ShowDiv3').click();")
|
||||
End Sub
|
||||
|
||||
Public Function ConsultarDirecciones(Dt As DataTable) As JArray
|
||||
Dim retorno As JArray = Nothing
|
||||
Dim posicionesArray = New JArray(From Row As DataRow In Dt
|
||||
Let index = Dt.Rows().IndexOf(Row)
|
||||
Select New JObject(
|
||||
New JProperty("indice", index),
|
||||
New JProperty("cveTrama", -1),
|
||||
New JProperty("lat", Row("Lat").ToString.ToDouble),
|
||||
New JProperty("lon", Row("Lng").ToString.ToDouble)
|
||||
))
|
||||
|
||||
Dim Base64array = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(posicionesArray.ToString()))
|
||||
|
||||
Using wc As New HttpClient()
|
||||
Try
|
||||
Dim Url = New Uri($"{ClsPaginas.UrlDirecciones}nominatim/reverseMultiple.php")
|
||||
Dim FormStuff = String.Format("formato=json&posiciones={0}", Base64array)
|
||||
Dim content = New StringContent(FormStuff, Encoding.UTF8, "application/x-www-form-urlencoded")
|
||||
Dim response = wc.PostAsync(Url, content).Result
|
||||
Dim result = response.Content.ReadAsStringAsync().Result
|
||||
retorno = JArray.Parse(result)
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener las direcciones", ex)
|
||||
End Try
|
||||
End Using
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
Protected Sub BtnTerminarTrayeto_Click(sender As Object, e As EventArgs)
|
||||
Dim DtEstatus As DataTable = Nothing
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetEstatusTrayectos(-1, UsuarioActual.CveCliente) Then
|
||||
DtEstatus = ObjGPS.DtResultados.Copy()
|
||||
End If
|
||||
Dim CveEstatusFinal As Integer = DtEstatus.FiltroPrimeroValor("CveEstatusTrayecto", "EsFin = True").ToEntero()
|
||||
If CveEstatusFinal > 0 Then
|
||||
If ObjGPS.UpdateTrayectoEstatus(CveTrayecto, CveEstatusFinal) Then
|
||||
Alert("El trayecto se finalizo correctamente")
|
||||
End If
|
||||
Else
|
||||
Alert("No se pudo obtener el estatus final", TipoMensaje.MsgError)
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
End Sub
|
||||
End Class
|
||||
1289
GPS/Trayectos.aspx
Normal file
1289
GPS/Trayectos.aspx
Normal file
File diff suppressed because it is too large
Load Diff
406
GPS/Trayectos.aspx.vb
Normal file
406
GPS/Trayectos.aspx.vb
Normal file
@@ -0,0 +1,406 @@
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports System.Net
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports Newtonsoft.Json.Linq
|
||||
Imports System.Linq
|
||||
|
||||
Partial Class GPS_Trayectos
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region "P R O P I E D A D E S"
|
||||
Private Property DtGeocercasAgregar As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtGeocercasAgregar"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtGeocercasAgregar") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtGeocercas As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtGeocercas"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtGeocercas") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property DtPosiciones As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtPosiciones"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtPosiciones") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
DirectCast(Master.FindControl("TSM"), ScriptManager).EnablePageMethods = True
|
||||
CargaDatos()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaDatos()
|
||||
CargaDispositivos()
|
||||
CargaGeoReferencias()
|
||||
CargaEstatus()
|
||||
CargaDdlTrayectos()
|
||||
|
||||
CargaTrayectos()
|
||||
End Sub
|
||||
Public Sub CargaDispositivos()
|
||||
DdlDispositivo.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario)
|
||||
DdlDispositivo.DataBind()
|
||||
DdlDispositivo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
DdlDispositivoNuevo.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario)
|
||||
DdlDispositivoNuevo.DataBind()
|
||||
DdlDispositivoNuevo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
|
||||
DdlDispositivoFiltro.DataSource = GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario)
|
||||
DdlDispositivoFiltro.DataBind()
|
||||
DdlDispositivoFiltro.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
Public Sub CargaGeoReferencias()
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GeoReferenciaGet(-1, 1, "-1", UsuarioActual.CveCliente) Then
|
||||
DtGeocercasAgregar = ObjGPS.DtResultados.Copy()
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
|
||||
DdlGeocerca.DataSource = DtGeocercasAgregar
|
||||
DdlGeocerca.DataBind()
|
||||
DdlGeocerca.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
End Sub
|
||||
Public Sub CargaTrayectos()
|
||||
Dim FechaI As String = If(IsDate(txtFechaI.Text), txtFechaI.Text, "-1")
|
||||
Dim FechaF As String = If(IsDate(txtFechaF.Text), txtFechaF.Text, "-1")
|
||||
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetTrayectos(-1, DdlDispositivoFiltro.SelectedValue.ToEntero(), UsuarioActual.CveCliente, DdlEstatusTrayecto.SelectedValue.ToEntero(), FechaI, FechaF) Then
|
||||
If ChkActivas.Checked Then
|
||||
GvBarra.DataSource = ObjGPS.DtResultados.FiltraParametros($"EsFin = False")
|
||||
Else
|
||||
GvBarra.DataSource = ObjGPS.DtResultados
|
||||
End If
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
GvBarra.DataBind()
|
||||
UPGV.Update()
|
||||
End Sub
|
||||
Public Sub CargaDdlTrayectos()
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetTrayectos(-1, -1, UsuarioActual.CveCliente) Then
|
||||
DdlTrayecto.DataSource = ObjGPS.DtResultados.FiltraParametros("EsFin = True")
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
DdlTrayecto.DataBind()
|
||||
|
||||
UpAgregar.Update()
|
||||
End Sub
|
||||
Public Sub CargaEstatus()
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetEstatusTrayectos(-1, UsuarioActual.CveCliente) Then
|
||||
GvEstatus.DataSource = ObjGPS.DtResultados
|
||||
GvEstatusNuevo.DataSource = ObjGPS.DtResultados
|
||||
DdlEstatusTrayecto.DataSource = ObjGPS.DtResultados
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
GvEstatus.DataBind()
|
||||
GvEstatusNuevo.DataBind()
|
||||
|
||||
DdlEstatusTrayecto.DataBind()
|
||||
DdlEstatusTrayecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
End Sub
|
||||
Protected Sub GvEstatus_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCDropDownList("DdlGeocerca").DataSource = DtGeocercasAgregar
|
||||
e.Row.FCDropDownList("DdlGeocerca").DataBind()
|
||||
|
||||
Dim EsInicio As Boolean = CBool(If(String.IsNullOrEmpty(e.Row.DBCampo("EsInicio")), "False", e.Row.DBCampo("EsInicio")))
|
||||
Dim EsFin As Boolean = CBool(If(String.IsNullOrEmpty(e.Row.DBCampo("EsFin")), "False", e.Row.DBCampo("EsFin")))
|
||||
|
||||
If EsInicio OrElse EsFin Then
|
||||
e.Row.FCCheckBox("chkDis").Checked = True
|
||||
e.Row.FCCheckBox("chkDis").Enabled = False
|
||||
Else
|
||||
e.Row.FCCheckBox("chkDis").CssClass = "ChkAllEvt"
|
||||
End If
|
||||
|
||||
e.Row.FCLinkButton("imgE").OnClientClick = $"CargaModalGeo({e.Row.RowIndex}); return false;"
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvEstatusNuevo_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCDropDownList("DdlGeocerca").DataSource = DtGeocercasAgregar
|
||||
e.Row.FCDropDownList("DdlGeocerca").DataBind()
|
||||
|
||||
Dim EsInicio As Boolean = CBool(If(String.IsNullOrEmpty(e.Row.DBCampo("EsInicio")), "False", e.Row.DBCampo("EsInicio")))
|
||||
Dim EsFin As Boolean = CBool(If(String.IsNullOrEmpty(e.Row.DBCampo("EsFin")), "False", e.Row.DBCampo("EsFin")))
|
||||
|
||||
If EsInicio OrElse EsFin Then
|
||||
e.Row.FCCheckBox("chkDis").Checked = True
|
||||
e.Row.FCCheckBox("chkDis").Enabled = False
|
||||
Else
|
||||
e.Row.FCCheckBox("chkDis").CssClass = "ChkAllEvt"
|
||||
End If
|
||||
|
||||
If DtGeocercas IsNot Nothing Then
|
||||
Dim CveEstatus = e.Row.DataKey("CveEstatusTrayecto")
|
||||
Dim CveGeoReferencia = DtGeocercas.FiltroPrimeroValor("CveGeoReferencia", $"CveEstatusTrayecto={CveEstatus}")
|
||||
If Not String.IsNullOrEmpty(CveGeoReferencia) Then
|
||||
e.Row.FCDropDownList("DdlGeocerca").SelectedValue = CveGeoReferencia
|
||||
e.Row.FCCheckBox("chkDis").Checked = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs)
|
||||
If GvEstatus.Rows.Count > 0 Then
|
||||
Dim Nombre As String = TxtNombre.Text
|
||||
Dim CveDispositivo As Integer = DdlDispositivo.SelectedValue.ToEntero
|
||||
Dim Rows = GvBarra.Rows.Cast(Of GridViewRow).Where(Function(x) x.RowType = DataControlRowType.DataRow)
|
||||
|
||||
Dim TieneFilas As Boolean = True ' Rows.Any(Function(z) z.FCCheckBox("chkDis").Checked)
|
||||
'Dim Filas = From Dr In GvBarra.Rows
|
||||
' Where Dr.Row
|
||||
' Select Row
|
||||
|
||||
If TieneFilas Then
|
||||
Dim TieneError As Boolean = False
|
||||
Dim ObjGPS As New ClsGPS
|
||||
ObjGPS.IniciaTransacSQL()
|
||||
|
||||
Try
|
||||
Dim CveTrayecto As Integer = ObjGPS.AddTrayecto(Nombre, DateTime.Now, "", CveDispositivo, UsuarioActual.CveCliente)
|
||||
|
||||
If CveTrayecto > 0 Then
|
||||
For Each Row As GridViewRow In GvEstatus.Rows
|
||||
If Row.RowType = DataControlRowType.DataRow Then
|
||||
If Row.FCCheckBox("chkDis").Checked Then
|
||||
Dim CveGeoReferencia As Integer = Row.FCDropDownList("DdlGeocerca").SelectedValue.ToEntero
|
||||
Dim CveEstatusTrayecto As Integer = Row.DataKey("CveEstatusTrayecto").ToEntero
|
||||
If Not ObjGPS.AddTrayectoGeoReferencia(CveTrayecto, CveGeoReferencia, CveEstatusTrayecto) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar el trayecto.", ex)
|
||||
End Try
|
||||
If TieneError Then
|
||||
ObjGPS.RollBack()
|
||||
Alert("Ocurrió un error al agregar el trayecto.", TipoMensaje.MsgError)
|
||||
Else
|
||||
ObjGPS.Commit()
|
||||
Alert("El trayecto se agrego correctamente.")
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
|
||||
RegistraScript("$('#DivAgregar').modal('hide');")
|
||||
Else
|
||||
Alert("No ha seleccionado ningun estatus para este trayecto.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("No hay estatus seleccionables para este trayecto.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
CargaDatos()
|
||||
End Sub
|
||||
Protected Sub LnkCrear_Click(sender As Object, e As EventArgs)
|
||||
Dim CveTrayecto As Integer = DdlTrayecto.SelectedValue.ToEntero
|
||||
If CveTrayecto > 0 Then
|
||||
Dim ObjGPS As New ClsGPS
|
||||
Dim TieneError As Boolean = False
|
||||
ObjGPS.IniciaTransacSQL()
|
||||
Try
|
||||
Dim Nombre As String = TxtNombreNuevo.Text
|
||||
Dim CveDispositivo As Integer = DdlDispositivoNuevo.SelectedValue.ToEntero
|
||||
If CveDispositivo > 0 Then
|
||||
Dim CveTrayectoNuevo As Integer = ObjGPS.AddTrayecto(Nombre, DateTime.Now, "", CveDispositivo, UsuarioActual.CveCliente)
|
||||
If CveTrayectoNuevo > 0 Then
|
||||
For Each Row As GridViewRow In GvEstatusNuevo.Rows
|
||||
If Row.RowType = DataControlRowType.DataRow Then
|
||||
If Row.FCCheckBox("chkDis").Checked Then
|
||||
Dim CveGeoReferencia As Integer = Row.FCDropDownList("DdlGeocerca").SelectedValue.ToEntero
|
||||
Dim CveEstatusTrayecto As Integer = Row.DataKey("CveEstatusTrayecto").ToEntero
|
||||
If Not ObjGPS.AddTrayectoGeoReferencia(CveTrayectoNuevo, CveGeoReferencia, CveEstatusTrayecto) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar el trayecto.", ex)
|
||||
End Try
|
||||
|
||||
If TieneError Then
|
||||
ObjGPS.RollBack()
|
||||
Alert("Ocurrió un error al agregar el trayecto.", TipoMensaje.MsgError)
|
||||
Else
|
||||
ObjGPS.Commit()
|
||||
Alert("El trayecto se agrego correctamente.")
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
|
||||
RegistraScript("$('#DivCrearApatir').modal('hide');")
|
||||
Else
|
||||
Alert("Debe seleccionar un trayecto.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
CargaTrayectos()
|
||||
End Sub
|
||||
Private Sub LimpiaCampos()
|
||||
TxtNombre.Text = ""
|
||||
DdlDispositivo.SelectedIndex = 0
|
||||
End Sub
|
||||
|
||||
#Region "C O N S U L T A "
|
||||
Protected Sub LnkConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaTrayectos()
|
||||
End Sub
|
||||
#End Region
|
||||
Protected Sub GvBarra_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.ID = String.Format("row{0}", e.Row.RowIndex)
|
||||
e.Row.Attributes.Add("idgv", e.Row.RowIndex.ToString)
|
||||
If e.Row.DBCampo("EsFin") = "True" Then
|
||||
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-primary"
|
||||
ElseIf e.Row.DBCampo("EsInicio") = "True" Then
|
||||
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-success"
|
||||
ElseIf e.Row.DBCampo("EsInicio") = "False" AndAlso e.Row.DBCampo("EsFin") = "False" Then
|
||||
e.Row.FCLabel("LblEstatus").CssClass = "badge badge-secondary"
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub DdlTrayecto_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
Dim CveTrayecto As Integer = DdlTrayecto.SelectedValue.ToEntero
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GetTrayectosGeoReferencias(CveTrayecto) Then
|
||||
DtGeocercas = ObjGPS.DtResultados
|
||||
End If
|
||||
If ObjGPS.GetTrayectos(CveTrayecto, -1, UsuarioActual.CveCliente) Then
|
||||
If ObjGPS.DtResultados.Rows.Count > 0 Then
|
||||
DdlDispositivoNuevo.SelectedValueExist(ObjGPS.DtResultados.Rows(0)("CveDispositivo"))
|
||||
End If
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
CargaEstatus()
|
||||
End Sub
|
||||
Protected Sub BtnAgregarGeoreferencia_Click(sender As Object, e As EventArgs)
|
||||
If String.IsNullOrEmpty(TxtNombreGeo.Text.Trim) Then
|
||||
Alert("El campo 'Nombre' es necesario favor de introducirlo.", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("setTimeout(function(){ initMapGeo(); DeletemarkersGeo();},1000);")
|
||||
Return
|
||||
End If
|
||||
If String.IsNullOrEmpty(GeoCerca.Value.Trim) Then
|
||||
Alert("La GeoReferencia no tiene una geocerca dibujada.", TipoMensaje.MsgAdvertencia)
|
||||
RegistraScript("setTimeout(function(){ initMapGeo(); DeletemarkersGeo();},1000);")
|
||||
Return
|
||||
End If
|
||||
Dim Importe As Decimal = 0
|
||||
|
||||
Dim GeoRefString = $"POLYGON(({GeoCerca.Value} {CommandArg.Value}))"
|
||||
|
||||
Dim TieneError As Boolean = False
|
||||
Dim ObjGPS As New ClsGPS
|
||||
ObjGPS.IniciaTransacSQL()
|
||||
Dim CveGeoReferencia As Integer = -1
|
||||
If ObjGPS.AddGeoReferencia(TxtNombreGeo.Text, -1, GeoRefString, "Geocerca", True, "-1", "-1", -1, -1, -1, -1, -1, -1, -1, "-1", "-1", hdnColor.Value, -1, Importe, UsuarioActual.CveCliente, EsParada:=False) Then
|
||||
CveGeoReferencia = ObjGPS.CveGeoReferencia
|
||||
Else
|
||||
TieneError = True
|
||||
End If
|
||||
|
||||
If TieneError Then
|
||||
ObjGPS.RollBack()
|
||||
Alert("Ocurrió un error al crear la GeoReferencia", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
ObjGPS.Commit()
|
||||
Alert("La GeoReferencia se agregó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
|
||||
UpGeocercas.Update()
|
||||
CargaGeoReferencias()
|
||||
|
||||
Dim index As Integer = HdnIndexEstatus.Value.ToEntero()
|
||||
If index > -1 AndAlso CveGeoReferencia > 0 Then
|
||||
For Each GvRow As GridViewRow In GvEstatus.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
GvRow.FCDropDownList("DdlGeocerca").DataSource = DtGeocercasAgregar
|
||||
GvRow.FCDropDownList("DdlGeocerca").DataBind()
|
||||
End If
|
||||
Next
|
||||
GvEstatus.Rows(index).FCDropDownList("DdlGeocerca").SelectedValueExist(CveGeoReferencia)
|
||||
End If
|
||||
UpAgregar.Update()
|
||||
RegistraScript("$('#DivGeocercas').modal('hide');")
|
||||
|
||||
End Sub
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaTrayectos()
|
||||
End Sub
|
||||
Protected Sub GvBarra_RowDeleting1(sender As Object, e As GridViewDeleteEventArgs)
|
||||
Dim CveTrayecto As Integer = GvBarra.Rows(e.RowIndex).DataKey("CveTrayecto").ToEntero()
|
||||
If CveTrayecto > 0 Then
|
||||
Dim ObjGPS As New ClsGPS()
|
||||
Dim TieneError As Boolean = Not ObjGPS.RemoveTrayecto(CveTrayecto)
|
||||
ObjGPS.Dispose()
|
||||
If Not TieneError Then
|
||||
Alert("El trayecto se eliminó correctamente.")
|
||||
RegistraScript("DeleteMarkers();")
|
||||
CargaTrayectos()
|
||||
End If
|
||||
Else
|
||||
Alert("No se pudo eliminar el trayecto", TipoMensaje.MsgError)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
<Web.Services.WebMethod()> <Script.Services.ScriptMethodAttribute()>
|
||||
Public Shared Function WsGeocercas(ByVal Id As System.String) As System.String
|
||||
Dim CveGeoReferencia As Integer = Id.ToEntero
|
||||
Dim Retorno As String = "{}"
|
||||
|
||||
If CveGeoReferencia > 0 Then
|
||||
Dim ObjGPS As New ClsGPS
|
||||
If ObjGPS.GeoReferenciaGet(CveGeoReferencia, 1, "-1", -1) Then
|
||||
Try
|
||||
Dim DrGeocercas As DataRow = ObjGPS.DtResultados.Rows(0)
|
||||
If DrGeocercas IsNot Nothing Then
|
||||
Dim Coords = ModExtensiones.SQLToGmapsJArray(DrGeocercas("Coordenadas").ToString, "POLYGON")
|
||||
Dim Json As New JObject(New JProperty("Posiciones", Coords))
|
||||
Retorno = Json.ToString
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ModExtensiones.GuardaLog("Ocurrió un error al obtener la geocerca " + ex.ToString)
|
||||
End Try
|
||||
End If
|
||||
ObjGPS.Dispose()
|
||||
End If
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
End Class
|
||||
57
GPS/UsuariosRastreo.aspx
Normal file
57
GPS/UsuariosRastreo.aspx
Normal file
@@ -0,0 +1,57 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="UsuariosRastreo.aspx.vb" Inherits="GPS_UsuariosRastreo" %>
|
||||
|
||||
<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">
|
||||
Gestión de Usuarios
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" Runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregarUsuario">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" Visible="false" ID="LnkAddUsuario" data-toggle="tooltip" data-placement="left" title="Agregar Usuario." Text="<i class='fa fa-user-plus'></i> Agregar Usuario"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" Runat="Server">
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right" align="left">
|
||||
<input type="text" id="TxtUsuarios" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtUsuarios','{0}')", GvUsuarios.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtUsuarios','{0}')", GvUsuarios.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpGvUsuarios" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvUsuarios" runat="server" GridLines="None" DataKeyNames="CveUsuario, Usuario" CssClass="table table-striped table-advance table-hover Widthall" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros" ToolTip="Listado de Estatus de Ordenes de Servicios">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Usuario" ItemStyle-Width="30%" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Nombre" ItemStyle-Width="30%" HeaderText="Nombre" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaUltimoAcceso" ItemStyle-Width="20%" HeaderText="Fecha Último Acceso" ItemStyle-HorizontalAlign="center" />
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEstatus" runat="server" Text=""></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgE" HeaderText="Eliminar" runat="server" AlternateText="Editar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Eliminar" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
69
GPS/UsuariosRastreo.aspx.vb
Normal file
69
GPS/UsuariosRastreo.aspx.vb
Normal file
@@ -0,0 +1,69 @@
|
||||
Option Strict On
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class GPS_UsuariosRastreo
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaUsuarios()
|
||||
LnkAddUsuario.Attributes.Add("onclick", $"javascript:AbrirVentana('/Sistemas/PopUpAddUsuario.aspx?CveCliente={UsuarioActual.CveCliente}', 801, 700);")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaUsuarios()
|
||||
Dim DtUsuarios As DataTable = Nothing
|
||||
|
||||
If UsuarioActual.CveCliente > 0 AndAlso UsuarioActual.CvePlataforma = 3 Then
|
||||
|
||||
If UsuarioActual.CveRol = 1198 Then
|
||||
LnkAddUsuario.Visible = True
|
||||
DtUsuarios = GlobalDTUsuarios(CveCliente:=UsuarioActual.CveCliente).FiltraParametros($"CveCliente = {UsuarioActual.CveCliente} AND CveRol = 1200 AND Estatus = 1")
|
||||
ElseIf UsuarioActual.CveRol = 1200 Then
|
||||
If UsuarioActual.TienePermisoProceso(214) Then
|
||||
LnkAddUsuario.Visible = True
|
||||
DtUsuarios = GlobalDTUsuarios(CveCliente:=UsuarioActual.CveCliente).FiltraParametros($"CveCliente = {UsuarioActual.CveCliente} AND Estatus = 1 AND (CveUsuario = {UsuarioActual.CveUsuario} OR CveUsuarioIng = {UsuarioActual.CveUsuario})")
|
||||
Else
|
||||
DtUsuarios = GlobalDTUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.CveCliente, -1).FiltraParametros($"CveCliente = {UsuarioActual.CveCliente}")
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
If DtUsuarios IsNot Nothing Then
|
||||
DtUsuarios = DtUsuarios.FiltraParametros("", "", {"CveUsuario", "Usuario", "Nombre", "FechaUltimoAcceso", "Estatus"})
|
||||
End If
|
||||
GvUsuarios.DataSource = DtUsuarios
|
||||
GvUsuarios.DataBind()
|
||||
|
||||
UpGvUsuarios.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvUsuarios_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvUsuarios.RowDeleting
|
||||
Dim ObjUsuarios As New ClsSisUsuarios
|
||||
Dim CveUsuario As Integer = GvUsuarios.Rows(e.RowIndex).DataKey("CveUsuario").ToEntero
|
||||
If ObjUsuarios.DeleteClienteUsuario(CveUsuario, UsuarioActual.CveCliente) Then
|
||||
Alert("El Usuario se eliminó correctamente", TipoMensaje.MsgInformacion)
|
||||
End If
|
||||
ObjUsuarios.Dispose()
|
||||
CargaGlobal()
|
||||
CargaUsuarios()
|
||||
End Sub
|
||||
|
||||
Public Sub CargaGlobal()
|
||||
Dim ObjUsuarios As New ClsSisUsuarios
|
||||
If ObjUsuarios.GetUsuariosEmpresas(-1) Then
|
||||
GlobalDTUsuarios(-1) = ObjUsuarios.DtResultados
|
||||
Else
|
||||
GlobalDTUsuarios() = Nothing
|
||||
End If
|
||||
ObjUsuarios.Dispose()
|
||||
End Sub
|
||||
|
||||
Protected Sub GvUsuarios_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvUsuarios.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCLinkButton("imgE").Attributes.Add("onclick", $"javascript:AbrirVentana('/Sistemas/PopUpAddUsuario.aspx?CveUsuario={e.Row.DBCampo("CveUsuario").ToString}&CveCliente={UsuarioActual.CveCliente}', 801, 701);")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
3348
GPS/Vehiculos.aspx
Normal file
3348
GPS/Vehiculos.aspx
Normal file
File diff suppressed because it is too large
Load Diff
1783
GPS/Vehiculos.aspx.vb
Normal file
1783
GPS/Vehiculos.aspx.vb
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user