Cambios Dashboard Graficas
This commit is contained in:
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)
|
||||
If e.Row.RowType = DataControlRowType.Header Then
|
||||
' Limpiar celdas originales
|
||||
e.Row.Cells.Clear()
|
||||
Dim grid As GridView = DirectCast(sender, GridView)
|
||||
|
||||
' Crear primera fila de encabezado (grupos)
|
||||
Dim headerRow As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||
' --- Fila 1 ---
|
||||
Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||
|
||||
' Celda para "Sucursal" (ocupa 2 filas)
|
||||
Dim cellSucursal As New TableHeaderCell()
|
||||
cellSucursal.RowSpan = 2
|
||||
cellSucursal.Text = "Sucursal"
|
||||
headerRow.Cells.Add(cellSucursal)
|
||||
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 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 cellAño As New TableHeaderCell()
|
||||
cellAño.ColumnSpan = 2
|
||||
cellAño.Text = "Año"
|
||||
headerRow.Cells.Add(cellAño)
|
||||
Dim cellAnio As New TableHeaderCell()
|
||||
cellAnio.ColumnSpan = 2
|
||||
cellAnio.HorizontalAlign = HorizontalAlign.Center
|
||||
cellAnio.Text = "Año"
|
||||
headerRow1.Cells.Add(cellAnio)
|
||||
|
||||
' Celda para "Mes" (abarca 2 columnas)
|
||||
Dim cellMes As New TableHeaderCell()
|
||||
cellMes.ColumnSpan = 2
|
||||
cellMes.HorizontalAlign = HorizontalAlign.Center
|
||||
cellMes.Text = "Mes"
|
||||
headerRow.Cells.Add(cellMes)
|
||||
headerRow1.Cells.Add(cellMes)
|
||||
|
||||
' Añadir fila al GridView
|
||||
Dim grid As GridView = DirectCast(sender, GridView)
|
||||
grid.Controls(0).Controls.AddAt(0, headerRow)
|
||||
headerRow1.TableSection = TableRowSection.TableHeader
|
||||
grid.Controls(0).Controls.AddAt(0, headerRow1)
|
||||
|
||||
' Crear segunda fila de encabezado (subtítulos)
|
||||
Dim subHeaderRow As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||
|
||||
' Subtítulos para "Año"
|
||||
subHeaderRow.Cells.Add(New TableHeaderCell() With {.Text = "Venta"})
|
||||
subHeaderRow.Cells.Add(New TableHeaderCell() With {.Text = "Utilidad"})
|
||||
|
||||
' 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)
|
||||
' --- Fila 2 ---
|
||||
Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal)
|
||||
headerRow2.Cells.Add(CreateSubHeaderCell("Venta", "chkVentaAnual", "VentaAnual"))
|
||||
headerRow2.Cells.Add(CreateSubHeaderCell("Utilidad", "chkUtilidadAnual", "UtilidadAnual"))
|
||||
headerRow2.Cells.Add(CreateSubHeaderCell("Venta", "chkVentaMensual", "VentaMensual"))
|
||||
headerRow2.Cells.Add(CreateSubHeaderCell("Utilidad", "chkUtilidadMensual", "UtilidadMensual"))
|
||||
|
||||
headerRow2.TableSection = TableRowSection.TableHeader
|
||||
grid.Controls(0).Controls.AddAt(1, headerRow2)
|
||||
End If
|
||||
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)
|
||||
If dt Is Nothing OrElse dt.Rows.Count = 0 Then
|
||||
|
||||
Reference in New Issue
Block a user