Exemple #1
0
        public void TxtSearch_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                formloading = true;

                if (Descrip_txtbox.Visible)
                {
                    Clearandhide();
                }

                if (string.IsNullOrEmpty(Createdbycombobox.Text) && string.IsNullOrEmpty(lastsavedbycombo.Text) && string.IsNullOrEmpty(Salespersoncomboxbox.Text) && string.IsNullOrEmpty(Shiptocomboxbox.Text) && string.IsNullOrEmpty(Soldtocombobox.Text) && string.IsNullOrEmpty(custvendcombobox.Text) && string.IsNullOrEmpty(CarrierscomboBox.Text))
                {
                    Showallitems(datarequest);
                    FillInvoiceItems();
                }
                if (txtSearch.Text.Length > 0)
                {
                    Descrip_txtbox.Show();
                    SendKeys.Send("{TAB}");
                    Mainsearch();
                }
                else
                {
                    SearchStringPosition();
                    searchtext(txtSearch.Text);
                }

                e.Handled          = true;
                e.SuppressKeyPress = true;

                formloading = false;
            }
        }
Exemple #2
0
        public void TxtSearch_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                formloading = true;

                if (Descrip_txtbox.Visible)
                {
                    Clearandhide();
                }

                if (string.IsNullOrEmpty(Createdbycomboxbox.Text) && string.IsNullOrEmpty(ReleasedBycombox.Text) && string.IsNullOrEmpty(CheckedBycomboxbox.Text) && string.IsNullOrEmpty(Prioritycombox.Text) && string.IsNullOrEmpty(ApprovedBycombobox.Text) && string.IsNullOrEmpty(LastSavedcombobox.Text) && string.IsNullOrEmpty(ByStatuscomboBox.Text))
                {
                    Showallitems();
                }
                if (txtSearch.Text.Length > 0)
                {
                    Descrip_txtbox.Show();
                    SendKeys.Send("{TAB}");
                    Mainsearch();
                }
                else
                {
                    SearchStringPosition();
                    Searchtext(txtSearch.Text);
                }

                e.Handled          = true;
                e.SuppressKeyPress = true;

                formloading = false;
            }
        }
Exemple #3
0
        public void TxtSearch_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                formloading = true;

                if (Descrip_txtbox.Visible)
                {
                    Clearandhide();
                }

                if (string.IsNullOrEmpty(jobnumbercombobox.Text) && string.IsNullOrEmpty(approvedbycombo.Text) && string.IsNullOrEmpty(deptrequestedcomboxbox.Text) && string.IsNullOrEmpty(requestedbycomboxbox.Text) && string.IsNullOrEmpty(ecrstatuscombobox.Text) && string.IsNullOrEmpty(completedbycombobox.Text) && string.IsNullOrEmpty(supervicsorcomboBox.Text))
                {
                    Showallitems(true);
                }
                if (txtSearch.Text.Length > 0)
                {
                    Descrip_txtbox.Show();
                    SendKeys.Send("{TAB}");
                    Mainsearch();
                }
                else
                {
                    SearchStringPosition();
                    Searchtext(txtSearch.Text);
                }

                e.Handled          = true;
                e.SuppressKeyPress = true;

                formloading = false;
            }
        }
        public void txtSearch_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                formloading = true;

                if (Descrip_txtbox.Visible)
                {
                    clearandhide();
                }

                if (string.IsNullOrEmpty(jobnumbercombobox.Text) && string.IsNullOrEmpty(authorizedbycombo.Text) && string.IsNullOrEmpty(customercomboxbox.Text) && string.IsNullOrEmpty(technamecomboxbox.Text) && string.IsNullOrEmpty(projectmangercombobox.Text) && string.IsNullOrEmpty(refjobcombobox.Text) && string.IsNullOrEmpty(equipmentcomboBox.Text))
                {
                    Showallitems(true);
                }
                if (txtSearch.Text.Length > 0)
                {
                    Descrip_txtbox.Show();
                    SendKeys.Send("{TAB}");
                    mainsearch();
                }
                else
                {
                    SearchStringPosition();
                    searchtext(txtSearch.Text);
                }

                e.Handled          = true;
                e.SuppressKeyPress = true;

                formloading = false;
            }
        }
Exemple #5
0
        private void Descrip_txtbox_KeyDown(object sender, KeyEventArgs e)
        {
            DataView dv = table0.DefaultView;

            table0 = dv.ToTable();

            if (e.KeyCode == Keys.Return)
            {
                formloading = true;
                string search2 = Descrip_txtbox.Text;

                try
                {
                    search2 = search2.Replace("'", "''");
                    search2 = search2.Replace("[", "[[]");
                    var secondFilter = string.Format(fullsearch, search2);
                    if (string.IsNullOrEmpty(dv.RowFilter))
                    {
                        dv.RowFilter = secondFilter;
                    }
                    else
                    {
                        dv.RowFilter += " AND " + secondFilter;
                    }
                    table1 = dv.ToTable();
                    dataGridView.DataSource = table1;
                    SearchStringPosition();
                    searchtext(Descrip_txtbox.Text);
                    dataGridView.Refresh();
                    recordlabel.Text = "Found " + table1.Rows.Count.ToString() + " Matching Items.";
                }
                catch (Exception)
                {
                    MessageBox.Show("Invalid Search Criteria Operator.", "SPM Connect - Search2");
                    Descrip_txtbox.Clear();
                    SendKeys.Send("~");
                }
                finally
                {
                }

                if (Descrip_txtbox.Text.Length > 0)
                {
                    filteroem_txtbox.Show();
                    SendKeys.Send("{TAB}");
                }
                else
                {
                    filteroem_txtbox.Hide();
                    filteroemitem_txtbox.Hide();
                    filter4.Hide();
                }
                if (!Descrip_txtbox.Visible)
                {
                    filteroem_txtbox.Hide();
                }
                e.Handled          = true;
                e.SuppressKeyPress = true;
                formloading        = false;
            }
        }