private void dataPurchaseOrder_KeyDown(object sender, KeyEventArgs e) { string selectedPurchaseInvoice; if (e.KeyCode == Keys.Enter) { if (dataPurchaseOrder.Rows.Count <= 0) { return; } int rowSelectedIndex = (dataPurchaseOrder.SelectedCells[0].RowIndex); DataGridViewRow selectedRow = dataPurchaseOrder.Rows[rowSelectedIndex]; if (originModuleID == 0) { if (null == editPOForm || editPOForm.IsDisposed) { selectedPOID = Convert.ToInt32(selectedRow.Cells["ID"].Value); editPOForm = new purchaseOrderDetailForm(globalConstants.EDIT_PURCHASE_ORDER, selectedPOID); } editPOForm.Show(); editPOForm.WindowState = FormWindowState.Normal; } else if (originModuleID == globalConstants.PENERIMAAN_BARANG_DARI_PO) { selectedPurchaseInvoice = selectedRow.Cells["NO PURCHASE"].Value.ToString(); if (null != parentForm) { penerimaanBarangForm originForm = (penerimaanBarangForm)parentForm; originForm.setSelectedInvoice(selectedPurchaseInvoice); } this.Close(); //penerimaanBarangForm displayedPenerimaanForm = new penerimaanBarangForm(originModuleID, selectedPurchaseInvoice); //displayedPenerimaanForm.ShowDialog(this); } else if (originModuleID == globalConstants.PEMBAYARAN_HUTANG) { if (null == displayPembayaranHutang || displayPembayaranHutang.IsDisposed) { selectedPurchaseInvoice = selectedRow.Cells["NO PURCHASE"].Value.ToString(); displayPembayaranHutang = new pembayaranHutangForm(selectedPurchaseInvoice); } displayPembayaranHutang.Show(); displayPembayaranHutang.WindowState = FormWindowState.Normal; } else if (originModuleID == globalConstants.REPRINT_PURCHASE_ORDER) { if (DialogResult.Yes == MessageBox.Show("RE-PRINT PO ?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) { selectedPurchaseInvoice = selectedRow.Cells["NO PURCHASE"].Value.ToString(); printOutPurchaseOrder(selectedPurchaseInvoice); } } // loadPOData(); } }
private void dataPurchaseOrder_DoubleClick(object sender, EventArgs e) { string selectedPurchaseInvoice; if (dataPurchaseOrder.Rows.Count <= 0) { return; } int rowSelectedIndex = (dataPurchaseOrder.SelectedCells[0].RowIndex); DataGridViewRow selectedRow = dataPurchaseOrder.Rows[rowSelectedIndex]; if (originModuleID == 0) { selectedPOID = Convert.ToInt32(selectedRow.Cells["ID"].Value); purchaseOrderDetailForm displayedForm = new purchaseOrderDetailForm(globalConstants.EDIT_PURCHASE_ORDER, selectedPOID); displayedForm.ShowDialog(this); } else if (originModuleID == globalConstants.PENERIMAAN_BARANG_DARI_PO) { selectedPurchaseInvoice = selectedRow.Cells["NO PURCHASE"].Value.ToString(); if (null != parentForm) { penerimaanBarangForm originForm = (penerimaanBarangForm)parentForm; originForm.setSelectedInvoice(selectedPurchaseInvoice); } this.Close(); //penerimaanBarangForm displayedPenerimaanForm = new penerimaanBarangForm(originModuleID, selectedPurchaseInvoice); //displayedPenerimaanForm.ShowDialog(this); } else if (originModuleID == globalConstants.PEMBAYARAN_HUTANG) { selectedPurchaseInvoice = selectedRow.Cells["NO PURCHASE"].Value.ToString(); pembayaranHutangForm displayedPembayaranForm = new pembayaranHutangForm(selectedPurchaseInvoice); displayedPembayaranForm.ShowDialog(this); } else if (originModuleID == globalConstants.REPRINT_PURCHASE_ORDER) { selectedPurchaseInvoice = selectedRow.Cells["NO PURCHASE"].Value.ToString(); printOutPurchaseOrder(selectedPurchaseInvoice); } loadPOData(); }
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; } }