Beispiel #1
0
        public S_FileInfo(string ID, S_DOC_Space space)
        {
            this._initEntity();
            if (space == null)
            {
                throw new Formula.Exceptions.BusinessException("档案配置对象未空,无法实例化编目节点对象");
            }
            this.Space      = space;
            this.InstanceDB = SQLHelper.CreateSqlHelper(this.Space.SpaceKey, this.Space.ConnectString);
            string sql = String.Format("select * from {0} where ID='{1}' ", TableName, ID);
            var    dt  = this.InstanceDB.ExecuteDataTable(sql);

            if (dt != null && dt.Rows.Count > 0)
            {
                var row = dt.Rows[0];
                _validateColumns(row);
                DataAdapter.DataRowToHashTable(row, this.DataEntity);
                this.ConfigInfo = this.Space.S_DOC_File.FirstOrDefault(d => d.ID == this.DataEntity["ConfigID"].ToString());
                if (this.ConfigInfo == null)
                {
                    throw new Formula.Exceptions.BusinessException("未找到ID为【" + this.DataEntity["ConfigID"].ToString() + "】编目定义对象,无法实例化编目节点对象");
                }
            }
            else
            {
                throw new Formula.Exceptions.BusinessException("未能找到ID为【" + ID + "】的编目节点");
            }
        }
Beispiel #2
0
        public S_Attachment(string ID, S_DOC_Space space)
        {
            this._initEntity();
            if (space == null)
            {
                throw new Formula.Exceptions.BusinessException("档案配置对象未空,无法实例化附件对象");
            }
            this.Space      = space;
            this.InstanceDB = SQLHelper.CreateSqlHelper(this.Space.SpaceKey, this.Space.ConnectString);
            string sql = String.Format("select * from {0} where ID='{1}' ", TableName, ID);
            var    dt  = this.InstanceDB.ExecuteDataTable(sql);

            if (dt != null && dt.Rows.Count > 0)
            {
                var row = dt.Rows[0];
                DataAdapter.DataRowToHashTable(row, this.DataEntity);
            }
            else
            {
                throw new Formula.Exceptions.BusinessException("未能找到ID为【" + ID + "】的编目节点");
            }
        }