예제 #1
0
        public int Create(IDataInfo dataInfoObject)
        {
            if (dataInfoObject == null || (dataInfoObject as DetailTextInfo) == null)
            {
                return(0);
            }
            DetailTextDB dbobj  = DetailTextHelper.changeToDetailTextDB(dataInfoObject as DetailTextInfo);
            int          result = repository.Create(dbobj);

            //将数据库生成的ID值传回
            dataInfoObject.ID = dbobj.ID;
            return(result);
        }
예제 #2
0
        /// <summary>
        /// 根据节点路径提取节点数据,如果未找到,返回null
        /// </summary>
        /// <param name="nodePath"></param>
        /// <returns></returns>
        public IDataInfo GetDataInfoObjectByPath(string nodePath)
        {
            if (String.IsNullOrEmpty(nodePath))
            {
                return(null);
            }
            DetailTextDB dbobj = repository.GetDataInfoObjectByPath(nodePath);

            if (dbobj == null)
            {
                return(null);
            }
            DetailTextInfo infoObj = DetailTextHelper.changeToDetailTextInfo(dbobj);

            //设置数据己装入标记
            infoObj.HasBeenLoadFromStorage = true;
            return(infoObj);
        }