Ejemplo n.º 1
0
        /// <summary>
        /// 创建规划文档
        /// </summary>
        /// <param name="issuedUnit">发文单位</param>
        /// <param name="issuedDate">发文日期</param>
        /// <param name="docNumber">发文文号</param>
        /// <param name="documentId">文档外键</param>
        /// <param name="docName">文档名称</param>
        /// <param name="programming">规划期间</param>
        /// <param name="type">规划文档类型</param>
        /// <returns>规划文档</returns>
        public static ProgrammingFile CreateProgrammingFile(IssuedUnit issuedUnit,DateTime? issuedDate,string docNumber,Guid documentId,string docName,Programming programming,int type)
        {
            var programmingFile = new ProgrammingFile
            {
                CreateDate = DateTime.Now,
                Type=type,
            };

            programmingFile.GenerateNewIdentity();
            programmingFile.SetDocNumber(docNumber);
            programmingFile.SetDocument(documentId,docName);
            programmingFile.SetIssuedDate(issuedDate);
            programmingFile.SetIssuedUnit(issuedUnit);
            programmingFile.SetProgramming(programming);
            return programmingFile;
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     设置发文单位
        /// </summary>
        /// <param name="issuedUnit">发文单位</param>
        public void SetIssuedUnit(IssuedUnit issuedUnit)
        {
            if (issuedUnit == null || issuedUnit.IsTransient())
            {
                throw new ArgumentException("发文单位Id参数为空!");
            }

            IssuedUnit = issuedUnit;
            IssuedUnitId = issuedUnit.Id;
        }