Ejemplo n.º 1
0
        /// <summary>
        /// Data Grid Cell End Edit Event: Sets the entered value to the search query string builder for use in the frmSearch search terms box.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvComponents_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                string id = dgvComponents["cID", e.RowIndex].Value.ToString();
                string v  = dgvComponents["cValue", e.RowIndex].Value.ToString();

                if (searchQuery.Contains(searchGroup))
                {
                    searchQuery.Remove(searchGroup);
                }

                if (!String.IsNullOrEmpty(v))
                {
                    AddSearchQueryItem(id, v);
                }
                else
                {
                    RemoveSearchQueryItem(id);
                }
                searchQuery.Add(searchGroup);
                txtCurrentQuery.Text = SearchTerm.BuildSearchQueryString(searchQuery);
            }
            catch (Exception ex)
            {
                Log.LogException(ex);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Add Button Click Event: Adds a new search query group to the search query string builder.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         searchGroup          = new List <SearchTerm>();
         txtCurrentQuery.Text = SearchTerm.BuildSearchQueryString(searchQuery) + "|";
         dgvComponents.Rows.Clear();
         bgw.RunWorkerAsync();
     }
     catch (Exception ex)
     {
         Log.LogException(ex).ShowDialog();
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initialization Method: Sets the current search query for display
 /// </summary>
 /// <param name="query">The current search query</param>
 public frmBuildSearch(string query)
 {
     InitializeComponent();
     searchQuery          = SearchTerm.GetSearchTerms(query);
     txtCurrentQuery.Text = SearchTerm.BuildSearchQueryString(searchQuery);
 }