diff --git a/App_Code/ClsGPS.vb b/App_Code/ClsGPS.vb index 9bffc2e1f..99017364d 100644 --- a/App_Code/ClsGPS.vb +++ b/App_Code/ClsGPS.vb @@ -4714,11 +4714,11 @@ Public Class ClsGPS OnError("Ocurrió un error al eliminar los costos del kilometro.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno - End Function + End Function #End Region - + #Region "T R A Y E C T O S" - Public Function AddTrayecto(Trayecto As String, Fecha As DateTime, Folio As String, CveDispositivo As Integer, CveCliente As Integer) As Integer + Public Function AddTrayecto(Trayecto As String, Fecha As DateTime, Folio As String, CveDispositivo As Integer, CveCliente As Integer, Optional EnviarNotificacion As Boolean = False, Optional CorreosNotificacion As String = "", Optional Intervalo As Integer = 0, Optional EnviarLiga As Boolean = False) As Integer Dim retorno As Integer = 0 DataAdapter("PA_GPS_TrayectosAdd", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -4727,6 +4727,10 @@ Public Class ClsGPS .Add("@Folio", SqlDbType.VarChar).Value = Folio .Add("@CveDispositivo", SqlDbType.Int).Value = CveDispositivo .Add("@CveCliente", SqlDbType.Int).Value = CveCliente + .Add("@EnviarNotificacion", SqlDbType.Bit).Value = EnviarNotificacion + .Add("@CorreosNotificacion", SqlDbType.VarChar).Value = CorreosNotificacion + .Add("@Intervalo", SqlDbType.Int).Value = Intervalo + .Add("@EnviarLiga", SqlDbType.Bit).Value = EnviarLiga .Add("@CveTrayecto", SqlDbType.Int).Direction = ParameterDirection.Output End With diff --git a/GPS/Rastreo.aspx b/GPS/Rastreo.aspx index 18559083e..d09872508 100644 --- a/GPS/Rastreo.aspx +++ b/GPS/Rastreo.aspx @@ -316,67 +316,7 @@ - <%-- - -
-
- -
- -
- - - -
- -
- -
-
- -
-
- -
- -
- - - - -
- -
- -
-
- -
-
- -
- -
- -
- -
- -
-
-
-
--%> - - <%----%> - - + @@ -1063,6 +1003,7 @@ CalculaDireccionHistorica(coord, j, ejecutar) } } + function CalculaDireccionHistorica(coord, j, ejecutar) { setTimeout(function () { var url = '<%= ClsPaginas.UrlDirecciones%>' + 'nominatim/reverse.php?format=jsonv2&lat=' + coord.lat + '&lon=' + coord.lng; @@ -1077,7 +1018,8 @@ } }); }, timeout + (j)); - } + } + function CalculaRutaHistorica(coordenadasRuta, lastCoord) { if (coordenadasRuta.length > 0) { var flag = 1; diff --git a/GPS/RastreoTrayectos.aspx b/GPS/RastreoTrayectos.aspx new file mode 100644 index 000000000..320c1d054 --- /dev/null +++ b/GPS/RastreoTrayectos.aspx @@ -0,0 +1,679 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="RastreoTrayectos.aspx.vb" Inherits="GPS_RastreoTrayectos" %> + + + + + + + + + + + + +
+ +
+ + + + + + + + + + diff --git a/GPS/RastreoTrayectos.aspx.vb b/GPS/RastreoTrayectos.aspx.vb new file mode 100644 index 000000000..46c849a09 --- /dev/null +++ b/GPS/RastreoTrayectos.aspx.vb @@ -0,0 +1,343 @@ +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_RastreoTrayectos + Inherits Page + +#Region "P R O P I E D A D E S" + 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 CveTrayecto As Integer + Get + Return IfNull(ViewState("CveTrayecto"), -1, ViewState("CveTrayecto").ToString().ToEntero()).ToString().ToEntero() + End Get + Set(value As Integer) + ViewState("CveTrayecto") = value + End Set + End Property + Private Property CveDispositivo As Integer + Get + Return IfNull(ViewState("CveDispositivo"), -1, ViewState("CveDispositivo").ToString().ToEntero()).ToString().ToEntero() + End Get + Set(value As Integer) + ViewState("CveDispositivo") = value + End Set + End Property + Private Property CveCliente As Integer + Get + Return IfNull(ViewState("CveCliente"), -1, ViewState("CveCliente").ToString().ToEntero()).ToString().ToEntero() + End Get + Set(value As Integer) + ViewState("CveCliente") = 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 + Private Property DtPosiciones As DataTable + Get + Return CType(ViewState("DtPosiciones"), DataTable) + End Get + Set(value As DataTable) + ViewState("DtPosiciones") = value + End Set + End Property + + Property GlobalDTDispositivos(CveCliente As Integer) As DataTable + Get + Dim Str As StringBuilder = New StringBuilder() + + If CveCliente <> -1 Then Str.AppendFormat(" {0} CveCliente = {1}", If(Str.Length > 0, "AND", ""), CveCliente) + + + If CveCliente <> -1 Then + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTDispositivos"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) + GlobalDTDispositivos = Dv.ToTable + Dv.Dispose() + Else + GlobalDTDispositivos = DirectCast(HttpContext.Current.Application("GlobalDTDispositivos"), DataTable) + End If + + End Get + Set(value As DataTable) + HttpContext.Current.Application("GlobalDTDispositivos") = 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 + RegistraScript("$('#SideNav').click();initMap();") + Me.CveTrayecto = 97 + + CreaDTPosiciones() + CargaDatos() + RastrearEquipos() + CargaTabla() + End If + End Sub + Private Sub CreaDTPosiciones() + DtPosiciones = Nothing + + Dim dt As New DataTable + dt.Columns.Add("CveDispositivo", Type.GetType("System.Int32")) + dt.Columns.Add("Vehiculo", Type.GetType("System.String")) + dt.Columns.Add("Fecha", Type.GetType("System.String")) + dt.Columns.Add("Evento", Type.GetType("System.String")) + dt.Columns.Add("TiempoDetenido", Type.GetType("System.Double")) + dt.Columns.Add("Velocidad", Type.GetType("System.Double")) + dt.Columns.Add("Posicion", Type.GetType("System.String")) + dt.Columns.Add("KMRecorridos", Type.GetType("System.Double")) + dt.Columns.Add("Icono", Type.GetType("System.String")) + + DtPosiciones = dt + End Sub + Private Sub CreaDTCoordenadas() + + Dim dt As New DataTable + dt.Columns.Add("CveDispositivo", Type.GetType("System.Int32")) + dt.Columns.Add("Coord", Type.GetType("System.String")) + + DtCoordenadasContinuas = dt + End Sub + Private Sub CargaDatos() + Using ObjGPS As New ClsGPS + If ObjGPS.GetTrayectos(CveTrayecto, -1, -1) AndAlso ObjGPS.DtResultados.Rows.Count > 0 Then + Dim Row As DataRow = ObjGPS.DtResultados.Rows(0) + Me.CveDispositivo = Row("CveDispositivo").ToString().ToEntero() + Me.CveCliente = Row("CveCliente").ToString().ToEntero() + End If + End Using + TrazarLineaContinuo = True + CreaDTCoordenadas() + End Sub + Protected Sub TimmerRefresh_Tick(sender As Object, e As EventArgs) + DtPosiciones.Rows.Clear() + RegistraScript("DeleteMarkers();") + Dim LastCoord As String = "" + Dim TmpDT As New DataTable + Dim Info = "" + Dim Direccion = "" + Dim SBBody As New StringBuilder + Dim Icono As String = "/Imagenes/rsz_11rsz_car.png" + Dim Fecha, Vehiculo As String + + Dim ObjGPS As New ClsGPS + Try + Dim RowVehiculo As DataRow = GlobalDTDispositivos(CveCliente).FiltroPrimero($"CveDispositivo = {CveDispositivo}") + + If ObjGPS.UltimaPosicionEquipoGet(CveDispositivo, MinFecha, MaxFecha) Then + If ObjGPS.DtResultados.Rows.Count > 0 Then + Dim Coord As String = SQLToGmaps(ObjGPS.DtResultados.Rows(0)("Posicion").ToString, "POINT") + Fecha = ObjGPS.DtResultados.Rows(0)("FechaTrama").ToString + Vehiculo = ObjGPS.DtResultados.Rows(0)("Vehiculo").ToString + Info = InfoWindowCombustible($" Vehículo: {Vehiculo}", "-1", CveDispositivo, ObjGPS.DtResultados.Rows(0), False) + + If ObjGPS.DtResultados.Rows(0)("SPD").ToString.ToDouble > 1 Then + Icono = $"/Imagenes/{RowVehiculo("Icono")}green.png" + Else + Icono = $"/Imagenes/{RowVehiculo("Icono")}.png" + End If + + AddRowCoordenadasContinuas(Coord, CveDispositivo) + + Dim POLYPATH As String = "[" + + For Each RCC As DataRow In DtCoordenadasContinuas.FiltraParametros($"CveDispositivo = {CveDispositivo}", DistinctColumns:={"CveDispositivo", "Coord"}).Rows + POLYPATH = $"{POLYPATH}{RCC("Coord").ToString}," + Next + POLYPATH = $"{POLYPATH.Substring(0, POLYPATH.Length - 1)}]" + RegistraScript($"creaPolyline({POLYPATH}, '{RowVehiculo("ColorTrazo")}', '{Info}', {Coord}, '{RowVehiculo("NombreVehiculo")}', '{Icono}',{CveDispositivo}, 1)", $"{CveDispositivo}{DtCoordenadasContinuas.Rows.Count}") + + RegistraScript($"setTimeout(function(){{ CreaMarcador({Coord},'{RowVehiculo("NombreVehiculo").ToString()}', '{Info}', '{Icono}');}}, 1000);", CveDispositivo.ToString()) + AddRowPosiciones(Vehiculo, Coord, ObjGPS.DtResultados.Rows(0)("SPD").ToString.ToDouble, Fecha, CveDispositivo, ObjGPS.DtResultados(0)("TiempoDetenido").ToString.ToDouble) + End If + End If + + TimmerRefresh.Enabled = True + Catch ex As Exception + OnError("Ocurrió un error al rastrear equipo", ex) + End Try + End Sub + Private Sub RastrearEquipos() + Dim LastCoord As String = "" + Dim TmpDT As New DataTable + Dim Info = "" + Dim Direccion = "" + Dim SBBody As New StringBuilder + Dim Icono As String = "/Imagenes/rsz_11rsz_car.png" + Dim Fecha, Vehiculo As String + + Dim ObjGPS As New ClsGPS + Try + Dim RowVehiculo As DataRow = GlobalDTDispositivos(CveCliente).FiltroPrimero($"CveDispositivo = {CveDispositivo}") + + If ObjGPS.UltimaPosicionEquipoGet(CveDispositivo, MinFecha, MaxFecha) Then + If ObjGPS.DtResultados.Rows.Count > 0 Then + Dim Coord As String = SQLToGmaps(ObjGPS.DtResultados.Rows(0)("Posicion").ToString, "POINT") + Fecha = ObjGPS.DtResultados.Rows(0)("FechaTrama").ToString + Vehiculo = ObjGPS.DtResultados.Rows(0)("Vehiculo").ToString + Info = InfoWindowCombustible($" Vehículo: {Vehiculo}", "-1", CveDispositivo, ObjGPS.DtResultados.Rows(0), False) + + If ObjGPS.DtResultados.Rows(0)("SPD").ToString.ToDouble > 1 Then + Icono = $"/Imagenes/{RowVehiculo("Icono")}green.png" + Else + Icono = $"/Imagenes/{RowVehiculo("Icono")}.png" + End If + + AddRowCoordenadasContinuas(Coord, CveDispositivo) + + RegistraScript($"setTimeout(function(){{ CreaMarcador({Coord},'{RowVehiculo("NombreVehiculo").ToString()}', '{Info}', '{Icono}');}}, 1000);", CveDispositivo.ToString()) + AddRowPosiciones(Vehiculo, Coord, ObjGPS.DtResultados.Rows(0)("SPD").ToString.ToDouble, Fecha, CveDispositivo, ObjGPS.DtResultados(0)("TiempoDetenido").ToString.ToDouble) + End If + End If + + TimmerRefresh.Enabled = True + Catch ex As Exception + OnError("Ocurrió un error al rastrear equipo", ex) + End Try + ObjGPS.Dispose() + End Sub + + Private Sub CargaTabla() + If DtPosiciones IsNot Nothing Then + GvBarra.DataSource = DtPosiciones + GvBarra.DataBind() + End If + + If GvBarra.HeaderRow IsNot Nothing Then + GvBarra.HeaderRow.Cells(3).Style.Add("display", "") + GvBarra.HeaderRow.Cells(4).Style.Add("display", "none !important") + End If + End Sub + + Private Sub AddRowCoordenadasContinuas(Coord As String, CveDispositivo As Integer) + Dim dr As DataRow = DtCoordenadasContinuas.NewRow() + dr("CveDispositivo") = CveDispositivo + dr("Coord") = Coord + DtCoordenadasContinuas.Rows.Add(dr) + End Sub + Private Sub AddRowPosiciones(Vehiculo As String, Posicion As String, Velocidad As Double, Fecha As String, CveDispositivo As Integer, Optional TiempoDetenido As Double = 0, Optional Evento As String = "", Optional KMRecorridos As Double = 0, Optional Icono As String = "/Imagenes/rsz_11rsz_car.png") + Dim dr As DataRow = DtPosiciones.NewRow() + dr("Vehiculo") = Vehiculo + dr("Fecha") = Fecha + dr("TiempoDetenido") = TiempoDetenido + dr("Velocidad") = Velocidad + dr("Posicion") = Posicion + dr("CveDispositivo") = CveDispositivo + dr("Evento") = Evento + dr("KMRecorridos") = KMRecorridos + dr("Icono") = Icono + + DtPosiciones.Rows.Add(dr) + End Sub + 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($"
") + SBuilder.Append($"
{Header}
") + SBuilder.Append($"
") + Try + SBuilder.Append($"") + SBuilder.Append($"") + If row.Table.Columns.Contains("Combustible") Then + SBuilder.Append($"") + End If + If row("SPD").ToString <> "-1" Then + SBuilder.Append($"") + End If + If ExtraBody <> "" AndAlso ExtraBody <> "-1" Then + SBuilder.Append(ExtraBody) + End If + SBuilder.AppendFormat("", row("Lat").ToString, row("Lng").ToString) + Catch ex As Exception + OnError("Ocurrió un error al consultar", ex) + End Try + SBuilder.Append($"
Fecha : {row("FechaTrama")}
Conductor : {row("Conductor").ToString}
Combustible : {IfNull(row("Combustible"), "NO DISPONIBLE", $"{row("Combustible").ToString.FormatoNumero} lts").ToString}
Velocidad : {row("SPD").ToString} KM/H
Ver en google maps
") + Return SBuilder.ToString + End Function + Protected Sub btnPagePrev_Click(sender As Object, e As EventArgs) + Dim TotalRegistros As Integer = DtPosiciones.Rows.Count + Dim TotalRowsPage As Integer = GvBarra.PageSize + Dim PrevIndex As Integer = HdnIndexPage.Value.ToEntero - 1 + Dim CurrentIndex As Integer = PrevIndex + 1 + + Dim PrevIndexDT As Integer = (TotalRowsPage) * PrevIndex + Dim CurrentIndexDT As Integer = (TotalRowsPage) * CurrentIndex + + HdnIndexPage.Value = PrevIndex.ToString + + If Not btnPageNext.Enabled Then + btnPageNext.Enabled = True + End If + + If PrevIndexDT <= 0 Then + btnPagePrev.Enabled = False + GvBarra.DataSource = DtPosiciones.FiltraPorIndices(0, CurrentIndexDT) + LblRegistros.Text = $"Distribución de datos desde 0 hasta {CurrentIndexDT.ToString.FormatoNumero(0)}. Total de registros: {DtPosiciones.Rows.Count.ToString.FormatoNumero(0)}" + Else + LblRegistros.Text = $"Distribución de datos desde {PrevIndexDT.ToString.FormatoNumero(0)} hasta {CurrentIndexDT.ToString.FormatoNumero(0)}. Total de registros: {DtPosiciones.Rows.Count.ToString.FormatoNumero(0)}" + GvBarra.DataSource = DtPosiciones.FiltraPorIndices(PrevIndexDT, CurrentIndexDT) + End If + + GvBarra.DataBind() + UPGV.Update() + + RegistraScript("setTimeout(function(){OpcionesHistorico();},500);") + End Sub + Protected Sub btnPageNext_Click(sender As Object, e As EventArgs) + Dim TotalRegistros As Integer = DtPosiciones.Rows.Count + Dim TotalRowsPage As Integer = GvBarra.PageSize + Dim Index As Integer = HdnIndexPage.Value.ToEntero + 1 + Dim NextIndex As Integer = Index + 1 + + Dim CurrentIndexDT As Integer = (TotalRowsPage) * Index + Dim NextIndexDT As Integer = (TotalRowsPage) * NextIndex + + HdnIndexPage.Value = Index.ToString + + If Not btnPagePrev.Enabled Then + btnPagePrev.Enabled = True + End If + + If NextIndexDT >= TotalRegistros Then + btnPageNext.Enabled = False + GvBarra.DataSource = DtPosiciones.FiltraPorIndices(CurrentIndexDT, TotalRegistros - 1) + LblRegistros.Text = $"Distribución de datos desde {CurrentIndexDT.ToString.FormatoNumero(0)} hasta {DtPosiciones.Rows.Count.ToString.FormatoNumero(0)}. Total de registros: {DtPosiciones.Rows.Count.ToString.FormatoNumero(0)}" + Else + GvBarra.DataSource = DtPosiciones.FiltraPorIndices(CurrentIndexDT, NextIndexDT) + LblRegistros.Text = $"Distribución de datos desde {CurrentIndexDT.ToString.FormatoNumero(0)} hasta {NextIndexDT.ToString.FormatoNumero(0)}. Total de registros: {DtPosiciones.Rows.Count.ToString.FormatoNumero(0)}" + End If + + GvBarra.DataBind() + UPGV.Update() + + RegistraScript("setTimeout(function(){OpcionesHistorico();},500);") + End Sub + + + 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), False) + End Sub + +End Class diff --git a/GPS/Trayectos.aspx b/GPS/Trayectos.aspx index 8a653600c..0d42e5047 100644 --- a/GPS/Trayectos.aspx +++ b/GPS/Trayectos.aspx @@ -1,400 +1,450 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Trayectos.aspx.vb" Inherits="GPS_Trayectos" EnableEventValidation="false" %> - - - - - - - - Reporte de Trayectos - - -
  • +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Trayectos.aspx.vb" Inherits="GPS_Trayectos" EnableEventValidation="false" %> + + + + + + + + Reporte de Trayectos + + +
  • - -
  • -
  • + +
  • +
  • - -
  • -
    - - - -
    -
    -
    - -
    -
    -
      + + + + + + +
      +
      +
      + +
      +
      +
      • Vehículo: - - -
      • + + + +
      • Estatus: - - -
      • + + + +
      • Fecha Inicio: -
        - -
        -
      • + +
        + +
        +
      • Fecha Fin: -
        - -
        -
      • + +
        + +
        +
      • Mostrar Solo Activas: - -
      • -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> -
      -
      - - - - - - - - - - - - - - - - - - - - - - - - -
      -
      - - - - -
    +
    +
    +
    +
    +
    +
    +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + -
    - - + + + + + + + - - - + + + diff --git a/GPS/Trayectos.aspx.vb b/GPS/Trayectos.aspx.vb index b05d84872..a1977fccd 100644 --- a/GPS/Trayectos.aspx.vb +++ b/GPS/Trayectos.aspx.vb @@ -183,7 +183,9 @@ Partial Class GPS_Trayectos ObjGPS.IniciaTransacSQL() Try - Dim CveTrayecto As Integer = ObjGPS.AddTrayecto(Nombre, DateTime.Now, "", CveDispositivo, UsuarioActual.CveCliente) + Dim CveTrayecto As Integer = ObjGPS.AddTrayecto(Nombre, DateTime.Now, "", CveDispositivo, UsuarioActual.CveCliente, EnviarNotificacion:=ChkNotificacion.Checked, + CorreosNotificacion:=TxtCorreoNot.Text, Intervalo:=If(ChkNotificacion.Checked, 0, DdlIntervalo.SelectedValue.ToEntero()), + EnviarLiga:=ChkEnviarLiga.Checked) If CveTrayecto > 0 Then For Each Row As GridViewRow In GvEstatus.Rows @@ -401,6 +403,115 @@ Partial Class GPS_Trayectos ObjGPS.Dispose() End If Return Retorno - End Function - + End Function + + Protected Sub ChkNotificacion_CheckedChanged(sender As Object, e As EventArgs) + DivNotificaciones.Visible = ChkNotificacion.Checked + UpAgregar.Update() + End Sub + Protected Sub LnkEnviar_Click(sender As Object, e As EventArgs) + Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) + + Dim CveTrayecto As Integer = GvRow.DataKey("CveTrayecto").ToEntero() + Dim EnviarLiga As Boolean = CBool(GvRow.DataKey("EnviarLiga")) + If CveTrayecto > 0 Then + Dim DtInfoTrayecto As DataTable = Nothing + Using ObjGPS As New ClsGPS + If ObjGPS.GetTrayectosDatos(CveTrayecto) Then + DtInfoTrayecto = ObjGPS.DtSetResultados.Tables(0).Copy() + End If + End Using + If DtInfoTrayecto IsNot Nothing AndAlso DtInfoTrayecto.Rows.Count > 0 Then + Dim Row As DataRow = DtInfoTrayecto.Rows(0) + GeneraCorreo(CveTrayecto, EnviarLiga, Row) + End If + End If + End Sub + + Protected Function GeneraCorreo(CveTrayecto As Integer, EnviarLiga As Boolean, Row As DataRow) As String + Dim strBody As New StringBuilder + Try + strBody.Append(" ") + strBody.Append(" ") + strBody.Append(" ") + strBody.Append(" ") + strBody.Append(" ") + strBody.Append("
    ") + strBody.Append(" ") + strBody.Append("
    ") + strBody.Append("
    Datos del Trayecto ") + strBody.Append(" ") + strBody.Append(" ") + strBody.AppendFormat(" ", Row("Trayecto")) + strBody.Append(" ") + strBody.Append(" ") + strBody.AppendFormat(" ", Row("Vehiculo")) + strBody.Append(" ") + strBody.Append(" ") + strBody.AppendFormat(" ", Row("Estatus")) + strBody.Append(" ") + If EnviarLiga Then + strBody.Append(" ") + strBody.AppendFormat(" ", String.Format("http://gps.signalsgps.com/GPS/RastreoTrayectos.aspx?P={0}", Encripta($"CveTrayecto={CveTrayecto}"))) + strBody.Append(" ") + End If + strBody.Append(" ") + strBody.AppendFormat(" ", Row("LigaImagen")) + strBody.Append(" ") + strBody.Append("
    Trayecto:{0}
    Vehículo:{0}
    Estatus:{0}
    Rastrea Equipo:{0}
    Posición:
    ") + strBody.Append("
    ") + strBody.Append("
    ") + strBody.Append(" ") + strBody.Append("
    ") + strBody.Append("
    ") + strBody.Append("") + Catch ex As Exception + OnError("Ocurrio un error al general el correo.", ex) + End Try + Return strBody.ToString() + End Function End Class diff --git a/SiteGPS.master b/SiteGPS.master index 7e7f433ff..f1aa06e3e 100644 --- a/SiteGPS.master +++ b/SiteGPS.master @@ -843,7 +843,7 @@ var request = { Metodo: "UpdateNotificacion", Params: { - Cve: <%= UsuarioActual.CveUsuario %>, + Cve: <%= If(UsuarioActual IsNot Nothing, UsuarioActual.CveUsuario, -1) %>, CveBitacora: -1 } } @@ -864,8 +864,6 @@ setTimeout(startTimer, 60000); // callback } - startTimer(); - // function ShowToast(text, header, type, footer, sound,persistencia,coords) { @@ -919,7 +917,7 @@ var request = { Metodo: "UpdateNotificacion", Params: { - Cve: <%= UsuarioActual.CveUsuario %>, + Cve: <%= If(UsuarioActual IsNot Nothing, UsuarioActual.CveUsuario, -1) %>, CveBitacora: CveNotificacionBitacora } } diff --git a/SiteGPS.master.vb b/SiteGPS.master.vb index d7770c0df..a0aa82fc9 100644 --- a/SiteGPS.master.vb +++ b/SiteGPS.master.vb @@ -127,19 +127,22 @@ Partial Class SiteGPS End If End If - CargarNotificaciones() + CargarNotificaciones() + + RegistraScript($"IniciarNotificaciones();startTimer();") Else Dim thisURL As String = Request.Url.Segments(Request.Url.Segments.Count - 1) If thisURL.Equals("WizardRegistro.aspx") OrElse thisURL.Equals("Registro.aspx") Then LitTit.Text = "AD  Soluciones en TI " - + ElseIf thisURL.Equals("RastreoTrayectos.aspx") Then + LitTit.Text = "Rastreo  Trayectos " End If 'Response.Redirect("/PortalGPS/LoginPortal.aspx") - End If + End If + + - - RegistraScript($"IniciarNotificaciones();") Else 'VALIDACION DE SEGURIDAD, EN LA QUE SE VALIDA QUE LA EMPRESA EN LA QUE SE GENERO LA PAGINA SEA LA MISMA A LA DE LA SESION,