예제 #1
0
        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);
        }
예제 #2
0
        public int UpdateNoteData(NoteData nd)
        {
            var ndTable = nd.GetTableObject();

            return(m_db.Update("NoteData", "note_data_id", ndTable, nd.NoteDataId));
        }