Exemplo n.º 1
0
        public static SearchCriteria Create(string internalName, string displayName, SearchFieldType filterType, SearchOperator searchOperator, string value)
        {
            SearchCriteria criteria = null;
            if (CampaignSearchCriteria.IsCampaignSearchCriteria(internalName)) criteria = new CampaignSearchCriteria();
            else if (LocationSearchCriteria.IsLocationSearchCriteria(internalName)) criteria = new LocationSearchCriteria();
            else if (DonationSearchCriteria.IsDonationSearchCriteria(internalName)) criteria = new DonationSearchCriteria();
            else
            {
                if (internalName.StartsWith("freeTextFacet_"))
                {
                    int facetId;
                    if (int.TryParse(internalName.Substring(14), out facetId))
                    {
                        criteria = new FacetSearchCriteria {FacetId = facetId};
                    }
                }

            }

            if (criteria == null)
            {
                throw new InvalidOperationException("Could not parse search criteria");
            }

            criteria.InternalName = internalName;
            criteria.DisplayName = displayName;
            criteria.Type = filterType;
            criteria.SearchOperator = searchOperator;
            criteria.Value = value;

            return criteria;
        }
Exemplo n.º 2
0
        public static SearchCriteria Create(string internalName, string displayName, SearchFieldType filterType, SearchOperator searchOperator, string value)
        {
            SearchCriteria criteria = null;

            if (CampaignSearchCriteria.IsCampaignSearchCriteria(internalName))
            {
                criteria = new CampaignSearchCriteria();
            }
            else if (LocationSearchCriteria.IsLocationSearchCriteria(internalName))
            {
                criteria = new LocationSearchCriteria();
            }
            else if (DonationSearchCriteria.IsDonationSearchCriteria(internalName))
            {
                criteria = new DonationSearchCriteria();
            }
            else
            {
                if (internalName.StartsWith("freeTextFacet_"))
                {
                    int facetId;
                    if (int.TryParse(internalName.Substring(14), out facetId))
                    {
                        criteria = new FacetSearchCriteria {
                            FacetId = facetId
                        };
                    }
                }
            }

            if (criteria == null)
            {
                throw new InvalidOperationException("Could not parse search criteria");
            }

            criteria.InternalName   = internalName;
            criteria.DisplayName    = displayName;
            criteria.Type           = filterType;
            criteria.SearchOperator = searchOperator;
            criteria.Value          = value;

            return(criteria);
        }
 public EqaulJsonFilter(LiveSearchFilterType filterType, T value)
 {
     _filterType = (SearchFieldType)filterType;
     _value      = value;
 }
Exemplo n.º 4
0
 public FacetFilterType(string name, bool isMulti = false, SearchFieldType fieldType = SearchFieldType.String)
 {
     Name      = name;
     IsMulti   = isMulti;
     FieldType = fieldType;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Search File System by Index
        /// </summary>
        /// <param name="fieldName"></param>
        /// <param name="searchValue"></param>
        /// <param name="cabinetId"></param>
        /// <returns></returns>
        public IEnumerable <DokmeeFilesystem> Search(string username, string fieldName, string searchValue, string cabinetId, SearchFieldType indexFieldType)
        {
            if (string.IsNullOrWhiteSpace(username))
            {
                throw new ArgumentException("username is null or empty");
            }

            IEnumerable <DokmeeFilesystem> results = new List <DokmeeFilesystem>();
            Guid id = Guid.Empty;

            if (!string.IsNullOrEmpty(cabinetId) && Guid.TryParse(cabinetId, out id))
            {
                DmsConnectorProperty.RegisterCabinet(id);
                if (DateTime.TryParse(searchValue, out DateTime conditionIndexValue))
                {
                    searchValue = conditionIndexValue.ToString("yyyy/MMM/dd");
                }
                var lookupResults = DmsConnectorProperty.Search(indexFieldType, searchValue, fieldName);
                results = lookupResults.DmsFilesystem;
            }
            return(results);
        }
Exemplo n.º 6
0
 public SearchAttribute(SearchFieldType type = SearchFieldType.String)
 {
     Type = type;
 }
 public SearchField(string name, string dbField, SearchFieldType fieldType)
 {
     m_name = name;
     m_dbField = dbField;
     m_fieldType = fieldType;
 }
Exemplo n.º 8
0
 public ValueContainsSearchFilter(LiveSearchFilterType filterType, params T[] values)
 {
     _filterType = (SearchFieldType)filterType;
     _values     = values;
 }
Exemplo n.º 9
0
 public CompareSearchFilter(LiveSearchFilterType filterType, T value, SearchFilterCompareCondition condition)
 {
     _filterType = (SearchFieldType)filterType;
     _value      = value;
     _condition  = condition;
 }
Exemplo n.º 10
0
        public SearchFieldType GetSortByField()
        {
            SearchFieldType result = SearchFieldType.Keyword;

            return(result);
        }
Exemplo n.º 11
0
 public SearchField() {
     this.typeField = SearchFieldType.text;
     this.externalOperatorField = false;
     this.positionField = ((uint)(0));
 }