option strict on

This commit is contained in:
2023-08-24 00:38:39 -07:00
parent 85d1bcd386
commit 4c6f8bbaef
15 changed files with 96 additions and 103 deletions

View File

@@ -104,7 +104,7 @@ Partial Class GPS_CatDispositivos
e.Row.VerticalAlign = VerticalAlign.Middle
' e.Row.FCLinkButton("ImgE").CommandArgument = e.Row.DataKey("CveDispositivo").ToString
If e.Row.DBCampo("CveEstatus") = 1 Then
If e.Row.DBCampo("CveEstatus") = "1" Then
e.Row.FCLabel("LblEstatus").Text = "Activo"
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green

View File

@@ -24,7 +24,7 @@ Partial Class GPS_CatModelos
e.Row.VerticalAlign = VerticalAlign.Middle
e.Row.FCHyperLink("ImgE").NavigateUrl = $"/GPS/WizardModelo.aspx?CveModelo={e.Row.DataKey("CveModelo").ToString}"
If e.Row.DBCampo("Estatus") = True Then
If e.Row.DBCampo("Estatus") = "True" Then
e.Row.FCLabel("LblEstatus").Text = "Activo"
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green

View File

@@ -19,7 +19,7 @@ Partial Class GPS_PlanesDatos
DdlProveedorComunicacion.DataBind()
End If
ObjGps.Dispose()
DdlProveedorComunicacion.Items.Insert(0, New ListItem("Seleccione", -1))
DdlProveedorComunicacion.Items.Insert(0, New ListItem("Seleccione", "-1"))
UpDatos.Update()
End Sub
Private Sub CargaDatos()
@@ -37,12 +37,12 @@ Partial Class GPS_PlanesDatos
Dim Estatus = 0
If ChkEstatus.Checked Then Estatus = 1
If HdnModalidad.Value = "A" Then
If ObjGps.PlanesDatosAdd(DdlProveedorComunicacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, TxtPlanDatos.Text, TxtImporte.Text, Estatus, TxtCapacidad.Text, DDLTipoDatos.SelectedValue, TxtCostoAdicional.Text, TxtTechoFacturacion.Text, UsuarioActual.CveEmpresa) Then
If ObjGps.PlanesDatosAdd(DdlProveedorComunicacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, TxtPlanDatos.Text, TxtImporte.Text.ToDecimal, Estatus, TxtCapacidad.Text.ToEntero, DDLTipoDatos.SelectedValue, TxtCostoAdicional.Text, TxtTechoFacturacion.Text, UsuarioActual.CveEmpresa) Then
CargaDatos()
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
End If
ElseIf HdnModalidad.Value = "U" Then
If ObjGps.PlanesDatosUpdate(HdnID.Value, DdlProveedorComunicacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, TxtPlanDatos.Text, TxtImporte.Text, Estatus, TxtCapacidad.Text, DDLTipoDatos.SelectedValue, TxtCostoAdicional.Text, TxtTechoFacturacion.Text) Then
If ObjGps.PlanesDatosUpdate(HdnID.Value.ToEntero, DdlProveedorComunicacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, TxtPlanDatos.Text, TxtImporte.Text.ToDecimal, Estatus, TxtCapacidad.Text.ToEntero, DDLTipoDatos.SelectedValue, TxtCostoAdicional.Text, TxtTechoFacturacion.Text) Then
CargaDatos()
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
End If
@@ -97,7 +97,7 @@ Partial Class GPS_PlanesDatos
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
HdnID.Value = GvRow.DataKey("CvePlanDato")
UpDatos.Update()
If ObjGps.PlanesDatosRemove(HdnID.Value) Then
If ObjGps.PlanesDatosRemove(HdnID.Value.ToEntero) Then
CargaDatos()
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
End If
@@ -112,7 +112,7 @@ Partial Class GPS_PlanesDatos
Private Sub GvPlanesDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPlanesDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Estatus") = True Then
If e.Row.DBCampo("Estatus") = "True" Then
e.Row.FCLabel("LblEstatus").Text = "Activo"
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
@@ -120,7 +120,7 @@ Partial Class GPS_PlanesDatos
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Red
End If
If e.Row.DBCampo("Importe") = True Then
If e.Row.DBCampo("Importe") = "True" Then
e.Row.FCLabel("LblImporte").Text = "$" + e.Row.FCLabel("LblImporte").Text.FormatoNumero()
End If
End If

