Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
 public void DeleteBFEMaterial(BFEMaterialDTO dto)
 {
     var delBFEMaterial = _materialRepository.Get(dto.BFEMaterialId); //获取需要删除的对象。
     _materialRepository.Remove(delBFEMaterial); //删除BFEMaterial。
 }
Beispiel #3
0
 public void InsertBFEMaterial(BFEMaterialDTO dto)
 {
     BFEMaterial bFEMaterial = MaterialFactory.CreateBFEMaterial(dto.Name, dto.Description, dto.Pn);
     bFEMaterial.ManufacturerID = dto.ManufacturerId;
     _materialRepository.Add(bFEMaterial);
 }