/// <summary> /// Delete this note from the database /// </summary> /// <returns></returns> public int Delete() { NotesDAO lwDataAccess = new NotesDAO(); lwDataAccess.NoteDelete(this); return(0); }
/// <summary> /// Add a new note to the database (or possibly update an existing item) /// </summary> /// <returns></returns> public int Add() { NotesDAO lwDataAccess = new NotesDAO(); if (NoteID == 0) { NoteID = lwDataAccess.NoteAdd(this); } else { lwDataAccess.NoteUpdate(this); } return(0); }
public int Populate(SCOPE scope, int parentID) { // Ensure that the list is empty initially this.Clear(); NotesDAO lwDataAccess = new NotesDAO(); DataTable table = lwDataAccess.EnumerateNotes(scope, parentID); // Iterate through the returned rows in the table and create AssetType objects for each foreach (DataRow row in table.Rows) { AddNote(row); } return(this.Count); }