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_do = (DeliveryOrder)result[0]; m_do = (DeliveryOrder)r_grn.Get(m_do.ID); m_do.EMPLOYEE = (Employee)r_employee.GetById(m_do.EMPLOYEE); m_do.CUSTOMER = (Customer)r_sup.GetById(m_do.CUSTOMER); setEditMode(EditMode.View); loadData(); setEnableForm(false); } else { using (SearchDeliveryOrderForm frm = new SearchDeliveryOrderForm(searchToolStripTextBox.Text, result)) { frm.ShowDialog(); if (frm.DELIVERY_ORDER == null) { return; } else { m_do = frm.DELIVERY_ORDER; m_do = (DeliveryOrder)r_grn.Get(m_do.ID); m_do.EMPLOYEE = (Employee)r_employee.GetById(m_do.EMPLOYEE); setEditMode(EditMode.View); loadData(); setEnableForm(false); } } } }