From 58eed4766ce200051e5adab187fcd6240a5d8366 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 22 Jan 2020 20:31:25 -0700 Subject: [PATCH] Arrastre en APP --- GPS/RepArrastre.aspx | 370 ++++++++++++++++++++-------------------- GPS/RepArrastre.aspx.cs | 198 ++++++++++----------- asmx/WSGPSApp.asmx | 20 +++ 3 files changed, 304 insertions(+), 284 deletions(-) diff --git a/GPS/RepArrastre.aspx b/GPS/RepArrastre.aspx index dbb648fe0..f265aa224 100644 --- a/GPS/RepArrastre.aspx +++ b/GPS/RepArrastre.aspx @@ -1,151 +1,151 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepArrastre.aspx.cs" Inherits="GPS_RepArrastre" %> - - - - - - - - Reporte de Arrastre - - - - -
  • - Apagar vehiculo -
  • -
    - - - - - -
    -
    -
    - - -
    -
    -
    -
    - Vehiculo: -
    -
    - - - -
    - -
    -
    -
    - -
    -
    -
    - - -
    -
    -
    -
    -
    - - datos vehiculo -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - Alerta el vehiculo se encuentra en arrastre -
    -
    -
    -
    -
    - -
    - <%----%> -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - + + - - + // initMap(); + //}); + + + diff --git a/GPS/RepArrastre.aspx.cs b/GPS/RepArrastre.aspx.cs index 4d3e6ab7e..3da7065db 100644 --- a/GPS/RepArrastre.aspx.cs +++ b/GPS/RepArrastre.aspx.cs @@ -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"); + } + } + } + + } } \ No newline at end of file diff --git a/asmx/WSGPSApp.asmx b/asmx/WSGPSApp.asmx index 7beb67125..c834e2cd5 100644 --- a/asmx/WSGPSApp.asmx +++ b/asmx/WSGPSApp.asmx @@ -938,6 +938,26 @@ Public Class WSGPSApp End Function + + 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 + + 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 + Public Function GetTrayectos(CveCliente As Integer) As String Dim Retorno As String = "[]"