Esempio n. 1
0
        public void UpdateItemCountrer(int listToItemId, int counter)
        {
            ServiceValidator.ValidateGreaterThanZero(listToItemId, nameof(listToItemId));
            ServiceValidator.ValidateGreaterThanZero(counter, nameof(counter));

            _dac.UpdateCountForItemInDisposeList(listToItemId, counter);
        }
Esempio n. 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()
            });
        }
        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()
            });
        }
Esempio n. 4
0
        public void MoveToShoppingList(int listToItemId)
        {
            ServiceValidator.ValidateGreaterThanZero(listToItemId, nameof(listToItemId));

            _dac.MoveItemToShoppingList(listToItemId);
        }
Esempio n. 5
0
        public void DeleteItem(int listToItemId)
        {
            ServiceValidator.ValidateGreaterThanZero(listToItemId, nameof(listToItemId));

            _dac.DeleteItem(listToItemId);
        }
Esempio n. 6
0
        public void AddItem(string barcode, string username)
        {
            ServiceValidator.ValidateString(username, nameof(username));

            _dac.AddItem(barcode, username);
        }