Пример #1
0
 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;
 }
Пример #2
0
        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");
            }
        }