Example #1
0
        private void TxtPostCode_Leave(System.Object sender, EventArgs e)
        {
            /* capitalise when leaving control */
            txtPostCode.Text = txtPostCode.Text.ToUpper();

            TFindscreensHelper.CriteriaTextBoxLeaveHandler(FFindCriteriaDataTable, txtPostCode, critPostCode);
        }
Example #2
0
        /// <summary>
        /// Changes any * character(s) in the middle of a Search Criteria's text into % character(s)
        /// for all textual Search Criteria into which the user can type text. This is to make the
        /// SQL-92 'LIKE' operator do what the user intended. The only case when this isn't done is
        /// when the Search Criteria's text starts with || AND ends with ||. This signalises that the
        /// Search Criteria's text is to be taken absolutely literally, that is, wild card characters are
        /// to be processed as the characters they really are, and not as wildcards.
        /// </summary>
        /// <remarks>IMPORTANT: The Method must work with a *copy* of ACriteriaDT and apply data changes only in there as
        /// otherwise the Search Criterias' text on the screen gets updated (eg. * characters would get replaced with %
        /// characters on screen)!</remarks>
        /// <param name="ACriteriaDT">DataTable holding the one DataRow that contains the Search Criteria data.</param>
        /// <returns>New DataTable holding the one DataRow that contains the Search Criteria Data in which the wildcard
        /// and 'stops' processing was applied to the relevant Search Criteria.</returns>
        private DataTable ProcessWildCardsAndStops(DataTable ACriteriaDT)
        {
            DataTable ReturnValue  = ACriteriaDT.Copy();
            DataRow   IndividualDR = ReturnValue.Rows[0];

            IndividualDR["Addr1"]    = TFindscreensHelper.ReplaceWildCardsInMiddleOfSearchCriteriaAndRemoveStops(IndividualDR["Addr1"].ToString());
            IndividualDR["Street2"]  = TFindscreensHelper.ReplaceWildCardsInMiddleOfSearchCriteriaAndRemoveStops(IndividualDR["Street2"].ToString());
            IndividualDR["Addr3"]    = TFindscreensHelper.ReplaceWildCardsInMiddleOfSearchCriteriaAndRemoveStops(IndividualDR["Addr3"].ToString());
            IndividualDR["City"]     = TFindscreensHelper.ReplaceWildCardsInMiddleOfSearchCriteriaAndRemoveStops(IndividualDR["City"].ToString());
            IndividualDR["PostCode"] = TFindscreensHelper.ReplaceWildCardsInMiddleOfSearchCriteriaAndRemoveStops(IndividualDR["PostCode"].ToString());
            IndividualDR["County"]   = TFindscreensHelper.ReplaceWildCardsInMiddleOfSearchCriteriaAndRemoveStops(IndividualDR["County"].ToString());

            return(ReturnValue);
        }
Example #3
0
        /// <summary>
        /// Sets up paged search result DataTable with the result of the Servers query
        /// and DataBind the DataGrid.
        /// </summary>
        private void SetupResultDataGrid()
        {
            try
            {
                if (grdResult.TotalPages > 0)
                {
                    /* Create SourceDataGrid columns */
                    CreateColumns();

//TLogging.Log("SetupResultDataGrid: Before calling SetupDataGridDataBinding()...");

                    /* DataBindingrelated stuff */
                    TFindscreensHelper.SetupDataGridDataBinding(grdResult, FPagedDataTable);
//TLogging.Log("SetupResultDataGrid: Before calling SetupDataGridVisualAppearance()...");

                    /* Setup the DataGrid's visual appearance */
                    TFindscreensHelper.SetupDataGridVisualAppearance(grdResult);
//TLogging.Log("SetupResultDataGrid: Before calling SelectRow()...");
                    // For speed reasons we must add the necessary amount of emtpy Rows only here (after .AutoSizeCells() has already
                    // been run! See XML Comment on the called Method TSgrdDataGridPaged.AddEmptyRows() for details!
                    grdResult.AddEmptyRows();
//TLogging.Log("After AddEmptyRows()");

                    /* Select (highlight) first Row */
                    grdResult.Selection.SelectRow(1, true);

                    /* Scroll grid to first line (the grid might have been scrolled before to another position) */
                    grdResult.ShowCell(new Position(1, 1), true);

                    btnOK.Enabled = true;
                }
                else
                {
                    btnOK.Enabled = false;
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show("Exception occured in SetupResultDataGrid: " + exp.Message);
            }
        }
Example #4
0
 private void TxtCity_Leave(System.Object sender, EventArgs e)
 {
     TFindscreensHelper.CriteriaTextBoxLeaveHandler(FFindCriteriaDataTable, txtCity, critCity);
 }