/// <summary> /// 创建运营飞机 /// </summary> /// <returns>运营飞机</returns> public static Aircraft CreateAircraft() { var aircraft = new Aircraft { CreateDate = DateTime.Now, }; aircraft.GenerateNewIdentity(); return aircraft; }
/// <summary> /// 插入所有权历史 /// </summary> /// <param name="aircraft">实际飞机</param> /// <param name="ownershipHistoryDto">所有权历史DTO</param> private void InsertOwnershipHistory(Aircraft aircraft, OwnershipHistoryDTO ownershipHistoryDto) { //获取相关数据 Supplier supplier = _supplierRepository.Get(ownershipHistoryDto.SupplierId); //添加所有权历史 OwnershipHistory newOwnh = aircraft.AddNewOwnershipHistory(ownershipHistoryDto.SupplierId, ownershipHistoryDto.StartDate, ownershipHistoryDto.EndDate, OperationStatus.草稿); newOwnh.SetSupplier(supplier); }
/// <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); }
/// <summary> /// 插入运营权历史 /// </summary> /// <param name="aircraft">实际飞机</param> /// <param name="operationHistoryDto">运营权历史DTO</param> private void InsertOperationHistory(Aircraft aircraft, OperationHistoryDTO operationHistoryDto) { //获取相关数据 Airlines airlines = _airlinesRepository.Get(operationHistoryDto.AirlinesId); ActionCategory exportCategory = _actionCategoryRepository.Get(operationHistoryDto.ExportCategoryId); ActionCategory importCategory = _actionCategoryRepository.Get(operationHistoryDto.ImportCategoryId); //添加运营权历史 OperationHistory newOh = aircraft.AddNewOperationHistory(); newOh.ChangeCurrentIdentity(operationHistoryDto.OperationHistoryId); newOh.SetAirlines(airlines); newOh.SetEndDate(operationHistoryDto.EndDate); newOh.SetExportCategoryID(exportCategory); newOh.SetImportCategory(importCategory); newOh.SetNote(operationHistoryDto.Note); newOh.SetOnHireDate(operationHistoryDto.OnHireDate); newOh.SetOperationStatus(OperationStatus.草稿); newOh.SetReceiptDate(operationHistoryDto.ReceiptDate); newOh.SetRegNumber(operationHistoryDto.RegNumber); newOh.SetStartDate(operationHistoryDto.StartDate); newOh.SetStopDate(operationHistoryDto.StopDate); newOh.SetTechDeliveryDate(operationHistoryDto.TechDeliveryDate); newOh.SetTechReceiptDate(operationHistoryDto.TechReceiptDate); }
/// <summary> /// 插入飞机配置历史 /// </summary> /// <param name="aircraft">实际飞机</param> /// <param name="acConfigHistoryDto">飞机配置历史DTO</param> private void InsertAcConfigHistory(Aircraft aircraft, AcConfigHistoryDTO acConfigHistoryDto) { //获取相关数据 AircraftConfiguration aircraftConfiguration = _aircraftConfigurationRepository.Get(acConfigHistoryDto.AircraftConfigurationId); //添加飞机配置历史 aircraft.AddNewAcConfigHistory(aircraftConfiguration, acConfigHistoryDto.StartDate, acConfigHistoryDto.EndDate); }