Ejemplo n.º 1
0
        public IHttpActionResult AddVehicleToZone(int id, Vehicle vehicle)
        {
            HttpResponseMessage response = null;

            try
            {
                if (ModelState.IsValid)
                {
                    string token = Request.Headers.GetValues("oauth_token").First();
                    ZoneService.AddVehicle(token, vehicle, id);
                    return(Content(HttpStatusCode.OK, "Se ha movido el vehiculo con exito "));
                }
                else
                {
                    return(Content(HttpStatusCode.BadRequest, "Modelo de entra invalido"));
                }
            }
            catch (Exception e)
            {
                //	return response = new HttpResponseMessage() { Content = new StringContent(e.Message) };
                return(Content(HttpStatusCode.ExpectationFailed, e.Message));
            }
        }