Ejemplo n.º 1
0
        /// <summary>
        /// Get search criteria system as string.
        /// </summary>
        /// <param name="searchCriteria">Search criteria.</param>
        /// <returns>Search criteria as string.</returns>
        public static String WebToString(this WebStringSearchCriteria searchCriteria)
        {
            Int32         index;
            StringBuilder stringBuilder;

            if (searchCriteria.IsNull())
            {
                return(String.Empty);
            }
            else
            {
                stringBuilder = new StringBuilder();
                stringBuilder.Append("String search criteria: ");
                if (searchCriteria.CompareOperators.IsNotEmpty())
                {
                    if (searchCriteria.CompareOperators.Count == 1)
                    {
                        stringBuilder.Append("Compare operator = " + searchCriteria.CompareOperators[0] + ", ");
                    }
                    else
                    {
                        stringBuilder.Append("Compare operators = [" + searchCriteria.CompareOperators[0]);
                        for (index = 1; index < searchCriteria.CompareOperators.Count; index++)
                        {
                            stringBuilder.Append(", " + searchCriteria.CompareOperators[index]);
                        }

                        stringBuilder.Append("], ");
                    }
                }

                stringBuilder.Append("Search string = [" + searchCriteria.SearchString + "]");
                return(stringBuilder.ToString());
            }
        }
Ejemplo n.º 2
0
        public WebStringSearchCriteria GetStringSearchCriteria(Boolean refresh = false)
        {
            if (_stringSearchCriteria.IsNull() || refresh)
            {
                _stringSearchCriteria = new WebStringSearchCriteria();
            }

            return(_stringSearchCriteria);
        }