Files
SIG/Contabilidad/RepBalanceGeneralProForma.aspx.vb
JORGE LUIS CAUDILLO ESPARZA c35cf91883 Commit inicial Ventas Productivo
2019-08-14 16:40:54 -07:00

153 lines
5.5 KiB
VB.net

Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Contabilidad_RepBalanceGeneralProForma
Inherits ClsPaginas
#Region " PROPIEDADES "
Private Property DtDatos As DataTable
Get
DtDatos = DirectCast(ViewState("DtDatos"), DataTable)
End Get
Set(ByVal value As DataTable)
ViewState("DtDatos") = value
End Set
End Property
Private Property TipoReporte As Integer
Get
TipoReporte = ViewState("TipoReporte").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("TipoReporte") = value
End Set
End Property
Private Property Anos As Integer
Get
Anos = ViewState("Anos").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("Anos") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
If UsuarioActual.Empresa.UsaContabilidad Then
CargaDatos()
Else
Alert("Este módulo requiere el uso de Contabilidad.", TipoMensaje.MsgAdvertencia)
BtnConsultar.Enabled = False
End If
End If
End Sub
Private Sub CargaDatos()
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
If ObjConta.GetBalanceGeneralProForma(DdlUnidad.SelectedValue.ToEntero) Then
DtDatos = ObjConta.DtResultados
Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos del balance general proforma", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
GvDatos.Columns(1).HeaderText = (Year(Date.Now) - 1).ToString
GvDatos.Columns(2).HeaderText = (Year(Date.Now) + 0).ToString
GvDatos.Columns(3).HeaderText = (Year(Date.Now) + 0).ToString
GvDatos.Columns(4).HeaderText = (Year(Date.Now) + 0).ToString
GvDatos.Columns(6).HeaderText = (Year(Date.Now) + 1).ToString
GvDatos.Columns(7).HeaderText = (Year(Date.Now) + 2).ToString
GvDatos.Columns(8).HeaderText = (Year(Date.Now) + 3).ToString
'Anos = (Year(Date.Now) - DdlEjercicio.SelectedValue.ToEntero) + 1
''Esconde todo
'For index = 1 To 40 Step 2
' GvDatos.Columns(index).Visible = False
' GvDatos.Columns(index + 1).Visible = False
'Next
'Dim i = 0
'For index = 1 To Anos * 2 Step 2
' GvDatos.Columns(index).Visible = True
' GvDatos.Columns(index + 1).Visible = True
' GvDatos.Columns(index).HeaderText = (DdlEjercicio.SelectedValue.ToEntero + i).ToString
' i = i + 1
'Next
If DtDatos IsNot Nothing Then
CargaGrid()
End If
End Sub
Private Sub CargaGrid()
GvDatos.DataSource = DtDatos
GvDatos.DataBind()
UpDatos.Update()
End Sub
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
CargaDatos()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("Nivel").ToString.ToEntero = 1 Then
e.Row.FCHyperLink("HLAnio0").Text = ""
e.Row.FCHyperLink("HLAnio11").Text = ""
e.Row.FCHyperLink("HLAnio12").Text = ""
e.Row.FCHyperLink("HLAnio13").Text = ""
e.Row.FCHyperLink("HLAnio2").Text = ""
e.Row.FCHyperLink("HLAnio3").Text = ""
e.Row.FCHyperLink("HLAnio4").Text = ""
e.Row.Cells(5).Text = ""
End If
'AGRUPADOR DE CUENTAS
If e.Row.DBCampo("Nivel").ToString.ToEntero = 1 Then
e.Row.FCLabel("LbNombre").Font.Bold = True
End If
'TITULO DE CUENTAS
If e.Row.DBCampo("Nivel").ToString.ToEntero = 2 Then
e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 10px;")
'e.Row.FCLabel("LbNombre").Font.Italic = True
End If
''CUENTAS
'If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 1 Then
' e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 20px;")
'End If
'If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 1 Or e.Row.DBCampo("CtaMayor").ToString.ToEntero = 3 Then
' For index = 1 To Anos
' e.Row.FCHyperLink("HLAno" + index.ToString).NavigateUrl = String.Format("/Contabilidad/RepAnexoCatalogo.aspx?ID={0}&FI={1}&FF={2}&TP={3}", e.Row.DBCampo("Id"), String.Format("01/01/{0}", (DdlEjercicio.SelectedValue.ToEntero + index - 1).ToString), String.Format("31/12/{0}", (DdlEjercicio.SelectedValue.ToEntero + index - 1).ToString), TipoReporte)
' Next
'End If
'TOTALES
If e.Row.DBCampo("CveCuenta").ToString = "" And e.Row.DBCampo("Nivel").ToString = "" Then
e.Row.Attributes.Add("style", "border-top: 1px solid;")
'e.Row.FCLabel("LbNombre").Attributes.Add("style", "padding-left: 10px;")
e.Row.FCLabel("LbNombre").Font.Italic = True
End If
''SUMAS
'If e.Row.DBCampo("CtaMayor").ToString.ToEntero = 6 Then
' e.Row.FCLabel("LbNombre").Font.Bold = True
'End If
End If
End Sub
End Class