Example #1
0
        /// <summary>
        ///
        /// </summary>
        public RouteDataStore()
        {
            routes = new List <Route>();

            if (Device.RuntimePlatform == Device.iOS)
            {
                routes.Add(new Route
                {
                    StartDestination = string.Empty,
                    EndDestination   = string.Empty,
                    Date             = string.Empty,
                    BGColorHexCode   = "#52597F",
                    IsSelected       = false
                });
            }

            routes.Add(new Route
            {
                StartDestination = "Tuzla",
                EndDestination   = "Gebze",
                BGColorHexCode   = "#52597F",
                Date             = DateTime.Today.ToShortDateString(),
                IsSelected       = false
            });

            routes.Add(new Route
            {
                StartDestination = "Bati Hereke",
                EndDestination   = "Dil Iskelesi",
                BGColorHexCode   = "#52597F",
                IsBookmarked     = true,
                Date             = DateTime.Today.ToShortDateString(),
                IsSelected       = false
            });


            routes.Add(new Route
            {
                StartDestination = "Kartal",
                EndDestination   = "Samandira",
                BGColorHexCode   = "#52597F",
                Date             = DateTime.Today.ToShortDateString(),
                IsSelected       = false
            });



            //Dört ekli, listede bir eksik
            var t = RouteDBContextHelper.GetRoutes().Result.ToList();

            t = t.OrderBy(x => x.IsBookmarked).ToList();
            if (t.Count == 0)
            {
                RouteDBContextHelper.AddOrUpdatePostsAsync(routes);
                t = RouteDBContextHelper.GetRoutes().Result.ToList().OrderBy(x => x.IsBookmarked).ToList();
            }

            ExtendedFrame.CurrentRoutes = t;
        }
Example #2
0
        public async Task <bool> UpdateItemAsync(List <Route> routes)
        {
            await RouteDBContextHelper.AddOrUpdatePostsAsync(routes);

            return(await Task.FromResult(true));
        }