Example #1
0
        void updateProductTransaction(string name, int transaction_id, int qty, decimal grp_price)
        {
            Product product     = dbController.getProductThroughName(name);
            Invoice transaction = new Invoice()
            {
                InvoiceId = transaction_id,
            };

            ProductInvoice productInvoice = new ProductInvoice()
            {
                product      = product,
                invoice      = transaction,
                QuantitySold = -qty,
                GroupPrice   = grp_price,
            };

            int quantity = 0;

            if (int.TryParse(getValueFromDatagridCell(2), out quantity))
            {
                if (qty > quantity)
                {
                    return;
                }
            }

            dbController.insertProductInvoice(productInvoice);
        }
Example #2
0
        void conclusion()
        {
            // End the transaction
            concludeTransaction = true;
            toggleEncoding(false);

            Inventory inventory = null;

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

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

            dbController.insertAuditTrail(message);
            masterController.clientClock();
        }
Example #3
0
        void updateProductTransaction(string name, int transaction_id, int qty, decimal grp_price)
        {
            Product product     = dbController.getProductThroughName(name);
            Invoice transaction = new Invoice()
            {
                InvoiceId = transaction_id,
            };

            ProductInvoice productInvoice = new ProductInvoice()
            {
                product      = product,
                invoice      = transaction,
                QuantitySold = -qty,
                GroupPrice   = grp_price,
            };

            dbController.insertProductInvoice(productInvoice);
        }