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); }
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); }
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); }
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); }
internal void InternalAdd(IFieldInfo field, BaseListSearch listSearch) { listSearch.FieldName = field; fList.Add(field.NickName, listSearch); }
protected BaseQueryCalcSource() { fDefaultSearch = new DefaultListSearch(); fIgnoreFields = new HashSet <string>(); fSearchMethod = new Dictionary <string, BaseListSearch>(); }