Example #1
0
        public async Task <IActionResult> Liste(int favorisStationId = 0, string ville = "lyon", float lat = 0f, float lon = 0f)
        {
            List <BikeStation> stations = new List <BikeStation>();

            if (ville == "lyon")
            {
                stations = await BikeStationRepository.ProcessBikeStation();
            }
            else if (ville == "bordeaux")
            {
                stations = await BikeStationRepository.ProcessBikeStationBordeauxx();
            }

            if (lat != 0 && lon != 0)
            {
                ViewBag.Stations = stations.OrderBy(s => s.GetDistanceFromUser(lat, lon)).ToList();
            }
            else
            {
                ViewBag.Stations = stations.OrderBy(s => s.name).ToList();
            }

            // TODO ajouter favoris a la base

            return(View());
        }
Example #2
0
        public async Task <IActionResult> Carte()
        {
            ViewBag.Stations = await BikeStationRepository.ProcessBikeStation();

            return(View());
        }