Example #1
0
 /// <summary>
 ///     创建发动机物料
 /// </summary>
 /// <returns>发动机物料</returns>
 public static EngineMaterial CreateEngineMaterial(string name, string description, string pn)
 {
     var engineMaterial = new EngineMaterial
     {
         Description = description,
         Name = name,
         Pn = pn
     };
     engineMaterial.GenerateNewIdentity();
     return engineMaterial;
 }
Example #2
0
        /// <summary>
        ///     设置发动机物料
        /// </summary>
        /// <param name="engineMaterial">发动机物料</param>
        public void SetEngineMaterial(EngineMaterial engineMaterial)
        {
            if (engineMaterial == null || engineMaterial.IsTransient())
            {
                throw new ArgumentException("发动机物料参数为空!");
            }

            EngineMaterial = engineMaterial;
            EngineMaterialId = engineMaterial.Id;
        }