public void ModifyBFEMaterial(BFEMaterialDTO dto) { var updateBFEMaterial = _materialRepository.Get(dto.BFEMaterialId) as BFEMaterial; //获取需要更新的对象。 //更新。 if (updateBFEMaterial != null) { updateBFEMaterial.SetPart(dto.Pn); updateBFEMaterial.Name = dto.Name; updateBFEMaterial.Description = dto.Description; updateBFEMaterial.ManufacturerID = dto.ManufacturerId; _materialRepository.Modify(updateBFEMaterial); } }
public void DeleteBFEMaterial(BFEMaterialDTO dto) { var delBFEMaterial = _materialRepository.Get(dto.BFEMaterialId); //获取需要删除的对象。 _materialRepository.Remove(delBFEMaterial); //删除BFEMaterial。 }
public void InsertBFEMaterial(BFEMaterialDTO dto) { BFEMaterial bFEMaterial = MaterialFactory.CreateBFEMaterial(dto.Name, dto.Description, dto.Pn); bFEMaterial.ManufacturerID = dto.ManufacturerId; _materialRepository.Add(bFEMaterial); }