Exemplo n.º 1
0
 public void DeleteSupplierCompanyAcMaterial(SupplierCompanyAcMaterialDTO supplierCompanyAcMaterial)
 {
     SupplierCompanyMaterial supplierMaterial =
         _supplierCompanyMaterialRepository.Get(supplierCompanyAcMaterial.SupplierCompanyMaterialId);
     DelSupplierCompanyMaterial(supplierMaterial);
 }
Exemplo n.º 2
0
 public void InsertSupplierCompanyAcMaterial(SupplierCompanyAcMaterialDTO supplierCompanyAcMaterial)
 {
     //判断增加的物料是否存在
     SupplierCompanyMaterial supplierCompanyMaterial = _supplierCompanyMaterialRepository.GetAll()
         .FirstOrDefault(
             p => p.MaterialId == supplierCompanyAcMaterial.MaterialId
                  &&
                  p.SupplierCompanyId ==
                  supplierCompanyAcMaterial.SupplierCompanyId);
     if (supplierCompanyMaterial != null)
         throw new Exception("飞机物料已存在");
     SupplierCompany supplier = _supplierCompanyRepository.Get(supplierCompanyAcMaterial.SupplierCompanyId);
     if (supplier != null)
     {
         supplier.AddMaterial(supplierCompanyAcMaterial.MaterialId); //添加物料
     }
 }