Esempio n. 1
0
        /// <summary>
        /// Metodo que retorna la vista parcial de la tabla por defecto para ahorrar codigo
        /// </summary>
        /// <param name="file"></param>
        /// <returns></returns>
        private async Task <string> GetParcialView()
        {
            ListaCategoriaVm model = new ListaCategoriaVm();
            //obtenemos la lista de las secciones ingresadas
            FiltroCategoriaDto filtro = new FiltroCategoriaDto();

            filtro.Estado = Core.Enums.Estado.Activo;
            DataEntityPager <CategoriaOutput> result = await _categoriaService.GetCategoriasAsync(filtro, _cantXPage, model.Page);

            model.PagingInfo = new PagingInfo()
            {
                CurrentPage  = model.Page,
                ItemsPerPage = _cantXPage,
                TotalItems   = result.CantidadTotal
            };
            model.Categorias = result.Results;
            string htmlViewTable = await this.RenderViewAsync("_TablaCategoria", model);

            return(htmlViewTable);
        }
Esempio n. 2
0
        public async Task <IActionResult> Index(ListaCategoriaVm model)
        {
            FiltroCategoriaDto filtro = new FiltroCategoriaDto();

            filtro.Nombre = model.Nombre;
            if (model.Estado == null)
            {
                filtro.Estado = Core.Enums.Estado.Activo;
            }
            else
            {
                filtro.Estado = model.Estado;
            }
            DataEntityPager <CategoriaOutput> result = await _categoriaService.GetCategoriasAsync(filtro, _cantXPage, model.Page);

            model.PagingInfo = new PagingInfo()
            {
                CurrentPage  = model.Page,
                ItemsPerPage = _cantXPage,
                TotalItems   = result.CantidadTotal
            };
            model.Categorias = result.Results;
            return(View(model));
        }