//[EnableCorsAttribute("http://localhost:44522", "*", "*")]//para permitir CORS public HttpResponseMessage TraerElementoDegradacionEspecifica(int id_Elemento_Degradacion) { UsuarioEntity usuarioComprobado = new UsuarioEntity(); Msg respuesta = new Msg(); try { var elementos = ElementosDegradacionDatos.ObtenerElemento(id_Elemento_Degradacion); if (elementos == null) { respuesta.Datos = elementos; respuesta.Estado = "OK"; return(Request.CreateResponse(System.Net.HttpStatusCode.OK, respuesta)); } else { respuesta.Datos = elementos; respuesta.Estado = "False"; return(Request.CreateResponse(System.Net.HttpStatusCode.OK, respuesta)); } } catch (Exception e) { respuesta.Mensajes = e.Message.ToString(); return(Request.CreateResponse(System.Net.HttpStatusCode.InternalServerError, respuesta)); } }
//[EnableCorsAttribute("http://localhost:44522", "*", "*")]//para permitir CORS public HttpResponseMessage TraerElementosDegradacion() { Msg respuesta = new Msg(); try { var elementos = ElementosDegradacionDatos.ObtenerElementos(); if (elementos.Count > 0) { respuesta.Datos = elementos; respuesta.Estado = "OK"; return(Request.CreateResponse(System.Net.HttpStatusCode.OK, respuesta)); } else { respuesta.Datos = elementos; respuesta.Estado = "False"; return(Request.CreateResponse(System.Net.HttpStatusCode.OK, respuesta)); } } catch (Exception e) { respuesta.Mensajes = e.Message.ToString(); return(Request.CreateResponse(System.Net.HttpStatusCode.InternalServerError, respuesta)); } }