Ejemplo n.º 1
0
        public IHttpActionResult PostGeoPoint(GeoPointRequest point)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            ObjectParameter output  = new ObjectParameter("responseMessage", typeof(string));
            ObjectParameter idPoint = new ObjectParameter("IdPoint", typeof(int));

            db.PR_CreatePoint(point.Latitude, point.Longitude, idPoint, output);
            var r = new GeoPointResponse()
            {
                Success = false, Msg = output.Value.ToString(), IdPoint = (int)idPoint.Value
            };

            if (output.Value.ToString().Equals("Success"))
            {
                r.Success = true;
            }

            return(Ok(r));
        }