Cambios estatus de trayectos
This commit is contained in:
@@ -50,6 +50,15 @@ Partial Class GPS_TrayectoDetalle
|
||||
ViewState("CveEstatusActual") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property OrdenActual As Integer
|
||||
Get
|
||||
Return CType(ViewState("OrdenActual"), Integer)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("OrdenActual") = value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
|
||||
@@ -148,6 +157,7 @@ Partial Class GPS_TrayectoDetalle
|
||||
LblTitulo.Text = $"Trayecto: {RowEstatus("Trayecto")}"
|
||||
LtlEstatusActual.Text = RowEstatus("Estatus").ToString()
|
||||
CveEstatusActual = RowEstatus("CveEstatusActual").ToString().ToEntero()
|
||||
OrdenActual = RowEstatus("OrdenActual").ToString().ToEntero()
|
||||
|
||||
If CBool(RowEstatus("EsFin")) Then
|
||||
BtnTerminarTrayeto.Visible = False
|
||||
@@ -158,7 +168,7 @@ Partial Class GPS_TrayectoDetalle
|
||||
|
||||
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()))
|
||||
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} KM/H", RowEstatus("VMedia"))
|
||||
LtlVMax.Text = String.Format("{0:N2} KM/H", RowEstatus("VMax"))
|
||||
LtlTiempo.Text = String.Format("{0}", RowEstatus("TiempoOperativo"))
|
||||
@@ -214,18 +224,41 @@ Partial Class GPS_TrayectoDetalle
|
||||
Dim CoordAnterior As String = ""
|
||||
Dim CveEstatus As Integer = -1
|
||||
Dim CveEstatusAnterior As Integer = -1
|
||||
Dim GeoreferenciaASeguir As String = ""
|
||||
Dim EstatusSiguiente As String = ""
|
||||
Dim OrdenEstatus As Integer = 0
|
||||
|
||||
'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
|
||||
OrdenEstatus = Row("OrdenEstatus").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))
|
||||
Dim Cruzo As String = IfNull(Row("Cruzo"), "0").ToString()
|
||||
|
||||
RegistraScript($"creaPoligono({Coord}, '{Row("Color").ToString}', '{Row("GeoReferencia")}', '{Row("EstatusTrayecto")}',{InicioFin},{CveEstatus},{CveEstatusAnterior},{Cruzo})", count.ToString())
|
||||
'MARCA PARA QUE NO CALCULE EL TIEMPO DE LAS GEOCERCAS RESTANTES
|
||||
If Not String.IsNullOrEmpty(GeoreferenciaASeguir) Then
|
||||
Cruzo = "1"
|
||||
End If
|
||||
|
||||
'VERIFICA SI SE ACTUALIZO MANUALMENTE
|
||||
If Cruzo = "0" Then
|
||||
If OrdenEstatus <= OrdenActual Then
|
||||
Cruzo = "1"
|
||||
End If
|
||||
End If
|
||||
|
||||
If Cruzo = "0" Then
|
||||
GeoreferenciaASeguir = Row("GeoReferencia").ToString()
|
||||
EstatusSiguiente = Row("EstatusTrayecto").ToString()
|
||||
End If
|
||||
|
||||
RegistraScript($"creaPoligono({Coord}, '{Row("Color").ToString}', '{Row("GeoReferencia")}', '{Row("EstatusTrayecto")}',{InicioFin},{CveEstatus},{CveEstatusAnterior},{Cruzo},'{GeoreferenciaASeguir}','{EstatusSiguiente}')", count.ToString())
|
||||
Next
|
||||
End If
|
||||
|
||||
@@ -324,11 +357,16 @@ Partial Class GPS_TrayectoDetalle
|
||||
Dim ObjGPS As New ClsGPS
|
||||
|
||||
Try
|
||||
If ObjGPS.GetEstatusTrayectos(-1, UsuarioActual.CveCliente) Then
|
||||
DtEstatus = ObjGPS.DtResultados.Copy()
|
||||
Dim CveEstatusFinal As Integer = -1
|
||||
If ObjGPS.GetTrayectosGeoReferencias(CveTrayecto) Then
|
||||
'TOMA LA GEOCERCA FINAL
|
||||
Dim Row As DataRow = ObjGPS.DtResultados.FiltroPrimero($"EsFin = True")
|
||||
If Row IsNot Nothing Then
|
||||
CveEstatusFinal = Row("CveEstatusTrayecto").ToString().ToEntero()
|
||||
End If
|
||||
|
||||
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", JSBtnAceptar:="RefrescarPagina();", ShowCloseButton:=False)
|
||||
@@ -336,6 +374,19 @@ Partial Class GPS_TrayectoDetalle
|
||||
Else
|
||||
Alert("No se pudo obtener el estatus final", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
'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", JSBtnAceptar:="RefrescarPagina();", ShowCloseButton:=False)
|
||||
' End If
|
||||
'Else
|
||||
' Alert("No se pudo obtener el estatus final", TipoMensaje.MsgError)
|
||||
'End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar el trayecto", ex)
|
||||
End Try
|
||||
|
||||
Reference in New Issue
Block a user