public void Add(DrinkCanDTO recDTO) { if (recDTO == null) { throw new ArgumentNullException(string.Format(ValidationConstants.SDataNotFoundWithValue, "DrinkCan")); } DrinkCan rec = DrinkCanMapper.Map(recDTO); _drinkCanRepository.Add(rec); }
public List <DrinkCanDTO> FindDrinkCans(DrinkCanFindCriteria criteria) { if (criteria == null) { throw new ArgumentNullException("criteria"); } var recs = _drinkCanRepository.FindByCriteria(criteria); List <DrinkCanDTO> result = new List <DrinkCanDTO>(); foreach (var rec in recs) { result.Add(DrinkCanMapper.Map(rec)); } return(result); }
public void Restock(List <DrinkCanDTO> stock) { if (stock == null) { throw new ArgumentNullException("stock"); } _drinkCanRepository.Reset(); _paymentRepository.Reset(); DrinkCan rec; foreach (var drinkCan in stock) { rec = DrinkCanMapper.Map(drinkCan); _drinkCanRepository.Add(rec); } }