Esempio n. 1
0
        /// <summary>
        /// 基础操作符查询
        /// </summary>
        /// <param name="row">一行记录</param>
        /// <param name="wheres">查询条件</param>
        /// <returns>是否符合条件</returns>
        private bool WhereBasic(DataTableResult row, DataTableSelectorData wheres)
        {
            switch (wheres.Operator)
            {
            case "==":
            case "=":
                return(row[wheres.Field] == wheres.Value);

            case "<":
                return(int.Parse(row[wheres.Field]) < int.Parse(wheres.Value));

            case ">":
                return(int.Parse(row[wheres.Field]) > int.Parse(wheres.Value));

            case "<=":
                return(int.Parse(row[wheres.Field]) <= int.Parse(wheres.Value));

            case ">=":
                return(int.Parse(row[wheres.Field]) >= int.Parse(wheres.Value));

            case "<>":
            case "!=":
                return(row[wheres.Field] != wheres.Value);

            default:
                return(false);
            }
        }
Esempio n. 2
0
		private bool QueryWhere(DataTableResult row , DataTableSelectorData wheres){

			switch(wheres.SelectType){

				case "Nested":return WhereNested(row , wheres);
				case "Basic": return WhereBasic(row , wheres);
				case "NotNull": return WhereNotNull(row , wheres);
				case "Null": return WhereNull(row , wheres);
				default: return false;

			}

		}
Esempio n. 3
0
		private bool WhereNotNull(DataTableResult row , DataTableSelectorData wheres){

			return !WhereNull(row, wheres);

		}
Esempio n. 4
0
		private bool WhereNull(DataTableResult row , DataTableSelectorData wheres){

			return string.IsNullOrEmpty(row[wheres.Field]);

		}
Esempio n. 5
0
		private bool WhereNested(DataTableResult row , DataTableSelectorData wheres){

			return Filter(row , wheres.Selector.Wheres);

		}