Beispiel #1
0
        public ActionResult Lista(PerfilViewModel model)
        {
            if (ModelState.IsValid)
            {
                Session["Filtro"] = model;
                int totalRegistros;
                totalRegistros = 0;
                if (string.IsNullOrEmpty(model.Filtro.PaginationParameters.OrderBy))
                {
                    model.Filtro.PaginationParameters.OrderBy = "descricao";
                }

                var result = perfilAppService.ListarPeloFiltro(model.Filtro, out totalRegistros);;
                if (result.Any())
                {
                    var listaViewModel = CreateListaViewModel(model.Filtro.PaginationParameters, totalRegistros, result);
                    return(PartialView("ListaPartial", listaViewModel));
                }
                return(PartialView("_EmptyListPartial"));
            }
            return(PartialView("_NotificationMessagesPartial"));
        }