/// <summary>
 /// 转换为部门业务区域数据传输对象
 /// </summary>
 /// <param name="entity">部门业务区域实体</param>
 public static OrganizationsRegionDto ToDto(this OrganizationsRegion entity)
 {
     if (entity == null)
     {
         return(new OrganizationsRegionDto());
     }
     return(entity.MapTo <OrganizationsRegionDto>());
 }
 /// <summary>
 /// 转换为部门业务区域数据传输对象
 /// </summary>
 /// <param name="entity">部门业务区域实体</param>
 public static OrganizationsRegionDto ToDto2(this OrganizationsRegion entity)
 {
     if (entity == null)
     {
         return(new OrganizationsRegionDto());
     }
     return(new OrganizationsRegionDto {
         Id = entity.Id.ToString(),
         OrganizationsId = entity.OrganizationsId,
         AddressId = entity.AddressId,
         AddressDetail = entity.AddressDetail,
         AddressName = entity.AddressName,
         Version = entity.Version,
     });
 }
        /// <summary>
        /// 创建部门业务区域
        /// </summary>
        /// <param name="deptRegionId">编号</param>
        /// <param name="organizationsId">组织机构编号(OrganizationsId)</param>
        /// <param name="addressId">地区编号</param>
        /// <param name="addressDetail">详细地址</param>
        /// <param name="addressName">地址 省市区</param>
        /// <param name="version">版本号</param>
        public static OrganizationsRegion Create(
            Guid deptRegionId,
            Guid?organizationsId,
            string addressId,
            string addressDetail,
            string addressName,
            Byte[] version
            )
        {
            OrganizationsRegion result;

            result = new OrganizationsRegion(deptRegionId);
            result.OrganizationsId = organizationsId;
            result.AddressId       = addressId;
            result.AddressDetail   = addressDetail;
            result.AddressName     = addressName;
            result.Version         = version;
            return(result);
        }