Ejemplo n.º 1
0
    private void cargarProductoLista()
    {
        try
        {
            string ordenar = "order by p.[nombre] asc";

            List <Producto> _cache        = new List <Producto>();
            string          armadoDeQuery = "@familiaId in(" + familiaIdHiddenField.Value + ")";
            string          query         = consultaSql(armadoDeQuery).SqlQuery();
            _totalRows = ProductoBLL.SearchProductoPaginacion(ref _cache, query, Pager1.PageSize, Pager1.CurrentRow, ordenar);
            familiaForIdRepeater.DataSource = _cache;
            familiaForIdRepeater.DataBind();

            Pager1.TotalRows = _totalRows;
            if (_cache.Count == 0)
            {
                noResult.Visible     = true;
                Pager1.Visible       = false;
                PagesButtons.Visible = true;
                return;
            }
            noResult.Visible = false;
            Pager1.Visible   = true;
            Pager1.BuildPagination();
        }
        catch (Exception ex)
        {
            log.Error("error al cargar la lista de articulos", ex);
            throw ex;
            //return;
        }
    }
Ejemplo n.º 2
0
    private void cargarImagenesRepeateLista()
    {
        string ordenar = "";

        //TIPO DE ORDEN
        ordenar = "order by i.[titulo] asc";
        try
        {
            Searcher searcher = new Searcher(new BusquedaImagen());
            searcher.Query = SearchQueryHiddenField.Value;

            List <Imagen> _cache = new List <Imagen>();
            try
            {
                _totalRows = ImagenBLL.SearchFiles(ref _cache, searcher.SqlQuery(), Pager1.PageSize, Pager1.CurrentRow, ordenar);
            }
            catch (Exception ex)
            {
                log.Error("Error serching product:", ex);
                throw ex;
                //return;
            }

            ImagenesRepeater.DataSource = _cache;
            ImagenesRepeater.DataBind();

            Pager1.TotalRows = _totalRows;
            if (_cache.Count == 0)
            {
                Pager1.Visible       = false;
                PagesButtons.Visible = true;
                return;
            }
            Pager1.Visible = true;
            Pager1.BuildPagination();
        }
        catch (Exception ex)
        {
            log.Error("error al cargar la lista de articulos", ex);
            return;
        }
    }