Option Explicit On Option Strict On Imports System.Data Imports Extensiones Imports Microsoft.Reporting.WebForms Partial Class Finanzas_FinanCuentas Inherits ClsPaginas #Region " PROPIEDADES " Private Property DTCuentas As DataTable Get Return CType(ViewState("DTCuentas"), DataTable) End Get Set(value As DataTable) ViewState("DTCuentas") = value End Set End Property Private Property DtDatos As DataTable Get Return CType(ViewState("DtDatos"), DataTable) End Get Set(value As DataTable) ViewState("DtDatos") = 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 CargaCuentas() End If End Sub Private Sub CargaCuentas() Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa) If ClsConta.GetCuentas(-1, "-1", 1) Then DTCuentas = ClsConta.DtResultados End If ClsConta.Dispose() End Sub Public Function WSCuentas() As String Dim Str As New StringBuilder Dim i As Integer = 0 Dim dt As DataTable = DTCuentas.FiltraParametros("Afectable = 1") If dt IsNot Nothing Then For Each dr As DataRow In dt.Rows i += 1 Str.AppendFormat("{{value:""{0}"",label:""{1}""}}{2}", dr("Id"), dr("CtaCodigo").ToString.Replace("""", ""), If(i < dt.Rows.Count, ",", "")) Next End If Return Str.ToString End Function Private Sub CargaDatos() Dim ClsContabilidad As New ClsContabilidad If ClsContabilidad.GetFinan_Metas(-1, UsuarioActual.CveEmpresa) Then DtDatos = ClsContabilidad.DtResultados Else Alert("Ocurrió un error al cargar las Metas. Por favor vuelva a intentar.", TipoMensaje.MsgError) DtDatos = Nothing End If ClsContabilidad.Dispose() If DtDatos.Rows.Count > 0 Then CargaGrid() End If End Sub Private Sub CargaGrid() End Sub Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then End If End Sub Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Dim ClsContabilidad As New ClsContabilidad If ClsContabilidad.AddFinan_Metas(TxtMeta.Text.ToDecimal, HdnCveCuenta.Value.ToEntero, TxtAnio.Text.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then Alert("La meta fue agregada exitosamente.", TipoMensaje.MsgInformacion) Else Alert("Ocurrió un error al agregar La meta.", TipoMensaje.MsgError) End If ClsContabilidad.Dispose() CargaDatos() End Sub End Class