public HttpResponseMessage getNueva()
        {
            //Lista Tipo Norma
            var tipoNormaList = _tablaServices.GetParametrosVert(TIPONORMA);
            //Normatividad Padre
            var normas = _normaServices.GetNormasPadre();
            //Lista Entidades
            var entidadList = _entidadServices.GetAllEntidades();
            //Lista Sectores
            var sectorList = _sectorServicioServices.GetAllSectorServicios();
            //Lista Sección
            var estadoList = _tablaServices.GetParametrosVert(ESTADO);

            if (tipoNormaList != null && normas != null && entidadList != null && sectorList != null && estadoList != null)
            {
                //var normaEntities = normas as List<NormaPadreEntity> ?? normas.ToList();
                //var sectorServicioEntities = sectorList as List<SectorServicioEntity> ?? sectorList.ToList();
                //var entidadEntities = entidadList as List<EntidadEntity> ?? entidadList.ToList();

                object[] jsonArray = { tipoNormaList, normas, entidadList, sectorList, estadoList };

                return(Request.CreateResponse(HttpStatusCode.OK, jsonArray));
            }
            return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No norma found for this id"));
        }
Beispiel #2
0
        public HttpResponseMessage Get(bool tipo)
        {
            var sectorServicios = _sectorServicioServices.GetAllSectorServicios();

            if (sectorServicios != null)
            {
                var sectorServicioEntities = sectorServicios as List <SectorEntity> ?? sectorServicios.ToList();
                if (sectorServicioEntities.Any())
                {
                    if (tipo)
                    {
                        return(Request.CreateResponse(HttpStatusCode.OK, sectorServicioEntities));
                    }
                    else
                    {
                        return(Request.CreateResponse(HttpStatusCode.OK, sectorServicioEntities, Configuration.Formatters.XmlFormatter));
                    }
                }
            }
            return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "sectorServicios not found"));
        }