View File

@@ -48,7 +48,7 @@ Partial Class GPS_CatProveedoresComunicacionCuentas
Private Sub CargaDdlClientes()
Dim ObjGps As New ClsClientes()
If ObjGps.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, -1, -1) Then
If ObjGps.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, "-1", -1) Then
DdlFiltroCliente.DataSource = ObjGps.DtResultados
DdlFiltroCliente.DataBind()
End If
@@ -128,7 +128,7 @@ Partial Class GPS_CatProveedoresComunicacionCuentas
If UsuarioActual.Empresa.Funcionalidad(541) = "1" Then
Estatus = 0
End If
If ObjGps.ProveedoresComunicacionCuentasAdd(DdlProveedorComunicacion.SelectedValue, DdlPlanDatos.SelectedValue, UsuarioActual.CveUsuario, TxtIP.Text, TxtSSID.Text, numeroTelefono, Estatus, UsuarioActual.CveEmpresa, Imei, CveUsuarioResguardante) Then
If ObjGps.ProveedoresComunicacionCuentasAdd(DdlProveedorComunicacion.SelectedValue.ToEntero, DdlPlanDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, TxtIP.Text, TxtSSID.Text, numeroTelefono, Estatus, UsuarioActual.CveEmpresa, Imei, CveUsuarioResguardante) Then
CargaDatos()
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
End If
@@ -137,7 +137,7 @@ Partial Class GPS_CatProveedoresComunicacionCuentas
envirCorreoActivacion()
Estatus = 1
End If
If ObjGps.ProveedoresComunicacionCuentasUpdate(HdnID.Value, DdlProveedorComunicacion.SelectedValue, DdlPlanDatos.SelectedValue, UsuarioActual.CveUsuario, TxtIP.Text, TxtSSID.Text, numeroTelefono, Estatus, UsuarioActual.CveEmpresa, Imei, CveUsuarioResguardante) Then
If ObjGps.ProveedoresComunicacionCuentasUpdate(HdnID.Value.ToEntero, DdlProveedorComunicacion.SelectedValue.ToEntero, DdlPlanDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, TxtIP.Text, TxtSSID.Text, numeroTelefono, Estatus, UsuarioActual.CveEmpresa, Imei, CveUsuarioResguardante) Then
CargaDatos()
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
End If
@@ -232,7 +232,7 @@ Partial Class GPS_CatProveedoresComunicacionCuentas
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
HdnID.Value = GvRow.DataKey("CveProveedorComunicacionCuenta")
UpDatos.Update()
If ObjGps.ProveedoresComunicacionCuentasRemove(HdnID.Value) Then
If ObjGps.ProveedoresComunicacionCuentasRemove(HdnID.Value.ToEntero) Then
CargaDatos()
End If
@@ -247,7 +247,7 @@ Partial Class GPS_CatProveedoresComunicacionCuentas
Private Sub GvProveedorComunicacionCuenta_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvProveedorComunicacionCuenta.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Estatus") = True Then
If e.Row.DBCampo("Estatus") = "True" Then
e.Row.FCLabel("LblEstatus").Text = "Activo"
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green
@@ -306,7 +306,7 @@ Partial Class GPS_CatProveedoresComunicacionCuentas
Dim Imei As String = TxtImei.Text
Dim CveUsuarioResguardante As Integer = DDlResguardante.SelectedValue.ToEntero()
If ObjGps.ProveedoresComunicacionCuentasUpdate(HdnID.Value, DdlProveedorComunicacion.SelectedValue, DdlPlanDatos.SelectedValue, UsuarioActual.CveUsuario, TxtIP.Text, TxtSSID.Text, numeroTelefono, Estatus, UsuarioActual.CveEmpresa, Imei, CveUsuarioResguardante) Then
If ObjGps.ProveedoresComunicacionCuentasUpdate(HdnID.Value.ToEntero, DdlProveedorComunicacion.SelectedValue.ToEntero, DdlPlanDatos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, TxtIP.Text, TxtSSID.Text, numeroTelefono, Estatus, UsuarioActual.CveEmpresa, Imei, CveUsuarioResguardante) Then
CargaDatos()
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
End If

View File

