public void Ok(object sender, object data) { if (data is ItemJualProduk) // pencarian produk baku { var itemJual = (ItemJualProduk)data; var produk = itemJual.Produk; if (!IsExist(produk.produk_id)) { SetItemProduk(this.gridControl, _rowIndex, itemJual, itemJual.jumlah - itemJual.jumlah_retur, itemJual.harga_jual); this.gridControl.Refresh(); RefreshTotal(); GridListControlHelper.SetCurrentCell(this.gridControl, _rowIndex, _colIndex + 1); RefreshTotal(); } else { MsgHelper.MsgWarning("Data produk sudah diinputkan"); GridListControlHelper.SelectCellText(this.gridControl, _rowIndex, _colIndex); } } else if (data is Customer) // pencarian customer { this._customer = (Customer)data; txtCustomer.Text = this._customer.nama_customer; KeyPressHelper.NextFocus(); } else if (data is JualProduk) // pencarian data jual { IJualProdukBll bll = new JualProdukBll(_log); this._jual = (JualProduk)data; this._jual.item_jual = bll.GetItemJual(this._jual.jual_id).ToList(); txtNotaJual.Text = this._jual.nota; KeyPressHelper.NextFocus(); } }
private void txtNotaJual_KeyPress(object sender, KeyPressEventArgs e) { if (KeyPressHelper.IsEnter(e)) { if (this._customer == null || txtCustomer.Text.Length == 0) { MsgHelper.MsgWarning("Maaf isian data belum lengkap !"); txtCustomer.Focus(); return; } var nota = ((TextBox)sender).Text; IJualProdukBll bll = new JualProdukBll(_log); var listOfJual = bll.GetNotaCustomer(this._customer.customer_id, nota); if (listOfJual.Count == 0) { MsgHelper.MsgWarning("Data nota jual tidak ditemukan"); txtNotaJual.Focus(); txtNotaJual.SelectAll(); } else if (listOfJual.Count == 1) { _jual = listOfJual[0]; _jual.item_jual = bll.GetItemJual(_jual.jual_id).ToList(); txtNotaJual.Text = _jual.nota; KeyPressHelper.NextFocus(); } else // data lebih dari satu { var frmLookup = new FrmLookupNota("Data Nota Penjualan", listOfJual); frmLookup.Listener = this; frmLookup.ShowDialog(); } } }
protected override void Pilih() { var rowIndex = this.gridList.SelectedIndex; if (!base.IsSelectedItem(rowIndex, this.Text)) { return; } if (_pengaturanUmum.is_auto_print) { if (MsgHelper.MsgKonfirmasi("Apakah proses pencetakan ingin dilanjutkan ?")) { var jual = _listOfJual[rowIndex]; if (jual != null) { IJualProdukBll bll = new JualProdukBll(_log); jual.item_jual = bll.GetItemJual(jual.jual_id).ToList(); } switch (_pengaturanUmum.jenis_printer) { case JenisPrinter.DotMatrix: CetakNotaDotMatrix(jual); break; case JenisPrinter.MiniPOS: CetakNotaMiniPOS(jual); break; default: // do nothing break; } } } }
private void LoadItemJual(JualProduk jualProduk) { IJualProdukBll bll = new JualProdukBll(_log); _jual.item_jual = bll.GetItemJual(_jual.jual_id).ToList(); }