Commit inicial Ventas Productivo
This commit is contained in:
70
GPS/RepTemperaturas.aspx.vb
Normal file
70
GPS/RepTemperaturas.aspx.vb
Normal file
@@ -0,0 +1,70 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
|
||||
|
||||
Partial Class GPS_RepTemperaturas
|
||||
Inherits ClsPaginas
|
||||
|
||||
|
||||
Private Sub CargaDispositivos()
|
||||
Dim GPS As New ClsGPS
|
||||
|
||||
If GPS.DispositivosSensoresGet(-1, -1, UsuarioActual.CveCliente) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
DdlDispositivo.DataSource = GPS.DtResultados.FiltraParametros("CveTipoControl = 2", "CveDispositivo ASC", {"CveDispositivo", "NoEconomico"})
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DdlDispositivo.DataBind()
|
||||
UPFiltros.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaSensores()
|
||||
DdlSensores.Items.Clear()
|
||||
If DdlDispositivo.SelectedValue = "-1" Then
|
||||
DdlSensores.DataSource = Nothing
|
||||
DdlSensores.DataBind()
|
||||
DdlSensores.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
Else
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.DispositivosSensoresGet(DdlDispositivo.SelectedValue.ToEntero, 1, UsuarioActual.CveCliente) AndAlso GPS.DtResultados.Rows.Count > 0 Then
|
||||
DdlSensores.DataSource = GPS.DtResultados.FiltraParametros("CveTipoControl = 2", "CveDispositivo ASC")
|
||||
Else
|
||||
DdlSensores.DataSource = Nothing
|
||||
End If
|
||||
GPS.Dispose()
|
||||
DdlSensores.DataBind()
|
||||
DdlSensores.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
UPFiltros.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub DdlDispositivo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlDispositivo.SelectedIndexChanged
|
||||
CargaSensores()
|
||||
End Sub
|
||||
|
||||
Private Sub GPS_RepTemperaturas_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaDispositivos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
|
||||
Dim GPS As New ClsGPS
|
||||
If GPS.GetReporteTemperatura(DdlDispositivo.SelectedValue.ToEntero, DdlSensores.SelectedValue, -1, MinFecha, MaxFecha) Then
|
||||
GvDatos.DataSource = GPS.DtResultados
|
||||
If GPS.DtResultados.Rows.Count > 0 Then
|
||||
lblMinima.Text = $"{GPS.DtResultados.MIN("Temperatura")} {GPS.DtResultados.FiltroPrimeroValor("UnidadMedida")}"
|
||||
lblPromedio.Text = $"{GPS.DtResultados.AVG("Temperatura").ToString("#0.##")} {GPS.DtResultados.FiltroPrimeroValor("UnidadMedida")}"
|
||||
lblMaxima.Text = $"{GPS.DtResultados.MAX("Temperatura")} {GPS.DtResultados.FiltroPrimeroValor("UnidadMedida")}"
|
||||
lblTmpActual.Text = $"{GPS.DtResultados.FiltroPrimeroValor("Temperatura", "1 = 1", "FechaTrama DESC")} {GPS.DtResultados.FiltroPrimeroValor("UnidadMedida")}"
|
||||
End If
|
||||
End If
|
||||
GPS.Dispose()
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
UpIndicadores.Update()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user