public void Insert(_514_Reminder reminder) { using (var dataContext = new ReminderDataContext()) { dataContext._514_Reminders.InsertOnSubmit(reminder); dataContext.SubmitChanges(); } }
public void DeleteReminderById(int id) { using (var dataContext = new ReminderDataContext()) { var reminder = dataContext._514_Reminders.Single(x => x.Id == id); dataContext._514_Reminders.DeleteOnSubmit(reminder); dataContext.SubmitChanges(); } }
public bool SetReminderIsActive(int id, bool complete) { using (var dataContext = new ReminderDataContext()) { var data = dataContext._514_Reminders.Single(x => x.Id == id); data.IsActive = complete; dataContext.SubmitChanges(); return(true); } }
public void Update(_514_Reminder reminder) { using (var dataContext = new ReminderDataContext()) { var data = dataContext._514_Reminders.Single(x => x.Id == reminder.Id); data.IsActive = reminder.IsActive; data.Date = reminder.Date; data.Title = reminder.Title; data.ListId = reminder.ListId; data.Notes = reminder.Notes; data.Priority = reminder.Priority; dataContext.SubmitChanges(); } }