Пример #1
0
        public IParamBuilder GetCondition(QueryConditionObject condition)
        {
            TkDebug.AssertArgumentNull(condition, "condition", this);

            ParamBuilderContainer container = new ParamBuilderContainer();

            foreach (var item in condition.Condition)
            {
                if (string.IsNullOrEmpty(item.Value))
                {
                    continue;
                }
                if (fIgnoreFields.Contains(item.Key))
                {
                    continue;
                }

                FieldItem      field  = new FieldItem(item.Key);
                BaseListSearch search = ObjectUtil.TryGetValue(fSearchMethod, item.Key);
                if (search == null)
                {
                    search = fDefaultSearch;
                }
                search.Context       = Context;
                search.ConditionData = condition.Condition;
                search.IsEqual       = false;
                search.FieldName     = field;

                var builder = search.GetCondition(field, item.Value);
                container.Add(builder);
            }
            return(container);
        }
Пример #2
0
        public void Add(IFieldInfo field, BaseListSearch listSearch)
        {
            TkDebug.AssertArgumentNull(field, "field", this);
            TkDebug.AssertArgumentNull(listSearch, "listSearch", this);

            listSearch.FieldName  = field;
            fList[field.NickName] = listSearch;
            //fList.Add(field.FieldName, listSearch);
        }
Пример #3
0
        public void AddSpan(IFieldInfo field, BaseListSearch smallSearch, BaseListSearch largeSearch)
        {
            TkDebug.AssertArgumentNull(field, "field", this);
            TkDebug.AssertArgumentNull(smallSearch, "smallSearch", this);
            TkDebug.AssertArgumentNull(largeSearch, "largeSearch", this);

            smallSearch.FieldName = field;
            largeSearch.FieldName = field;
            fList.Add(field.NickName, smallSearch);
            fList.Add(field.NickName + "END", largeSearch);
        }
Пример #4
0
        protected bool AddSearchMethod(string fieldName, BaseListSearch search)
        {
            TkDebug.AssertArgumentNullOrEmpty(fieldName, "fieldName", this);
            TkDebug.AssertArgumentNull(search, "search", this);

            if (!fSearchMethod.ContainsKey(fieldName))
            {
                fSearchMethod.Add(fieldName, search);
                return(true);
            }
            return(false);
        }
Пример #5
0
 internal void InternalAdd(IFieldInfo field, BaseListSearch listSearch)
 {
     listSearch.FieldName = field;
     fList.Add(field.NickName, listSearch);
 }
Пример #6
0
 protected BaseQueryCalcSource()
 {
     fDefaultSearch = new DefaultListSearch();
     fIgnoreFields  = new HashSet <string>();
     fSearchMethod  = new Dictionary <string, BaseListSearch>();
 }