public void BuscarPropuesta()
        {
            _presentadorPropuesta = new ConsultarPropuestaPresentador();

            int i = 0;
            int estado = 1;

            propuestas = _presentadorPropuesta.BuscarPorTitulo(estado);
            for (i = 0; i < propuestas.Count; i++)
            {
                _vista.PropuestaAsociada.Items.Add(propuestas.ElementAt(i).Titulo);
            }
        }
    protected void Page_Init(object sender, EventArgs e)
    {
        Core.LogicaNegocio.Entidades.Usuario usuario =
                                (Core.LogicaNegocio.Entidades.Usuario)Session[SesionUsuario];

        bool permiso = false;

        for (int i = 0; i < usuario.PermisoUsu.Count; i++)
        {
            if (usuario.PermisoUsu[i].IdPermiso == 26)
            {
                i = usuario.PermisoUsu.Count;

                _presenter = new ConsultarPropuestaPresentador(this);

                permiso = true;

                ListOpcion.SelectedIndex = 0;

            }
        }

        if (permiso == false)
        {
            Response.Redirect(paginaSinPermiso);
        }
    }
        //
        /// <summary>
        /// Metodo que Ejecuta la busqueda de acuerdo a la seleccion del usuario
        /// y retorna una lista de propuesta cliente o gastos por rango de fecha
        /// </summary>
        public void BuscarInformacion()
        {
            #region Atributos de la pagina
            _vista.BotonBuscarDatos.Visible = false;
            _vista.BusquedaConsulta.Visible = false;
            _vista.CheckOpcionBuscar.Visible = false;
            _vista.LTipoConsulta.Visible = false;
            _vista.TablaInicio.Visible = false;
            _vista.TablaConsultaParametro.Visible = false;

            #endregion

            listaGasto = new List<Core.LogicaNegocio.Entidades.Gasto>();

            int Opcion = _vista.CheckOpcionBuscar.SelectedIndex;
            string Parametro = _vista.BusquedaConsulta.Text;

            if (_vista.CheckOpcionBuscar.SelectedIndex == 0) // La Seleccion fue por Propuesta
            {
                try
                {

                    ConsultarPropuestaPresentador _presentadorPropuesta2 =
                        new ConsultarPropuestaPresentador();
                    listaPropuesta = _presentadorPropuesta2.LlenarListaParametro(1, Parametro);

                    if (listaPropuesta != null)
                    {
                        _vista.GetObjectContainerConsultaGastoSeleccion.DataSource = listaPropuesta;

                        _vista.TablaConsultaParametro.Visible = true;

                    }
                }

                catch (ConsultarGastoLNException e)
                {
                    _vista.Error.Text = e.Message;
                    _vista.Error.Visible = true;
                }
                catch (Exception e)
                {
                    _vista.Error.Text = e.Message;
                    _vista.Error.Visible = true;
                }

            }

            if (_vista.CheckOpcionBuscar.SelectedIndex == 1) // La Seleccion fue por Nombre Cliente
            {
                try
                {

                    // Se crea la entidad Cliente que es necesaria para el comando consultar de cliente
                    Core.LogicaNegocio.Entidades.Cliente cliente =
                        new Core.LogicaNegocio.Entidades.Cliente();

                    cliente.Nombre = _vista.BusquedaConsulta.Text;

                    // Instancia del presentador
                    ConsultarClientePresentador _presentadorcliente =
                        new ConsultarClientePresentador();

                    // Llamado al metodo
                    listaCliente = _presentadorcliente.ConsultarClienteNombre(cliente);

                    if (listaCliente != null)
                    {
                        _vista.GetObjectContainerCliente.DataSource = listaCliente;
                        _vista.TablaCliente.Visible = true;
                    }
                }
                catch (ConsultarGastoLNException e)
                {
                    _vista.Error.Text = e.Message;
                    _vista.Error.Visible = true;
                }
                catch (Exception e)
                {
                    _vista.Error.Text = e.Message;
                    _vista.Error.Visible = true;
                }

            }
            if (_vista.CheckOpcionBuscar.SelectedIndex == 2) // La Seleccion por fecha
            {
                try
                {
                    gasto = new Core.LogicaNegocio.Entidades.Gasto();
                    gasto.FechaGasto = Convert.ToDateTime( _vista.TextBoxFecha.Text);

                    listaGasto = ConsultarPorFecha(gasto);

                    if (listaGasto != null)
                    {
                        _vista.GetObjectContainerConsultaGasto.DataSource = listaGasto;
                        _vista.TablaInicio.Visible = false;
                        _vista.GridViewParametro.Visible = false;
                        _vista.TablaSeleccionGrid.Visible = true;
                    }
                }

                catch (ConsultarGastoLNException e)
                {
                    _vista.Error.Text = e.Message;
                    _vista.Error.Visible = true;
                }
                catch (Exception e)
                {
                    _vista.Error.Text = e.Message;
                    _vista.Error.Visible = true;
                }
            }
        }
        //
        public void BuscarInformacion()
        {
            try
            {
                #region Atributos de la pagina

                _vista.BusquedaConsulta.Visible = false;
                _vista.CheckOpcionBuscar.Visible = false;
                _vista.BotonBuscarDatos.Visible = false;

                #endregion

                listaGasto = new List<Core.LogicaNegocio.Entidades.Gasto>();

                int Opcion = _vista.CheckOpcionBuscar.SelectedIndex;
                string Parametro = _vista.BusquedaConsulta.Text;

                if (_vista.CheckOpcionBuscar.SelectedIndex == 0) // La Seleccion fue por Propuesta
                {

                    ConsultarPropuestaPresentador _presentadorPropuesta2 = new ConsultarPropuestaPresentador();
                    listaPropuesta = _presentadorPropuesta2.LlenarListaParametro(1, Parametro);

                    try
                    {
                        if (listaPropuesta != null)
                        {
                            _vista.GetObjectContainerConsultaGastoSeleccion.DataSource = listaPropuesta;
                            _vista.LabelInfo.Visible = false;

                        }
                    }

                    catch (WebException e)
                    {
                        //Mensaje de error al usuario
                    }

                }

                if (_vista.CheckOpcionBuscar.SelectedIndex == 1) // La Seleccion fue por Nombre Cliente
                {

                    // Se crea la entidad Cliente que es necesaria para el comando consultar de cliente
                    Core.LogicaNegocio.Entidades.Cliente cliente =
                        new Core.LogicaNegocio.Entidades.Cliente();

                    cliente.Nombre = _vista.BusquedaConsulta.Text;

                    // Instancia del presentador
                    ConsultarClientePresentador _presentadorcliente =
                        new ConsultarClientePresentador();

                    // Llamado al metodo
                    listaCliente = _presentadorcliente.ConsultarClienteNombre(cliente);

                    try
                    {
                        if (listaCliente != null)
                        {
                            _vista.GetObjectContainerCliente.DataSource = listaCliente;
                            _vista.ModificarGasto.ActiveViewIndex = 1;
                        }
                    }

                    catch (WebException e)
                    {
                        //Mensaje de error al usuario
                    }
                }
            }
            catch
            {
                _vista.ModificarGasto.ActiveViewIndex = 3;
                _vista.MensajeError.Text = "Debe Seleccionar una Opcion";

            }
        }