public override async void ViewDidLoad() { base.ViewDidLoad(); NewsItemGrabber _newsItemGrabber; _newsItemGrabber = new NewsItemGrabber(); LocalBhasvicDB.createNewsItemTable(); var jsonString = await _newsItemGrabber.getNews(); Console.WriteLine(jsonString); LocalBhasvicDB.updateDBWithJSON(jsonString); Console.WriteLine(LocalBhasvicDB.getItemList()); // Initialise AlertCategory Table if this is the first time the App is run if (LocalBhasvicDB.getTableInfo("AlertCategory").Count == 0) { LocalBhasvicDB.createAlertCategoryTable(); var alertCat = new AlertCategory(); foreach (var category in ChosenCategories.categories) { alertCat.Alert = true; alertCat.Category = category; LocalBhasvicDB.updateAlertCategoryTable(alertCat); } } }
static public bool initialiseAlertTable() { if (LocalBhasvicDB.getTableInfo("AlertCategory").Count == 0) { LocalBhasvicDB.createAlertCategoryTable(); var alertCat = new AlertCategory(); foreach (var category in ChosenCategories.categories) { alertCat.Alert = true; alertCat.Category = category; LocalBhasvicDB.updateAlertCategoryTable(alertCat); } } return(true); }