Example #1
0
 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;
     }
 }
Example #2
0
        private void searchToolStripButton_Click(object sender, EventArgs e)
        {
            IList result = searchToolStripTextBox.Text == string.Empty ? new ArrayList() : r_prn.Search(searchToolStripTextBox.Text);

            if (result.Count == 1)
            {
                m_prn          = (SalesReturn)result[0];
                m_prn          = (SalesReturn)r_prn.Get(m_prn.ID);
                m_prn.EMPLOYEE = (Employee)r_employee.GetById(m_prn.EMPLOYEE);
                m_prn.CUSTOMER = (Customer)r_sup.GetById(m_prn.CUSTOMER);
                setEditMode(EditMode.View);
                loadData();
                setEnableForm(false);
            }
            else
            {
                using (SearchSalesReturnForm frm = new SearchSalesReturnForm(searchToolStripTextBox.Text, result))
                {
                    frm.ShowDialog();
                    if (frm.SALES_RETURN == null)
                    {
                        return;
                    }
                    else
                    {
                        m_prn          = frm.SALES_RETURN;
                        m_prn          = (SalesReturn)r_prn.Get(m_prn.ID);
                        m_prn.EMPLOYEE = (Employee)r_employee.GetById(m_prn.EMPLOYEE);
                        m_prn.CUSTOMER = (Customer)r_sup.GetById(m_prn.CUSTOMER);
                        setEditMode(EditMode.View);
                        loadData();
                        setEnableForm(false);
                    }
                }
            }
        }