Пример #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
        public dataProdukForm(int moduleID, dataReturPenjualanForm thisParentForm, string searchParam = "")
        {
            InitializeComponent();

            originModuleID = moduleID;
            parentReturJualForm = thisParentForm;
            returJualSearchParam = searchParam;
            // accessed from other form other than Master -> Data Produk
            // it means that this form is only displayed for browsing / searching purpose only
            newButton.Visible = false;
        }
Пример #3
0
        private void dataPelangganDataGridView_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (dataPelangganDataGridView.Rows.Count <= 0)
                    return;

                int selectedrowindex = dataPelangganDataGridView.SelectedCells[0].RowIndex;

                DataGridViewRow selectedRow = dataPelangganDataGridView.Rows[selectedrowindex];
                selectedCustomerID = Convert.ToInt32(selectedRow.Cells["CUSTOMER_ID"].Value);

                if (originModuleID == globalConstants.CASHIER_MODULE)
                {
                    parentForm.setCustomerID(selectedCustomerID);
                    this.Close();
                }
                else if (originModuleID == globalConstants.RETUR_PENJUALAN_STOCK_ADJUSTMENT)
                {
                    if (null == returPenjualanForm || returPenjualanForm.IsDisposed)
                        returPenjualanForm = new dataReturPenjualanForm(originModuleID, "", selectedCustomerID);

                    returPenjualanForm.Show();
                    returPenjualanForm.WindowState = FormWindowState.Normal;
                }
                else if (originModuleID == globalConstants.PEMBAYARAN_PIUTANG)
                {
                    if (null == pembayaranPiutangLumpSumForm || pembayaranPiutangLumpSumForm.IsDisposed)
                        pembayaranPiutangLumpSumForm = new pembayaranLumpSumForm(originModuleID, selectedCustomerID);

                    pembayaranPiutangLumpSumForm.Show();
                    pembayaranPiutangLumpSumForm.WindowState = FormWindowState.Normal;
                }
                else 
                {
                    if (null == editPelangganForm || editPelangganForm.IsDisposed)
                        editPelangganForm = new dataPelangganDetailForm(globalConstants.EDIT_CUSTOMER, selectedCustomerID);

                    editPelangganForm.Show();
                    editPelangganForm.WindowState = FormWindowState.Normal;
                }
            }
        }
Пример #4
0
        private void unknownCustomerButton_Click(object sender, EventArgs e)
        {
            if (null == unknownCustReturPenjualanForm || unknownCustReturPenjualanForm.IsDisposed)
                    unknownCustReturPenjualanForm = new dataReturPenjualanForm(originModuleID, "", 0);

            unknownCustReturPenjualanForm.Show();
            unknownCustReturPenjualanForm.WindowState = FormWindowState.Normal;
        }
Пример #5
0
        private void dataInvoiceDataGridView_DoubleClick(object sender, EventArgs e)
        {
            if (dataInvoiceDataGridView.Rows.Count <= 0)
                return;

            int rowSelectedIndex = dataInvoiceDataGridView.SelectedCells[0].RowIndex;
            DataGridViewRow selectedRow = dataInvoiceDataGridView.Rows[rowSelectedIndex];

            if (selectedRow.Cells["STATUS BAYAR"].Value.ToString() == "LUNAS" && originModuleID == globalConstants.PEMBAYARAN_PIUTANG)
                return;

            selectedSO = selectedRow.Cells["NO INVOICE"].Value.ToString();

            switch(originModuleID)
            {
                case globalConstants.PEMBAYARAN_PIUTANG:
                    pembayaranPiutangForm pembayaranForm = new pembayaranPiutangForm(selectedSO);
                    pembayaranForm.ShowDialog(this);
                    break;

                case globalConstants.RETUR_PENJUALAN:
                    dataReturPenjualanForm displayedForm = new dataReturPenjualanForm(originModuleID, selectedSO);
                    displayedForm.ShowDialog(this);
                    break;
            }

        }