This commit is contained in:
@@ -4,8 +4,8 @@ Option Strict On
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Partial Class Contabilidad2_RepAnexoCatalogoCC
|
||||
Inherits ClsPaginas
|
||||
|
||||
Inherits ClsPaginas
|
||||
|
||||
#Region " PROPIEDADES "
|
||||
Public Property CveCuenta As Integer
|
||||
Get
|
||||
@@ -14,12 +14,44 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
|
||||
Set(value As Integer)
|
||||
ViewState("CveCuenta") = value
|
||||
End Set
|
||||
End Property
|
||||
End Property
|
||||
Private Property listacolores As List(Of String)
|
||||
Get
|
||||
Return DirectCast(ViewState("listacolores"), List(Of String))
|
||||
End Get
|
||||
Set(value As List(Of String))
|
||||
ViewState("listacolores") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property listaCampos As List(Of String())
|
||||
Get
|
||||
Return DirectCast(ViewState("listaCampos"), List(Of String()))
|
||||
End Get
|
||||
Set(value As List(Of String()))
|
||||
ViewState("listaCampos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
If Not IsPostBack Then
|
||||
|
||||
listacolores = New List(Of String)
|
||||
listaCampos = New List(Of String())
|
||||
listacolores.Add("#FF0F00")
|
||||
listacolores.Add("#FF6600")
|
||||
listacolores.Add("#F8FF01")
|
||||
listacolores.Add("#04D215")
|
||||
listacolores.Add("#2A0CD0")
|
||||
listacolores.Add("#8A0CCF")
|
||||
listacolores.Add("#CD0D74")
|
||||
listacolores.Add("#754DEB")
|
||||
listacolores.Add("#DDDDDD")
|
||||
listacolores.Add("#999999")
|
||||
listacolores.Add("#000000")
|
||||
listacolores.Add("#FF0F00")
|
||||
'Dim EjercicioParametro, SubProyectoParametro, DivisorParametro As Integer
|
||||
'CveCuenta = IfNull(Request("C"), "-1").ToString.ToEntero
|
||||
'EjercicioParametro = IfNull(Request("E"), "-1").ToString.ToEntero
|
||||
@@ -91,17 +123,19 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
|
||||
Dim Index = 4
|
||||
For Index = 4 To GvCC.Columns.Count - 1
|
||||
GvCC.Columns(Index).Visible = False
|
||||
Next Index
|
||||
Next Index
|
||||
listaCampos.Clear()
|
||||
|
||||
Index = 4
|
||||
For Each Dr As DataRow In DtHeaders.Rows
|
||||
GvCC.Columns(Index).Visible = True
|
||||
CType(GvCC.Columns(Index), BoundField).DataField = $"SubProyecto{Dr("SubProyecto").ToString}"
|
||||
GvCC.Columns(Index).HeaderText = Dr("SubProyecto").ToString
|
||||
CType(GvCC.Columns(Index), BoundField).DataField = String.Format("SubProyecto{0}", Dr("SubProyecto"))
|
||||
GvCC.Columns(Index).HeaderText = Dr("SubProyecto").ToString()
|
||||
listaCampos.Add(New String() {String.Format("SubProyecto{0}", Dr("SubProyecto")), Dr("SubProyecto").ToString()})
|
||||
|
||||
|
||||
GvCC.Columns(Index + 1).Visible = True
|
||||
CType(GvCC.Columns(Index + 1), BoundField).DataField = $"SubProyecto{Dr("SubProyecto").ToString}Porcentaje"
|
||||
CType(GvCC.Columns(Index + 1), BoundField).DataField = String.Format("SubProyecto{0}Porcentaje", Dr("SubProyecto"))
|
||||
GvCC.Columns(Index + 1).HeaderText = "%"
|
||||
|
||||
Index += 2
|
||||
@@ -124,11 +158,11 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
|
||||
|
||||
RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});")
|
||||
Conta.Dispose()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
#Region " GV ROW DATABOUND "
|
||||
Protected Sub GvCC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvCC.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
@@ -136,11 +170,24 @@ Partial Class Contabilidad2_RepAnexoCatalogoCC
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.Style.Add("font-weight", "bold")
|
||||
End If
|
||||
|
||||
e.Row.Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
|
||||
setgraficaCC(e)
|
||||
e.Row.Cells(1).Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub setgraficaCC(e As GridViewRowEventArgs)
|
||||
Dim lista As New List(Of Object)
|
||||
Dim colorindex As Integer = 0
|
||||
For Each campo As String() In listaCampos
|
||||
lista.Add(New With {.Texto = campo(1), .Valor = e.Row.DBCampo(campo(0)).ToDecimal(), .Color = listacolores(colorindex)})
|
||||
colorindex = colorindex + 1
|
||||
If colorindex >= listacolores.Count Then
|
||||
colorindex = 0
|
||||
End If
|
||||
Next
|
||||
e.Row.FCHyperLink("Hypgrafica").Attributes.Add("data-values", Newtonsoft.Json.JsonConvert.SerializeObject(lista))
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
|
||||
Reference in New Issue
Block a user