예제 #1
0
        public void ModifyAircraftMaterial(AircraftMaterialDTO dto)
        {
            var updateAircraftMaterial = _materialRepository.Get(dto.AcMaterialId) as AircraftMaterial;  //获取需要更新的对象。

            var aircraftType = _aircraftTypeRepository.Get(dto.AircraftTypeId);

            //更新。
            if (updateAircraftMaterial != null)
            {
                updateAircraftMaterial.SetAircraftType(aircraftType);
                updateAircraftMaterial.Name = dto.Name;
                updateAircraftMaterial.Description = dto.Description;
                updateAircraftMaterial.ManufacturerID = dto.ManufacturerId;
                _materialRepository.Modify(updateAircraftMaterial);
            }
        }
예제 #2
0
 public void DeleteAircraftMaterial(AircraftMaterialDTO dto)
 {
     var delAircraftMaterial = _materialRepository.Get(dto.AcMaterialId); //获取需要删除的对象。
     _materialRepository.Remove(delAircraftMaterial); //删除AircraftMaterial。
 }
예제 #3
0
 public void InsertAircraftMaterial(AircraftMaterialDTO dto)
 {
     AircraftMaterial aircraftMaterial = MaterialFactory.CreateAircraftMaterial(dto.Name, dto.Description, dto.AircraftTypeId);
     aircraftMaterial.ManufacturerID = dto.ManufacturerId;
     _materialRepository.Add(aircraftMaterial);
 }