/// <summary> /// 新建一个LabelNode记录,不包容任何关联节点 /// </summary> /// <param name="dataInfoObject"></param> /// <returns></returns> public int Create(IDataInfo dataInfoObject) { if (dataInfoObject == null || (dataInfoObject as LabelNodeDataInfo) == null) { return(0); } LabelNodeDB dbobj = LabelNodeHelper.changeToLabelNodeDB(dataInfoObject as LabelNodeDataInfo); int result = repository.AddLabelNodeDB(dbobj); //将数据库生成的ID值传回 dataInfoObject.ID = dbobj.ID; return(0); }
public IDataInfo GetDataInfoObjectByPath(string nodePath) { LabelNodeDB dbobj = repository.GetLabelNodeDBWithoutInfoNodeDBsByPath(nodePath); ObservableCollection <DBInfoNodeInfo> infos = repository.GetDBInfoNodeInfosOfLabelNodeDB(nodePath); LabelNodeDataInfo nodeInfo = LabelNodeHelper.changeToLabelNodeDataInfo(dbobj); if (nodeInfo != null) { nodeInfo.AttachInfoNodeInfos = infos; } return(nodeInfo); }