예제 #1
0
        /// <summary>
        ///     更新
        /// </summary>
        /// <param name="enginePlanHistoryDto">计划历史DTO</param>
        /// <param name="enginePlanHistory">计划历史</param>
        private void UpdateEnginePlanHistory(EnginePlanHistoryDTO enginePlanHistoryDto,
            EnginePlanHistory enginePlanHistory)
        {
            //获取
            ActionCategory actionCategory = _actionCategoryRepository.Get(enginePlanHistoryDto.ActionCategoryId);
            EngineType engineType = _engineTypeRepository.Get(enginePlanHistoryDto.EngineTypeId);
            Annual annual = _annualRepository.Get(enginePlanHistoryDto.PerformAnnualId);

            // 更新计划历史
            enginePlanHistory.SetActionCategory(actionCategory);
            enginePlanHistory.SetEngineType(engineType);
            enginePlanHistory.SetMaxThrust(enginePlanHistoryDto.MaxThrust);
            enginePlanHistory.SetNote(enginePlanHistoryDto.Note);
            enginePlanHistory.SetImportDate(enginePlanHistoryDto.ImportDate);
            enginePlanHistory.SetPerformDate(annual, enginePlanHistoryDto.PerformMonth);
            enginePlanHistory.SetPlanEngine(enginePlanHistoryDto.PlanEngineId);
            enginePlanHistory.SetPlanStatus((EnginePlanDeliverStatus) enginePlanHistoryDto.Status);
        }
예제 #2
0
        /// <summary>
        ///     插入计划明细
        /// </summary>
        /// <param name="enginePlan">备发计划</param>
        /// <param name="enginePlanHistoryDto">计划历史DTO</param>
        private void InsertEnginePlanHistory(EnginePlan enginePlan, EnginePlanHistoryDTO enginePlanHistoryDto)
        {
            //获取
            ActionCategory actionCategory = _actionCategoryRepository.Get(enginePlanHistoryDto.ActionCategoryId);
            EngineType engineType = _engineTypeRepository.Get(enginePlanHistoryDto.EngineTypeId);
            Annual annual = _annualRepository.Get(enginePlanHistoryDto.PerformAnnualId);

            // 添加接机行
            EnginePlanHistory newEnginePlanHistory = enginePlan.AddNewEnginePlanHistory();
            newEnginePlanHistory.SetActionCategory(actionCategory);
            newEnginePlanHistory.SetEngineType(engineType);
            newEnginePlanHistory.SetMaxThrust(enginePlanHistoryDto.MaxThrust);
            newEnginePlanHistory.SetNote(enginePlanHistoryDto.Note);
            newEnginePlanHistory.SetPerformDate(annual, enginePlanHistoryDto.PerformMonth);
            newEnginePlanHistory.SetPlanEngine(enginePlanHistoryDto.PlanEngineId);
            newEnginePlanHistory.SetPlanStatus(EnginePlanDeliverStatus.计划);
        }