Farbpalette vorladen lassen
Bootstraper läd jetzt die farbeinstellung sofort und nicht nachträglich cleanup and rework PDF switch to HTML export fix Colorsystem Farben für knöpfe hinzugefügt als anpassung button color button color primary and secondary change
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
using cfs_tracker.Models;
|
||||
|
||||
namespace cfs_tracker.Data;
|
||||
|
||||
public class NotificationScheduleRepository
|
||||
{
|
||||
private readonly AppDatabase _database;
|
||||
|
||||
public NotificationScheduleRepository(AppDatabase database)
|
||||
{
|
||||
_database = database;
|
||||
}
|
||||
|
||||
public async Task<List<NotificationSchedule>> GetAllAsync()
|
||||
{
|
||||
await _database.InitAsync();
|
||||
|
||||
return await _database.Connection.Table<NotificationSchedule>()
|
||||
.OrderBy(x => x.DayOfWeekValue)
|
||||
.ThenBy(x => x.Hour)
|
||||
.ThenBy(x => x.Minute)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task ReplaceAllAsync(IEnumerable<NotificationSchedule> schedules)
|
||||
{
|
||||
await _database.InitAsync();
|
||||
|
||||
await _database.Connection.DeleteAllAsync<NotificationSchedule>();
|
||||
|
||||
foreach (var schedule in schedules
|
||||
.OrderBy(x => x.DayOfWeekValue)
|
||||
.ThenBy(x => x.Hour)
|
||||
.ThenBy(x => x.Minute))
|
||||
{
|
||||
await _database.Connection.InsertAsync(new NotificationSchedule
|
||||
{
|
||||
DayOfWeekValue = schedule.DayOfWeekValue,
|
||||
Hour = schedule.Hour,
|
||||
Minute = schedule.Minute,
|
||||
IsEnabled = schedule.IsEnabled
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user