Exemplo n.º 1
0
        private List <PointItem> GetPointsItemsFromRepo(ILocalizationPointRepository repository)
        {
            var repoPoints = repository.GetAllPoints();
            var result     = new List <PointItem>();

            foreach (var point in repoPoints)
            {
                string pointID;
                if (point.StaticScore == 0)
                {
                    pointID = point.PointId.ToString();
                }
                else
                {
                    List <long?> childIds       = repository.GetByParentId((long)point.PointId).Select(x => x.PointId).ToList();
                    string       childIdsString = "";
                    childIds.ForEach(x => childIdsString += $"{x.ToString()}, ");
                    childIdsString = childIdsString.Substring(0, childIdsString.Length - 2);
                    pointID        = $"{point.PointId.ToString()}: {childIdsString}";
                }
                PointItem pointItem = new PointItem()
                {
                    BackgroundColor = point.StaticScore == 0 ? "LightBlue" : "LightCoral",
                    Name            = pointID,
                    Location        = new Location(point.Point.Coordinates.Latitude, point.Point.Coordinates.Longitude)
                };
                result.Add(pointItem);
            }

            return(result);
        }
Exemplo n.º 2
0
 protected BaseRouter()
 {
     this.repo = new LocalizationPointRepository();
     //this.repo = new MockLocalizationPointRepositoryMazowieckie();
     this.waypoints = new List <Position>();
 }