Esempio n. 1
0
        public IActionResult MapMarkerAdd([FromBody] Marker marker)
        {
            try {
                if (!markerService.CanAddMarker(CustomerID))
                {
                    return(Json(new {
                        success = false,
                        message = "You can't add more then 10 markers"
                    }));
                }

                marker.Point.Address = pointService.GetPointAddress(marker.Point);
                marker.CustomerID    = CustomerID;

                var markers = markerService.AddMarkerWithIndexUpdate(marker);
                //markerService.AddMarker (marker);

                return(Json(new {
                    success = true,
                    markers
                }));
            } catch (Exception ex) {
                return(new JsonNetResult(new {
                    success = false,
                    message = ex.Message
                }));
            }
        }