示例#1
0
        void conclusion()
        {
            // End the transaction
            concludeTransaction = true;
            toggleEncoding(false);

            Inventory inventory = null;

            foreach (ProductInvoice item in carts)
            {
                inventory = new Inventory()
                {
                    Barcode     = item.product.Barcode,
                    QtyReceived = 0,
                    QtyOnHand   = -item.QuantitySold,
                };
                Product product = dbController.getProductFromBarcode(item.product.Barcode);
                dbController.pullInventory(inventory);
                dbController.checkProductCriticalLevel(product);
                dbController.consumeProductInvoice(item);
            }

            // audit
            string message = string.Format("completed a transaction: {0}", lblPOSmsg.Text);

            dbController.insertAuditTrail(message);
            masterController.clientClock();
        }