@@ -12,15 +12,15 @@ Partial Class GPS_TipoComunicacion
Private Sub BtnAgregarTipoComunicacion_Click(sender As Object, e As EventArgs) Handles BtnAgregarTipoComunicacion.Click
Dim ObjGps As New ClsGPS
Dim Estatus = 0
If ChkEstatus.Checked Then Estatus = 1
Dim Estatus As Boolean = False
If ChkEstatus.Checked Then Estatus = True
If HdnModalidad.Value = "A" Then
If ObjGps.TipoComunicacionAdd(TxtTipoComunicacion.Text, Estatus, UsuarioActual.CveUsuario) Then
CargaDatos()
Alert("Agregado Correctamente.", TipoMensaje.MsgInformacion)
End If
ElseIf HdnModalidad.Value = "U" Then
If ObjGps.TipoComunicacionUpdate(HdnID.Value, TxtTipoComunicacion.Text, Estatus, UsuarioActual.CveUsuario) Then
If ObjGps.TipoComunicacionUpdate(HdnID.Value.ToEntero, TxtTipoComunicacion.Text, Estatus, UsuarioActual.CveUsuario) Then
CargaDatos()
Alert("Actualizado Correctamente.", TipoMensaje.MsgInformacion)
End If
@@ -66,7 +66,7 @@ Partial Class GPS_TipoComunicacion
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
HdnID.Value = GvRow.DataKey("CveTipoComunicacion")
UpDatos.Update()
If ObjGps.TipoComunicacionDelete(HdnID.Value) Then
If ObjGps.TipoComunicacionDelete(HdnID.Value.ToEntero) Then
CargaDatos()
Alert("Eliminado Correctamente.", TipoMensaje.MsgInformacion)
End If
@@ -88,7 +88,7 @@ Partial Class GPS_TipoComunicacion
Private Sub GvTipoComunicacion_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvTipoComunicacion.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Estatus") = True Then
If e.Row.DBCampo("Estatus") = "True" Then
e.Row.FCLabel("LblEstatus").Text = "Activo"
e.Row.FCLabel("LblEstatus").ForeColor = Drawing.Color.Green

View File

@@ -132,7 +132,7 @@ Partial Class GPS_RepCombustible2
If DTDatos.Rows.Count > 0 Then
LtlDistancia.Text = $"{DTDatos.Rows(0)("KmRecorridos")}"
lblVelocidad.Text = $"{DTDatos.Rows(0)("SPD")}"
lblRendBruto.Text = $"{DTDatos.Rows(0)("KmRecorridos") / DTDatos.Rows(0)("CombustibleConsumido"):N2}"
lblRendBruto.Text = $"{DTDatos.Rows(0)("KmRecorridos").ToString.ToDecimal / DTDatos.Rows(0)("CombustibleConsumido").ToString.ToDecimal:N2}"
LtlCombustibleInicial.Text = $"{DTDatos.Rows(0)("CombustibleInicial")}"
LtlCombustibleFinal.Text = $"{DTDatos.Rows(0)("CombustibleFinal")}"
LtlNoCargas.Text = $"{DTDatos.Rows(0)("CCargas")}"
@@ -172,7 +172,7 @@ Partial Class GPS_RepCombustible2
' LtlCostoCombustibleF.Text = $"${(GPS.DtResultados.Rows(0)("CombustibleFinal").ToString.ToDecimal * CostoCombustible).ToString.FormatoNumero}"
' LtlCostoInicial.Text = $"${(GPS.DtResultados.Rows(0)("CombustibleInicial").ToString.ToDecimal * CostoCombustible).ToString.FormatoNumero}"
' lCombustibleConsumido.Text = CombustibleConsumido.ToString.FormatoNumero
lblMuerto.Text = $"{((DateDiff(DateInterval.Minute, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime).ToString - GPS.DtResultados.Rows(0)("Horas").ToString.ToLong) / 60).ToString.FormatoNumero} Hrs."
lblMuerto.Text = $"{((DateDiff(DateInterval.Minute, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime).ToString.ToEntero - GPS.DtResultados.Rows(0)("Horas").ToString.ToLong) / 60).ToString.FormatoNumero} Hrs."
lblMovimiento.Text = $"{(GPS.DtResultados.Rows(0)("Horas").ToString.ToDecimal / 60).ToString.FormatoNumero} Hrs"
LtlRalenti.Text = $"{GPS.DtResultados.Rows(0)("TiempoRalentiHoras").ToString.FormatoNumero} Hrs. ({GPS.DtResultados.Rows(0)("TiempoRalentiMinutos").ToString} Minutos)"

