Esta de resultados y anexos, Links en deatalles

This commit is contained in:
Rakcsle Supertramp
2020-09-21 10:50:46 -07:00
parent ce00578a34
commit 47d830f8f9
8 changed files with 3118 additions and 2670 deletions

View File

@@ -42,6 +42,63 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
End Set
End Property
Public Property DtHeadersCount As Integer
Get
If ViewState("DtHeadersCount") Is Nothing Then
Return -1
Else
Return ViewState("DtHeadersCount").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("DtHeadersCount") = value
End Set
End Property
Private Property DTHeaders As DataTable
Get
If ViewState("DTHeaders") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("DTHeaders"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("DTHeaders") = value
End Set
End Property
Private Property DTDatos As DataTable
Get
If ViewState("DTDatos") Is Nothing Then
Return New DataTable
Else
Return DirectCast(ViewState("DTDatos"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("DTDatos") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -121,20 +178,33 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
Protected Sub BtnCargaAsignados_Click(sender As Object, e As EventArgs) Handles BtnCargaAsignados.Click
CargaDatos()
End Sub
Private Sub CargaDatos()
Private Sub CargaDatos()
DTHeaders = New DataTable
DTDatos = New DataTable
Dim Conta As New ClsContabilidad
DtHeadersCount = 0
If Conta.GetAnexoCatalogoAnual(CveCuenta, DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlEjercicio2.SelectedValue.ToEntero, DdlDivisor.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlPeriodo.SelectedValue.ToEntero) Then
Dim DtHeaders As DataTable = Conta.DSResultados.Tables(0)
'Dim DtHeaders As DataTable = Conta.DSResultados.Tables(0)
DTHeaders = Conta.DSResultados.Tables(0)
DTDatos = Conta.DSResultados.Tables(1)
DtHeadersCount = DTHeaders.Rows.Count
GvAnual.DataSource = Conta.DSResultados.Tables(1)
Dim Index = 2
For Index = 2 To GvAnual.Columns.Count - 1
GvAnual.Columns(Index).Visible = False
Next Index
listaCamposanios.Clear()
Index = 2
For Each Dr As DataRow In DtHeaders.Rows
For Each Dr As DataRow In DTHeaders.Rows
GvAnual.Columns(Index).Visible = True
CType(GvAnual.Columns(Index), BoundField).DataField = String.Format("Ejercicio{0}", Dr("Ejercicio"))
GvAnual.Columns(Index).HeaderText = Dr("Ejercicio").ToString
@@ -166,7 +236,9 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
UpAnual.Update()
'RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});")
RegistraScript($"LimpiaCeros();")
'RegistraScript($"LimpiaCeros();")
Conta.Dispose()
@@ -191,10 +263,61 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
setgraficaCC(e)
If e.Row.RowIndex = 0 Then
e.Row.Style.Add("font-weight", "bold")
End If
e.Row.Cells(1).Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
End If
If e.Row.DataKey("Level").ToEntero = 0 Then
e.Row.CssClass = "Totales"
End If
If e.Row.DataKey("Level").ToEntero = 1 Then
e.Row.CssClass = "SubTotales"
End If
Dim CveCunetaRow As Integer = e.Row.DataKey("CveCuenta").ToEntero
Dim inicial As Boolean = True
Dim Index As Integer = 2
For Each DRow As DataRow In DTHeaders.Rows
Dim Importe As Decimal = e.Row.DBCampo($"Ejercicio{DRow("Ejercicio")}").ToDecimal
Dim Anio As Integer = DRow("Ejercicio").ToString.ToEntero
If Importe <> 0 Then
e.Row.Cells(Index).Text = $"<a { If(Importe < 0, "style='color:Red;'", "style='color:#337ab7;'") } target='_blank' href='./RepAnexoCatalogo.aspx?CveCuenta={CveCunetaRow}&FF=31/12/{Anio}&FI=01/01/{Anio}&ER=1&CveSubProyecto={DdlSubProyecto.SelectedValue.ToEntero}' >{ If(DdlDivisor.SelectedValue.ToEntero > 1, Importe.ToString("###,###,##0"), Importe.ToString("###,###,###.00")) }</a>"
End If
If e.Row.Cells(Index + 1).Text.ToDecimal = 0 Then
e.Row.Cells(Index + 1).Text = "-"
ElseIf e.Row.Cells(Index + 1).Text.ToDecimal < 0 Then
e.Row.Cells(Index + 1).ForeColor = Drawing.Color.Red
End If
If e.Row.Cells(Index + 2).Text.Replace("%", "").ToDecimal = 0 Then
e.Row.Cells(Index + 2).Text = "-"
ElseIf e.Row.Cells(Index + 2).Text.Replace("%", "").ToDecimal < 0 Then
e.Row.Cells(Index + 2).ForeColor = Drawing.Color.Red
End If
'If inicial Then
' Index = Indice + 1
' inicial = False
' Continue For
'End If
Index += 3
Next
'e.Row.Cells(1).Style.Add("text-indent", $"{e.Row.DBCampo("Level").ToString.ToEntero * 2}em")
End If
End Sub
@@ -231,4 +354,56 @@ Partial Class Contabilidad2_RepAnexoCatalogoAnual
Protected Sub GvAnual_DataBound(sender As Object, e As EventArgs)
'If DtHeadersCount > 0 Then
' '96 32
' Dim NColumns As Integer = GvAnual.Columns.Count
' Dim row As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal)
' Dim cell1 As New TableHeaderCell()
' cell1.Text = ""
' cell1.ColumnSpan = 1
' row.Controls.Add(cell1)
' Dim cell2 As New TableHeaderCell()
' cell2.Text = ""
' cell2.ColumnSpan = 1
' row.Controls.Add(cell2)
' Dim cell3 As New TableHeaderCell()
' cell3.Text = ""
' cell3.ColumnSpan = 1
' row.Controls.Add(cell3)
' Dim cell4 As New TableHeaderCell()
' cell4.Text = ""
' cell4.ColumnSpan = 1
' row.Controls.Add(cell4)
' For x = 0 To DtHeadersCount
' Dim cell As New TableHeaderCell()
' cell.Text = ""
' cell.ColumnSpan = 1
' row.Controls.Add(cell)
' Dim cellColspan2 = New TableHeaderCell()
' cellColspan2.ColumnSpan = 2
' cellColspan2.Text = "Variación"
' row.Controls.Add(cellColspan2)
' x = x + 1
' Next
' GvAnual.HeaderRow.Parent.Controls.AddAt(0, row)
'End If
End Sub
End Class