Ejemplo n.º 1
0
        public SingleModelResponse<Route> SaveRoute(RouteViewModel mapRoute,string userId)
        {
            string MapUrl = MapUri + "AddRoute?userId="+userId;
            List<Checkpoint> newCheckPoints = new List<Checkpoint>();
            foreach (CheckpointViewModel check in mapRoute.Checkpoints)
            {
                Checkpoint checkPoint = new Checkpoint();
                checkPoint.Latitude = check.Latitude;
                checkPoint.Longitude = check.Longitude;
                newCheckPoints.Add(checkPoint);
            }

            var newRoute = new Route
            {
                UserID = mapRoute.UserID,
                Title = mapRoute.Title,
                Distance = mapRoute.TotalDistance,
                Checkpoint = newCheckPoints
            };
            var createdRoute = PostContent(MapUrl, newRoute);
            return createdRoute;
        }
Ejemplo n.º 2
0
 public EventRoute(Route evntRoute)
 {
     Title = evntRoute.Title;
     RouteID = evntRoute.RouteId;
     DateAdded = DateTime.Now.Date.ToString();
 }
Ejemplo n.º 3
0
        public SingleModelResponse<Route> UpdateRoute(RouteViewModel mapRoute)
        {
            string MapUrl = MapUri + "Update/EditRoute";
            List<Checkpoint> newCheckPoints = new List<Checkpoint>();
            foreach (CheckpointViewModel check in mapRoute.Checkpoints)
            {
                Checkpoint checkPoint = new Checkpoint();
                checkPoint.Latitude = check.Latitude;
                checkPoint.Longitude = check.Longitude;
                newCheckPoints.Add(checkPoint);
            }

            var newRoute = new Route
            {
                RouteId = mapRoute.RouteId,
                UserID = mapRoute.UserID,
                Title = mapRoute.Title,
                Distance = mapRoute.TotalDistance,
                Checkpoint = newCheckPoints
            };
            var createdRoute = PutContent(MapUrl, newRoute);
            return createdRoute;
        }
Ejemplo n.º 4
0
 public EventRoute(Route evntRoute)
 {
     Title     = evntRoute.Title;
     RouteID   = evntRoute.RouteId;
     DateAdded = DateTime.Now.Date.ToString();
 }