public NoteData NewNoteData(NoteData noteData) { if (NoteDataExists(noteData.NoteId, noteData.DatasetId)) { throw new ApplicationException("Add new note [" + noteData.NoteId.ToString() + "][" + noteData.DatasetId.ToString() + "] failed."); } var tableNoteData = noteData.GetTableObject(); var id = m_db.Insert("NoteData", "note_data_id", true, tableNoteData); noteData.NoteDataId = (int)id; return(noteData); }
public int UpdateNoteData(NoteData nd) { var ndTable = nd.GetTableObject(); return(m_db.Update("NoteData", "note_data_id", ndTable, nd.NoteDataId)); }