private void FrmCetakLabelHargaProduk_KeyDown(object sender, KeyEventArgs e) { if (KeyPressHelper.IsShortcutKey(Keys.F11, e)) { btnPindahKeDaftarCetak_Click(sender, new EventArgs()); } }
private void FrmEntryPengeluaranBiaya_KeyDown(object sender, KeyEventArgs e) { if (KeyPressHelper.IsShortcutKey(Keys.F1, e)) // tambah data jenis pengeluaran { ShowEntryJenisPengeluaran(); } }
private void FrmSettingReportStandard_KeyDown(object sender, KeyEventArgs e) { if (KeyPressHelper.IsShortcutKey(Keys.F10, e)) { Preview(); } }
private void gridControl_KeyDown(object sender, KeyEventArgs e) { // kasus khusus untuk shortcut F2, tidak jalan jika dipanggil melalui event Form KeyDown if (KeyPressHelper.IsShortcutKey(Keys.F2, e)) // tambahan data customer { ShowEntryCustomer(); } }
private void FrmSettingReportEmptyBody_KeyDown(object sender, KeyEventArgs e) { if (KeyPressHelper.IsShortcutKey(Keys.F10, e)) { Preview(); e.SuppressKeyPress = true; } }
private void FrmLookupStandard_KeyDown(object sender, KeyEventArgs e) { if (KeyPressHelper.IsShortcutKey(Keys.F10, e)) { if (btnPilih.Enabled) { Pilih(); } } }
private void FrmEntryPenjualanProduk_KeyDown(object sender, KeyEventArgs e) { if (KeyPressHelper.IsShortcutKey(Keys.F1, e)) // tambah data produk { ShowEntryProduk(); } else if (KeyPressHelper.IsShortcutKey(Keys.F2, e)) // tambahan data customer { ShowEntryCustomer(); } }
private void FrmEntryPembelianProduk_KeyDown(object sender, KeyEventArgs e) { if (KeyPressHelper.IsShortcutKey(Keys.F1, e)) // tambah data produk { ShowEntryProduk(); } else if (KeyPressHelper.IsShortcutKey(Keys.F2, e)) // tambahan data supplier { ShowEntrySupplier(); } }
private void FrmLookupEmptyBody_KeyDown(object sender, KeyEventArgs e) { if (KeyPressHelper.IsShortcutKey(Keys.F10, e)) { if (btnPilih.Enabled) { Pilih(); } e.SuppressKeyPress = true; } }
private void FrmEntryPenjualanProduk_KeyDown(object sender, KeyEventArgs e) { if (KeyPressHelper.IsShortcutKey(Keys.F1, e)) // tambah data produk { ShowEntryProduk(); } else if (KeyPressHelper.IsShortcutKey(Keys.F2, e)) // tambahan data customer { ShowEntryCustomer(); } else if (KeyPressHelper.IsShortcutKey(Keys.F5, e) || KeyPressHelper.IsShortcutKey(Keys.F6, e) || KeyPressHelper.IsShortcutKey(Keys.F7, e)) { var colIndex = 4; var rowIndex = this.gridControl.CurrentCell.RowIndex; switch (e.KeyCode) { case Keys.F5: // edit jumlah colIndex = 4; break; case Keys.F6: // edit diskon colIndex = 5; break; case Keys.F7: // edit harga colIndex = 6; break; default: break; } if (gridControl.RowCount > 1 && gridControl.RowCount == rowIndex) { gridControl.Focus(); GridListControlHelper.SetCurrentCell(gridControl, _listOfItemJual.Count - 1, colIndex); } } }
private void Shortcut(object sender, KeyEventArgs e) { double total = 0; try { if (e.Modifiers == Keys.Control && e.KeyCode == Keys.B) // pembatalan transaksi { total = SumGrid(_listOfItemJual); if (total > 0) { ResetTransaksi(); // reset transaksi dengan menampilkan pesan konfirmasi } } else if (e.Modifiers == Keys.Control && e.KeyCode == Keys.D) // hapus item transaksi { total = SumGrid(_listOfItemJual); if (total > 0) { HapusItemTransaksi(); // hapus item transaksi } } else if (e.Modifiers == Keys.Control && e.KeyCode == Keys.N) // tanpa nota/struk { if (_isCetakStruk) { _isCetakStruk = false; ShowMessage("Tanpa nota/struk transaksi", true); } } else if (e.Modifiers == Keys.Control && e.KeyCode == Keys.X) // tutup form aktif { this.Close(); } else { if (KeyPressHelper.IsShortcutKey(Keys.F5, e) || KeyPressHelper.IsShortcutKey(Keys.F6, e) || KeyPressHelper.IsShortcutKey(Keys.F7, e)) { var colIndex = 5; var rowIndex = this.gridControl.CurrentCell.RowIndex; switch (e.KeyCode) { case Keys.F5: // edit jumlah colIndex = 5; break; case Keys.F6: // edit diskon colIndex = 6; break; case Keys.F7: // edit harga colIndex = 7; break; default: break; } if (gridControl.RowCount > 1 && gridControl.RowCount == rowIndex) { gridControl.Focus(); GridListControlHelper.SetCurrentCell(gridControl, _listOfItemJual.Count - 1, colIndex); } } else { switch (e.KeyCode) { case Keys.F3: // input produk gridControl.Focus(); GridListControlHelper.SetCurrentCell(gridControl, _listOfItemJual.Count, 2); // fokus ke kolom kode produk break; case Keys.F4: // cari/reset pelanggan if (_customer == null) // cari pelanggan { txtCustomer.Enabled = true; txtCustomer.Focus(); } else // reset pelanggan { _customer = null; txtCustomer.Clear(); lblStatusBar.Text = lblStatusBar.Text.Replace("Reset Pelanggan", "Cari Pelanggan"); } break; case Keys.F8: // cek nota terakhir var jual = _bll.GetListItemNotaTerakhir(_pengguna.pengguna_id, MainProgram.mesinId); if (jual == null) { ShowMessage("Belum ada info nota terakhir", true); return; } jual.item_jual = _bll.GetItemJual(jual.jual_id); var frmInfoNota = new FrmInfoNotaTerakhir("Info Nota Terakhir", jual); frmInfoNota.ShowDialog(); break; case Keys.F10: // bayar e.SuppressKeyPress = true; if (this._jual == null) { _jual = new JualProduk(); } _jual.total_nota = SumGrid(_listOfItemJual); if (!(_jual.total_nota > 0)) { ShowMessage("Anda belum melengkapi inputan data produk !", true); return; } _jual.pengguna_id = this._pengguna.pengguna_id; _jual.Pengguna = this._pengguna; if (this._customer != null) { _jual.customer_id = this._customer.customer_id; _jual.Customer = this._customer; } _jual.nota = _currentNota; _jual.tanggal = DateTime.Today; _jual.tanggal_tempo = DateTimeHelper.GetNullDateTime(); _jual.is_tunai = true; _jual.item_jual = this._listOfItemJual.Where(f => f.Produk != null).ToList(); foreach (var item in _jual.item_jual) { if (!(item.harga_beli > 0)) { item.harga_beli = item.Produk.harga_beli; } if (!(item.harga_jual > 0)) { item.harga_jual = GetHargaJualFix(item.Produk, item.jumlah - item.jumlah_retur, item.Produk.harga_jual); } } DisplayTotal(lblTotal.Text); var frmBayar = new FrmBayar("Pembayaran", _jual, _bll); frmBayar.Listener = this; frmBayar.ShowDialog(); break; default: break; } } } } catch (Exception ex) { _log.Error("Error:", ex); } }