Ejemplo n.º 1
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            int internalProductID;

            if (saveData())
            {
                gUtil.showSuccess(options);

                if (originModuleID == globalConstants.STOK_PECAH_BARANG)
                {
                    internalProductID = getInternalProductID(selectedProductID);
                    parentForm.setNewSelectedProductID(internalProductID);

                    this.Close();
                }

                switch (originModuleID)
                {
                case globalConstants.NEW_PRODUK:
                    gUtil.saveUserChangeLog(globalConstants.MENU_PRODUK, globalConstants.CHANGE_LOG_INSERT, "INSERT NEW PRODUK [" + namaProdukTextBox.Text + "]");
                    break;

                case globalConstants.EDIT_PRODUK:
                    if (nonAktifCheckbox.Checked == true)
                    {
                        gUtil.saveUserChangeLog(globalConstants.MENU_PRODUK, globalConstants.CHANGE_LOG_UPDATE, "UPDATE PRODUK [" + namaProdukTextBox.Text + "] STATUS PRODUK NON-AKTIF");
                    }
                    else
                    {
                        gUtil.saveUserChangeLog(globalConstants.MENU_PRODUK, globalConstants.CHANGE_LOG_UPDATE, "UPDATE PRODUK [" + namaProdukTextBox.Text + "] STATUS PRODUK AKTIF");
                    }
                    break;

                case globalConstants.PENERIMAAN_BARANG:
                    penerimaanForm.addNewRowFromBarcode(selectedProductID, namaProdukTextBox.Text.Trim());
                    this.Close();
                    break;
                }

                gUtil.ResetAllControls(this);

                currentSelectedKategoriID.Clear();
                produkKategoriTextBox.Clear();

                stokAwalTextBox.Text    = "0";
                limitStokTextBox.Text   = "0";
                hppTextBox.Text         = "0";
                hargaEcerTextBox.Text   = "0";
                hargaGrosirTextBox.Text = "0";
                hargaPartaiTextBox.Text = "0";

                selectedPhoto = "";
                panelImage.BackgroundImage = null;

                errorLabel.Text = "";

                for (int i = 0; i < detailLokasiDataGridView.Rows.Count; i++)
                {
                    detailLokasiDataGridView.Rows[i].Cells["locationQty"].Value = 0;
                }

                originModuleID = globalConstants.NEW_PRODUK;
                options        = gUtil.INS;
            }
        }
Ejemplo n.º 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, selectedRowIndex);
                this.Close();
                break;

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

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

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

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

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

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

            case globalConstants.PRODUCT_BC:
                parentBarcodeForm.addNewRowFromBarcode(selectedkodeProduct, selectedProductName, selectedRowIndex);
                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;
            }
        }
        private void saveButton_Click(object sender, EventArgs e)
        {
            int internalProductID;

            if (saveData())
            {
                gUtil.showSuccess(options);

                if (originModuleID == globalConstants.NEW_PRODUK)
                {
                    kodeProdukTextBox.Select();
                }
                else
                {
                    //barcodeTextBox.Select();
                    this.Close();
                }

                if (originModuleID == globalConstants.STOK_PECAH_BARANG)
                {
                    internalProductID = getInternalProductID(productID);
                    parentForm.setNewSelectedProductID(internalProductID);

                    this.Close();
                }

                switch (originModuleID)
                {
                case globalConstants.NEW_PRODUK:
                    gUtil.saveUserChangeLog(globalConstants.MENU_PRODUK, globalConstants.CHANGE_LOG_INSERT, "INSERT NEW PRODUK [" + namaProdukTextBox.Text + "]");
                    break;

                case globalConstants.EDIT_PRODUK:
                    if (nonAktifCheckbox.Checked == true)
                    {
                        gUtil.saveUserChangeLog(globalConstants.MENU_PRODUK, globalConstants.CHANGE_LOG_UPDATE, "UPDATE PRODUK [" + namaProdukTextBox.Text + "] STATUS PRODUK NON-AKTIF");
                    }
                    else
                    {
                        gUtil.saveUserChangeLog(globalConstants.MENU_PRODUK, globalConstants.CHANGE_LOG_UPDATE, "UPDATE PRODUK [" + namaProdukTextBox.Text + "] STATUS PRODUK AKTIF");
                    }
                    break;
                }

                gUtil.ResetAllControls(this);
                clearUpProductCategory();

                stokAwalTextBox.Text    = "0";
                limitStokTextBox.Text   = "0";
                hppTextBox.Text         = "0";
                hargaEcerTextBox.Text   = "0";
                hargaGrosirTextBox.Text = "0";
                hargaBSTextBox.Text     = "0";

                selectedPhoto = "";
                panelImage.BackgroundImage = null;

                errorLabel.Text = "";

                originModuleID            = globalConstants.NEW_PRODUK;
                options                   = gUtil.INS;
                kodeProdukTextBox.Enabled = true;
            }
        }