Example #1
0
        //---------------------------
        // SEARCH AND CLEAR SEARCH  |
        //---------------------------
        private void btnSearch_Click(object sender, EventArgs e)
        {
            //Wrong Inputs
            if (txtSearch.Text == "Search for...")
            {
                MessageBox.Show("Please input something to search for.", "Nothing to Search", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (txtSearch.Text == null)
            {
                MessageBox.Show("There is nothing to search for.", "Blank Field", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (cbbFilterBy.Text == "Filter by...")
            {
                MessageBox.Show("Please select a filter option.", "No Filter Option", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            //Valid
            sql.SearchRFQ(cbbFilterBy.Text, txtSearch.Text, dgvRFQ);
            if (dgvRFQ.Rows.Count == 0)
            {
                MessageBox.Show("No such request for price quotation was found.", "Empty Search Results", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }