コード例 #1
0
        public void Add(DrinkCanDTO recDTO)
        {
            if (recDTO == null)
            {
                throw new ArgumentNullException(string.Format(ValidationConstants.SDataNotFoundWithValue, "DrinkCan"));
            }

            DrinkCan rec = DrinkCanMapper.Map(recDTO);

            _drinkCanRepository.Add(rec);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
            }
        }