View File

@@ -16,8 +16,6 @@ Partial Class GPS_Soporte
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaDispositivos()
@@ -45,7 +43,7 @@ Partial Class GPS_Soporte
Private Sub CargaDatos()
Dim GPS As New ClsGPS
If GPS.DispositivosGet(DdlDispositivo.SelectedValue, -1, -1) AndAlso GPS.DtResultados.Rows.Count > 0 Then
If GPS.DispositivosGet(DdlDispositivo.SelectedValue.ToEntero, -1, -1) AndAlso GPS.DtResultados.Rows.Count > 0 Then
TxtIp.Text = GPS.DtResultados.Rows(0)("IP").ToString
TxtPuerto.Text = "80"
TxtAPN.Text = GPS.DtResultados.Rows(0)("APN").ToString
@@ -85,7 +83,7 @@ Partial Class GPS_Soporte
If DdlTipoConsulta.SelectedValue = "Last" Then
If GPS.GetRepDispositivo(DdlDispositivo.SelectedValue.ToEntero, MinFecha, MaxFecha, "Top 1") Then
If GPS.DtResultados.Rows.Count > 0 Then
Dim Coord As String = SQLToGmaps(GPS.DtResultados.Rows(0)("Punto"), "POINT")
Dim Coord As String = SQLToGmaps(GPS.DtResultados.Rows(0)("Punto").ToString, "POINT")
RegistraScript($"CreaMarcador({Coord},'{DdlDispositivo.SelectedItem.Text}');")
GvReportes.DataSource = GPS.DtResultados
GvVLog.DataSource = GPS.DtResultados
@@ -98,7 +96,7 @@ Partial Class GPS_Soporte
If GPS.GetRepDispositivo(DdlDispositivo.SelectedValue.ToEntero, MinFecha, MaxFecha, "TOP 10") Then
If GPS.DtResultados.Rows.Count > 0 Then
For Each row As DataRow In GPS.DtResultados.Rows
Dim Coord As String = SQLToGmaps(row("Punto"), "POINT")
Dim Coord As String = SQLToGmaps(row("Punto").ToString, "POINT")
RegistraScript($"CreaMarcador({Coord},'{DdlDispositivo.SelectedItem.Text}: {row("FechaIng").ToString}');")
Next
GvReportes.DataSource = GPS.DtResultados
@@ -112,7 +110,7 @@ Partial Class GPS_Soporte
If GPS.GetRepDispositivo(DdlDispositivo.SelectedValue.ToEntero, DateTime.Today.AddHours(-1), DateTime.Today.AddDays(1)) Then
If GPS.DtResultados.Rows.Count > 0 Then
For Each row As DataRow In GPS.DtResultados.Rows
Dim Coord As String = SQLToGmaps(row("Punto"), "POINT")
Dim Coord As String = SQLToGmaps(row("Punto").ToString, "POINT")
RegistraScript($"CreaMarcador({Coord},'{DdlDispositivo.SelectedItem.Text}: {row("FechaIng")}');")
Next
GvReportes.DataSource = GPS.DtResultados
@@ -126,7 +124,7 @@ Partial Class GPS_Soporte
If GPS.GetRepDispositivo(DdlDispositivo.SelectedValue.ToEntero, DateTime.Today.AddDays(-1).AddHours(-1), DateTime.Today) Then
If GPS.DtResultados.Rows.Count > 0 Then
For Each row As DataRow In GPS.DtResultados.Rows
Dim Coord As String = SQLToGmaps(row("Punto"), "POINT")
Dim Coord As String = SQLToGmaps(row("Punto").ToString, "POINT")
RegistraScript($"CreaMarcador({Coord},'{DdlDispositivo.SelectedItem.Text}: {row("FechaIng")}');")
Next
GvReportes.DataSource = GPS.DtResultados
@@ -141,7 +139,7 @@ Partial Class GPS_Soporte
If GPS.DtResultados.Rows.Count > 0 Then
Dim dr As DataRow = TmpDT.NewRow
For Each row As DataRow In GPS.DtResultados.Rows
Dim Coord As String = SQLToGmaps(row("Punto"), "POINT")
Dim Coord As String = SQLToGmaps(row("Punto").ToString, "POINT")
RegistraScript($"CreaMarcador({Coord},'{DdlDispositivo.SelectedItem.Text}: {row("FechaIng")}');")
Next
GvReportes.DataSource = GPS.DtResultados
@@ -158,7 +156,7 @@ Partial Class GPS_Soporte
If GPS.DtResultados.Rows.Count > 0 Then
Dim dr As DataRow = TmpDT.NewRow
For Each row As DataRow In GPS.DtResultados.Rows
Dim Coord As String = SQLToGmaps(row("Punto"), "POINT")
Dim Coord As String = SQLToGmaps(row("Punto").ToString, "POINT")
RegistraScript($"CreaMarcador({Coord},'{DdlDispositivo.SelectedItem.Text}: {row("FechaIng")}');")
Next
GvReportes.DataSource = GPS.DtResultados
@@ -219,10 +217,10 @@ Partial Class GPS_Soporte
Dim Var As String = ""
For Each coordenada As String In CoordsPuntos
If coordenada Is CoordsPuntos.Last Then
Dim latlng() As String = coordenada.Trim.Split(" ")
Dim latlng() As String = coordenada.Trim.Split(" "c)
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }}"
Else
Dim latlng() As String = coordenada.Trim.Split(" ")
Dim latlng() As String = coordenada.Trim.Split(" "c)
Var = $"{Var}{{lat: {latlng(1)}, lng: {latlng(0)} }},"
End If
Next
@@ -231,11 +229,11 @@ Partial Class GPS_Soporte
Private Sub CreaTmpDT(Opcion As String)
TmpDT = New DataTable
If Opcion = 1 Then
If Opcion = "1" Then
TmpDT.Columns.Add("Fecha", GetType(String))
TmpDT.Columns.Add("Valor", GetType(String))
TmpDT.Columns.Add("CveTrama", GetType(Integer))
ElseIf Opcion = 2 Then
ElseIf Opcion = "2" Then
TmpDT.Columns.Add("Trama", GetType(String))
TmpDT.Columns.Add("CveTrama", GetType(Integer))
End If
@@ -255,7 +253,7 @@ Partial Class GPS_Soporte
Protected Sub BtnCargaLog_Click(sender As Object, e As EventArgs) Handles BtnCargaLog.Click
Dim GPS As New ClsGPS
If GPS.DispositivosGet(DdlDispositivo.SelectedValue, -1, -1) AndAlso GPS.DtResultados.Rows.Count > 0 Then
If GPS.DispositivosGet(DdlDispositivo.SelectedValue.ToEntero, -1, -1) AndAlso GPS.DtResultados.Rows.Count > 0 Then
ltlSerieLog.Text = GPS.DtResultados.Rows(0)("Serie").ToString
Else
Alert("No se encontraron resultados con el equipo seleccionado", TipoMensaje.MsgAdvertencia)
@@ -278,10 +276,9 @@ Partial Class GPS_Soporte
Private Sub CargaLog()
Dim GPS As New ClsGPS
CreaTmpDT(2)
CreaTmpDT("2")
RegistraScript("DeleteMarkers();")
If DdlTipoConsultaLog.SelectedValue = "Last" Then
If GPS.GetRepDispositivo(DdlDispositivosLog.SelectedValue.ToEntero, MinFecha, MaxFecha) Then
If GPS.DtResultados.Rows.Count > 0 Then
@@ -330,7 +327,7 @@ Partial Class GPS_Soporte
If GPS.DtResultados.Rows.Count > 0 Then
Dim dr As DataRow = TmpDT.NewRow
For Each row As DataRow In GPS.DtResultados.Rows
Dim Coord As String = SQLToGmaps(row("Punto"), "POINT")
Dim Coord As String = SQLToGmaps(row("Punto").ToString, "POINT")
dr = TmpDT.NewRow
dr("Trama") = row("Trama").ToString
dr("CveTrama") = row("CveTrama").ToString
@@ -383,7 +380,7 @@ Partial Class GPS_Soporte
Protected Sub btnAgregar_Click(sender As Object, e As EventArgs) Handles btnAgregar.Click
Dim GPS As New ClsGPS
If GPS.DispositivosGet(-1, -1, DdlClientes.SelectedValue, UsuarioActual.CveEmpresa) Then
If GPS.DispositivosGet(-1, -1, DdlClientes.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GvConsultaM.DataSource = GPS.DtResultados
Else
GvConsultaM.DataSource = GPS.DtResultados