Arrastre en APP
This commit is contained in:
@@ -1,151 +1,151 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepArrastre.aspx.cs" Inherits="GPS_RepArrastre" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
#map {
|
||||
height: 450px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Arrastre
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkApagarvehiculo" runat="server">Apagar vehiculo</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" OnClick="BtnConsultar_Click" 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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<asp:HiddenField ID="HdfVGrafica" ClientIDMode="Static" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpInfo" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="portlet light smmallpadding traspasorow bordered" style="">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-red">
|
||||
<i class="fa fa-clock-o font-red"></i>
|
||||
<span class="caption-subject bold uppercase">datos vehiculo</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="C_bodyreportes" class="portlet-body rowpadding">
|
||||
<asp:TextBox ID="TxtFunciones" CssClass="hidden EvalRun" runat="server"></asp:TextBox>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">¿Activar funcion de arrastre?</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:CheckBox ID="chkActivarArrastre" CssClass="chksino " AutoPostBack="true" OnCheckedChanged="chkActivarArrastre_CheckedChanged" Text=" " runat="server" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">Velocidad</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label ID="LblVelocidad" runat="server" Text="Sin Información"></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">¿Encendido / Apagado?</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label ID="LblEncApa" runat="server" Text="Sin Información"></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">Fecha ultima Conexión</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label ID="LblFechaInfo" runat="server" Text="Sin Información"></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:Panel runat="server" ID="pnlAlertaActiva" Visible="false" CssClass="col-md-6">
|
||||
<div id="pulsate-regular" class="portlet light smmallpadding traspasorow bordered" style="">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-red">
|
||||
<i class="fa fa-clock-o font-red"></i>
|
||||
<span class="caption-subject bold uppercase">Alerta el vehiculo se encuentra en arrastre</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<%--<a href="javascript:;" class="collapse" data-original-title="" title=""></a>--%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="map">
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places"></script>
|
||||
<script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script>
|
||||
<script>
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepArrastre.aspx.cs" Inherits="GPS_RepArrastre" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<style>
|
||||
#map {
|
||||
height: 450px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Arrastre
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkApagarvehiculo" runat="server">Apagar vehiculo</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" OnClick="BtnConsultar_Click" 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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<asp:HiddenField ID="HdfVGrafica" ClientIDMode="Static" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpInfo" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="portlet light smmallpadding traspasorow bordered" style="">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-red">
|
||||
<i class="fa fa-clock-o font-red"></i>
|
||||
<span class="caption-subject bold uppercase">datos vehiculo</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="C_bodyreportes" class="portlet-body rowpadding">
|
||||
<asp:TextBox ID="TxtFunciones" CssClass="hidden EvalRun" runat="server"></asp:TextBox>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">¿Activar funcion de arrastre?</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:CheckBox ID="chkActivarArrastre" CssClass="chksino " AutoPostBack="true" OnCheckedChanged="chkActivarArrastre_CheckedChanged" Text=" " runat="server" />
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">Velocidad</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label ID="LblVelocidad" runat="server" Text="Sin Información"></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">¿Encendido / Apagado?</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label ID="LblEncApa" runat="server" Text="Sin Información"></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label style="font-weight: bold;">Fecha ultima Conexión</label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<asp:Label ID="LblFechaInfo" runat="server" Text="Sin Información"></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:Panel runat="server" ID="pnlAlertaActiva" Visible="false" CssClass="col-md-6">
|
||||
<div id="pulsate-regular" class="portlet light smmallpadding traspasorow bordered" style="">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-red">
|
||||
<i class="fa fa-clock-o font-red"></i>
|
||||
<span class="caption-subject bold uppercase">Alerta el vehiculo se encuentra en arrastre</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tools">
|
||||
<%--<a href="javascript:;" class="collapse" data-original-title="" title=""></a>--%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<div id="map">
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=places"></script>
|
||||
<script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script>
|
||||
<script>
|
||||
var image = '/Imagenes/rsz_11rsz_car.png';
|
||||
var geocoder;
|
||||
var map;
|
||||
@@ -156,45 +156,45 @@
|
||||
var polylinesRoute = [];
|
||||
var directionsDisplayArray = [];
|
||||
if (jQuery('#pulsate-regular')) {
|
||||
jQuery('#pulsate-regular').pulsate({
|
||||
color: "#bf1c56"
|
||||
jQuery('#pulsate-regular').pulsate({
|
||||
color: "#bf1c56"
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
var retorno;
|
||||
function setCenter(myLatLn) {
|
||||
map.setCenter(myLatLn);
|
||||
map.setCenter(myLatLn);
|
||||
}
|
||||
function addmarkerarrastre(myLatLn) {//myLatLn = { lat: -25.363, lng: 131.044 }
|
||||
if (markerArrastre) {
|
||||
markerArrastre.setMap(null);
|
||||
}
|
||||
markerArrastre = new google.maps.Marker({
|
||||
position: myLatLn,
|
||||
map: map,
|
||||
title: 'Activacion Arrastre'
|
||||
});
|
||||
if (markerArrastre) {
|
||||
markerArrastre.setMap(null);
|
||||
}
|
||||
markerArrastre = new google.maps.Marker({
|
||||
position: myLatLn,
|
||||
map: map,
|
||||
title: 'Activacion Arrastre'
|
||||
});
|
||||
}
|
||||
|
||||
function addmarkerActual(myLatLn, Encencido) {//myLatLn = { lat: -25.363, lng: 131.044 } ,addmarkerActual({ lat: -25.363, lng: 131.044 })
|
||||
|
||||
var imagen = Encencido == 1 ? '/Imagenes/rsz_11rsz_cargreen.png' : '/Imagenes/rsz_11rsz_car.png';
|
||||
var markerIcon = { url: imagen, labelOrigin: new google.maps.Point(26, 43) };
|
||||
if (markerActual) {
|
||||
markerActual.setMap(null);
|
||||
}
|
||||
markerActual = new google.maps.Marker({
|
||||
position: myLatLn,
|
||||
map: map,
|
||||
if (markerActual) {
|
||||
markerActual.setMap(null);
|
||||
}
|
||||
markerActual = new google.maps.Marker({
|
||||
position: myLatLn,
|
||||
map: map,
|
||||
title: 'Posición Actual',
|
||||
icon: markerIcon
|
||||
});
|
||||
icon: markerIcon
|
||||
});
|
||||
}
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: { lat: 29.0628417, lng: -110.9872448 },
|
||||
zoom: 13
|
||||
|
||||
zoom: 13
|
||||
|
||||
});
|
||||
//var ShowDiv1 = document.createElement('div');
|
||||
//var ShowDivControl = new ShowDiv(ShowDiv1, map);
|
||||
@@ -219,25 +219,25 @@
|
||||
|
||||
geocoder = new google.maps.Geocoder();
|
||||
|
||||
//google.maps.event.addListener(map, "click", function (event) {
|
||||
// closeLastOpenedInfoWindow();
|
||||
//google.maps.event.addListener(map, "click", function (event) {
|
||||
// closeLastOpenedInfoWindow();
|
||||
//});
|
||||
|
||||
directionsService = new google.maps.DirectionsService;
|
||||
directionsDisplay = new google.maps.DirectionsRenderer;
|
||||
directionsDisplay.setOptions({ suppressMarkers: true });
|
||||
directionsDisplay.setMap(map);
|
||||
}
|
||||
|
||||
|
||||
function ADSBegin() {
|
||||
eval($('.EvalRun').val());
|
||||
directionsDisplay.setMap(map);
|
||||
}
|
||||
|
||||
|
||||
function ADSBegin() {
|
||||
eval($('.EvalRun').val());
|
||||
}
|
||||
initMap();
|
||||
//$(document).ready(function () {
|
||||
|
||||
// initMap();
|
||||
//});
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
// initMap();
|
||||
//});
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
@@ -1,100 +1,100 @@
|
||||
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_RepArrastre : ClsPaginas
|
||||
{
|
||||
|
||||
public int CveDispositivo
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ViewState["CveDispositivo"] != null)
|
||||
{
|
||||
return ViewState["CveDispositivo"].ToString().ToEntero();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
set { ViewState["CveDispositivo"] = value; }
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
// fijo borrar
|
||||
//DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(263965, 1928) ;
|
||||
DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario) ;
|
||||
DdlDispositivo.DataBind();
|
||||
getArrastre();
|
||||
}
|
||||
|
||||
}
|
||||
private void getArrastre()
|
||||
{
|
||||
CveDispositivo = DdlDispositivo.SelectedValue.ToEntero();
|
||||
using (ClsGPS objgps = new ClsGPS())
|
||||
{
|
||||
if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
DataRow dtrow = objgps.DtResultados.Rows[0];
|
||||
upInfo(dtrow);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public void upInfo(DataRow dtrow)
|
||||
{
|
||||
if ( dtrow != null)
|
||||
{
|
||||
LblVelocidad.Text = $"{dtrow["Speed"]:N0}";
|
||||
LblEncApa.Text = $"{dtrow["EncendidoText"]}";
|
||||
LblFechaInfo.Text = $"{dtrow["FechaTrama"]:dd/MM/yyyy HH:mm:ss}";
|
||||
chkActivarArrastre.Checked = dtrow["ArrastreActivo"].ToString() == "1";
|
||||
pnlAlertaActiva.Visible = dtrow["AlertaArrastre"].ToString() == "1";
|
||||
//LblVelocidad.Text = $"{dtrow[""]}";
|
||||
//LblVelocidad.Text = $"{dtrow[""]}";addmarkerActual({ lat: -25.363, lng: 131.044 })
|
||||
string pVehiculo = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["Lat"], dtrow["Lng"]);
|
||||
string parrastre = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["LatArrastre"], dtrow["LngArrastre"]);
|
||||
TxtFunciones.Text = string.Format("addmarkerActual({0},{3}){1};setCenter({2})", pVehiculo, (dtrow["ArrastreActivo"].ToString() == "1" ? $" ;addmarkerarrastre({parrastre})" : ";addmarkerarrastre()"), (dtrow["ArrastreActivo"].ToString() == "1" ? parrastre : pVehiculo), dtrow["Encendido"].ToString().ToEntero());
|
||||
UpInfo.Update();
|
||||
}
|
||||
}
|
||||
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
getArrastre();
|
||||
}
|
||||
|
||||
protected void chkActivarArrastre_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
using (ClsGPS objgps = new ClsGPS())
|
||||
{
|
||||
if (objgps.GPS_ArrastreActivarDesactivar(CveDispositivo, chkActivarArrastre.Checked)){
|
||||
|
||||
if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
DataRow dtrow = objgps.DtResultados.Rows[0];
|
||||
upInfo(dtrow);
|
||||
}
|
||||
if (chkActivarArrastre.Checked)
|
||||
{
|
||||
Alert("se ha activado la funcion de arrastre");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("se ha desactivado la funcion de arrastre");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
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_RepArrastre : ClsPaginas
|
||||
{
|
||||
|
||||
public int CveDispositivo
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ViewState["CveDispositivo"] != null)
|
||||
{
|
||||
return ViewState["CveDispositivo"].ToString().ToEntero();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
set { ViewState["CveDispositivo"] = value; }
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
// fijo borrar
|
||||
//DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(263965, 1928) ;
|
||||
DdlDispositivo.DataSource = get_GlobalDTDispositivosUsuarios(UsuarioActual.CveCliente, UsuarioActual.CveUsuario) ;
|
||||
DdlDispositivo.DataBind();
|
||||
getArrastre();
|
||||
}
|
||||
|
||||
}
|
||||
private void getArrastre()
|
||||
{
|
||||
CveDispositivo = DdlDispositivo.SelectedValue.ToEntero();
|
||||
using (ClsGPS objgps = new ClsGPS())
|
||||
{
|
||||
if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
DataRow dtrow = objgps.DtResultados.Rows[0];
|
||||
upInfo(dtrow);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public void upInfo(DataRow dtrow)
|
||||
{
|
||||
if ( dtrow != null)
|
||||
{
|
||||
LblVelocidad.Text = $"{dtrow["Speed"]:N0}";
|
||||
LblEncApa.Text = $"{dtrow["EncendidoText"]}";
|
||||
LblFechaInfo.Text = $"{dtrow["FechaTrama"]:dd/MM/yyyy HH:mm:ss}";
|
||||
chkActivarArrastre.Checked = dtrow["ArrastreActivo"].ToString() == "1";
|
||||
pnlAlertaActiva.Visible = dtrow["AlertaArrastre"].ToString() == "1";
|
||||
//LblVelocidad.Text = $"{dtrow[""]}";
|
||||
//LblVelocidad.Text = $"{dtrow[""]}";addmarkerActual({ lat: -25.363, lng: 131.044 })
|
||||
string pVehiculo = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["Lat"], dtrow["Lng"]);
|
||||
string parrastre = string.Format("{{ lat: {0}, lng: {1}}}", dtrow["LatArrastre"], dtrow["LngArrastre"]);
|
||||
TxtFunciones.Text = string.Format("addmarkerActual({0},{3}){1};setCenter({2})", pVehiculo, (dtrow["ArrastreActivo"].ToString() == "1" ? $" ;addmarkerarrastre({parrastre})" : ";addmarkerarrastre()"), (dtrow["ArrastreActivo"].ToString() == "1" ? parrastre : pVehiculo), dtrow["Encendido"].ToString().ToEntero());
|
||||
UpInfo.Update();
|
||||
}
|
||||
}
|
||||
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
getArrastre();
|
||||
}
|
||||
|
||||
protected void chkActivarArrastre_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
using (ClsGPS objgps = new ClsGPS())
|
||||
{
|
||||
if (objgps.GPS_ArrastreActivarDesactivar(CveDispositivo, chkActivarArrastre.Checked)){
|
||||
|
||||
if (objgps.GPS_ArrastreGET(CveDispositivo) && objgps.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
DataRow dtrow = objgps.DtResultados.Rows[0];
|
||||
upInfo(dtrow);
|
||||
}
|
||||
if (chkActivarArrastre.Checked)
|
||||
{
|
||||
Alert("se ha activado la funcion de arrastre");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("se ha desactivado la funcion de arrastre");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -938,6 +938,26 @@ Public Class WSGPSApp
|
||||
|
||||
End Function
|
||||
|
||||
<WebMethod>
|
||||
Public Function GetArrastre(CveDispositivo As Integer) As String
|
||||
Dim Retorno As String = "[]"
|
||||
Using ObjGPS As New ClsGPS
|
||||
If ObjGPS.GPS_ArrastreGET(CveDispositivo) Then
|
||||
Retorno = ObjGPS.DtResultados.DataTableToJSONIPP()
|
||||
End If
|
||||
End Using
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
<WebMethod>
|
||||
Public Function ActivarDesactivarArrastre(CveDispositivo As Integer, Activo As Boolean) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Using ObjGPS As New ClsGPS
|
||||
Retorno = ObjGPS.GPS_ArrastreActivarDesactivar(CveDispositivo, Activo)
|
||||
End Using
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
<WebMethod>
|
||||
Public Function GetTrayectos(CveCliente As Integer) As String
|
||||
Dim Retorno As String = "[]"
|
||||
|
||||
Reference in New Issue
Block a user