/// <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); }
/// <summary> /// 插入商业数据历史 /// </summary> /// <param name="aircraft">实际飞机</param> /// <param name="aircraftBusinessDto">商业数据历史DTO</param> private void InsertAircraftBusiness(Aircraft aircraft, AircraftBusinessDTO aircraftBusinessDto) { //获取相关数据 AircraftType aircraftType = _aircraftTypeRepository.Get(aircraftBusinessDto.AircraftTypeId); ActionCategory importCategory = _actionCategoryRepository.Get(aircraftBusinessDto.ImportCategoryId); //添加商业数据历史 AircraftBusiness newAb = aircraft.AddNewAircraftBusiness(); newAb.SetAircraftType(aircraftType); newAb.SetCarryingCapacity(aircraftBusinessDto.CarryingCapacity); newAb.SetEndDate(aircraftBusinessDto.EndDate); newAb.SetImportCategory(importCategory); newAb.SetOperationStatus(OperationStatus.草稿); newAb.SetSeatingCapacity(aircraftBusinessDto.SeatingCapacity); newAb.SetStartDate(aircraftBusinessDto.StartDate); }