Beispiel #1
0
 /// <summary>
 ///     设置商业数据历史
 /// </summary>
 /// <param name="aircraftBusiness">商业数据历史</param>
 public void SetAircraftBusiness(AircraftBusiness aircraftBusiness)
 {
     if (aircraftBusiness != null)
     {
         AircraftBusiness = AircraftBusiness;
         AircraftBusinessId = aircraftBusiness.Id;
     }
 }
Beispiel #2
0
        /// <summary>
        /// 新增飞机商业数据历史
        /// </summary>
        /// <returns></returns>
        public AircraftBusiness AddNewAircraftBusiness()
        {
            var aircraftBusiness = new AircraftBusiness
            {
                AircraftId = Id,
            };

            aircraftBusiness.GenerateNewIdentity();
            AircraftBusinesses.Add(aircraftBusiness);

            return aircraftBusiness;
        }
Beispiel #3
0
        /// <summary>
        ///     更新商业数据历史
        /// </summary>
        /// <param name="aircraftBusinessDto">商业数据历史DTO</param>
        /// <param name="aircraftBusiness">商业数据历史</param>
        private void UpdateAircraftBusiness(AircraftBusinessDTO aircraftBusinessDto, AircraftBusiness aircraftBusiness)
        {
            //获取相关数据
            AircraftType aircraftType = _aircraftTypeRepository.Get(aircraftBusinessDto.AircraftTypeId);
            ActionCategory importCategory = _actionCategoryRepository.Get(aircraftBusinessDto.ImportCategoryId);

            //更新商业数据历史
            aircraftBusiness.SetAircraftType(aircraftType);
            aircraftBusiness.SetCarryingCapacity(aircraftBusinessDto.CarryingCapacity);
            aircraftBusiness.SetEndDate(aircraftBusinessDto.EndDate);
            aircraftBusiness.SetImportCategory(importCategory);
            aircraftBusiness.SetOperationStatus((OperationStatus) aircraftBusinessDto.Status);
            aircraftBusiness.SetSeatingCapacity(aircraftBusinessDto.SeatingCapacity);
            aircraftBusiness.SetStartDate(aircraftBusinessDto.StartDate);
        }