示例#1
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     _fromDate = DateTime.MinValue;
     if (dtpDateFrom.Checked)
     {
         _fromDate = dtpDateFrom.Value;
     }
     _toDate = DateTime.MinValue;
     if (dtpDateTo.Checked)
     {
         _toDate = dtpDateTo.Value;
     }
     _orderID   = 0;
     _orderName = "";
     if (tbOrderID.Text != "")
     {
         try
         {
             _orderID = Convert.ToInt32(tbOrderID.Text);
         }
         catch
         {
             _orderName = tbOrderID.Text;
         }
     }
     _firstName = tbFirstName.Text;
     _lastName  = tbLastName.Text;
     _cityName  = tbCity.Text;
     _state     = cbState.Text;
     _country   = cbCountry.Text;
     _zip       = tbZip.Text;
     _maxNumberOfItemsToReturn = Convert.ToInt32(numericUpDownNumRows.Value);
     _prefetch         = checkBoxPrefetch.Checked;
     btnSearch.Enabled = false;
     _frmStatusBar     = new frmStatusBar();
     _frmStatusBar.Show();
     _frmStatusBar.CancelButtonClicked += FrmStatusBarCancelButtonClicked;
     searchWorker.RunWorkerAsync();
 }
示例#2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            _fromDate = DateTime.MinValue;
            if (dtpDateFrom.Checked)
            {
                _fromDate = dtpDateFrom.Value;
            }
            _toDate = DateTime.MinValue;
            if (dtpDateTo.Checked)
            {
                _toDate = dtpDateTo.Value;
            }
            _orderID   = 0;
            _orderName = "";
            if (tbOrderID.Text != "")
            {
                try
                {
                    _orderID = Convert.ToInt32(tbOrderID.Text);
                }
                catch
                {
                    _orderName = tbOrderID.Text;
                }
            }
            _firstName = tbFirstName.Text;
            _lastName  = tbLastName.Text;
            _cityName  = tbCity.Text;
            _state     = cbState.Text;
            _countries = from country in listBoxCountry.SelectedItems.OfType <CountryRegionEntity>() select country.Name;
            _zip       = tbZip.Text;

            btnSearch.Enabled = false;
            _frmStatusBar     = new frmStatusBar();
            _frmStatusBar.Show();
            _frmStatusBar.CancelButtonClicked += FrmStatusBarCancelButtonClicked;
            searchWorker.RunWorkerAsync();
        }