public async void DeleteUserAccount(UserAccount delUserAccount) { using (var db = new ProjectSparyContext()) { db.UserAccounts.Remove(delUserAccount); await db.SaveChangesAsync(); } }
public async void AddUserAccount(UserAccount addUserAccount) { using (var db = new ProjectSparyContext()) { db.UserAccounts.Add(addUserAccount); await db.SaveChangesAsync(); } }
public async void UpdateUserAccount(UserAccount modUserAccount) { using (var db = new ProjectSparyContext()) { db.UserAccounts.Update(modUserAccount); await db.SaveChangesAsync(); } }
public async void DeleteNote(Note delNote) { using (var db = new ProjectSparyContext()) { db.Notes.Remove(delNote); await db.SaveChangesAsync(); } }
public async void AddNote(Note addNote) { using (var db = new ProjectSparyContext()) { db.Notes.Add(addNote); await db.SaveChangesAsync(); } }
public async void UpdateNote(Note modNote) { using (var db = new ProjectSparyContext()) { db.Notes.Update(modNote); await db.SaveChangesAsync(); } }
public async void DeleteAlarm(Alarm modAlarm) { using (var db = new ProjectSparyContext()) { db.Alarms.Remove(modAlarm); await db.SaveChangesAsync(); } }
/* * public List<Alarm> GetAlarms() * { * List<Alarm> rAlarms = null; * * using (var db = new ProjectSparyContext()) * { * rAlarms = db.Alarms.ToList(); * } * * return rAlarms; * } * * public List<Alarm> GetAlarms(bool Active) * { * List<Alarm> rAlarms = null; * * using (var db = new ProjectSparyContext()) * { * rAlarms = db.Alarms.Where(x => x.Active == Active).ToList(); * } * * return rAlarms; * }*/ public async void AddAlarm(Alarm addAlarm) { using (var db = new ProjectSparyContext()) { db.Alarms.Add(addAlarm); await db.SaveChangesAsync(); } }
public App() { this.InitializeComponent(); this.Suspending += OnSuspending; using (var db = new ProjectSparyContext()) { db.Database.Migrate(); } }
public async Task <List <UserAccount> > GetUserAccounts() { List <UserAccount> listUA = null; using (var db = new ProjectSparyContext()) { listUA = await db.UserAccounts.ToListAsync(); } return(listUA); }
public async Task <UserAccount> GetUserAccount(string UserAccountGUID) { UserAccount rUA = null; using (var db = new ProjectSparyContext()) { rUA = await db.UserAccounts.FirstOrDefaultAsync(x => x.UserAccountGUID == UserAccountGUID); } return(rUA); }
public async Task <List <Note> > GetNotes() { List <Note> rNotes = null; using (var db = new ProjectSparyContext()) { rNotes = await db.Notes.ToListAsync(); } return(rNotes); }
public async Task <Note> GetNote(string NoteGUID) { Note rNote = null; using (var db = new ProjectSparyContext()) { rNote = await db.Notes.FirstOrDefaultAsync(x => x.NoteGUID == NoteGUID); } return(rNote); }
public async Task <List <Alarm> > GetAlarms(bool Active) { List <Alarm> rAlarms = null; using (var db = new ProjectSparyContext()) { rAlarms = await db.Alarms.Where(x => x.Active == Active).ToListAsync(); } return(rAlarms); }
public async Task <List <Alarm> > GetAlarms() { List <Alarm> rAlarms = null; using (var db = new ProjectSparyContext()) { rAlarms = await db.Alarms.ToListAsync(); } return(rAlarms); }
public async Task <Alarm> GetAlarm(string AlarmGUID) { Alarm rAlarm = null; using (var db = new ProjectSparyContext()) { rAlarm = await db.Alarms.FirstOrDefaultAsync(x => x.AlarmGUID == AlarmGUID); } return(rAlarm); }