public EquipmentConsumerGood UpdConsumerGood(EquipmentConsumerGood updConsumerType) { EquipmentConsumerGood rtEqConsumnerGood = null; try { _eqConsumerGoodDal.Update(updConsumerType); rtEqConsumnerGood = updConsumerType; } catch (RepositoryException ex) { throw ex; } return(rtEqConsumnerGood); }
public EquipmentConsumerGood AddConsumerGood(EquipmentConsumerGood newConsumerType) { EquipmentConsumerGood rtEqConsumnerGood = null; try { _eqConsumerGoodDal.Add(newConsumerType); rtEqConsumnerGood = newConsumerType; } catch (RepositoryException ex) { throw ex; } return(rtEqConsumnerGood); }
public EquipmentConsumerGood DelConsumerGood(EquipmentConsumerGood delConsumerGood) { EquipmentConsumerGood rtEqConsumnerGood = null; try { if (delConsumerGood.EquipmentMaintDetailConsumers.Count != 0) //throw new RepositoryException("耗材 " + delConsumerGood.consumer_goods_name + " 已被使用,无法删除。", new Exception()); { } _eqConsumerGoodDal.Delete(delConsumerGood); rtEqConsumnerGood = delConsumerGood; } catch (RepositoryException ex) { throw ex; } return(rtEqConsumnerGood); }