public Note Save(Note note) { note.UpdateDate = DateTime.Now; note.CreateDate = note.UpdateDate; if (note.NoteId == 0) { note.CreateDate = note.UpdateDate; GetDb().Insert("note", "noteid", note); } else { GetDb().Update("note", "noteid", note); } return note; }
public Notebook MapIt(Notebook notebook, Note note) { if (notebook == null) return current; if (current != null && notebook.NotebookId == current.NotebookId) { if (current.Notes == null) { current.Notes = new List<Note>(); } current.Notes.Add(note); return null; } Notebook prev = current; current = notebook; current.Notes = new List<Note> {note}; return prev; }
public void DeleteNote(Note note) { GetDb().Delete("note", "noteid", note); }
public Note SaveNote(Note note) { var noteDb = new NoteDb(); return noteDb.Save(note); }
public void DeleteNote(Note note) { var noteDb = new NoteDb(); noteDb.DeleteNote(note); }