コード例 #1
0
        /// <summary>
        /// 新建一个InfoNode记录,不包容任何文件
        /// </summary>
        /// <param name="dataInfoObject"></param>
        /// <returns></returns>
        public int Create(IDataInfo dataInfoObject)
        {
            if (dataInfoObject == null || (dataInfoObject as InfoNodeDataInfo) == null)
            {
                return(0);
            }
            InfoNodeDB dbobj  = InfoNodeHelper.changeToInfoNodeDB(dataInfoObject as InfoNodeDataInfo);
            int        result = repository.AddInfoNodeDB(dbobj);

            //将数据库生成的ID值传回
            dataInfoObject.ID = dbobj.ID;
            return(0);
        }
コード例 #2
0
        public IDataInfo GetDataInfoObjectByPath(string nodePath)
        {
            InfoNodeDB dbobj = repository.GetInfoNodeDBWithoutFileInfosByPath(nodePath);
            ObservableCollection <DBFileInfo> files = repository.GetFileInfosOfInfoNodeDB(nodePath);

            ObservableCollection <DBLabelInfo> labels = repository.GetLabelInfosOfInfoNodeDB(nodePath);

            InfoNodeDataInfo InfoNodeInfo = InfoNodeHelper.changeToInfoNodeDataInfo(dbobj);

            if (InfoNodeInfo != null)
            {
                InfoNodeInfo.AttachFiles  = files;
                InfoNodeInfo.AttachLabels = labels;
            }

            return(InfoNodeInfo);
        }