Ejemplo n.º 1
0
        /// <summary>
        ///     创建备发计划
        /// </summary>
        /// <param name="versionNumber">版本号</param>
        /// <returns>备发计划</returns>
        public static EnginePlan CreateEnginePlan(int versionNumber)
        {
            var enginePlan = new EnginePlan
            {
                VersionNumber = versionNumber,
                CreateDate = DateTime.Now,
            };

            enginePlan.GenerateNewIdentity();
            return enginePlan;
        }
Ejemplo n.º 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.计划);
        }