Example #1
0
 private void buttonSpecAny1_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         gridData.Rows.Clear();
         IList records = r_stocktaking.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_stocktaking.Search(searchToolStripTextBox.Text);

            if (result.Count == 1)
            {
                m_stocktaking           = (StockTaking)result[0];
                m_stocktaking           = (StockTaking)r_stocktaking.Get(m_stocktaking.ID);
                m_stocktaking.EMPLOYEE  = (Employee)r_employee.GetById(m_stocktaking.EMPLOYEE);
                m_stocktaking.WAREHOUSE = (Warehouse)r_warehouse.GetById(m_stocktaking.WAREHOUSE);
                m_stocktaking.CURRENCY  = (Currency)r_ccy.GetById(m_stocktaking.CURRENCY);
                loadData();
                setEnableForm(false);
                setEditMode(EditMode.View);
            }
            else
            {
                using (SearchStockTakingForm frm = new SearchStockTakingForm(searchToolStripTextBox.Text, result))
                {
                    frm.ShowDialog();
                    if (frm.STOCK_TAKING == null)
                    {
                        return;
                    }
                    else
                    {
                        m_stocktaking           = frm.STOCK_TAKING;
                        m_stocktaking           = (StockTaking)r_stocktaking.Get(m_stocktaking.ID);
                        m_stocktaking.EMPLOYEE  = (Employee)r_employee.GetById(m_stocktaking.EMPLOYEE);
                        m_stocktaking.WAREHOUSE = (Warehouse)r_warehouse.GetById(m_stocktaking.WAREHOUSE);
                        m_stocktaking.CURRENCY  = (Currency)r_ccy.GetById(m_stocktaking.CURRENCY);
                        loadData();
                        setEnableForm(false);
                        setEditMode(EditMode.View);
                    }
                }
            }
        }