private void AddRouteDetail(RouteDetail routeDetail, Route route) { var stops = from stop in db.Stops from routeStop in db.RouteStops orderby routeStop.StopSequence where (routeStop.StopID == stop.ID) && (routeStop.RouteID == route.ID) select stop; foreach (var stop in stops) { // Use arrival times if available var stopWithArrivalTime = StopArrivalTime.GetStopSummaryWithArrivalTimes(stop.ID); if (stopWithArrivalTime != null) { routeDetail.Stops.Add(stopWithArrivalTime); } else { routeDetail.Stops.Add(new StopSummary(stop)); } } var shapes = from shape in db.Shapes orderby shape.Sequence where (shape.RouteID == route.ID) select shape; foreach (var shape in shapes) { var coordinate = new Location(); coordinate.Lat = shape.Lat; coordinate.Lon = shape.Lon; routeDetail.RoutePath.Add(coordinate); } }
private void AddRouteDetail(RouteDetail routeDetail, Route route) { var stops = from stop in db.Stops from routeStop in db.RouteStops orderby routeStop.StopSequence where (routeStop.StopID == stop.ID) && (routeStop.RouteID == route.ID) select stop; foreach (var stop in stops) { routeDetail.Stops.Add(new StopSummary(stop)); } var shapes = from shape in db.Shapes orderby shape.Sequence where (shape.RouteID == route.ID) select shape; foreach (var shape in shapes) { var coordinate = new Location(); coordinate.Lat = shape.Lat; coordinate.Lon = shape.Lon; routeDetail.RoutePath.Add(coordinate); } }