public void SaveScheduledTime(ItemScheduledTime itemScheduledTime) { lock (locker) { connection.InsertOrReplace(itemScheduledTime); } }
public ChooseTimeDialog() { InitializeComponent(); scheduledTime = new ItemScheduledTime(); _timePicker.Time = DateTime.Now.TimeOfDay; Title = "New Alarm"; BindingContext = this; var settingsDatabaseController = new SettingsDatabaseController(); var curr_settings = settingsDatabaseController.GetSettings(); if (curr_settings == null) { curr_settings = new ItemSettings() { IsDatabaseSetUp = true, LastDifficultyChosen = "Advanced" }; settingsDatabaseController.SaveSettings(curr_settings); } switch (curr_settings.LastDifficultyChosen) { case "A1": pickerIndex = 0; break; case "A2": pickerIndex = 1; break; case "B1": pickerIndex = 2; break; case "B2": pickerIndex = 3; break; default: pickerIndex = 4; break; } _difficultyPicker.SelectedIndex = pickerIndex; }
public void DeleteScheduledTime(ItemScheduledTime itemScheduledTime) { lock (locker) { if (itemScheduledTime.ID.HasValue) { connection.Delete <ItemScheduledTime>(itemScheduledTime.ID); } } }