Exemplo n.º 1
0
        public IHttpActionResult DeleteCarreras(string id)
        {
            try
            {
                string resp = validaciones.validarcodigo(id.ToString());

                if (resp.Equals("1"))
                {
                    resp = db.eliminarCarrera(id);
                    if (resp.Equals("1"))
                    {
                        return(StatusCode(HttpStatusCode.NoContent));
                    }
                    else if (resp.Equals("La carrera no esta registrada"))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw new Exception(resp);
                    }
                }
                else
                {
                    throw new Exception(resp);
                }
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }