Ejemplo n.º 1
0
        private void OnChangeQtyRequest(object parameter)
        {
            int     productIDAdded = (int)parameter;
            product p = DataBaseManager.GetProductById(productIDAdded);

            double qty = 1;

            CaptureQTY cqty = new CaptureQTY((bool)p.weighable, MainScreen.Order.GetQtyByProduct(p));

            if (true == cqty.ShowDialog())
            {
                qty = cqty.GetValue();
            }
            else
            {
                return;
            }

            MainScreen.Order.AddToCart(p, qty, true);
            LoadOrder(MainScreen.Order, false, MainScreen.Order.IndexOfProduct(p));
        }
Ejemplo n.º 2
0
        private void OnItemSelectedFromCatalog(object parameter)
        {
            int     productIDAdded = (int)parameter;
            product p = DataBaseManager.GetProductById(productIDAdded);

            double qty = 1;

            if ((bool)p.weighable)
            {
                CaptureQTY cqty = new CaptureQTY((bool)p.weighable, 0);
                if (true == cqty.ShowDialog())
                {
                    qty = cqty.GetValue();
                }
                else
                {
                    return;
                }
            }

            MainScreen.Order.AddToCart(p, qty, false);
            LoadOrder(MainScreen.Order, false, MainScreen.Order.IndexOfProduct(p));
        }