コード例 #1
0
 // Remove a category from database
 public void RemoveToDoCategory(ToDoCategory toDoForRemove)
 {
     if (toDoForRemove.Id == DefaultCategory.Id)
         return;
     foreach (ToDoNote note in toDoDB.Notes)
         if (note._categoryId == toDoForRemove.Id)
             note.Category = DefaultCategory;
     toDoDB.Categories.DeleteOnSubmit(toDoForRemove);
     toDoDB.SubmitChanges();
     ReLoadData();
 }
コード例 #2
0
 // Rename a category from database
 public void RenameCategory(ToDoCategory toDoForRename, string newName)
 {
     if (toDoForRename.Id == DefaultCategory.Id)
         return;
     toDoForRename.Name = newName;
     toDoDB.SubmitChanges();
     ReLoadData();
 }
コード例 #3
0
 // Add a category to database
 public void AddToDoCategory(ToDoCategory newToDoCategory)
 {
     toDoDB.Categories.InsertOnSubmit(newToDoCategory);
     toDoDB.SubmitChanges();
     ReLoadData();
 }