Ejemplo n.º 1
0
        /// <summary>
        ///     创建实际发动机
        /// </summary>
        /// <returns>实际发动机</returns>
        public static Engine CreateEngine()
        {
            var engine = new Engine
            {
                CreateDate = DateTime.Now,
            };

            engine.GenerateNewIdentity();
            return engine;
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     设置发动机
 /// </summary>
 /// <param name="engine">实际发动机</param>
 public void SetEngine(Engine engine)
 {
     if (engine != null)
     {
         Engine = engine;
         EngineId = engine.Id;
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        ///     插入所有权历史
        /// </summary>
        /// <param name="engine">实际发动机</param>
        /// <param name="engineOhDto">所有权历史DTO</param>
        private void InsertEngineOwnershipHistory(Engine engine, EngineOwnershipHistoryDTO engineOhDto)
        {
            //获取相关数据
            Supplier supplier = _supplierRepository.Get(engineOhDto.SupplierId);

            //添加所有权历史
            EngineOwnershipHistory newEngineOh = engine.AddNewEngineOwnershipHistory();
            newEngineOh.SetEndDate(engineOhDto.EndDate);
            newEngineOh.SetStartDate(engineOhDto.StartDate);
            newEngineOh.SetSupplier(supplier);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     插入商业数据历史
        /// </summary>
        /// <param name="engine">实际发动机</param>
        /// <param name="engineBhDto">商业数据历史DTO</param>
        private void InsertEngineBusinesHistory(Engine engine, EngineBusinessHistoryDTO engineBhDto)
        {
            //获取相关数据
            EngineType engineType = _engineTypeRepository.Get(engineBhDto.EngineTypeId);
            ActionCategory importCategory = _actionCategoryRepository.Get(engineBhDto.ImportCategoryId);

            //添加商业数据历史
            EngineBusinessHistory newEngineBh = engine.AddNewEngineBusinessHistory();
            newEngineBh.SetEngineType(engineType);
            newEngineBh.SetEndDate(engineBhDto.EndDate);
            newEngineBh.SetImportCategory(importCategory);
            newEngineBh.SetStartDate(engineBhDto.StartDate);
            newEngineBh.SetMaxThrust(engineBhDto.MaxThrust);
        }