Beispiel #1
0
        /// <summary>
        /// 新增飞机配置历史
        /// </summary>
        /// <returns></returns>
        public AcConfigHistory AddNewAcConfigHistory(AircraftConfiguration aircraftConfiguration, DateTime starDate, DateTime? endatDate)
        {
            var acConfigHistory = new AcConfigHistory
            {
                AircraftId = Id,
            };
            acConfigHistory.SetAircraftConfiguration(aircraftConfiguration);
            acConfigHistory.SetStartDate(starDate);
            acConfigHistory.SetEndDate(endatDate);
            acConfigHistory.GenerateNewIdentity();

            AcConfigHistories.Add(acConfigHistory);
            return acConfigHistory;
        }
Beispiel #2
0
        /// <summary>
        ///     更新飞机配置历史
        /// </summary>
        /// <param name="acConfigHistoryDto">飞机配置历史DTO</param>
        /// <param name="acConfigHistory">飞机配置历史</param>
        private void UpdateAcConfigHistory(AcConfigHistoryDTO acConfigHistoryDto, AcConfigHistory acConfigHistory)
        {
            //获取相关数据
            AircraftConfiguration aircraftConfiguration =
                _aircraftConfigurationRepository.Get(acConfigHistoryDto.AircraftConfigurationId);

            //更新飞机配置历史
            acConfigHistory.SetEndDate(acConfigHistoryDto.EndDate);
            acConfigHistory.SetStartDate(acConfigHistoryDto.StartDate);
            acConfigHistory.SetAircraftConfiguration(aircraftConfiguration);
        }