Exemplo n.º 1
0
        public async Task UpdateShoppingListAsync(ShoppingListVm shoppingList)
        {
            if (shoppingList == null)
            {
                return;
            }

            await _shoppingListRepository.UpdateShoppingListAsync(shoppingList.ShoppingList);
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ShoppingListVm shoppingList = value as ShoppingListVm;

            if (shoppingList == null)
            {
                return((Color)Application.Current.Resources["FirstColor"]);
            }
            else
            {
                return(SetBackgroundColor(shoppingList.ProductsCount));
            }
        }
Exemplo n.º 3
0
        public async Task DeleteShoppingListAsync(ShoppingListVm shoppingList)
        {
            if (shoppingList == null)
            {
                return;
            }

            foreach (var product in shoppingList.Products)
            {
                await DeleteProductAsync(product);
            }

            await _shoppingListRepository.DeleteShoppingListAsync(shoppingList.ShoppingList);
        }
Exemplo n.º 4
0
 public async Task InsertShoppingListAsync(ShoppingListVm shoppingList)
 {
     await _shoppingListRepository.InsertShoppingListAsync(shoppingList.ShoppingList);
 }