Exemple #1
0
        /// <summary>
        ///     更新运营权历史
        /// </summary>
        /// <param name="operationHistoryDto">运营权历史DTO</param>
        /// <param name="operationHistory">运营权历史</param>
        private void UpdateOperationHistory(OperationHistoryDTO operationHistoryDto, OperationHistory operationHistory)
        {
            //获取相关数据
            Airlines airlines = _airlinesRepository.Get(operationHistoryDto.AirlinesId);
            ActionCategory exportCategory = _actionCategoryRepository.Get(operationHistoryDto.ExportCategoryId);
            ActionCategory importCategory = _actionCategoryRepository.Get(operationHistoryDto.ImportCategoryId);

            //更新运营权历史
            operationHistory.SetAirlines(airlines);
            operationHistory.SetEndDate(operationHistoryDto.EndDate);
            operationHistory.SetExportCategoryID(exportCategory);
            operationHistory.SetImportCategory(importCategory);
            operationHistory.SetNote(operationHistoryDto.Note);
            operationHistory.SetOnHireDate(operationHistoryDto.OnHireDate);
            operationHistory.SetOperationStatus((OperationStatus) operationHistoryDto.Status);
            operationHistory.SetReceiptDate(operationHistoryDto.ReceiptDate);
            operationHistory.SetRegNumber(operationHistoryDto.RegNumber);
            operationHistory.SetStartDate(operationHistoryDto.StartDate);
            operationHistory.SetStopDate(operationHistoryDto.StopDate);
            operationHistory.SetTechDeliveryDate(operationHistoryDto.TechDeliveryDate);
            operationHistory.SetTechReceiptDate(operationHistoryDto.TechReceiptDate);
        }
Exemple #2
0
        /// <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);
        }