Ejemplo n.º 1
0
        private async void BtnAddToCart_Clicked(object sender, EventArgs e)
        {
            AddToCart addToCart = new AddToCart {
                Qty         = LblQty.Text,
                Price       = LblPrice.Text,
                TotalAmount = LblTotalPrice.Text,
                ProductId   = productID,
                CustomerId  = Preferences.Get("userId", 0)
            };

            bool response = await ApiServices.AddItemsToCart(addToCart);

            if (response)
            {
                await DisplayAlert("Congratulations", "Your item has been successfully added", "OK");

                await Navigation.PopModalAsync();
            }
            else
            {
                await DisplayAlert("Error", "Something went wrong", "OK");
            }
        }