Exemple #1
0
        //[IsAuthorize("Usuario", "Index")]
        public async Task <ActionResult> Index(int idPag = 0)
        {
            try
            {
                //var perfilId = CurrentUser.PerfilId;
                //var perfilId = System.Web.HttpContext.Current.GetOwinContext()
                //    .Authentication.User.FindFirst("PerfilId").Value;
                var paginar = new Pagination
                {
                    PaginaAtual = idPag
                };

                var model = _usuarioApp.GetUsuariosPaging(paginar)
                            .CastAll <UsuarioModel>();

                paginar             = paginar.CalcularPagination(paginar, await _usuarioApp.CountAsync());
                ViewBag.PaginaAtual = paginar.PaginaAtual;
                ViewBag.QtdePaginas = paginar.QtdePaginas;

                return(View(model));
            }
            catch (Exception e)
            {
                ShowMessageDialog("Ocorreu um problema ao tentar listar os usuário", e);
                return(RedirectToAction("Index", "Home"));
            }
        }