Example #1
0
        //
        // GET: /Route/

        public ActionResult ShowAllRoutes()
        {
            IRouteRepository routeRepository = new RouteRepository();
            var aggregatedRoutes             = routeRepository.GetAggregatedRoutes(50 * 1000); // w metrach
            var routes = routeRepository.getAllRoutes();
            List <POIModelExtended> RoutesList = new List <POIModelExtended>();
            POIModelExtended        routeToAdd;
            string place;

            //foreach(var route in routes)
            //{
            //    routeToAdd = new POIModel("", route.StartPoint, route.StartLat.GetValueOrDefault(), route.StartLong.GetValueOrDefault());
            //    RoutesList.Add(routeToAdd);
            //    routeToAdd = new POIModel("", route.EndPoint, route.EndLat.GetValueOrDefault(), route.EndLong.GetValueOrDefault());
            //    RoutesList.Add(routeToAdd);
            //}

            foreach (var route in aggregatedRoutes)
            {
                routeToAdd = new POIModelExtended("", route.StartName, route.StartLat, route.StartLong, route.Rate);
                RoutesList.Add(routeToAdd);
                routeToAdd = new POIModelExtended("", route.EndName, route.EndLat, route.EndLong, route.Rate);
                RoutesList.Add(routeToAdd);
            }

            return(View(RoutesList));
        }