/// <summary> /// 更新所有权历史 /// </summary> /// <param name="ownershipHistoryDto">所有权历史DTO</param> /// <param name="ownershipHistory">所有权历史</param> private void UpdateOwnershipHistory(OwnershipHistoryDTO ownershipHistoryDto, OwnershipHistory ownershipHistory) { //获取相关数据 Supplier supplier = _supplierRepository.Get(ownershipHistoryDto.SupplierId); //更新所有权历史 ownershipHistory.SetEndDate(ownershipHistoryDto.EndDate); ownershipHistory.SetOperationStatus((OperationStatus) ownershipHistoryDto.Status); ownershipHistory.SetStartDate(ownershipHistoryDto.StartDate); ownershipHistory.SetSupplier(supplier); }
/// <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); }