Ejemplo n.º 1
0
 private void buttonSpecAny1_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         gridData.Rows.Clear();
         IList records = r_po.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;
     }
 }
Ejemplo n.º 2
0
        private void searchToolStripButton_Click(object sender, EventArgs e)
        {
            IList result = searchToolStripTextBox.Text == string.Empty ? new ArrayList() : r_si.Search(searchToolStripTextBox.Text);

            if (result.Count == 1)
            {
                m_si          = (POS)result[0];
                m_si          = (POS)r_si.Get(m_si.ID);
                m_si.EMPLOYEE = (Employee)r_employee.GetById(m_si.EMPLOYEE);
                m_si.CURRENCY = (Currency)r_ccy.GetById(m_si.CURRENCY);
                m_si.DIVISION = (Division)r_division.GetById(m_si.DIVISION);
                m_si.TOP      = (TermOfPayment)r_top.GetById(m_si.TOP);
                m_si.TAX      = m_si.TAX == null ? null : (Tax)r_tax.GetById(m_si.TAX);
                m_si.CUSTOMER = (Customer)r_sup.GetById(m_si.CUSTOMER);
                setEditMode(EditMode.View);
                loadData();
                setEnableForm(false);
            }
            else
            {
                using (SearchPOSForm frm = new SearchPOSForm(searchToolStripTextBox.Text, result))
                {
                    frm.ShowDialog();
                    if (frm.POS == null)
                    {
                        return;
                    }
                    else
                    {
                        m_si          = frm.POS;
                        m_si          = (POS)r_si.Get(m_si.ID);
                        m_si.EMPLOYEE = (Employee)r_employee.GetById(m_si.EMPLOYEE);
                        m_si.CURRENCY = (Currency)r_ccy.GetById(m_si.CURRENCY);
                        m_si.DIVISION = (Division)r_division.GetById(m_si.DIVISION);
                        m_si.TOP      = (TermOfPayment)r_top.GetById(m_si.TOP);
                        m_si.TAX      = m_si.TAX == null ? null : (Tax)r_tax.GetById(m_si.TAX);
                        m_si.CUSTOMER = (Customer)r_sup.GetById(m_si.CUSTOMER);
                        setEditMode(EditMode.View);
                        loadData();
                        setEnableForm(false);
                        //setEditMode(EditMode.View);
                    }
                }
            }
        }