private void buttonSpecAny1_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; gridData.Rows.Clear(); IList records = r_grn.Search(searchText.Text.Trim()); loadResult(records); this.Cursor = Cursors.Default; } catch (Exception x) { KryptonMessageBox.Show(x.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } finally { this.Cursor = Cursors.Default; } }
private void searchToolStripButton_Click(object sender, EventArgs e) { IList result = searchToolStripTextBox.Text == string.Empty ? new ArrayList() : r_grn.Search(searchToolStripTextBox.Text); if (result.Count == 1) { m_po = (GoodReceiveNote)result[0]; m_po = (GoodReceiveNote)r_grn.Get(m_po.ID); m_po.EMPLOYEE = (Employee)r_employee.GetById(m_po.EMPLOYEE); m_po.SUPPLIER = (Supplier)r_sup.GetById(m_po.SUPPLIER); setEditMode(EditMode.View); loadData(); setEnableForm(false); } else { using (SearchGoodReceiveNoteForm frm = new SearchGoodReceiveNoteForm(searchToolStripTextBox.Text, result)) { frm.ShowDialog(); if (frm.GOOD_RECEIVE_NOTE == null) { return; } else { m_po = frm.GOOD_RECEIVE_NOTE; m_po = (GoodReceiveNote)r_grn.Get(m_po.ID); m_po.EMPLOYEE = (Employee)r_employee.GetById(m_po.EMPLOYEE); setEditMode(EditMode.View); loadData(); setEnableForm(false); } } } }