sclass HCRUD_Concepts extends HCRUD_Data { Concepts cc = db_mainConcepts(); Class cClass; *(Class *cClass) {} S itemName() { ret shortName(cClass); } //LS fields() { ret conceptFields(cClass); } L> list() { ret (L) conceptsToMaps_gen_withNullValues(main list(cc, cClass)); } Map emptyObject() { ret conceptToMap_gen_withNullValues(unlisted(cClass)); } Map getObject(O id) { ret putKeysFirst(getFieldOrder(o), conceptToMap_gen_withNullValues(getConcept(cc, cClass, toLong(id)))); } O createObject(SS map) { Concept c = cnew(cc, cClass); cSmartSet(c, mapToParams(map)); ret c.id; } S updateObject(O id, SS map) { Concept c = getConcept(cc, cClass, toLong(id)); if (c == null) ret "Object " + id + " not found"; cSmartSet(c, mapToParams(map)); ret "Object " + id + " updated"; } S deleteObject(O id) { Concept c = getConcept(cc, cClass, toLong(id)); if (c == null) ret "Object not found"; deleteConcept(c); ret "Object deleted"; } }