protected void GridView_HistorialPresupuestoGeneral_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView_HistorialPresupuestoGeneral.PageIndex = e.NewPageIndex;

        Decimal ID_PRES_GEN = Convert.ToDecimal(HiddenField_ID_PRES_GEN_SELECCIONADO.Value);

        presupuesto _pres = new presupuesto(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        DataTable tablaHistorial = _pres.ObtenerHistPresupuestoGeneral(ID_PRES_GEN);

        if (tablaHistorial.Rows.Count <= 0)
        {
            if (_pres.MensajeError != null)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _pres.MensajeError, Proceso.Error);
            }

            Panel_DatosPresupuestoAnioSeleccionado.Visible = false;
        }
        else
        {
            Panel_DatosPresupuestoAnioSeleccionado.Visible = true;

            GridView_HistorialPresupuestoGeneral.DataSource = tablaHistorial;
            GridView_HistorialPresupuestoGeneral.DataBind();
        }
    }
    private void CargarPresupuestoGeneralSeleccionado(Decimal ID_PRES_GEN, Int32 ANIO, Decimal MONTO, Decimal ASIGNADO, Decimal EJECUTADO)
    {
        tools _tools = new tools();

        HiddenField_ID_PRES_GEN_SELECCIONADO.Value = ID_PRES_GEN.ToString();
        HiddenField_ANNO_SELECCIONADO.Value = ANIO.ToString();
        HiddenField_MONTO_PRES_GEN_SELECCIONADO.Value = MONTO.ToString();
        HiddenField_ASIGNADO_PRES_GEN_SELECCIONADO.Value = ASIGNADO.ToString();
        HiddenField_EJECUTADO_PRES_GEN_SELECCIONADO.Value = EJECUTADO.ToString();

        presupuesto _pres = new presupuesto(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        DataTable tablaHistorial = _pres.ObtenerHistPresupuestoGeneral(ID_PRES_GEN);
        if (tablaHistorial.Rows.Count <= 0)
        {
            if (_pres.MensajeError != null)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _pres.MensajeError, Proceso.Error);
            }

            Panel_DatosPresupuestoAnioSeleccionado.Visible = false;
        }
        else
        {
            Panel_DatosPresupuestoAnioSeleccionado.Visible = true;

            GridView_HistorialPresupuestoGeneral.DataSource = tablaHistorial;
            GridView_HistorialPresupuestoGeneral.DataBind();
        }

        DataTable tablaPresupuestosEmpresas = null;

        if (HiddenField_ID_AREA.Value != Programa.Areas.GESTIONHUMANA.ToString())
        {
            tablaPresupuestosEmpresas = _pres.ObtenerPresupuestosEmpresasesPorPresGen(ID_PRES_GEN, ANIO, 0);
        }
        else
        {
            Decimal ID_EMPRESA = _tools.ObtenerIdEmpleadorPorSession(Convert.ToInt32(Session["idEmpresa"]));
            tablaPresupuestosEmpresas = _pres.ObtenerPresupuestosEmpresasesPorPresGen(ID_PRES_GEN, ANIO, ID_EMPRESA);
        }

        HiddenField_INDEX_GRID_DET_PRES_GEN.Value = "-1";
        HiddenField_PAGE_GRID_DET_PRES_GEN.Value = "0";

        if (tablaPresupuestosEmpresas.Rows.Count <= 0)
        {
            if (_pres.MensajeError != null)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _pres.MensajeError, Proceso.Error);
            }
            else
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "No se encontró información de empresa y presupuestos para el año seleccionado.", Proceso.Advertencia);
            }

            GridView_DetallesPresupuestoGeneral.PageIndex = 0;
            GridView_DetallesPresupuestoGeneral.DataSource = null;
            GridView_DetallesPresupuestoGeneral.DataBind();

            Panel_DetallesPresupuestoGeneral.Visible = false;
        }
        else
        {
            Panel_DetallesPresupuestoGeneral.Visible = true;

            Cargar_GridView_DetallesPresupuestoGeneral_DesdeDataTable(tablaPresupuestosEmpresas);

            InhabilitarFilasGrilla(GridView_DetallesPresupuestoGeneral, 4);
            ConfigurarBotonesEdicion_GridView_DetallesPresupuestoGeneral(GridView_DetallesPresupuestoGeneral, true, true, false, false);
        }
    }