Beispiel #1
0
        public async Task <ActionResult> Index(int page = 1, int pageSize = 2)
        {
            try
            {
                var lista = await repository.ListarPaises();

                var newList = lista.ToPagedList(page, DefaultPageSize);
                model = (PagedList <Paises>)newList;
                return(View(model));
            }
            catch (Exception ex)
            {
                ShowMessages("@Error", ex.Message);
            }
            return(View());
        }
Beispiel #2
0
        public async Task <ActionResult> Index(int page = 1, int pageSize = 2)
        {
            try
            {
                IEnumerable <Paises> paises = await pais_repository.ListarPaises();

                context.Session.Set(@"ListaPaises", paises as List <Paises>);
                ViewData[@"Paises"] = paises as List <Paises>;
                var lista = await repository.ListarRegiones();

                var newList = lista.ToPagedList(page, DefaultPageSize);
                model = (PagedList <Regiones>)newList;
                return(View(model));
            }
            catch (Exception ex)
            {
                ShowMessages("@Error", ex.Message);
            }
            return(View());
        }