public JsonResult GetAnexosRequerimento(string searchPhrase, int current = 1, int rowCount = 5, int requerimentoId = 0) { if (requerimentoId != 0) { var arquivoRequerimento = new ArquivoRequerimento { RequerimentoId = requerimentoId }; var usuario = LoginServer.RetornarUsuarioLogado(User.Identity.Name); var request = FormatGridUtils <ArquivoRequerimento> .Format(Request, searchPhrase, arquivoRequerimento, current, rowCount); var response = new ResponseGrid <ArquivoRequerimento>(); response = ArquivoRequerimentoServer.Listar(request, usuario); return(Json(new { rows = response.Entidades, current, rowCount, total = response.QuantidadeRegistros }, JsonRequestBehavior.AllowGet)); } return(Json(new { rows = "", current, rowCount, total = 0 }, JsonRequestBehavior.AllowGet)); }
public JsonResult Listar(string searchPhrase, int current = 1, int rowCount = 10) { var request = FormatGridUtils <Cursos> .Format(Request, searchPhrase, new Cursos(), current, rowCount); var response = cursoServer.Listar(request); return(Json(new { rows = response.Entidades, current, rowCount, total = response.QuantidadeRegistros }, JsonRequestBehavior.AllowGet)); }
public JsonResult ListarAnexos(string searchPhrase, int current = 1, int rowCount = 10, int statusAtualId = 0, int tipoRequerimentoId = 0) { var request = FormatGridUtils <FormularioValidacaoUC> .Format(Request, searchPhrase, new FormularioValidacaoUC(), current, rowCount); return(Json(new { rows = "TESTE", current, rowCount, total = 1 }, JsonRequestBehavior.AllowGet)); }
public JsonResult ListarProximos(string searchPhrase, int current = 1, int rowCount = 10, int statusAtualId = 0, int tipoRequerimentoId = 0) { var request = FormatGridUtils <FluxoStatus> .Format(Request, searchPhrase, new FluxoStatus(), current, rowCount); var response = FluxoStatusServer.ListarProximos(request, statusAtualId, tipoRequerimentoId); return(Json(new { rows = response.Entidades, current, rowCount, total = response.QuantidadeRegistros }, JsonRequestBehavior.AllowGet)); }
public JsonResult ListarAuditoriaRequerimento(string searchPhrase, int current = 1, int rowCount = 10, int requerimentoId = 0) { var requerimento = new Auditoria(); requerimento.RequerimentoId = requerimentoId; var request = FormatGridUtils <Auditoria> .Format(Request, searchPhrase, requerimento, current, rowCount); var response = AuditoriaServer.Listar(request); return(Json(new { rows = response.Entidades, current, rowCount, total = response.QuantidadeRegistros }, JsonRequestBehavior.AllowGet)); }
public JsonResult ListarTodos(string searchPhrase, int current = 1, int rowCount = 10) { var requerimento = new RequerimentoGridDC(); var request = FormatGridUtils <Requerimento> .Format(Request, searchPhrase, requerimento, current, rowCount); AjustarCampoOrdenacao(request); var response = ServerRequerimento.ListarTudo(request); return(Json(new { rows = response.Entidades, current, rowCount, total = response.QuantidadeRegistros }, JsonRequestBehavior.AllowGet)); }
public JsonResult Listar(string searchPhrase, int current = 1, int rowCount = 10, bool filtrarPorAtendente = false, bool filtrarPorRequerente = false, bool origem = false) { var requerimento = new RequerimentoGridDC { }; var request = FormatGridUtils <Requerimento> .Format(Request, searchPhrase, requerimento, current, rowCount); AjustarCampoOrdenacao(request); var response = new ResponseGrid <RequerimentoGridDC>(); if (filtrarPorAtendente) { request.Entidade = new RequerimentoGridDC { UsuarioAtendenteId = LoginServer.RetornarUsuarioLogado(User.Identity.Name).Id }; response = ServerRequerimento.ListarPorAtendente(request); } else if (filtrarPorRequerente) { var usuario = LoginServer.RetornarUsuarioLogado(User.Identity.Name); request.Entidade = new RequerimentoGridDC { UsuarioRequerenteId = usuario.Id }; if ((usuario.PapelId == (int)PapelDao.PapelUsuario.Administrador || usuario.PapelId == (int)PapelDao.PapelUsuario.Servidor) && origem) { response = ServerRequerimento.ListarTudo(request); } else { response = ServerRequerimento.ListarPorRequerente(request); } } return(Json(new { rows = response.Entidades, current, rowCount, total = response.QuantidadeRegistros }, JsonRequestBehavior.AllowGet)); }