public DiscountsWindow()
 {
     InitializeComponent();
     UniversalFunctions.setUpWindow(this);
     String[] products = ServiceProducts.getAllProductsName();
     loadDiscounts();
     for (int i = 0; i < products.Length; i++)
     {
         cmboxProduct.Items.Add(products[i]);
         System.Diagnostics.Debug.WriteLine("suppliers??? " + products[i]);
     }
     DataDiscountHistory.DataContext = ServiceDiscount.getAllDiscountHistoryToDisplay().DefaultView;
 }
        private void btnDiscountProdcut_Click(object sender, RoutedEventArgs e)
        {
            Console.WriteLine("Selected product" + cmboxProduct.SelectedItem.ToString());
            Boolean isSuccessful = ServiceDiscount.discountProduct(cmboxProduct.SelectedItem.ToString(), cmboxDiscounts.SelectedItem.ToString(), txtStartDate.Text, txtEndDate.Text);

            if (isSuccessful)
            {
                Console.WriteLine("Added Discount to product");
                txtEndDate.Text                 = "";
                txtStartDate.Text               = "";
                cmboxProduct.Text               = "";
                cmboxDiscounts.Text             = "";
                DataDiscountHistory.DataContext = ServiceDiscount.getAllDiscountHistoryToDisplay().DefaultView;
            }
            else
            {
                Console.WriteLine("FAIL");
            }
        }