Cambios Dashboard Graficas
This commit is contained in:
@@ -748,55 +748,55 @@ Public Class ClsGenerales
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
'#Region " E S T A D O S"
|
'#Region " E S T A D O S"
|
||||||
' Public Function GetGralEstados() As Boolean
|
' Public Function GetGralEstados() As Boolean
|
||||||
' Dim Retorno As Boolean = False
|
' Dim Retorno As Boolean = False
|
||||||
' DataAdapter("PA_Gral_EstadoGet")
|
' DataAdapter("PA_Gral_EstadoGet")
|
||||||
' Try
|
' Try
|
||||||
' SqlAdapter.Fill(Data)
|
' SqlAdapter.Fill(Data)
|
||||||
' Retorno = True
|
' Retorno = True
|
||||||
' Catch ex As Exception
|
' Catch ex As Exception
|
||||||
' OnError("Ocurrió un error al obtener el Catálogo de Estados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
' OnError("Ocurrió un error al obtener el Catálogo de Estados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
' End Try
|
' End Try
|
||||||
|
|
||||||
' Return Retorno
|
' Return Retorno
|
||||||
' End Function
|
' End Function
|
||||||
'#End Region
|
'#End Region
|
||||||
|
|
||||||
'#Region " M U N I C I P I O S"
|
'#Region " M U N I C I P I O S"
|
||||||
' Public Function GetGralMunicipios() As Boolean
|
' Public Function GetGralMunicipios() As Boolean
|
||||||
' Dim Retorno As Boolean = False
|
' Dim Retorno As Boolean = False
|
||||||
' DataAdapter("PA_Gral_MunicipioGet")
|
' DataAdapter("PA_Gral_MunicipioGet")
|
||||||
' Try
|
' Try
|
||||||
' SqlAdapter.Fill(Data)
|
' SqlAdapter.Fill(Data)
|
||||||
' Retorno = True
|
' Retorno = True
|
||||||
' Catch ex As Exception
|
' Catch ex As Exception
|
||||||
' OnError("Ocurrió un error al obtener el Catálogo de Municipios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
' OnError("Ocurrió un error al obtener el Catálogo de Municipios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
' End Try
|
' End Try
|
||||||
|
|
||||||
' Return Retorno
|
' Return Retorno
|
||||||
' End Function
|
' End Function
|
||||||
'#End Region
|
'#End Region
|
||||||
|
|
||||||
'#Region " P A I S E S"
|
'#Region " P A I S E S"
|
||||||
' Public Function GetGralPaises() As Boolean
|
' Public Function GetGralPaises() As Boolean
|
||||||
' Dim Retorno As Boolean = False
|
' Dim Retorno As Boolean = False
|
||||||
' DataAdapter("PA_Gral_PaisGet")
|
' DataAdapter("PA_Gral_PaisGet")
|
||||||
' Try
|
' Try
|
||||||
' SqlAdapter.Fill(Data)
|
' SqlAdapter.Fill(Data)
|
||||||
' Retorno = True
|
' Retorno = True
|
||||||
' Catch ex As Exception
|
' Catch ex As Exception
|
||||||
' OnError("Ocurrió un error al obtener el Catálogo de Paises.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
' OnError("Ocurrió un error al obtener el Catálogo de Paises.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
' End Try
|
' End Try
|
||||||
|
|
||||||
' Return Retorno
|
' Return Retorno
|
||||||
' End Function
|
' End Function
|
||||||
'#End Region
|
'#End Region
|
||||||
|
|
||||||
#Region " P O B L A C I O N E S"
|
#Region " P O B L A C I O N E S"
|
||||||
Public Function GetGralPoblaciones() As Boolean
|
Public Function GetGralPoblaciones() As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|||||||
@@ -574,7 +574,7 @@
|
|||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
function LimpiaCeros(Divisor) {
|
function LimpiaCeros(Divisor) {
|
||||||
$('.ceros').each(function (i, obj) {
|
$('.ceros').each(function (i, obj) {
|
||||||
|
|
||||||
if ($(this).html() == '0.00' || $(this).html() == '0.00%') {
|
if ($(this).html() == '0.00' || $(this).html() == '0.00%') {
|
||||||
$(this).html('-');
|
$(this).html('-');
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -373,50 +373,411 @@ Partial Class General_Dashboard
|
|||||||
|
|
||||||
Protected Sub gvResumenSucursales_RowCreated(sender As Object, e As GridViewRowEventArgs)
|
Protected Sub gvResumenSucursales_RowCreated(sender As Object, e As GridViewRowEventArgs)
|
||||||
If e.Row.RowType = DataControlRowType.Header Then
|
If e.Row.RowType = DataControlRowType.Header Then
|
||||||
' Limpiar celdas originales
|
|
||||||
e.Row.Cells.Clear()
|
e.Row.Cells.Clear()
|
||||||
|
Dim grid As GridView = DirectCast(sender, GridView)
|
||||||
|
|
||||||
' Crear primera fila de encabezado (grupos)
|
' --- Fila 1 ---
|
||||||
Dim headerRow As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
' Celda para "Sucursal" (ocupa 2 filas)
|
|
||||||
Dim cellSucursal As New TableHeaderCell()
|
Dim cellSucursal As New TableHeaderCell()
|
||||||
cellSucursal.RowSpan = 2
|
cellSucursal.RowSpan = 2
|
||||||
cellSucursal.Text = "Sucursal"
|
cellSucursal.VerticalAlign = VerticalAlign.Middle
|
||||||
headerRow.Cells.Add(cellSucursal)
|
cellSucursal.Controls.Add(New LiteralControl("<span>Sucursal</span> "))
|
||||||
|
Dim hypGrafica As New HyperLink()
|
||||||
|
hypGrafica.NavigateUrl = "javascript:void(0);"
|
||||||
|
hypGrafica.Attributes.Add("onclick", "return generarGraficaSucursales();")
|
||||||
|
hypGrafica.CssClass = "grafica-icon"
|
||||||
|
hypGrafica.Controls.Add(New LiteralControl("<i class='fa fa-bar-chart'></i>"))
|
||||||
|
cellSucursal.Controls.Add(hypGrafica)
|
||||||
|
headerRow1.Cells.Add(cellSucursal)
|
||||||
|
|
||||||
' Celda para "Año" (abarca 2 columnas)
|
Dim cellAnio As New TableHeaderCell()
|
||||||
Dim cellAño As New TableHeaderCell()
|
cellAnio.ColumnSpan = 2
|
||||||
cellAño.ColumnSpan = 2
|
cellAnio.HorizontalAlign = HorizontalAlign.Center
|
||||||
cellAño.Text = "Año"
|
cellAnio.Text = "Año"
|
||||||
headerRow.Cells.Add(cellAño)
|
headerRow1.Cells.Add(cellAnio)
|
||||||
|
|
||||||
' Celda para "Mes" (abarca 2 columnas)
|
|
||||||
Dim cellMes As New TableHeaderCell()
|
Dim cellMes As New TableHeaderCell()
|
||||||
cellMes.ColumnSpan = 2
|
cellMes.ColumnSpan = 2
|
||||||
|
cellMes.HorizontalAlign = HorizontalAlign.Center
|
||||||
cellMes.Text = "Mes"
|
cellMes.Text = "Mes"
|
||||||
headerRow.Cells.Add(cellMes)
|
headerRow1.Cells.Add(cellMes)
|
||||||
|
|
||||||
' Añadir fila al GridView
|
headerRow1.TableSection = TableRowSection.TableHeader
|
||||||
Dim grid As GridView = DirectCast(sender, GridView)
|
grid.Controls(0).Controls.AddAt(0, headerRow1)
|
||||||
grid.Controls(0).Controls.AddAt(0, headerRow)
|
|
||||||
|
|
||||||
' Crear segunda fila de encabezado (subtítulos)
|
' --- Fila 2 ---
|
||||||
Dim subHeaderRow As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Venta", "chkVentaAnual", "VentaAnual"))
|
||||||
' Subtítulos para "Año"
|
headerRow2.Cells.Add(CreateSubHeaderCell("Utilidad", "chkUtilidadAnual", "UtilidadAnual"))
|
||||||
subHeaderRow.Cells.Add(New TableHeaderCell() With {.Text = "Venta"})
|
headerRow2.Cells.Add(CreateSubHeaderCell("Venta", "chkVentaMensual", "VentaMensual"))
|
||||||
subHeaderRow.Cells.Add(New TableHeaderCell() With {.Text = "Utilidad"})
|
headerRow2.Cells.Add(CreateSubHeaderCell("Utilidad", "chkUtilidadMensual", "UtilidadMensual"))
|
||||||
|
|
||||||
' Subtítulos para "Mes"
|
|
||||||
subHeaderRow.Cells.Add(New TableHeaderCell() With {.Text = "Venta"})
|
|
||||||
subHeaderRow.Cells.Add(New TableHeaderCell() With {.Text = "Utilidad"})
|
|
||||||
|
|
||||||
grid.Controls(0).Controls.AddAt(1, subHeaderRow)
|
|
||||||
|
|
||||||
|
headerRow2.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(1, headerRow2)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub gvVentasPorSucursal_RowCreated(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
If e.Row.RowType = DataControlRowType.Header Then
|
||||||
|
e.Row.Cells.Clear()
|
||||||
|
Dim grid As GridView = DirectCast(sender, GridView)
|
||||||
|
|
||||||
|
' --- Fila 1 ---
|
||||||
|
Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Celda principal (Sucursal)
|
||||||
|
Dim cellSucursal As New TableHeaderCell()
|
||||||
|
cellSucursal.RowSpan = 2
|
||||||
|
cellSucursal.VerticalAlign = VerticalAlign.Middle
|
||||||
|
cellSucursal.Controls.Add(New LiteralControl("<span>Sucursal</span> "))
|
||||||
|
Dim hypGrafica As New HyperLink()
|
||||||
|
hypGrafica.NavigateUrl = "javascript:void(0);"
|
||||||
|
hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');")
|
||||||
|
hypGrafica.CssClass = "grafica-icon"
|
||||||
|
hypGrafica.Controls.Add(New LiteralControl("<i class='fa fa-bar-chart'></i>"))
|
||||||
|
cellSucursal.Controls.Add(hypGrafica)
|
||||||
|
headerRow1.Cells.Add(cellSucursal)
|
||||||
|
|
||||||
|
headerRow1.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(0, headerRow1)
|
||||||
|
|
||||||
|
' --- Fila 2 (Subheaders) ---
|
||||||
|
Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Subheaders con checkboxes
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Año", "chkAño", "Año"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Mes", "chkMes", "Mes"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Semana", "chkSemana", "Semana"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Día", "chkDia", "Dia"))
|
||||||
|
|
||||||
|
headerRow2.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(1, headerRow2)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub gvVentasPorVendedor_RowCreated(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
If e.Row.RowType = DataControlRowType.Header Then
|
||||||
|
e.Row.Cells.Clear()
|
||||||
|
Dim grid As GridView = DirectCast(sender, GridView)
|
||||||
|
|
||||||
|
' --- Fila 1 ---
|
||||||
|
Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Celda principal (Sucursal)
|
||||||
|
Dim cellSucursal As New TableHeaderCell()
|
||||||
|
cellSucursal.RowSpan = 2
|
||||||
|
cellSucursal.VerticalAlign = VerticalAlign.Middle
|
||||||
|
cellSucursal.Controls.Add(New LiteralControl("<span>Vendedor</span> "))
|
||||||
|
Dim hypGrafica As New HyperLink()
|
||||||
|
hypGrafica.NavigateUrl = "javascript:void(0);"
|
||||||
|
hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');")
|
||||||
|
hypGrafica.CssClass = "grafica-icon"
|
||||||
|
hypGrafica.Controls.Add(New LiteralControl("<i class='fa fa-bar-chart'></i>"))
|
||||||
|
cellSucursal.Controls.Add(hypGrafica)
|
||||||
|
headerRow1.Cells.Add(cellSucursal)
|
||||||
|
|
||||||
|
headerRow1.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(0, headerRow1)
|
||||||
|
|
||||||
|
' --- Fila 2 (Subheaders) ---
|
||||||
|
Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Subheaders con checkboxes
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Año", "chkAño", "Año"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Mes", "chkMes", "Mes"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Semana", "chkSemana", "Semana"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Día", "chkDia", "Dia"))
|
||||||
|
|
||||||
|
headerRow2.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(1, headerRow2)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub gvVentasPorClasificacion_RowCreated(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
If e.Row.RowType = DataControlRowType.Header Then
|
||||||
|
e.Row.Cells.Clear()
|
||||||
|
Dim grid As GridView = DirectCast(sender, GridView)
|
||||||
|
|
||||||
|
' --- Fila 1 ---
|
||||||
|
Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Celda principal (Sucursal)
|
||||||
|
Dim cellSucursal As New TableHeaderCell()
|
||||||
|
cellSucursal.RowSpan = 2
|
||||||
|
cellSucursal.VerticalAlign = VerticalAlign.Middle
|
||||||
|
cellSucursal.Controls.Add(New LiteralControl("<span>Clasificación</span> "))
|
||||||
|
Dim hypGrafica As New HyperLink()
|
||||||
|
hypGrafica.NavigateUrl = "javascript:void(0);"
|
||||||
|
hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');")
|
||||||
|
hypGrafica.CssClass = "grafica-icon"
|
||||||
|
hypGrafica.Controls.Add(New LiteralControl("<i class='fa fa-bar-chart'></i>"))
|
||||||
|
cellSucursal.Controls.Add(hypGrafica)
|
||||||
|
headerRow1.Cells.Add(cellSucursal)
|
||||||
|
|
||||||
|
headerRow1.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(0, headerRow1)
|
||||||
|
|
||||||
|
' --- Fila 2 (Subheaders) ---
|
||||||
|
Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Subheaders con checkboxes
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Año", "chkAño", "Año"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Mes", "chkMes", "Mes"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Semana", "chkSemana", "Semana"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Día", "chkDia", "Dia"))
|
||||||
|
|
||||||
|
headerRow2.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(1, headerRow2)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub gvVentasPorMarca_RowCreated(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
If e.Row.RowType = DataControlRowType.Header Then
|
||||||
|
e.Row.Cells.Clear()
|
||||||
|
Dim grid As GridView = DirectCast(sender, GridView)
|
||||||
|
|
||||||
|
' --- Fila 1 ---
|
||||||
|
Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Celda principal (Sucursal)
|
||||||
|
Dim cellSucursal As New TableHeaderCell()
|
||||||
|
cellSucursal.RowSpan = 2
|
||||||
|
cellSucursal.VerticalAlign = VerticalAlign.Middle
|
||||||
|
cellSucursal.Controls.Add(New LiteralControl("<span>Marca</span> "))
|
||||||
|
Dim hypGrafica As New HyperLink()
|
||||||
|
hypGrafica.NavigateUrl = "javascript:void(0);"
|
||||||
|
hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');")
|
||||||
|
hypGrafica.CssClass = "grafica-icon"
|
||||||
|
hypGrafica.Controls.Add(New LiteralControl("<i class='fa fa-bar-chart'></i>"))
|
||||||
|
cellSucursal.Controls.Add(hypGrafica)
|
||||||
|
headerRow1.Cells.Add(cellSucursal)
|
||||||
|
|
||||||
|
headerRow1.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(0, headerRow1)
|
||||||
|
|
||||||
|
' --- Fila 2 (Subheaders) ---
|
||||||
|
Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Subheaders con checkboxes
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Año", "chkAño", "Año"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Mes", "chkMes", "Mes"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Semana", "chkSemana", "Semana"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Día", "chkDia", "Dia"))
|
||||||
|
|
||||||
|
headerRow2.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(1, headerRow2)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub gvVentasPorPS_RowCreated(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
If e.Row.RowType = DataControlRowType.Header Then
|
||||||
|
e.Row.Cells.Clear()
|
||||||
|
Dim grid As GridView = DirectCast(sender, GridView)
|
||||||
|
|
||||||
|
' --- Fila 1 ---
|
||||||
|
Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Celda principal (Sucursal)
|
||||||
|
Dim cellSucursal As New TableHeaderCell()
|
||||||
|
cellSucursal.RowSpan = 2
|
||||||
|
cellSucursal.VerticalAlign = VerticalAlign.Middle
|
||||||
|
cellSucursal.Controls.Add(New LiteralControl("<span>PS</span> "))
|
||||||
|
Dim hypGrafica As New HyperLink()
|
||||||
|
hypGrafica.NavigateUrl = "javascript:void(0);"
|
||||||
|
hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');")
|
||||||
|
hypGrafica.CssClass = "grafica-icon"
|
||||||
|
hypGrafica.Controls.Add(New LiteralControl("<i class='fa fa-bar-chart'></i>"))
|
||||||
|
cellSucursal.Controls.Add(hypGrafica)
|
||||||
|
headerRow1.Cells.Add(cellSucursal)
|
||||||
|
|
||||||
|
headerRow1.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(0, headerRow1)
|
||||||
|
|
||||||
|
' --- Fila 2 (Subheaders) ---
|
||||||
|
Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Subheaders con checkboxes
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Año", "chkAño", "Año"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Mes", "chkMes", "Mes"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Semana", "chkSemana", "Semana"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Día", "chkDia", "Dia"))
|
||||||
|
|
||||||
|
headerRow2.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(1, headerRow2)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub gvVentasPorCliente_RowCreated(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
If e.Row.RowType = DataControlRowType.Header Then
|
||||||
|
e.Row.Cells.Clear()
|
||||||
|
Dim grid As GridView = DirectCast(sender, GridView)
|
||||||
|
|
||||||
|
' --- Fila 1 ---
|
||||||
|
Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Celda principal (Sucursal)
|
||||||
|
Dim cellSucursal As New TableHeaderCell()
|
||||||
|
cellSucursal.RowSpan = 2
|
||||||
|
cellSucursal.VerticalAlign = VerticalAlign.Middle
|
||||||
|
cellSucursal.Controls.Add(New LiteralControl("<span>Cliente</span> "))
|
||||||
|
Dim hypGrafica As New HyperLink()
|
||||||
|
hypGrafica.NavigateUrl = "javascript:void(0);"
|
||||||
|
hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');")
|
||||||
|
hypGrafica.CssClass = "grafica-icon"
|
||||||
|
hypGrafica.Controls.Add(New LiteralControl("<i class='fa fa-bar-chart'></i>"))
|
||||||
|
cellSucursal.Controls.Add(hypGrafica)
|
||||||
|
headerRow1.Cells.Add(cellSucursal)
|
||||||
|
|
||||||
|
headerRow1.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(0, headerRow1)
|
||||||
|
|
||||||
|
' --- Fila 2 (Subheaders) ---
|
||||||
|
Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Subheaders con checkboxes
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Año", "chkAño", "Año"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Mes", "chkMes", "Mes"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Semana", "chkSemana", "Semana"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Día", "chkDia", "Dia"))
|
||||||
|
|
||||||
|
headerRow2.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(1, headerRow2)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub gvVentasPorProveedor_RowCreated(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
If e.Row.RowType = DataControlRowType.Header Then
|
||||||
|
e.Row.Cells.Clear()
|
||||||
|
Dim grid As GridView = DirectCast(sender, GridView)
|
||||||
|
|
||||||
|
' --- Fila 1 ---
|
||||||
|
Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Celda principal (Sucursal)
|
||||||
|
Dim cellSucursal As New TableHeaderCell()
|
||||||
|
cellSucursal.RowSpan = 2
|
||||||
|
cellSucursal.VerticalAlign = VerticalAlign.Middle
|
||||||
|
cellSucursal.Controls.Add(New LiteralControl("<span>Proveedor</span> "))
|
||||||
|
Dim hypGrafica As New HyperLink()
|
||||||
|
hypGrafica.NavigateUrl = "javascript:void(0);"
|
||||||
|
hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');")
|
||||||
|
hypGrafica.CssClass = "grafica-icon"
|
||||||
|
hypGrafica.Controls.Add(New LiteralControl("<i class='fa fa-bar-chart'></i>"))
|
||||||
|
cellSucursal.Controls.Add(hypGrafica)
|
||||||
|
headerRow1.Cells.Add(cellSucursal)
|
||||||
|
|
||||||
|
headerRow1.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(0, headerRow1)
|
||||||
|
|
||||||
|
' --- Fila 2 (Subheaders) ---
|
||||||
|
Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Subheaders con checkboxes
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Año", "chkAño", "Año"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Mes", "chkMes", "Mes"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Semana", "chkSemana", "Semana"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Día", "chkDia", "Dia"))
|
||||||
|
|
||||||
|
headerRow2.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(1, headerRow2)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub gvCarteraPorSucursal_RowCreated(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
If e.Row.RowType = DataControlRowType.Header Then
|
||||||
|
e.Row.Cells.Clear()
|
||||||
|
Dim grid As GridView = DirectCast(sender, GridView)
|
||||||
|
|
||||||
|
' --- Fila 1 ---
|
||||||
|
Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Celda principal (Sucursal)
|
||||||
|
Dim cellSucursal As New TableHeaderCell()
|
||||||
|
cellSucursal.RowSpan = 2
|
||||||
|
cellSucursal.VerticalAlign = VerticalAlign.Middle
|
||||||
|
cellSucursal.Controls.Add(New LiteralControl("<span>Sucursal</span> "))
|
||||||
|
Dim hypGrafica As New HyperLink()
|
||||||
|
hypGrafica.NavigateUrl = "javascript:void(0);"
|
||||||
|
hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');")
|
||||||
|
hypGrafica.CssClass = "grafica-icon"
|
||||||
|
hypGrafica.Controls.Add(New LiteralControl("<i class='fa fa-bar-chart'></i>"))
|
||||||
|
cellSucursal.Controls.Add(hypGrafica)
|
||||||
|
headerRow1.Cells.Add(cellSucursal)
|
||||||
|
|
||||||
|
headerRow1.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(0, headerRow1)
|
||||||
|
|
||||||
|
' --- Fila 2 (Subheaders) ---
|
||||||
|
Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Subheaders con checkboxes
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("TotalCxC", "chkTotalCxC", "Total CxC"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Vencido", "chkVencido", "Vencido"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("PorVencer", "chkPorVencer", "Por Vencer"))
|
||||||
|
|
||||||
|
headerRow2.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(1, headerRow2)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub gvCarteraPorVendedor_RowCreated(sender As Object, e As GridViewRowEventArgs)
|
||||||
|
If e.Row.RowType = DataControlRowType.Header Then
|
||||||
|
e.Row.Cells.Clear()
|
||||||
|
Dim grid As GridView = DirectCast(sender, GridView)
|
||||||
|
|
||||||
|
' --- Fila 1 ---
|
||||||
|
Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Celda principal (Sucursal)
|
||||||
|
Dim cellSucursal As New TableHeaderCell()
|
||||||
|
cellSucursal.RowSpan = 2
|
||||||
|
cellSucursal.VerticalAlign = VerticalAlign.Middle
|
||||||
|
cellSucursal.Controls.Add(New LiteralControl("<span>Vendedor</span> "))
|
||||||
|
Dim hypGrafica As New HyperLink()
|
||||||
|
hypGrafica.NavigateUrl = "javascript:void(0);"
|
||||||
|
hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');")
|
||||||
|
hypGrafica.CssClass = "grafica-icon"
|
||||||
|
hypGrafica.Controls.Add(New LiteralControl("<i class='fa fa-bar-chart'></i>"))
|
||||||
|
cellSucursal.Controls.Add(hypGrafica)
|
||||||
|
headerRow1.Cells.Add(cellSucursal)
|
||||||
|
|
||||||
|
headerRow1.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(0, headerRow1)
|
||||||
|
|
||||||
|
' --- Fila 2 (Subheaders) ---
|
||||||
|
Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||||
|
|
||||||
|
' Subheaders con checkboxes
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("TotalCxC", "chkTotalCxC", "Total CxC"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("Vencido", "chkVencido", "Vencido"))
|
||||||
|
headerRow2.Cells.Add(CreateSubHeaderCell("PorVencer", "chkPorVencer", "Por Vencer"))
|
||||||
|
|
||||||
|
headerRow2.TableSection = TableRowSection.TableHeader
|
||||||
|
grid.Controls(0).Controls.AddAt(1, headerRow2)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' Ahora emitimos HTML puro para el checkbox + label,
|
||||||
|
''' así el label realmente dispara el toggle del input.
|
||||||
|
''' </summary>
|
||||||
|
Private Function CreateSubHeaderCell(text As String, checkboxId As String, dataField As String) As TableHeaderCell
|
||||||
|
Dim cell As New TableHeaderCell()
|
||||||
|
cell.HorizontalAlign = HorizontalAlign.Center
|
||||||
|
|
||||||
|
' Construimos un pequeño bloque HTML con <input> y <label for="">
|
||||||
|
Dim html As String = $"
|
||||||
|
<div style='display:flex;flex-direction:column;align-items:center;'>
|
||||||
|
<span>{text}</span>
|
||||||
|
<div>
|
||||||
|
<input type='checkbox' id='{checkboxId}' class='header-checkbox' data-field='{dataField}' />
|
||||||
|
<label for='{checkboxId}'</label>
|
||||||
|
</div>
|
||||||
|
</div>"
|
||||||
|
cell.Controls.Add(New LiteralControl(html))
|
||||||
|
Return cell
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Sub CargarVentasPorSucursal(dt As DataTable)
|
Private Sub CargarVentasPorSucursal(dt As DataTable)
|
||||||
If dt Is Nothing OrElse dt.Rows.Count = 0 Then
|
If dt Is Nothing OrElse dt.Rows.Count = 0 Then
|
||||||
|
|||||||
Reference in New Issue
Block a user