Ejemplo n.º 1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public TLocationFindDialogWinForm() : base()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            #region CATALOGI18N

            // this code has been inserted by GenerateI18N, all changes in this region will be overwritten by GenerateI18N
            this.btnOK.Text            = Catalog.GetString("&Accept");
            this.lblSearchInfo.Text    = Catalog.GetString("Searching...");
            this.btnClearCriteria.Text = Catalog.GetString("Clea&r");
            this.grpCriteria.Text      = Catalog.GetString("&Find Criteria");
            this.lblPostCode.Text      = Catalog.GetString("P&ost Code") + ":";
            this.lblCounty.Text        = Catalog.GetString("Co&unty") + ":";
            this.lblCountry.Text       = Catalog.GetString("Co&untry") + ":";
            this.lblLocationKey.Text   = Catalog.GetString("Location &Key") + ":";
            this.lblCity.Text          = Catalog.GetString("Cit&y/Town") + ":";
            this.lblStreet2.Text       = Catalog.GetString("Address &2") + ":";
            this.lblAddr3.Text         = Catalog.GetString("Address &3") + ":";
            this.lblAddr1.Text         = Catalog.GetString("Address &1") + ":";
            this.btnSearch.Text        = Catalog.GetString(" &Search");
            this.grpResult.Text        = Catalog.GetString("Find R&esult");
            this.btnOK.Text            = Catalog.GetString("&Accept");
            this.btnCancel.Text        = Catalog.GetString("&Cancel");
            this.Text = Catalog.GetString("Location Find");
            #endregion

            FDefaultValues = FFindCriteriaDataTable.NewRow();

            lblSearchInfo.Text = "";
            grdResult.SendToBack();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public TLocationFindDialogWinForm() : base()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            FDefaultValues = FFindCriteriaDataTable.NewRow();

            lblSearchInfo.Text = "";
            grdResult.SendToBack();
        }
Ejemplo n.º 3
0
        private void ResetSearchCriteriaValuesToDefault()
        {
            DataRow SingleDataRow;

            if (FFindCriteriaDataTable.Rows.Count != 0)
            {
                SingleDataRow = FFindCriteriaDataTable.Rows[0];
                SingleDataRow.BeginEdit();
                SetSearchCriteriaDefaultValues(ref SingleDataRow);
                SingleDataRow.EndEdit();
            }
            else
            {
                SingleDataRow = FFindCriteriaDataTable.NewRow();
                SetSearchCriteriaDefaultValues(ref SingleDataRow);
                FFindCriteriaDataTable.Rows.Add(SingleDataRow);
            }

            FFindCriteriaDataTable.Rows[0].BeginEdit();
            FDefaultValues.ItemArray = FFindCriteriaDataTable.Rows[0].ItemArray;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="AParentForm"></param>
        public TLocationFindDialogWinForm(Form AParentForm) : base()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            FPetraUtilsObject = new Ict.Petra.Client.CommonForms.TFrmPetraUtils(AParentForm, this, stbMain);

            FLocationFindObject = TRemote.MPartner.Partner.UIConnectors.PartnerLocationFind();

            FPetraUtilsObject.InitActionState();
            FDefaultValues = FFindCriteriaDataTable.NewRow();

            lblSearchInfo.Text = "";
            grdResult.SendToBack();

            // catch enter on all controls, to trigger search or accept (could use this.AcceptButton, but we have a search button and an Accept Button)
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CatchEnterKey);

            this.Closed += new System.EventHandler(this.TLocationFindDialogWinForm_Closed);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Checks if the internal CriteriaDataTable has any criteria to search for.
        /// </summary>
        /// <returns>true if there are any search criterias </returns>
        private bool HasSearchCriteria()
        {
            string CurrentColumnsContent;

            if (FFindCriteriaDataTable.Rows.Count != 1)
            {
                return(true);
            }

            DataRow SearchDataRow = FFindCriteriaDataTable.NewRow();

            SearchDataRow.ItemArray = FFindCriteriaDataTable.Rows[0].ItemArray;

            for (int Counter = 0; Counter < SearchDataRow.ItemArray.Length; ++Counter)
            {
                CurrentColumnsContent = SearchDataRow[Counter].ToString();

                if (FFindCriteriaDataTable.Columns[Counter].ColumnName.EndsWith("Match"))
                {
                    // ignore changes of the Values like "ExactPartnerKeyMatch" or
                    // "EmailMatch" or "Address3Match"...
                    // because just a change in these values doesn't mean that there is a search criteria
                    continue;
                }

                if (FFindCriteriaDataTable.Columns[Counter].ColumnName.CompareTo("PartnerStatus") == 0)
                {
                    if ((CurrentColumnsContent == "ALL") ||
                        (CurrentColumnsContent == "ACTIVE"))
                    {
                        // if there is partner status "All" or "Active" marked
                        // treat it as if there is no search criteria selected
                        continue;
                    }
                    else
                    {
                        return(true);
                    }
                }

                if ((CurrentColumnsContent != FDefaultValues[Counter].ToString()) &&
                    (CurrentColumnsContent != "*") &&
                    (CurrentColumnsContent != "%"))
                {
                    if ((CurrentColumnsContent.Length > 1) &&
                        ((CurrentColumnsContent.StartsWith("*")) ||
                         (CurrentColumnsContent.StartsWith("%"))))
                    {
                        // Ensure that the whole string doesn't consist just of * characters
                        for (int CharCounter = 1; CharCounter < CurrentColumnsContent.Length; CharCounter++)
                        {
                            if ((CurrentColumnsContent[CharCounter] != '*') &&
                                (CurrentColumnsContent[CharCounter] != '%'))
                            {
                                return(true);
                            }
                        }
                    }
                    else
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }