public static bool AdNote(long userId, string title, bool isPublic, string tag, string content) { try { WNDataContext db = new WNDataContext(); Note note = new Note(); note.user_Id = userId; note.title = title; note.isPublic = isPublic; note.content = content; note.creation_date = DateTime.Now; note.last_update = DateTime.Now; db.Notes.InsertOnSubmit(note); db.SubmitChanges(); return true; } catch (Exception e) { //TODO: log error -> medium return false; } }
partial void DeleteNote(Note instance);
partial void UpdateNote(Note instance);
partial void InsertNote(Note instance);
private void detach_Notes(Note entity) { this.SendPropertyChanging(); entity.User = null; }
private void attach_Notes(Note entity) { this.SendPropertyChanging(); entity.User = this; }