CREAR PUNTO DE INTERES EN RASTREO

This commit is contained in:
2020-02-05 18:35:33 -07:00
parent ef8a2a74d1
commit 603dc66866
2 changed files with 1403 additions and 1201 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -127,6 +127,7 @@ Partial Class GPS_Rastreo
CargaDispositivos()
CargaEventos()
CargaGrupos()
CargaGruposPI()
CreaTmpDTDetalle()
IndiceGV = 0
End If
@@ -144,6 +145,16 @@ Partial Class GPS_Rastreo
RegistraScript("$('#C_GvDispositivos_chkSelectAll').click(function () { $("".ChkAllEvt input"").not(this).prop('checked',$(this).is(':checked')); });", "1")
End Sub
Private Sub CargaGruposPI()
Dim ObjGPS As New ClsGPS
If ObjGPS.PuntoDeInteresGrupoGet(-1, 1) Then
GvGrupos.DataSource = ObjGPS.DtResultados
End If
ObjGPS.Dispose()
GvGrupos.DataBind()
UpAgregarPuntoInteres.Update()
End Sub
Private Sub CargaEventos()
Dim GPS As New ClsGPS
@@ -2177,4 +2188,37 @@ Partial Class GPS_Rastreo
End Sub
#End Region
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 HuboError = False
Dim ObjGPS As New ClsGPS
ObjGPS.IniciaTransacSQL()
Try
Dim GEOM As String = $"POINT{GeoCerca.Value}"
If Not ObjGPS.PuntoDeInteresAdd(TxtNombrePI.Text, UsuarioActual.CveCliente, GEOM, True, TxtDescripcion.Text, HdnGrupo.Value.ToEntero) Then
HuboError = True
End If
Catch ex As Exception
HuboError = True
OnError("Ocurrió un error al agregar el punto de interés", ex)
End Try
If HuboError Then
ObjGPS.RollBack()
Else
ObjGPS.Commit()
TxtDescripcion.Text = ""
TxtNombre.Text = ""
Alert("El punto de interés se agregó correctamente", TipoMensaje.MsgInformacion)
RegistraScript("$('#DivAgregarPuntoInteres').modal('hide');DeleteMarkersG();", "1")
End If
UpAgregarPuntoInteres.Update()
End Sub
End Class