private void detailPMDataGridView_KeyDown(object sender, KeyEventArgs e)
        {
            string selectedPurchaseInvoice = "";
            string selectedSO = "";
            int rowSelectedIndex = 0;

            if (detailPMDataGridView.Rows.Count <= 0)
                return;

            if (e.KeyCode == Keys.Enter)
            { 
                rowSelectedIndex = detailPMDataGridView.SelectedCells[0].RowIndex;
                DataGridViewRow selectedRow = detailPMDataGridView.Rows[rowSelectedIndex];

                if (originModuleID == globalConstants.PEMBAYARAN_PIUTANG)
                {
                    if (selectedRow.Cells["SISA PIUTANG"].Value.ToString() == "0")
                        return;

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

                    pembayaranPiutangForm pembayaranForm = new pembayaranPiutangForm(selectedSO);
                    pembayaranForm.ShowDialog(this);

                }
                else if (originModuleID == globalConstants.PEMBAYARAN_HUTANG)
                {
                    if (selectedRow.Cells["SISA HUTANG"].Value.ToString() == "0")
                        return;

                    selectedPurchaseInvoice = selectedRow.Cells["PURCHASE INVOICE"].Value.ToString();
                    pembayaranHutangForm displayedPembayaranForm = new pembayaranHutangForm(selectedPurchaseInvoice);
                    displayedPembayaranForm.ShowDialog(this);
                }
            }
        }
Esempio n. 2
0
        private void displaySpecificForm(int moduleID, string identifierNo)
        {
            int productID = 0;
            switch (moduleID)
            {
                case globalConstants.MENU_TRANSAKSI_PENJUALAN:
                    pembayaranPiutangForm displayPiutangForm = new pembayaranPiutangForm(identifierNo);
                    displayPiutangForm.ShowDialog(this);
                    break;

                case globalConstants.MENU_PURCHASE_ORDER:
                    pembayaranHutangForm displayHutangForm = new pembayaranHutangForm(identifierNo);
                    displayHutangForm.ShowDialog(this);
                    break;

                case globalConstants.MENU_PEMBAYARAN_PIUTANG:
                    pembayaranPiutangForm displayPiutangFormConfirm = new pembayaranPiutangForm(identifierNo);
                    displayPiutangFormConfirm.ShowDialog(this);
                    break;

                case globalConstants.MENU_PEMBAYARAN_HUTANG_SUPPLIER:
                    pembayaranHutangForm displayHutangFormConfirm = new pembayaranHutangForm(identifierNo);
                    displayHutangFormConfirm.ShowDialog(this);
                    break;

                case globalConstants.MENU_REQUEST_ORDER:
                    dataMutasiBarangDetailForm displayedForm = new dataMutasiBarangDetailForm(globalConstants.CEK_DATA_MUTASI, identifierNo);
                    displayedForm.ShowDialog(this);
                    break;

                case globalConstants.MENU_PRODUK:
                    productID = Convert.ToInt32(DS.getDataSingleValue("SELECT ID FROM MASTER_PRODUCT WHERE PRODUCT_ID = '"+identifierNo+"'"));
                    dataProdukDetailForm displayProdukDetail = new dataProdukDetailForm(globalConstants.EDIT_PRODUK, productID);
                    displayProdukDetail.ShowDialog(this);
                    break;

            }
        }
Esempio n. 3
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;
            }

        }