Esempio n. 1
0
        void frmDetailedItemEnquiry_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                if (!bJustEscd)
                {
                    this.Close();
                }
                else
                {
                    bJustEscd = false;
                }
            }
            else
            {
                switch (InputTextBox("INPUT").Text.ToUpper())
                {
                case "A":
                    frmGetBarcode fgb = new frmGetBarcode(ref sEngine);
                    fgb.LastCategory = sItemCategory;
                    fgb.ShowDialog();
                    if (fgb.Barcode != "" && fgb.Barcode != null)
                    {
                        sBarcode = fgb.Barcode;
                        ShowStatsAboutProduct();
                        fgb.Dispose();
                    }
                    break;

                case "E":
                    frmAddEditItem faei = new frmAddEditItem(ref sEngine);
                    faei.EditingBarcode = sBarcode;
                    faei.ShowDialog();
                    faei.Dispose();
                    this.ShowStatsAboutProduct();
                    bJustEscd = true;
                    break;

                case "Q":
                    this.Close();
                    break;

                case "O":
                    frmOrdersWithItemIn fowii = new frmOrdersWithItemIn(ref sEngine, sBarcode);
                    fowii.ShowDialog();
                    this.ShowStatsAboutProduct();
                    bJustEscd = true;
                    break;

                case "I":
                    if (ForAnOrder)
                    {
                        ItemAdded = true;
                        this.Close();
                    }
                    break;

                case "R":
                    if (sMainStock[5] == "1")
                    {
                        sEngine.AddSuggestedOrderItem(sBarcode, sShopCode);
                        MessageBox.Show("Item has been suggested!");
                    }
                    else
                    {
                        MessageBox.Show("Sorry, only type 1 items can be ordered!");
                    }
                    break;

                case "S":
                    frmSuppliersForItem fsfi = new frmSuppliersForItem(ref sEngine, sBarcode);
                    fsfi.ShowDialog();
                    bJustEscd = true;
                    break;

                case "V":
                    frmListOfSales flos = new frmListOfSales(ref sEngine, sBarcode);
                    flos.ShowDialog();
                    bJustEscd = true;
                    break;
                }
                InputTextBox("INPUT").Text = "";
            }
        }