E172 Rep Indicador Resumen: Agregar tabla de Indicadores agrupada por Proveedor
This commit is contained in:
@@ -77,6 +77,20 @@ Partial Class General_RepIndicadorResumen
|
||||
ViewState("CPxP") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property Indicadores As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("Indicadores") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("Indicadores"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("Indicadores") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtColor As DataTable
|
||||
Get
|
||||
@@ -126,7 +140,8 @@ Partial Class General_RepIndicadorResumen
|
||||
|
||||
Dim ObjVentas As New ClsVentas
|
||||
Dim ObjCompras As New ClsCompras
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
Dim ObjMovtos As New ClsMovimientos
|
||||
Dim ObjCitrus As New ClsCGame
|
||||
|
||||
If ObjVentas.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), MinFecha, MaxFecha, -1,
|
||||
-1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=1) Then
|
||||
@@ -177,17 +192,28 @@ Partial Class General_RepIndicadorResumen
|
||||
CPxP = Nothing
|
||||
End If
|
||||
|
||||
If ObjCitrus.GetIndicadores(UsuarioActual.CveEmpresa) Then
|
||||
|
||||
Indicadores = ObjCitrus.DtResultados
|
||||
GvIndicadores.DataSource = Indicadores
|
||||
Else
|
||||
GvIndicadores.DataSource = Nothing
|
||||
Indicadores = Nothing
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
ObjCompras.Dispose()
|
||||
ObjMovtos.Dispose()
|
||||
ObjCitrus.Dispose()
|
||||
|
||||
GvVxP.DataBind()
|
||||
GvCxP192.DataBind()
|
||||
GvCxP.DataBind()
|
||||
GvCCxC.DataBind()
|
||||
GvCPxP.DataBind()
|
||||
GvIndicadores.DataBind()
|
||||
|
||||
' Mostrar gráficos solo si hay datos en su respectiva tabla
|
||||
'Mostrar gráficos solo si hay datos en su respectiva tabla
|
||||
If GvVxP.Rows.Count > 0 Then
|
||||
UPGraficaVxP.Visible = True
|
||||
Else
|
||||
@@ -213,8 +239,13 @@ Partial Class General_RepIndicadorResumen
|
||||
Else
|
||||
UPGraficaCPxP.Visible = False
|
||||
End If
|
||||
'If GvIndicadores.Rows.Count > 0 Then
|
||||
' UPGraficaIndicadores.Visible = True
|
||||
'Else
|
||||
' UPGraficaIndicadores.Visible = False
|
||||
'End If
|
||||
|
||||
' Si no había datos en ninguna tabla no cargar función de gráficos
|
||||
'Si no había datos en ninguna tabla no cargar función de gráficos
|
||||
If (GvVxP.Rows.Count = 0 AndAlso GvCxP.Rows.Count = 0 AndAlso GvCxP192.Rows.Count = 0 AndAlso GvCCxC.Rows.Count = 0 AndAlso GvCPxP.Rows.Count = 0) Then Exit Sub
|
||||
GraficasPastel()
|
||||
'GraficasBarras()
|
||||
@@ -247,6 +278,13 @@ Partial Class General_RepIndicadorResumen
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub GvIndicadores_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvIndicadores.RowDataBound
|
||||
'If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
' If e.Row.DBCampo("Orden") = "" Then
|
||||
' e.Row.CssClass = "Totales"
|
||||
' End If
|
||||
'End If
|
||||
End Sub
|
||||
Private Sub CreaDataTableColor()
|
||||
DtColor = New DataTable
|
||||
DtColor.Columns.Add("Color")
|
||||
@@ -447,6 +485,8 @@ Partial Class General_RepIndicadorResumen
|
||||
Next
|
||||
Dim query_cpxp = From s In DtCPxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
||||
|
||||
'TODO: Indicadores x Proveedor -- Determinar qué poner en la gráfica con E172
|
||||
|
||||
'Serializar datos agrupándolos en su respectivo DataTable, todos en un solo JSON
|
||||
Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.VxP = query_vxp, .CxP = query_cxp, .CxP192 = query_cxp192, .CCxC = query_ccxc, .CPxP = query_cpxp})
|
||||
'Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.VxP = query_vxp, .CCxC = New String() {}})
|
||||
|
||||
Reference in New Issue
Block a user