Exemple #1
0
        private void Inventory_KeyFunction(KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F1)
            {
                if (mainTab.SelectedTab == tabPage1)
                {
                    keyButton6.updateButton();
                    modalInspectProduct inspect = new modalInspectProduct(dbController);
                    inspect.bcode = getBarcodeFromRow();
                    inspect.ShowDialog();
                }
                else
                {
                    toogleSearchTransaction();
                    keyButton10.updateButton();
                }
            }
            else if (e.KeyCode == Keys.F2)
            {
                if (mainTab.SelectedTab == tabPage1)
                {
                    keyButton9.updateButton();
                    currentSelection = dgInventory.CurrentCell.RowIndex;
                    updateProduct();
                    dgInventory.Rows[currentSelection].Selected = true;
                }
                else
                {
                    keyButton11.updateButton();
                    toggleReturnQty();
                }
            }
            else if (e.KeyCode == Keys.F3)
            {
                keyButton8.updateButton();
                currentSelection = dgInventory.CurrentCell.RowIndex;
                addProduct();
                dgInventory.Rows[currentSelection].Selected = true;
            }
            else if (e.Control && e.KeyCode == Keys.P)
            {
                if (mainTab.SelectedTab == tabPage1)
                {
                    keyButton11.updateButton();
                    keyButton7.updateButton();
                    if (rbInventory.Checked || rbPurchased.Checked)
                    {
                        print();
                    }
                }
                else
                {
                    keyButton13.updateButton();
                    keyButton14.updateButton();
                    printReceipt();
                }
            }
            else if (e.KeyCode == Keys.Escape)
            {
                if (productSliderPane1.isOpen())
                {
                    productSliderPane1.toggle();
                    toogleSearch();
                }
            }

            if (sliderPane.isOpen())
            {
                if (e.KeyCode == Keys.Enter)
                {
                    sliderPane.OK();
                    toogleSearch();
                }
            }
        }
        private void Inventory_KeyFunction(KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F1)
            {
                if (mainTab.SelectedTab == tabPage1)
                {
                    toogleSearch();
                    keyButton6.updateButton();
                }
                else
                {
                    toogleSearchTransaction();
                    keyButton10.updateButton();
                }
            }
            else if (e.KeyCode == Keys.F2)
            {
                if (mainTab.SelectedTab == tabPage1)
                {
                    keyButton9.updateButton();
                    updateProduct();
                    productSliderPane1.mode = InventoryMode.UPDATE;

                    if (!productSliderPane1.isOpen())
                    {
                        productSliderPane1.toggle();
                    }
                }
                else
                {
                    keyButton11.updateButton();
                    toggleReturnQty();
                }
            }
            else if (e.KeyCode == Keys.F3)
            {
                keyButton8.updateButton();
                addProduct();
            }
            else if (e.Control && e.KeyCode == Keys.P)
            {
                if (mainTab.SelectedTab == tabPage1)
                {
                    keyButton11.updateButton();
                    keyButton7.updateButton();
                    if (rbInventory.Checked || rbPurchased.Checked)
                    {
                        print();
                    }
                }
                else
                {
                    keyButton13.updateButton();
                    keyButton14.updateButton();
                    printReceipt();
                }
            }
            else if (e.KeyCode == Keys.Escape)
            {
                if (productSliderPane1.isOpen())
                {
                    productSliderPane1.toggle();
                }
            }

            if (sliderPane.isOpen())
            {
                if (e.KeyCode == Keys.Enter)
                {
                    sliderPane.OK();
                }
            }
        }