Esempio n. 1
0
        bool RemoveProductDiscount(Backend.Objects.DiscountProduct product)
        {
            var response = QueryController.Products.Discount.RemoveProduct(product);

            if (response.StatusCode == 204)
            {
                Alert.Show("Product removed From Discount", $"Product was successfully removed from Discount ",
                           Alert.AlertType.Success, isMini: false);
            }
            else
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        bool AddProductDiscount(Backend.Objects.DiscountProduct product)
        {
            var response = QueryController.Products.Discount.AddProduct(product);

            if (response.StatusCode == 201)
            {
                Alert.Show("Product added to Discount", $"Product was successfully added to Discount ",
                           Alert.AlertType.Success, isMini: false);
            }

            else if (response.StatusCode == 409)
            {
                Alert.Show("Product already Used", $"This Product is already in a Discount please remove it before adding it here",
                           Alert.AlertType.Warning, isMini: false);
                return(false);
            }

            else
            {
                return(false);
            }
            return(true);
        }