107 lines
3.1 KiB
VB.net
107 lines
3.1 KiB
VB.net
Option Explicit On
|
|
Option Strict On
|
|
|
|
Imports System.Data
|
|
Imports Extensiones
|
|
Partial Class Contabilidad2_RepAnexoCatalogoMensual
|
|
Inherits ClsPaginas
|
|
|
|
#Region " PROPIEDADES "
|
|
Public Property CveCuenta As Integer
|
|
Get
|
|
Return ViewState("CveCuenta").ToString.ToEntero
|
|
End Get
|
|
Set(value As Integer)
|
|
ViewState("CveCuenta") = 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
|
|
|
|
Dim EjercicioParametro, SubProyectoParametro, DivisorParametro As Integer
|
|
CveCuenta = IfNull(Request("C"), "-1").ToString.ToEntero
|
|
EjercicioParametro = IfNull(Request("E"), "-1").ToString.ToEntero
|
|
SubProyectoParametro = IfNull(Request("S"), "-1").ToString.ToEntero
|
|
DivisorParametro = IfNull(Request("D"), "-1").ToString.ToEntero
|
|
|
|
InicializaValores()
|
|
|
|
DdlEjercicio.SelectedValueExist(EjercicioParametro.ToString)
|
|
DdlSubProyecto.SelectedValueExist(SubProyectoParametro.ToString)
|
|
DdlDivisor.SelectedValueExist(DivisorParametro.ToString)
|
|
|
|
CargaDatos()
|
|
|
|
End If
|
|
End Sub
|
|
|
|
|
|
#Region " INICIALIZA VALORES "
|
|
Private Sub InicializaValores()
|
|
CargaCombos()
|
|
End Sub
|
|
Private Sub CargaCombos()
|
|
|
|
Dim Conta As New ClsContabilidad
|
|
If Conta.GetEjercicios(UsuarioActual.CveEmpresa) Then
|
|
DdlEjercicio.DataSource = Conta.DtResultados
|
|
Else
|
|
DdlEjercicio.DataSource = Nothing
|
|
End If
|
|
Conta.Dispose()
|
|
|
|
DdlEjercicio.DataBind()
|
|
DdlEjercicio.SelectedValueExist(Now.Year.ToString)
|
|
|
|
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa)
|
|
DdlSubProyecto.DataBind()
|
|
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
|
|
DdlSubProyecto.SelectedValue = "-1"
|
|
|
|
End Sub
|
|
#End Region
|
|
|
|
|
|
#Region " CARGA DATOS "
|
|
Protected Sub BtnCargaAsignados_Click(sender As Object, e As EventArgs) Handles BtnCargaAsignados.Click
|
|
CargaDatos()
|
|
End Sub
|
|
Private Sub CargaDatos()
|
|
Dim Conta As New ClsContabilidad
|
|
|
|
If Conta.GetAnexoCatalogoMensual(CveCuenta, DdlEjercicio.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
GvMensual2.DataSource = Conta.DtResultados
|
|
Else
|
|
GvMensual2.DataSource = Nothing
|
|
End If
|
|
GvMensual2.DataBind()
|
|
UpMensual.Update()
|
|
|
|
RegistraScript($"LimpiaCeros({DdlDivisor.SelectedValue});")
|
|
Conta.Dispose()
|
|
End Sub
|
|
|
|
#End Region
|
|
|
|
|
|
#Region " GV ROW DATABOUND "
|
|
Protected Sub GvMensual1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMensual2.RowDataBound
|
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
|
|
|
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")
|
|
|
|
End If
|
|
End Sub
|
|
#End Region
|
|
|
|
|
|
|
|
End Class
|