示例#1
0
        public async Task GetBusStops()
        {
            if (this.BusStops != null)
            {
                return;
            }

            string query = $"SELECT * FROM BusStop WHERE IdOfTrack = {this.Id} AND IdOfSchedule = {this.IdOfSchedule};";
            await Task.Run(() => this.BusStops = SQLServices.QueryTimetable <BusStop>(query));
        }
示例#2
0
        public async Task GetTracks()
        {
            if (this.Tracks != null)
            {
                return;
            }

            string query = $"SELECT * FROM Track WHERE IdOfSchedule = {this.Id};";
            await Task.Run(() => this.Tracks = SQLServices.QueryTimetable <Track>(query));
        }
示例#3
0
        public async Task <List <Letter> > GetLetters()
        {
            string        query   = $"SELECT * FROM Letter WHERE IdOfBusStop = {this.Id};";
            List <Letter> letters = await Task.Run(() => SQLServices.QueryTimetable <Letter>(query)
                                                   .GroupBy(p => p.IdOfName)
                                                   .Select(p => p.First())
                                                   .ToList());

            return(letters);
        }
示例#4
0
        public async Task GetHours()
        {
            if (Hours != null)
            {
                return;
            }

            string query = $"SELECT * FROM Hour WHERE IdOfBusStop = {this.Id};";
            await Task.Run(() => this.Hours = SQLServices.QueryTimetable <Hour>(query));
        }
示例#5
0
        public static async Task <bool> LoadTimetableFromLocalCacheAsync()
        {
            if (!(SQLServices.IsValidTimetableDatabase()))
            {
                return(false);
            }

            bool isTimetableLoaded = await SQLServices.LoadTimetableFromDatabase();

            return(isTimetableLoaded);
        }
示例#6
0
 private bool _IsFavouriteFunc()
 => (SQLServices.QueryFavourite <BusStopName>($"SELECT * FROM BusStopName WHERE Name = '{GetBytes(this.Name)}';")).Count() > 0;