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)); }
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)); }
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); }
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)); }
public static async Task <bool> LoadTimetableFromLocalCacheAsync() { if (!(SQLServices.IsValidTimetableDatabase())) { return(false); } bool isTimetableLoaded = await SQLServices.LoadTimetableFromDatabase(); return(isTimetableLoaded); }
private bool _IsFavouriteFunc() => (SQLServices.QueryFavourite <BusStopName>($"SELECT * FROM BusStopName WHERE Name = '{GetBytes(this.Name)}';")).Count() > 0;