Exemplo n.º 1
0
        private void btnUpdateQuantity_Click(object sender, EventArgs e)
        {
            int selected = lstInventory.SelectedIndices[0];
            Product selectedProd = products[selected];
            Transaction updateQty = new Transaction(selectedProd.discountPrice, selectedProd);

            updateQty.associatedProduct.productQuantity = 10;
            updateQty.UpdateTransaction();
        }
Exemplo n.º 2
0
        static void khalil()
        {
            TransactionHandler th = new TransactionHandler();
            //th.AddTransaction(new Transaction(0.0M, Product.GetAllProducts()[0]));
            //th.AddTransaction(new Transaction(0.0M, Product.GetAllProducts()[1]));

            Transaction t = new Transaction(2.00M, Product.GetAllProducts()[0]);
            Transaction r = TransactionHandler.GetReversedTransaction(t);

            Console.WriteLine(t.calcCostWithExclusiveDisc());
            t.purchasedQuantity = 5;
            t.UpdateTransaction();
            //th.ApplyGlobalDiscount(15);
            Console.WriteLine(r.calcCostWithExclusiveDisc());
        }