Exemplo n.º 1
0
 /// <summary>
 ///     创建机型
 /// </summary>
 /// <param name="id">机型ID</param>
 /// <param name="name">机型名称</param>
 /// <param name="manufacturerId">制造商</param>
 /// <param name="aircraftCategoryId">座级</param>
 /// <param name="aircraftSeriesId">系列</param>
 /// <param name="caacAircraftTypeId">民航机型</param>
 /// <returns></returns>
 public static AircraftType CreateAircraftType(Guid id, string name,Guid manufacturerId,Guid aircraftCategoryId,Guid aircraftSeriesId,Guid caacAircraftTypeId)
 {
     var aircraftType = new AircraftType {Name = name};
     aircraftType.ChangeCurrentIdentity(id);
     aircraftType.ManufacturerId = manufacturerId;
     aircraftType.AircraftCategoryId = aircraftCategoryId;
     aircraftType.AircraftSeriesId = aircraftSeriesId;
     aircraftType.CaacAircraftTypeId = caacAircraftTypeId;
     return aircraftType;
 }
Exemplo n.º 2
0
        /// <summary>
        ///     设置机型
        /// </summary>
        /// <param name="aircraftType">机型</param>
        public void SetAircraftType(AircraftType aircraftType)
        {
            if (aircraftType == null || aircraftType.IsTransient())
            {
                throw new ArgumentException("机型参数为空!");
            }

            AircraftType = aircraftType;
            AircraftTypeId = aircraftType.Id;
            CaacAircraftType = aircraftType.CaacAircraftType;
            CaacAircraftTypeId = aircraftType.CaacAircraftTypeId;
        }