private async Task UpdateItem(ShoppingListItem shoppingListItem) { if (shoppingListItem != null) { var dbCartItem = await _Connection.Table <ShoppingCartitem>().FirstOrDefaultAsync(x => x.GroceryItemID == shoppingListItem.ItemID); if (dbCartItem != null) { dbCartItem.Quantity = shoppingListItem.Quantity; var intRetValue = await _Connection.UpdateAsync(dbCartItem); } Update(); } }
private async Task DeleteItem(ShoppingListItem shoppingListItem) { if (shoppingListItem != null) { var shoppingCartItem = await _Connection.FindAsync <ShoppingCartitem>(x => x.GroceryItemID == shoppingListItem.ItemID); if (shoppingCartItem != null) { IsBusy = true; await _Connection.DeleteAsync(shoppingCartItem); IsBusy = false; } Removeitem(shoppingListItem); SortList(); } }