Example #1
0
        public void DeleteToDoItem(ToDoItem toDoForDelete)
        {
            // Remove the to-do item from the data context.
            toDoDB.Items.DeleteOnSubmit(toDoForDelete);

            // Save changes to the database.
            toDoDB.SubmitChanges();
        }
Example #2
0
        public void AddToDoItem(ToDoItem newToDoItem)
        {
            // Add a to-do item to the data context.
            toDoDB.Items.InsertOnSubmit(newToDoItem);

            // Save changes to the database.
            toDoDB.SubmitChanges();
        }
Example #3
0
 // Called during a remove operation
 private void detach_ToDo(ToDoItem toDo)
 {
     NotifyPropertyChanging("ToDoItem");
     toDo.Category = null;
 }
Example #4
0
 // Called during an add operation
 private void attach_ToDo(ToDoItem toDo)
 {
     NotifyPropertyChanging("ToDoItem");
     toDo.Category = this;
 }