示例#1
0
        private void barcodeTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            string productID = "";

            if (e.KeyChar == 13)
            {
                productNameTextBox.Text = getProductName(barcodeTextBox.Text);
                productID = getProductID(barcodeTextBox.Text);

                if (productNameTextBox.Text.Length > 0)
                {
                    switch (originModuleID)
                    {
                    case globalConstants.CASHIER_MODULE:
                        originCashierForm = (cashierForm)parentForm;
                        originCashierForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;

                    case globalConstants.PENERIMAAN_BARANG:
                        originPenerimaanForm = (penerimaanBarangForm)parentForm;
                        originPenerimaanForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;

                    case globalConstants.NEW_PURCHASE_ORDER:
                        originPOForm = (purchaseOrderDetailForm)parentForm;
                        originPOForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;

                    case globalConstants.MUTASI_BARANG:
                        originMutasiForm = (dataMutasiBarangDetailForm)parentForm;
                        originMutasiForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;

                    case globalConstants.NEW_REQUEST_ORDER:
                        originRequestForm = (permintaanProdukForm)parentForm;
                        originRequestForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;

                    case globalConstants.RETUR_PENJUALAN:
                        originReturJualForm = (dataReturPenjualanForm)parentForm;
                        originReturJualForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;

                    case globalConstants.RETUR_PEMBELIAN:
                        originReturBeliForm = (dataReturPermintaanForm)parentForm;
                        originReturBeliForm.addNewRowFromBarcode(productID, productNameTextBox.Text);
                        break;
                    }
                }
                barcodeTextBox.SelectAll();
            }
            else if (e.KeyChar == 27)
            {
                this.Close();
            }
        }
示例#2
0
        private void displaySpecificForm()
        {
            switch (originModuleID)
            {
            case globalConstants.STOK_PECAH_BARANG:
                if (null == displayStokPecahBarangForm || displayStokPecahBarangForm.IsDisposed)
                {
                    displayStokPecahBarangForm = new stokPecahBarangForm(selectedProductID);
                }

                displayStokPecahBarangForm.Show();
                displayStokPecahBarangForm.WindowState = FormWindowState.Normal;
                break;

            case globalConstants.PENYESUAIAN_STOK:
                if (null == displayPenyesuaianStokForm || displayPenyesuaianStokForm.IsDisposed)
                {
                    displayPenyesuaianStokForm = new penyesuaianStokForm(selectedProductID);
                }

                displayPenyesuaianStokForm.Show();
                displayPenyesuaianStokForm.WindowState = FormWindowState.Normal;
                break;

            case globalConstants.BROWSE_STOK_PECAH_BARANG:
                parentForm.setNewSelectedProductID(selectedProductID);
                this.Close();
                break;

            case globalConstants.CASHIER_MODULE:
                parentCashierForm.addNewRowFromBarcode(selectedkodeProduct, selectedProductName);
                this.Close();
                break;

            case globalConstants.PENERIMAAN_BARANG:
                parentPenerimaanBarangForm.addNewRowFromBarcode(selectedkodeProduct, selectedProductName);
                this.Close();
                break;

            case globalConstants.NEW_PURCHASE_ORDER:
                parentPOForm.addNewRowFromBarcode(selectedkodeProduct, selectedProductName);
                this.Close();
                break;

            case globalConstants.MUTASI_BARANG:
                parentMutasiForm.addNewRowFromBarcode(selectedkodeProduct, selectedProductName);
                this.Close();
                break;

            case globalConstants.NEW_REQUEST_ORDER:
                parentRequestForm.addNewRowFromBarcode(selectedkodeProduct, selectedProductName);
                this.Close();
                break;

            case globalConstants.RETUR_PENJUALAN:
            case globalConstants.RETUR_PENJUALAN_STOCK_ADJUSTMENT:
                parentReturJualForm.addNewRowFromBarcode(selectedkodeProduct, selectedProductName);
                this.Close();
                break;

            case globalConstants.RETUR_PEMBELIAN_KE_PUSAT:
            case globalConstants.RETUR_PEMBELIAN_KE_SUPPLIER:
                parentReturBeliForm.addNewRowFromBarcode(selectedkodeProduct, selectedProductName);
                this.Close();
                break;

            default:     // MASTER DATA PRODUK
                if (null == editProductForm || editProductForm.IsDisposed)
                {
                    editProductForm = new dataProdukDetailForm(globalConstants.EDIT_PRODUK, selectedProductID);
                }

                editProductForm.Show();
                editProductForm.WindowState = FormWindowState.Normal;
                break;
            }
        }