예제 #1
0
        private void SearchButton_Click(object sender, EventArgs e)
        {
            int runFlag = 1;

            if (SearchBox.Text == "")
            {
                ClassBackEnd.Book.Clear();
                nPage = 1;
                DataSheetLoad(1);
                return;
            }
            NoResultTextBox.Hide();
            AddBookButton.Hide();
            ResultDataSheet.Rows.Clear();
            lastState  = ButtonState;
            lastString = SearchBox.Text;
            LoadGIFBox.Show();
            if (SearchWorker.IsBusy)
            {
                runFlag = 0;
                SearchWorker.CancelAsync();
            }
            if (runFlag != 0)
            {
                SearchWorker.RunWorkerAsync();
            }
        }
예제 #2
0
 private void ProcessingDialogShown(object sender, EventArgs e)
 {
     if (!SearchWorker.IsBusy)
     {
         SearchWorker.RunWorkerAsync(_path);
     }
 }
예제 #3
0
        private void SearchResultForm_Load(object sender, EventArgs e)
        {
            if ((bool)Tag == true)
            {
                SearchWorker.RunWorkerAsync();
            }
            else
            {
                JumpPTextBox.Text = nPage.ToString();
                PageTextBox.Text  = maxPage.ToString();
                DataSheetLoad(nPage);
            }
            #region 返回按钮处理
            frmMain.ReturnButton.Tag = 1;//1 第一层  2 第二层
            Point t = new Point(61, 11);
            frmMain.ReturnButton.Show();
            frmMain.TitleLabel.Location = t;
            #endregion

            #region 默认搜索条件:全部检索
            AllBackground.Show();
            SearchAll.ForeColor = Color.White;//默认检索条件:全部检索
            SearchAll.BackColor = Color.FromArgb(26, 148, 129);
            ISBNBackground.Hide();
            NameBackground.Hide();
            AuthorBackground.Hide();
            PublisherBackgound.Hide();
            LabelBackground.Hide();
            ButtonState = 1;
            #endregion
        }
        private void SearchWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            lstvUsers.Items.Clear();
            // check if previews search matches
            if (lastSearchBGW != txbSearch.Text)
            {
                SearchWorker.RunWorkerAsync(txbSearch.Text);
                lastSearchBGW = txbSearch.Text;
                return;
            }


            dbDataSet.EmployeesDataTable eDt = (dbDataSet.EmployeesDataTable)e.Result;
            if (eDt.Count == 0)
            {
                return;
            }

            int i = 0;

            //this.Text = eDt[0].GivenName;
            do
            {
                ListViewItem lstv = new ListViewItem();
                lstv.Text = eDt[i].GivenName;
                lstv.SubItems.Add(eDt[i].MiddleName);
                lstv.SubItems.Add(eDt[i].FamilyName);
                lstv.SubItems.Add(eDt[i].LoginName);
                lstv.SubItems.Add(eDt[i].Acces_Name);
                lstv.SubItems.Add(eDt[i].Id + "");

                lstvUsers.Items.Add(lstv);
            } while (++i < eDt.Count);
        }
        private void deleteSelected_Click(object sender, EventArgs e)
        {
            //MessageBox.Show(lstvUsers.SelectedItems[0].SubItems[5].Text);
            dbDataSet.EmployeesDataTable init = new dbDataSet.EmployeesDataTable();
            employeesTableAdapterMain.DeleteQueryById(int.Parse(lstvUsers.SelectedItems[0].SubItems[5].Text));

            SearchWorker.RunWorkerAsync(txbSearch.Text);
            lastSearchBGW = txbSearch.Text;
        }
 private void txbSearch_TextChanged(object sender, EventArgs e)
 {
     if (!SearchWorker.IsBusy && txbSearch.Text.Length >= 3)
     {
         SearchWorker.RunWorkerAsync(txbSearch.Text);
         lastSearchBGW = txbSearch.Text;
     }
     else
     {
         lstvUsers.Items.Clear();
     }
 }
 private void refreshToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!SearchWorker.IsBusy && txbSearch.Text.Length >= 3)
     {
         SearchWorker.RunWorkerAsync(txbSearch.Text);
         lastSearchBGW = txbSearch.Text;
     }
     else
     {
         lstvUsers.Items.Clear();
     }
 }
        private void btnCalculate_Click(object sender, EventArgs e)
        {
            BizLojaVenda bizLojaVenda = new BizLojaVenda();
            int          num;

            if (!int.TryParse(txtAño.Text, out num))
            {
                MessageBox.Show("No se ingreso un año valido");
                return;
            }

            if (!int.TryParse(cmbMes.SelectedItem.ToString(), out num))
            {
                MessageBox.Show("No se ingreso un mes valido");
                return;
            }

            btnBuscar.BackColor = Color.LightSteelBlue;



            dtDesde = DateTime.Parse(txtAño.Text + "/" + cmbMes.SelectedItem.ToString() + "/01");
            dtHasta = (dtDesde.AddMonths(1)).AddDays(-1);

            /*Filtro de ventas por tienda*/
            if (cmbTienda.SelectedValue.ToString() == "_0")
            {
                lstLojaVenda = bizLojaVenda.getLojaVendaList(dtDesde, dtHasta);
            }
            else
            {
                lstLojaVenda = bizLojaVenda.getLojaVendaList(dtDesde, dtHasta, new FILIAIS()
                {
                    COD_FILIAL = cmbTienda.SelectedValue.ToString()
                });
            }

            numVentas = lstLojaVenda.Count;

            lblResultados.Text    = "Se encontraron " + numVentas + " tickets ";
            lblResultados.Visible = true;

            btnCalcular.Enabled   = true;
            btnCalcular.BackColor = Color.LightSalmon;

            btnCalcular.Enabled              = false;
            SearchWorker.DoWork             += new DoWorkEventHandler(searchDoWork);
            SearchWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(searchWorkerCompleted);
            SearchWorker.ProgressChanged    += new ProgressChangedEventHandler(searchWorker_ProgressChanged);
            SearchWorker.RunWorkerAsync();
        }
예제 #9
0
        private void SearchButton_Click(object sender, EventArgs e)
        {
            int runFlag = 1;

            ResultDataSheet.Rows.Clear();
            lastState  = ButtonState;
            lastString = SearchBox.Text;
            LoadGIFBox.Show();
            if (SearchWorker.IsBusy)
            {
                runFlag = 0;
                SearchWorker.CancelAsync();
            }
            if (runFlag != 0)
            {
                SearchWorker.RunWorkerAsync();
            }
        }
예제 #10
0
        public void Search()
        {
            if (IsSearching)
            {
                SearchPending = true;
                CancelSearch();
                return;
            }

            SearchPending = false;
            if (Directory.Exists(SelectedDirectory))
            {
                TheSettings.WelcomeList.Clear();
                SaveFiles.Clear();

                SearchWorker.RunWorkerAsync();
                IsSearching = true;

                Log.Info($"Searching for GTA:LCS save files...{(RecursiveSearch ? " (recursive)" : "")}");
            }
        }
예제 #11
0
 private void SearchWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Cancelled == false)
     {
         if (ClassBackEnd.Book.Count <= 10)
         {
             maxPage = 1;
         }
         else
         {
             maxPage = ClassBackEnd.Book.Count / 10 + 1;
         }
         PageTextBox.Text  = maxPage.ToString();
         JumpPTextBox.Text = "1";
         nPage             = 1;
         DataSheetLoad(1);
     }
     else
     {
         SearchWorker.RunWorkerAsync();
     }
 }