示例#1
0
        public void InsertSupplierCompanyEngineMaterial(SupplierCompanyEngineMaterialDTO supplierCompanyEngineMaterial)
        {
            //判断增加的物料是否存在
            SupplierCompanyMaterial supplierCompanyMaterial = _supplierCompanyMaterialRepository.GetAll()
                .FirstOrDefault(
                    p => p.MaterialId == supplierCompanyEngineMaterial.MaterialId
                         &&
                         p.SupplierCompanyId ==
                         supplierCompanyEngineMaterial.SupplierCompanyId);
            if (supplierCompanyMaterial != null)
                throw new Exception("发动机物料已存在");

            SupplierCompany supplier = _supplierCompanyRepository.Get(supplierCompanyEngineMaterial.SupplierCompanyId);
            if (supplier != null)
            {
                supplier.AddMaterial(supplierCompanyEngineMaterial.MaterialId); //添加物料
            }
        }
示例#2
0
 public void DeleteSupplierCompanyEngineMaterial(SupplierCompanyEngineMaterialDTO supplierCompanyEngineMaterial)
 {
     SupplierCompanyMaterial supplierMaterial =
         _supplierCompanyMaterialRepository.Get(supplierCompanyEngineMaterial.SupplierCompanyMaterialId);
     DelSupplierCompanyMaterial(supplierMaterial);
 }