Example #1
0
        /// <summary>
        ///     设置飞机物料
        /// </summary>
        /// <param name="aircraftMaterial">飞机物料</param>
        public void SetAircraftMaterial(AircraftMaterial aircraftMaterial)
        {
            if (aircraftMaterial == null || aircraftMaterial.IsTransient())
            {
                throw new ArgumentException("飞机物料参数为空!");
            }

            AircraftMaterial = aircraftMaterial;
            AircraftMaterialId = aircraftMaterial.Id;
        }
Example #2
0
        /// <summary>
        ///     创建飞机物料
        /// </summary>
        /// <returns>飞机物料</returns>
        public static AircraftMaterial CreateAircraftMaterial(string name, string description, Guid aircraftTypeId)
        {
            var aircraftMaterial = new AircraftMaterial
                {
                    Description = description,
                    Name = name,
                };
            aircraftMaterial.SetAircraftTypeId(aircraftTypeId);

            return aircraftMaterial;
        }