public dataProdukForm(int moduleID, cashierForm thisParentForm) { InitializeComponent(); originModuleID = moduleID; parentCashierForm = thisParentForm; // 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; }
public dataPelangganForm(int moduleID, cashierForm originForm) { InitializeComponent(); originModuleID = moduleID; parentForm = originForm; if (originModuleID == globalConstants.CASHIER_MODULE) { newButton.Visible = false; // unknownCustomerButton.Visible = false; pelanggangnonactiveoption.Visible = false; } if (originModuleID == globalConstants.RETUR_PENJUALAN_STOCK_ADJUSTMENT) unknownCustomerButton.Visible = true; }
private void captureAll(Keys key) { int posindex = 0; int rowcount = 0; switch (key) { case Keys.F1: cashierHelpForm displayHelp = new cashierHelpForm(); displayHelp.ShowDialog(this); break; case Keys.F2: if (originModuleID != globalConstants.COPY_NOTA) { totalAfterDiscTextBox.Focus(); gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : DISPLAY BARCODE FORM"); if (null == displayBarcodeForm || displayBarcodeForm.IsDisposed) { displayBarcodeForm = new barcodeForm(this, globalConstants.CASHIER_MODULE); displayBarcodeForm.Top = this.Top + 5;// - displayBarcodeForm.Height; displayBarcodeForm.Left = this.Left + 5;// (Screen.PrimaryScreen.Bounds.Width / 2) - (displayBarcodeForm.Width / 2); } displayBarcodeForm.Show(); displayBarcodeForm.WindowState = FormWindowState.Normal; //cashierDataGridView.Focus(); } break; case Keys.F3: if (originModuleID == 0) { gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : CREATE NEW INSTANCE [" + objCounter + "]"); cashierForm displayForm = new cashierForm(objCounter); displayForm.Show(); } break; case Keys.F4: if (originModuleID != globalConstants.COPY_NOTA) { //MessageBox.Show("F4"); gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : DISPLAY PELANGGAN FORM"); if (null == browsePelangganForm || browsePelangganForm.IsDisposed) browsePelangganForm = new dataPelangganForm(globalConstants.CASHIER_MODULE, this); browsePelangganForm.Show(); browsePelangganForm.WindowState = FormWindowState.Normal; } break; case Keys.F5: // NOT USED if (originModuleID != globalConstants.COPY_NOTA) if (DialogResult.Yes == MessageBox.Show("HAPUS DATA DATA DI LAYAR ?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) clearUpScreen(); break; case Keys.F7: if (originModuleID == globalConstants.COPY_NOTA) if (selectedsalesinvoice != "") if (DialogResult.Yes == MessageBox.Show("REPRINT INVOICE ?", "WARNING", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) reprintInvoice(); break; case Keys.F8: // USED if (originModuleID != globalConstants.COPY_NOTA) { gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : HOTKEY TO ADD NEW ROW PRESSED"); //focus to row below rowcount = cashierDataGridView.RowCount; cashierDataGridView.CurrentCell = cashierDataGridView.Rows[rowcount - 1].Cells["productID"]; //if (rowcount > 1) //{ // posindex = cashierDataGridView.CurrentCell.RowIndex; // if (posindex < rowcount - 1) // { // cashierDataGridView.CurrentCell = cashierDataGridView.Rows[posindex + 1].Cells["productID"]; // } //} //addNewRow(); } break; case Keys.F9: if (originModuleID != globalConstants.COPY_NOTA) { gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : HOTKEY TO SAVE AND PRINT OUT INVOICE PRESSED"); saveAndPrintOutInvoice(); } break; case Keys.F11: if (originModuleID != globalConstants.COPY_NOTA) { totalAfterDiscTextBox.Focus(); gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : HOTKEY TO OPEN PRODUK SEARCH FORM PRESSED"); if (null == browseProdukForm || browseProdukForm.IsDisposed) browseProdukForm = new dataProdukForm(globalConstants.CASHIER_MODULE, this); browseProdukForm.Show(); browseProdukForm.WindowState = FormWindowState.Normal; //cashierDataGridView.Focus(); } break; case Keys.Add: bayarTextBox.Focus(); break; case Keys.Subtract: discJualMaskedTextBox.Focus(); break; case Keys.Delete: //if (cashierDataGridView.Focused) //if (!bayarTextBox.Focused && !discJualMaskedTextBox.Focused && // !tempoMaskedTextBox.Focused && !paymentComboBox.Focused && // !customerComboBox.Focused // ) { if (originModuleID != globalConstants.COPY_NOTA) if (cashierDataGridView.Rows.Count > 1) if (DialogResult.Yes == MessageBox.Show("DELETE CURRENT ROW?", "WARNING", MessageBoxButtons.YesNo)) { gutil.saveSystemDebugLog(globalConstants.MENU_PENJUALAN, "CASHIER FORM : cashierDataGridView_KeyDown ATTEMPT TO DELETE ROW"); deleteCurrentRow(); updateRowNumber(); calculateTotal(); } } break; case Keys.F10: MessageBox.Show("F10"); break; case Keys.F12: MessageBox.Show("F12"); break; case Keys.Up: SendKeys.Send("+{TAB}"); break; case Keys.Down: SendKeys.Send("{TAB}"); break; } }
private void dataPenerimaanBarang_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { string noInvoice = ""; if (dataPenerimaanBarang.Rows.Count <= 0) return; int rowSelectedIndex = (dataPenerimaanBarang.SelectedCells[0].RowIndex); DataGridViewRow selectedRow = dataPenerimaanBarang.Rows[rowSelectedIndex]; noInvoice = selectedRow.Cells["NO INVOICE"].Value.ToString(); cashierForm cashierFormDisplay = new cashierForm(noInvoice); cashierFormDisplay.ShowDialog(this); } }
private void toolStripMenuItem18_Click(object sender, EventArgs e) { if (null == displayCashierForm || displayCashierForm.IsDisposed) displayCashierForm = new cashierForm(1); displayCashierForm.Show(); displayCashierForm.WindowState = FormWindowState.Normal; }
private void captureAll(Keys key) { int userAccessOptions = 0; switch (key) { case Keys.F1: if (0 != ( DS.getUserAccessRight(globalConstants.MENU_PRODUK, gutil.getUserGroupID()) * DS.getUserAccessRight(globalConstants.MENU_PURCHASE_ORDER, gutil.getUserGroupID()) * DS.getUserAccessRight(globalConstants.MENU_PENJUALAN, gutil.getUserGroupID()) * DS.getUserAccessRight(globalConstants.MENU_PEMBAYARAN_PIUTANG, gutil.getUserGroupID()) * DS.getUserAccessRight(globalConstants.MENU_PEMBAYARAN_HUTANG_SUPPLIER, gutil.getUserGroupID()) * DS.getUserAccessRight(globalConstants.MENU_TRANSAKSI_HARIAN, gutil.getUserGroupID()) * DS.getUserAccessRight(globalConstants.MENU_RETUR_PEMBELIAN, gutil.getUserGroupID()) * DS.getUserAccessRight(globalConstants.MENU_RETUR_PENJUALAN, gutil.getUserGroupID()) * DS.getUserAccessRight(globalConstants.MENU_MODULE_MESSAGING, gutil.getUserGroupID()) ) ) { adminHelpForm displayHelp = new adminHelpForm(); displayHelp.ShowDialog(this); } break; case Keys.F2: userAccessOptions = DS.getUserAccessRight(globalConstants.MENU_PRODUK, gutil.getUserGroupID()); if (userAccessOptions > 0) { dataProdukForm displayedProdukForm = new dataProdukForm(); displayedProdukForm.ShowDialog(this); } break; case Keys.F3: userAccessOptions = DS.getUserAccessRight(globalConstants.MENU_PURCHASE_ORDER, gutil.getUserGroupID()); if (userAccessOptions > 0) { dataPOForm displayedPOForm = new dataPOForm(); displayedPOForm.ShowDialog(this); } break; case Keys.F4: userAccessOptions = DS.getUserAccessRight(globalConstants.MENU_PENJUALAN, gutil.getUserGroupID()); if (userAccessOptions > 0) { cashierForm displayedCashierForm = new cashierForm(1); displayedCashierForm.ShowDialog(this); } break; case Keys.F5: userAccessOptions = DS.getUserAccessRight(globalConstants.MENU_PEMBAYARAN_PIUTANG, gutil.getUserGroupID()); if (userAccessOptions > 0) { dataInvoiceForm displayedInvoiceForm = new dataInvoiceForm(globalConstants.PEMBAYARAN_PIUTANG); displayedInvoiceForm.ShowDialog(this); } break; case Keys.F6: userAccessOptions = DS.getUserAccessRight(globalConstants.MENU_PEMBAYARAN_HUTANG_SUPPLIER, gutil.getUserGroupID()); if (userAccessOptions > 0) { dataPOForm displayedPOSupplierForm = new dataPOForm(globalConstants.PEMBAYARAN_HUTANG); displayedPOSupplierForm.ShowDialog(this); } break; case Keys.F7: userAccessOptions = DS.getUserAccessRight(globalConstants.MENU_TRANSAKSI_HARIAN, gutil.getUserGroupID()); if (userAccessOptions > 0) { dataTransaksiJurnalHarianDetailForm displayedDJForm = new dataTransaksiJurnalHarianDetailForm(globalConstants.NEW_DJ, selectedUserID); displayedDJForm.ShowDialog(this); } break; case Keys.F8: userAccessOptions = DS.getUserAccessRight(globalConstants.MENU_RETUR_PEMBELIAN, gutil.getUserGroupID()); if (userAccessOptions > 0) { dataReturPermintaanForm displayedRetBeliForm = new dataReturPermintaanForm(globalConstants.RETUR_PEMBELIAN_KE_SUPPLIER); displayedRetBeliForm.ShowDialog(this); } break; case Keys.F9: userAccessOptions = DS.getUserAccessRight(globalConstants.MENU_RETUR_PENJUALAN, gutil.getUserGroupID()); if (userAccessOptions > 0) { dataInvoiceForm displayedRetJualForm = new dataInvoiceForm(globalConstants.RETUR_PENJUALAN); displayedRetJualForm.ShowDialog(this); } break; } }
private void toolStripMenuItem28_Click(object sender, EventArgs e) { cashierForm displayedForm = new cashierForm(globalConstants.DUMMY_TRANSACTION_TAX, true); displayedForm.ShowDialog(this); }
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(); } }