Пример #1
0
        public void UpdateItemCountrer(int listToItemId, int counter)
        {
            ServiceValidator.ValidateGreaterThanZero(listToItemId, nameof(listToItemId));
            ServiceValidator.ValidateGreaterThanZero(counter, nameof(counter));

            _dac.UpdateCountForItemInDisposeList(listToItemId, counter);
        }
Пример #2
0
        public DisposeList GetUserDisposeList(string username)
        {
            ServiceValidator.ValidateString(username, nameof(username));

            var models = _dac.SelectDisposeList(username);

            return(new DisposeList
            {
                Items = models
                        .Select(i => new DisposeList.DisposeListItem
                {
                    BarCode = i.barcode,
                    Count = i.count,
                    DisposeListToItemId = i.objid,
                    Name = i.name,
                })
                        .ToList()
            });
        }
Пример #3
0
        public ShoppingList GetUserShoppingList(string username)
        {
            ServiceValidator.ValidateString(username, nameof(username));

            var models = _dac.SelectShoppingList(username);

            return(new ShoppingList
            {
                Items = models
                        .Select(i => new ShoppingList.ShoppingListItem
                {
                    BarCode = i.barcode,
                    Count = i.count,
                    Name = i.name,
                    ShoppingListToItemId = i.objid
                })
                        .ToList()
            });
        }
Пример #4
0
        public void MoveToShoppingList(int listToItemId)
        {
            ServiceValidator.ValidateGreaterThanZero(listToItemId, nameof(listToItemId));

            _dac.MoveItemToShoppingList(listToItemId);
        }
Пример #5
0
        public void DeleteItem(int listToItemId)
        {
            ServiceValidator.ValidateGreaterThanZero(listToItemId, nameof(listToItemId));

            _dac.DeleteItem(listToItemId);
        }
Пример #6
0
        public void AddItem(string barcode, string username)
        {
            ServiceValidator.ValidateString(username, nameof(username));

            _dac.AddItem(barcode, username);
        }