private void txtSupplier_KeyPress(object sender, KeyPressEventArgs e) { if (KeyPressHelper.IsEnter(e)) { var name = ((TextBox)sender).Text; ISupplierBll bll = new SupplierBll(MainProgram.isUseWebAPI, MainProgram.baseUrl, _log); var listOfSupplier = bll.GetByName(name); if (listOfSupplier.Count == 0) { MsgHelper.MsgWarning("Data supplier tidak ditemukan"); txtSupplier.Focus(); txtSupplier.SelectAll(); } else if (listOfSupplier.Count == 1) { _supplier = listOfSupplier[0]; txtSupplier.Text = _supplier.nama_supplier; KeyPressHelper.NextFocus(); } else // data lebih dari satu { var frmLookup = new FrmLookupReferensi("Data Supplier", listOfSupplier); frmLookup.Listener = this; frmLookup.ShowDialog(); } } }
private void LoadSupplier(string name) { ISupplierBll bll = new SupplierBll(_log); _listOfSupplier = bll.GetByName(name); FillDataHelper.FillSupplier(chkListBox, _listOfSupplier); }