Beispiel #1
0
        public async Task <ActionResult <IEnumerable <IdentityRole> > > Gets([FromBody] DataTablesResponseViewModel model)
        {
            string filtro          = model.Search.Value;
            int    ordernar        = model.Order[0].Column;
            string ordernarDirecao = model.Order[0].Dir;

            int _draw    = model.Draw;
            int startRec = model.Start;
            int pageSize = model.Length;

            FuncaoManager funcaoManager = FuncaoManager.Create(_roleManager);

            IList <IdentityRole> funcoes = await funcaoManager.Gets(startRec, filtro, pageSize);

            //IList<EmpresaTableViewModel> tablesEempresa = converterEmpresaViewModelParaEmpresaTableViewModel(empresas);
            List <IdentityRole> funcoesOrdenadas = FuncaoConfiguracao.ordenacaoTableFuncoes(ordernar, ordernarDirecao, funcoes);

            int totalRegistros = funcaoManager.totalRegistro;

            var retorno = this.Json(new { draw = _draw, recordsTotal = totalRegistros, recordsFiltered = totalRegistros, data = funcoesOrdenadas });

            return(retorno);
        }