public List <TimerDurationSettings> FetchAll() { var durationSettings = new List <TimerDurationSettings>(); var reader = this.Select(); while (reader.Read()) { var setting = DurationSettingsModel.Parse(reader); durationSettings.Add(setting); } return(durationSettings); }
private SimpleTimerSettings Parse(SQLiteDataReader reader) { if (reader[TimerSettingsModel.IdCol.Name] is DBNull) { return(null); } int id = Convert.ToInt32(reader[TimerSettingsModel.IdCol.Name]); string name = Convert.ToString(reader[TimerSettingsModel.NameCol.Name]); string finalMessage = Convert.ToString(reader[TimerSettingsModel.MessageCol.Name]); bool blinkOnExpired = Convert.ToInt32(reader[TimerSettingsModel.BlinkCol.Name]) > 0; TimerDurationSettings durationSettings = DurationSettingsModel.Parse(reader); TimerVisualSettings visualSettings = VisualSettingsModel.Parse(reader); return(new SimpleTimerSettings(id, name, finalMessage, blinkOnExpired, durationSettings, visualSettings, null)); }